mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-07 23:33:15 +02:00
Use SDL scancodes instead of keycodes for keybindings
This commit is contained in:
@@ -56,7 +56,7 @@ std::string InputSourceKeyboard::getKeyNameWithModifiers(const std::string & key
|
|||||||
|
|
||||||
void InputSourceKeyboard::handleEventKeyDown(const SDL_KeyboardEvent & key)
|
void InputSourceKeyboard::handleEventKeyDown(const SDL_KeyboardEvent & key)
|
||||||
{
|
{
|
||||||
std::string keyName = getKeyNameWithModifiers(SDL_GetKeyName(key.keysym.sym), false);
|
std::string keyName = getKeyNameWithModifiers(SDL_GetScancodeName(key.keysym.scancode), false);
|
||||||
logGlobal->trace("keyboard: key '%s' pressed", keyName);
|
logGlobal->trace("keyboard: key '%s' pressed", keyName);
|
||||||
assert(key.state == SDL_PRESSED);
|
assert(key.state == SDL_PRESSED);
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ void InputSourceKeyboard::handleEventKeyUp(const SDL_KeyboardEvent & key)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string keyName = getKeyNameWithModifiers(SDL_GetKeyName(key.keysym.sym), true);
|
std::string keyName = getKeyNameWithModifiers(SDL_GetScancodeName(key.keysym.scancode), true);
|
||||||
logGlobal->trace("keyboard: key '%s' released", keyName);
|
logGlobal->trace("keyboard: key '%s' released", keyName);
|
||||||
|
|
||||||
if (SDL_IsTextInputActive() == SDL_TRUE)
|
if (SDL_IsTextInputActive() == SDL_TRUE)
|
||||||
|
|||||||
Reference in New Issue
Block a user