From 14b5cebb62881a4a3cd1f8e4850a6b9cdbab069a Mon Sep 17 00:00:00 2001 From: Tomoya Tanjo Date: Sun, 27 Jun 2021 17:00:42 +0000 Subject: [PATCH 1/3] Fix keycode for `Kana` in Windows key mapping --- src/lib/platform/MSWindowsKeyState.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/platform/MSWindowsKeyState.cpp b/src/lib/platform/MSWindowsKeyState.cpp index 5afa9e8f..0daa8ee8 100644 --- a/src/lib/platform/MSWindowsKeyState.cpp +++ b/src/lib/platform/MSWindowsKeyState.cpp @@ -61,8 +61,8 @@ const KeyID MSWindowsKeyState::s_virtualKey[] = /* 0x012 */ { kKeyAlt_L }, // VK_MENU /* 0x013 */ { kKeyPause }, // VK_PAUSE /* 0x014 */ { kKeyCapsLock }, // VK_CAPITAL - /* 0x015 */ { kKeyKana }, // VK_HANGUL, VK_KANA - /* 0x016 */ { kKeyNone }, // undefined + /* 0x015 */ { kKeyNone }, // undefined + /* 0x016 */ { kKeyKana }, // VK_HANGUL, VK_KANA /* 0x017 */ { kKeyNone }, // VK_JUNJA /* 0x018 */ { kKeyNone }, // VK_FINAL /* 0x019 */ { kKeyKanzi }, // VK_HANJA, VK_KANJI From eec676948c5f84515bf2228743ddfdfe0290bb89 Mon Sep 17 00:00:00 2001 From: Tomoya Tanjo Date: Sun, 27 Jun 2021 17:05:26 +0000 Subject: [PATCH 2/3] Add `IME on` and `IME off` key entries to Windows Note that these key codes are same as Kana and EisuToggle keys in macOS, respectively. See also: https://docs.microsoft.com/en-US/windows-hardware/design/component-guidelines/keyboard-japan-ime#hid-usage-ps2-scan-code-and-virtual-key-code-for-imeon-key--imeoff-key --- src/lib/platform/MSWindowsKeyState.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/platform/MSWindowsKeyState.cpp b/src/lib/platform/MSWindowsKeyState.cpp index 0daa8ee8..e1072c40 100644 --- a/src/lib/platform/MSWindowsKeyState.cpp +++ b/src/lib/platform/MSWindowsKeyState.cpp @@ -62,11 +62,11 @@ const KeyID MSWindowsKeyState::s_virtualKey[] = /* 0x013 */ { kKeyPause }, // VK_PAUSE /* 0x014 */ { kKeyCapsLock }, // VK_CAPITAL /* 0x015 */ { kKeyNone }, // undefined - /* 0x016 */ { kKeyKana }, // VK_HANGUL, VK_KANA + /* 0x016 */ { kKeyKana }, // VK_HANGUL, VK_KANA, VK_IME_ON /* 0x017 */ { kKeyNone }, // VK_JUNJA /* 0x018 */ { kKeyNone }, // VK_FINAL /* 0x019 */ { kKeyKanzi }, // VK_HANJA, VK_KANJI - /* 0x01a */ { kKeyNone }, // undefined + /* 0x01a */ { kKeyEisuToggle }, // VK_IME_OFF /* 0x01b */ { kKeyEscape }, // VK_ESCAPE /* 0x01c */ { kKeyHenkan }, // VK_CONVERT /* 0x01d */ { kKeyMuhenkan }, // VK_NONCONVERT From 7a4c6a25d7305c1772149fd9e20db8594565020b Mon Sep 17 00:00:00 2001 From: Tomoya Tanjo Date: Sun, 27 Jun 2021 17:07:45 +0000 Subject: [PATCH 3/3] Add `Henkan`, `Muhenkan` and `Zenkaku` entries to macOS Note: these keys are sometimes referred as `international4` and `international5`, respectively. --- src/lib/platform/OSXKeyState.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/platform/OSXKeyState.cpp b/src/lib/platform/OSXKeyState.cpp index b1f070f5..aad20729 100644 --- a/src/lib/platform/OSXKeyState.cpp +++ b/src/lib/platform/OSXKeyState.cpp @@ -43,6 +43,9 @@ static const UInt32 s_launchpadVK = 131; static const UInt32 s_osxNumLock = 1 << 16; +static const UInt32 s_int4VK = 0x8a; // international4 +static const UInt32 s_int5VK = 0x8b; // international5 + struct KeyEntry { public: KeyID m_keyID; @@ -126,7 +129,10 @@ static const KeyEntry s_controlKeys[] = { // JIS keyboards only { kKeyEisuToggle, kVK_JIS_Eisu }, - { kKeyKana, kVK_JIS_Kana } + { kKeyKana, kVK_JIS_Kana }, + { kKeyMuhenkan, s_int5VK }, + { kKeyHenkan, s_int4VK }, + { kKeyZenkaku, kVK_ANSI_Grave } };