mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
Make right Alt key work on X11
This commit is contained in:
parent
39b8d67262
commit
3d62999485
@ -43,6 +43,7 @@ Keyboard::Key keySymToKey(KeySym symbol)
|
||||
case XK_Control_L: return Keyboard::LControl;
|
||||
case XK_Control_R: return Keyboard::RControl;
|
||||
case XK_Alt_L: return Keyboard::LAlt;
|
||||
case XK_ISO_Level3_Shift:
|
||||
case XK_Alt_R: return Keyboard::RAlt;
|
||||
case XK_Super_L: return Keyboard::LSystem;
|
||||
case XK_Super_R: return Keyboard::RSystem;
|
||||
|
@ -544,9 +544,15 @@ KeyCode keyToKeyCode(sf::Keyboard::Key key)
|
||||
Display* display = sf::priv::OpenDisplay();
|
||||
KeyCode keycode = XKeysymToKeycode(display, keysym);
|
||||
sf::priv::CloseDisplay(display);
|
||||
return keycode;
|
||||
|
||||
if (keycode != NullKeyCode)
|
||||
return keycode;
|
||||
}
|
||||
|
||||
// Fallback for when XKeysymToKeycode cannot tell the KeyCode for XK_Alt_R
|
||||
if (key == sf::Keyboard::RAlt)
|
||||
return scancodeToKeycode[sf::Keyboard::ScanRAlt];
|
||||
|
||||
return NullKeyCode;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user