Nymph Game Engine
Chaiscript based Game Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
key_up_event.h
Go to the documentation of this file.
1 #ifndef KEY_UP_EVENT_H
2 #define KEY_UP_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 KeyUpEvent : public Events::Event {
14  private:
15  int key;
16  public:
17  //= BEGIN SCRIPTABLE
18 
24  KeyUpEvent(const int key) : Event(Events::EventType::KEY_UP), key(key) {}
32  static std::shared_ptr<KeyUpEvent> create(const int key) { return std::make_shared<KeyUpEvent>(key); }
33  int getKey() const noexcept { return key; }
34  //= END SCRIPTABLE
35  };
36 }
37 
38 #endif
Class for event.
Definition: event.h:10
Definition: event_type.h:20
EventType
Event type enum that is used when passing events.
Definition: event_type.h:12
static std::shared_ptr< KeyUpEvent > create(const int key)
Factory function.
Definition: key_up_event.h:32
Class for key up event.
Definition: key_up_event.h:13
Event(const EventType &type)
Event constructor.
Definition: event.h:21
KeyUpEvent(const int key)
KeyUpEvent constructor.
Definition: key_up_event.h:24
int getKey() const noexcept
Definition: key_up_event.h:33