mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Fix issue with keys not being recognized on non-English keyboards
This commit is contained in:
parent
a1403ef457
commit
a089d3d36d
|
@ -168,8 +168,6 @@ int CInput::Update()
|
|||
case SDL_TEXTINPUT:
|
||||
{
|
||||
const char *text = Event.text.text;
|
||||
//std::cout << text << std::endl;
|
||||
//std::cout << text[0] << " " << text[1] << " " << text[2] << std::endl;
|
||||
while(*text)
|
||||
{
|
||||
int Code = str_utf8_decode(&text);
|
||||
|
@ -183,11 +181,15 @@ int CInput::Update()
|
|||
|
||||
// handle keys
|
||||
case SDL_KEYDOWN:
|
||||
Key = SDL_GetScancodeFromName(SDL_GetKeyName(Event.key.keysym.sym));
|
||||
if(Event.key.keysym.sym == KEY_UNKNOWN)
|
||||
continue;
|
||||
Key = Event.key.keysym.scancode;
|
||||
break;
|
||||
case SDL_KEYUP:
|
||||
if(Event.key.keysym.sym == KEY_UNKNOWN)
|
||||
continue;
|
||||
Action = IInput::FLAG_RELEASE;
|
||||
Key = SDL_GetScancodeFromName(SDL_GetKeyName(Event.key.keysym.sym));
|
||||
Key = Event.key.keysym.scancode;
|
||||
break;
|
||||
|
||||
// handle mouse buttons
|
||||
|
|
Loading…
Reference in a new issue