From a0c1302428cbd21b4a8e8678b81877ed2b4c8a25 Mon Sep 17 00:00:00 2001 From: Andrew Mickelson Date: Sat, 13 Jun 2015 08:59:44 -0700 Subject: [PATCH] Fix keypad keys not being detected on Linux --- src/SFML/Window/Unix/InputImpl.cpp | 20 ++++++++++---------- src/SFML/Window/Unix/WindowImplX11.cpp | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/SFML/Window/Unix/InputImpl.cpp b/src/SFML/Window/Unix/InputImpl.cpp index 394911511..2ccd63d12 100644 --- a/src/SFML/Window/Unix/InputImpl.cpp +++ b/src/SFML/Window/Unix/InputImpl.cpp @@ -346,16 +346,16 @@ void InputImpl::buildMap() keycodeMap[sf::Keyboard::X] = getKeycode(XK_x); keycodeMap[sf::Keyboard::Y] = getKeycode(XK_y); keycodeMap[sf::Keyboard::Z] = getKeycode(XK_z); - keycodeMap[sf::Keyboard::Num0] = getKeycode(XK_0); - keycodeMap[sf::Keyboard::Num1] = getKeycode(XK_1); - keycodeMap[sf::Keyboard::Num2] = getKeycode(XK_2); - keycodeMap[sf::Keyboard::Num3] = getKeycode(XK_3); - keycodeMap[sf::Keyboard::Num4] = getKeycode(XK_4); - keycodeMap[sf::Keyboard::Num5] = getKeycode(XK_5); - keycodeMap[sf::Keyboard::Num6] = getKeycode(XK_6); - keycodeMap[sf::Keyboard::Num7] = getKeycode(XK_7); - keycodeMap[sf::Keyboard::Num8] = getKeycode(XK_8); - keycodeMap[sf::Keyboard::Num9] = getKeycode(XK_9); + keycodeMap[sf::Keyboard::Num0] = getKeycode(XK_KP_Insert); + keycodeMap[sf::Keyboard::Num1] = getKeycode(XK_KP_End); + keycodeMap[sf::Keyboard::Num2] = getKeycode(XK_KP_Down); + keycodeMap[sf::Keyboard::Num3] = getKeycode(XK_KP_Page_Down); + keycodeMap[sf::Keyboard::Num4] = getKeycode(XK_KP_Left); + keycodeMap[sf::Keyboard::Num5] = getKeycode(XK_KP_Begin); + keycodeMap[sf::Keyboard::Num6] = getKeycode(XK_KP_Right); + keycodeMap[sf::Keyboard::Num7] = getKeycode(XK_KP_Home); + keycodeMap[sf::Keyboard::Num8] = getKeycode(XK_KP_Up); + keycodeMap[sf::Keyboard::Num9] = getKeycode(XK_KP_Page_Up); keycodeMap[sf::Keyboard::Escape] = getKeycode(XK_Escape); keycodeMap[sf::Keyboard::LControl] = getKeycode(XK_Control_L); keycodeMap[sf::Keyboard::LShift] = getKeycode(XK_Shift_L); diff --git a/src/SFML/Window/Unix/WindowImplX11.cpp b/src/SFML/Window/Unix/WindowImplX11.cpp index 8387975c6..1f6ed09f7 100644 --- a/src/SFML/Window/Unix/WindowImplX11.cpp +++ b/src/SFML/Window/Unix/WindowImplX11.cpp @@ -423,16 +423,16 @@ namespace case XK_Right: return sf::Keyboard::Right; case XK_Up: return sf::Keyboard::Up; case XK_Down: return sf::Keyboard::Down; - case XK_KP_0: return sf::Keyboard::Numpad0; - case XK_KP_1: return sf::Keyboard::Numpad1; - case XK_KP_2: return sf::Keyboard::Numpad2; - case XK_KP_3: return sf::Keyboard::Numpad3; - case XK_KP_4: return sf::Keyboard::Numpad4; - case XK_KP_5: return sf::Keyboard::Numpad5; - case XK_KP_6: return sf::Keyboard::Numpad6; - case XK_KP_7: return sf::Keyboard::Numpad7; - case XK_KP_8: return sf::Keyboard::Numpad8; - case XK_KP_9: return sf::Keyboard::Numpad9; + case XK_KP_Insert: return sf::Keyboard::Numpad0; + case XK_KP_End: return sf::Keyboard::Numpad1; + case XK_KP_Down: return sf::Keyboard::Numpad2; + case XK_KP_Page_Down: return sf::Keyboard::Numpad3; + case XK_KP_Left: return sf::Keyboard::Numpad4; + case XK_KP_Begin: return sf::Keyboard::Numpad5; + case XK_KP_Right: return sf::Keyboard::Numpad6; + case XK_KP_Home: return sf::Keyboard::Numpad7; + case XK_KP_Up: return sf::Keyboard::Numpad8; + case XK_KP_Page_Up: return sf::Keyboard::Numpad9; case XK_a: return sf::Keyboard::A; case XK_b: return sf::Keyboard::B; case XK_c: return sf::Keyboard::C;