diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2022-02-26 23:57:37 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2022-02-26 23:57:37 +0300 |
commit | ee160630c66b5b043554f6d16f1a2b8ab7129cee (patch) | |
tree | 4cbd074a5322dd5822fc421f16295b85759ce23d /intern/ghost | |
parent | 576853661c4231ebe7f075966fdbe9340c8475f1 (diff) | |
parent | 4ee4b61dd8d372358606441f450df02a6e27d563 (diff) |
Merge branch 'blender-v3.1-release'
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.mm | 1 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.cpp | 45 |
2 files changed, 29 insertions, 17 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index 51d4083b436..d3248a826e6 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -307,6 +307,7 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction) case ']': return GHOST_kKeyRightBracket; case '`': + case '<': /* The position of '`' is equivalent to this symbol in the French layout. */ return GHOST_kKeyAccentGrave; default: return GHOST_kKeyUnknown; diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 1c26935ed64..fa93324e0b3 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -53,9 +53,6 @@ #ifndef VK_COMMA # define VK_COMMA 0xBC #endif // VK_COMMA -#ifndef VK_QUOTE -# define VK_QUOTE 0xDE -#endif // VK_QUOTE #ifndef VK_BACK_QUOTE # define VK_BACK_QUOTE 0xC0 #endif // VK_BACK_QUOTE @@ -635,14 +632,32 @@ GHOST_TKey GHOST_SystemWin32::hardKey(RAWINPUT const &raw, GHOST_TKey GHOST_SystemWin32::processSpecialKey(short vKey, short scanCode) const { GHOST_TKey key = GHOST_kKeyUnknown; - switch (PRIMARYLANGID(m_langId)) { - case LANG_FRENCH: - if (vKey == VK_OEM_8) - key = GHOST_kKeyF13; // oem key; used purely for shortcuts . + char ch = (char)MapVirtualKeyA(vKey, MAPVK_VK_TO_CHAR); + switch (ch) { + case u'\"': + case u'\'': + key = GHOST_kKeyQuote; break; - case LANG_ENGLISH: - if (SUBLANGID(m_langId) == SUBLANG_ENGLISH_UK && vKey == VK_OEM_8) // "`¬" - key = GHOST_kKeyAccentGrave; + case u'.': + key = GHOST_kKeyNumpadPeriod; + break; + case u'/': + key = GHOST_kKeySlash; + break; + case u'`': + case u'²': + key = GHOST_kKeyAccentGrave; + break; + default: + if (vKey == VK_OEM_7) { + key = GHOST_kKeyQuote; + } + else if (vKey == VK_OEM_8) { + if (PRIMARYLANGID(m_langId) == LANG_FRENCH) { + /* oem key; used purely for shortcuts. */ + key = GHOST_kKeyF13; + } + } break; } @@ -777,9 +792,6 @@ GHOST_TKey GHOST_SystemWin32::convertKey(short vKey, short scanCode, short exten case VK_CLOSE_BRACKET: key = GHOST_kKeyRightBracket; break; - case VK_QUOTE: - key = GHOST_kKeyQuote; - break; case VK_GR_LESS: key = GHOST_kKeyGrLess; break; @@ -821,9 +833,6 @@ GHOST_TKey GHOST_SystemWin32::convertKey(short vKey, short scanCode, short exten case VK_CAPITAL: key = GHOST_kKeyCapsLock; break; - case VK_OEM_8: - key = ((GHOST_SystemWin32 *)getSystem())->processSpecialKey(vKey, scanCode); - break; case VK_MEDIA_PLAY_PAUSE: key = GHOST_kKeyMediaPlay; break; @@ -836,8 +845,10 @@ GHOST_TKey GHOST_SystemWin32::convertKey(short vKey, short scanCode, short exten case VK_MEDIA_NEXT_TRACK: key = GHOST_kKeyMediaLast; break; + case VK_OEM_7: + case VK_OEM_8: default: - key = GHOST_kKeyUnknown; + key = ((GHOST_SystemWin32 *)getSystem())->processSpecialKey(vKey, scanCode); break; } } |