From df3b407427e778d4c2798266b26aa2c748a07514 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Tue, 28 Jan 2014 19:54:31 +0100 Subject: [PATCH] Detect azerty and qwertz Addresses #2462. --- Common/KeyMap.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Common/KeyMap.cpp b/Common/KeyMap.cpp index 863106c63c..1e3a573106 100644 --- a/Common/KeyMap.cpp +++ b/Common/KeyMap.cpp @@ -15,7 +15,9 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. -#if defined(_WIN32) && !defined(_XBOX) +#if defined(SDL) +#include +#elif defined(_WIN32) && !defined(_XBOX) #include #endif #include @@ -345,7 +347,16 @@ void SetDefaultKeyMap(DefaultMaps dmap, bool replace) { { bool azerty = false; bool qwertz = false; -#if defined(_WIN32) && !defined(_XBOX) +#if defined(SDL) + char q, w, y; + q = SDL_GetKeyFromScancode(SDL_SCANCODE_Q); + w = SDL_GetKeyFromScancode(SDL_SCANCODE_W); + y = SDL_GetKeyFromScancode(SDL_SCANCODE_Y); + if (q == 'a' && w == 'z' && y == 'y') + azerty = true; + else if (q == 'q' && w == 'w' && y == 'z') + qwertz = true; +#elif defined(_WIN32) && !defined(_XBOX) HKL localeId = GetKeyboardLayout(0); // TODO: Is this list complete enough? switch ((int)localeId & 0xFFFF) {