Nymph Game Engine
Chaiscript based Game Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
key_repeat_event.h
Go to the documentation of this file.
1 #ifndef KEY_REPEAT_EVENT_H
2 #define KEY_REPEAT_EVENT_H
3 #include <glm/glm.hpp>
4 #include "events/event.h"
5 #include "events/event_type.h"
6 
7 //= SCRIPTABLE
8 //= SCRIPTABLE BASES Event
9 namespace Input {
13  class KeyRepeatEvent : public Events::Event {
14  private:
15  int key;
16  public:
17  //= BEGIN SCRIPTABLE
18 
24  KeyRepeatEvent(const int key) : Event(Events::EventType::KEY_REPEAT), key(key) {}
32  static std::shared_ptr<KeyRepeatEvent> create(const int key) { return std::make_shared<KeyRepeatEvent>(key); }
38  int getKey() const noexcept { return key; }
39  //= END SCRIPTABLE
40  };
41 }
42 
43 #endif
KeyRepeatEvent(const int key)
Constructor for KeyRepeatEvent.
Definition: key_repeat_event.h:24
Class for event.
Definition: event.h:10
Class for key repeat event.
Definition: key_repeat_event.h:13
static std::shared_ptr< KeyRepeatEvent > create(const int key)
Factory function.
Definition: key_repeat_event.h:32
EventType
Event type enum that is used when passing events.
Definition: event_type.h:12
int getKey() const noexcept
Gets the key.
Definition: key_repeat_event.h:38
Definition: event_type.h:21
Event(const EventType &type)
Event constructor.
Definition: event.h:21