summaryrefslogtreecommitdiff
path: root/src/keyboardconfig.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/keyboardconfig.h')
-rw-r--r--src/keyboardconfig.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/keyboardconfig.h b/src/keyboardconfig.h
index 1c91159ac..55e795e61 100644
--- a/src/keyboardconfig.h
+++ b/src/keyboardconfig.h
@@ -24,9 +24,13 @@
#define KEYBOARDCONFIG_H
#include <SDL_types.h>
+#include <SDL_keyboard.h>
#include <string>
+//enum SDLKey;
+union SDL_Event;
+
/**
* Each key represents a key function. Such as 'Move up', 'Attack' etc.
*/
@@ -104,12 +108,12 @@ class KeyboardConfig
/**
* Get the key function index by providing the keys value.
*/
- int getKeyIndex(int keyValue, int grp = 1) const;
+ int getKeyIndex(const SDL_Event &event, int grp = 1) const;
/**
* Get the key function index for an emote by providing the offset value.
*/
- int getKeyEmoteOffset(int keyValue) const;
+ int getKeyEmoteOffset(const SDL_Event &event) const;
/**
* Set the enable flag, which will stop the user from doing actions.
@@ -126,8 +130,7 @@ class KeyboardConfig
/**
* Set the value of the new key.
*/
- void setNewKey(int value)
- { mKey[mNewKeyIndex].value = value; }
+ void setNewKey(const SDL_Event &event);
/**
* Set a reference to the key setup window.
@@ -152,6 +155,10 @@ class KeyboardConfig
const std::string &getBindError() const
{ return mBindError; }
+ SDLKey getKeyFromEvent(const SDL_Event &event) const;
+
+ void unassignKey();
+
/**
* All the key functions.
* KEY_NO_VALUE is used in initialization, and should be unchanged.