mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
Improve scancodeToKeycode mapping
This commit is contained in:
parent
3d62999485
commit
7f5e7205c4
@ -499,7 +499,10 @@ void ensureMapping()
|
||||
if (keycodeToScancode[static_cast<KeyCode>(keycode)] == sf::Keyboard::ScanUnknown)
|
||||
{
|
||||
scancode = translateKeyCode(display, static_cast<KeyCode>(keycode));
|
||||
scancodeToKeycode[scancode] = static_cast<KeyCode>(keycode);
|
||||
|
||||
if (scancode != sf::Keyboard::ScanUnknown && scancodeToKeycode[scancode] == NullKeyCode)
|
||||
scancodeToKeycode[scancode] = static_cast<KeyCode>(keycode);
|
||||
|
||||
keycodeToScancode[keycode] = scancode;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user