summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/enums/events/keyeventtype.h17
-rw-r--r--src/events/keyevent.h6
-rw-r--r--src/gui/gui.cpp4
-rw-r--r--src/input/keyinput.h6
4 files changed, 15 insertions, 18 deletions
diff --git a/src/enums/events/keyeventtype.h b/src/enums/events/keyeventtype.h
index 7c96b749a..b04ddab7e 100644
--- a/src/enums/events/keyeventtype.h
+++ b/src/enums/events/keyeventtype.h
@@ -64,16 +64,13 @@
#ifndef ENUMS_EVENTS_KEYEVENTTYPE_H
#define ENUMS_EVENTS_KEYEVENTTYPE_H
-namespace KeyEventType
+#include "enums/simpletypes/enumdefines.h"
+
+enumStart(KeyEventType)
{
- /**
- * Key event types.
- */
- enum Type
- {
- PRESSED = 0,
- RELEASED
- };
-} // namespace KeyEventType
+ PRESSED = 0,
+ RELEASED
+}
+enumEnd(KeyEventType);
#endif // ENUMS_EVENTS_KEYEVENTTYPE_H
diff --git a/src/events/keyevent.h b/src/events/keyevent.h
index 3cad1bce2..9f0a54972 100644
--- a/src/events/keyevent.h
+++ b/src/events/keyevent.h
@@ -88,7 +88,7 @@ class KeyEvent: public InputGuiEvent
* @param key The key of the event.
*/
KeyEvent(Widget *const source,
- KeyEventType::Type type,
+ KeyEventTypeT type,
const int actionId,
const Key &key) :
InputGuiEvent(source),
@@ -111,7 +111,7 @@ class KeyEvent: public InputGuiEvent
*
* @return The type of the event.
*/
- KeyEventType::Type getType() const A_WARN_UNUSED
+ KeyEventTypeT getType() const A_WARN_UNUSED
{ return mType; }
/**
@@ -146,7 +146,7 @@ class KeyEvent: public InputGuiEvent
/**
* Holds the type of the key event.
*/
- KeyEventType::Type mType;
+ KeyEventTypeT mType;
int mActionId;
};
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 49b6d2774..4cfd83f0f 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -1263,7 +1263,7 @@ void Gui::distributeKeyEvent(KeyEvent &event) const
std::list<KeyListener*> keyListeners
= widget->getKeyListeners();
- const KeyEventType::Type eventType = event.getType();
+ const KeyEventTypeT eventType = event.getType();
// Send the event to all key listeners of the source widget.
FOR_EACH (std::list<KeyListener*>::const_iterator,
it, keyListeners)
@@ -1296,7 +1296,7 @@ void Gui::distributeKeyEvent(KeyEvent &event) const
void Gui::distributeKeyEventToGlobalKeyListeners(KeyEvent& event)
{
BLOCK_START("Gui::distributeKeyEventToGlobalKeyListeners")
- const KeyEventType::Type eventType = event.getType();
+ const KeyEventTypeT eventType = event.getType();
FOR_EACH (KeyListenerListIterator, it, mKeyListeners)
{
switch (eventType)
diff --git a/src/input/keyinput.h b/src/input/keyinput.h
index f308af244..8555d8bbb 100644
--- a/src/input/keyinput.h
+++ b/src/input/keyinput.h
@@ -85,12 +85,12 @@ class KeyInput final
~KeyInput()
{ }
- void setType(KeyEventType::Type type)
+ void setType(KeyEventTypeT type)
{
mType = type;
}
- KeyEventType::Type getType() const
+ KeyEventTypeT getType() const
{
return mType;
}
@@ -136,7 +136,7 @@ class KeyInput final
/**
* Holds the type of the key input.
*/
- KeyEventType::Type mType;
+ KeyEventTypeT mType;
#ifdef USE_SDL2
std::string mText;