Photon Editor Library 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
KeyEvent.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <Utility/TBitFlags.h>
7#include <Utility/utility.h>
8
9namespace ph::editor
10{
11
12class KeyEvent : public Event
13{
14// Hide special members as this class is not intended to be used polymorphically.
15// It is derived class's choice to expose them (by defining them in public) or not.
16protected:
18
19public:
20 explicit KeyEvent(EKeyCode key);
21
22 /*EEventType getDynamicType() const override = 0;
23 std::string toString() const override = 0;*/
24
25 //EEventSource getSourceType() const override;
26
27 EKeyCode getKey() const;
28
29private:
30 EKeyCode m_key;
31};
32
34 : Event()
35 , m_key(key)
36{}
37
38//inline EEventSource KeyEvent::getSourceType() const
39//{
40// return TEnumFlags<EEventSource>(
41// {EEventSource::App, EEventSource::Input, EEventSource::Keyboard}).getEnum();
42//}
43
45{
46 return m_key;
47}
48
49}// end namespace ph::editor
Base of all event types. Derived classes should strive to keep the size of the object small,...
Definition Event.h:59
Definition KeyEvent.h:13
KeyEvent(EKeyCode key)
Definition KeyEvent.h:33
EKeyCode getKey() const
Definition KeyEvent.h:44
PH_DEFINE_INLINE_RULE_OF_5_MEMBERS(KeyEvent)
Definition ph_editor.h:10
EKeyCode
Definition EKeyCode.h:9