87 return SDL_GetScancodeName(
88 static_cast<SDL_Scancode
>(key));
91 return SDL_GetKeyName(
static_cast<SDLKey
>(key));
101 if (key ==
"backspace")
103 else if (key ==
"numlock")
105 else if (key ==
"caps lock")
107 else if (key ==
"scroll lock")
109 else if (key ==
"right shift")
111 else if (key ==
"left shift")
113 else if (key ==
"right ctrl")
115 else if (key ==
"left ctrl")
117 else if (key ==
"right alt")
119 else if (key ==
"left alt")
121 else if (key ==
"right meta")
123 else if (key ==
"left meta")
125 else if (key ==
"right super")
127 else if (key ==
"left super")
129 else if (key ==
"print screen")
130 return "print screen";
131 else if (key ==
"page up")
133 else if (key ==
"page down")
136 if (key ==
"unknown key")
183 const int value = val.
value;
189 else if (value < -1 && value > -500)
209 if (key < -1 && key > -500)
218 if (key < -1 && key > -500)
228 if (key < -1 && key > -500)
237 if (key < -1 && key > -500)
248 const int key = (*it).first;
254 else if (key < -1 && key > -500)
261 int &keyTime = (*it).second;
262 if (time > keyTime && abs(time - keyTime)
270 BLOCK_END(
"KeyboardConfig::handleRepeat")
282 bool KeyboardConfig::ignoreKey(
const SDL_Event &
restrict event)
289 const int key =
event.key.keysym.scancode;
290 if (key == SDL_SCANCODE_TAB)
292 #if SDL_VERSION_ATLEAST(2, 0, 5)
301 else if (key == SDL_SCANCODE_LALT)
bool getBoolValue(const std::string &key) const
int getIntValue(const std::string &key) const
InputActionT getActionId(const SDL_Event &event)
static std::string getKeyShortString(const std::string &key)
KeyToActionMap mKeyToAction
void resetRepeat(const int key)
static InputActionT getKeyIndex(const SDL_Event &event, const int grp)
void handleActivateKey(const SDL_Event &event)
void handleRepeat(const int time)
KeysVector * getActionVector(const SDL_Event &event)
const uint8_t * mActiveKeys
bool isActionActive(const InputActionT index) const
KeysVector * getActionVectorByKey(const int i)
static std::string getKeyName(const int key)
static int getKeyValueFromEvent(const SDL_Event &event)
void handleDeActicateKey(const SDL_Event &event)
KeyboardFocusT inputFocused
#define FOR_EACH(type, iter, array)
#define BLOCK_START(name)
std::string strprintf(const char *const format,...)