[PATCH] ui/cocoa: Support unique keys of JIS keyboards

Akihiko Odaki posted 1 patch 3 years, 3 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210212000404.28413-1-akihiko.odaki@gmail.com
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, Peter Maydell <peter.maydell@linaro.org>
ui/cocoa.m | 7 +++++++
1 file changed, 7 insertions(+)
[PATCH] ui/cocoa: Support unique keys of JIS keyboards
Posted by Akihiko Odaki 3 years, 3 months ago
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
---
 ui/cocoa.m | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ui/cocoa.m b/ui/cocoa.m
index 13fba8103e1..78fcfeaf04b 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -240,6 +240,13 @@ static bool bool_with_iothread_lock(BoolCodeBlock block)
     [kVK_F14] = Q_KEY_CODE_SCROLL_LOCK,
     [kVK_F15] = Q_KEY_CODE_PAUSE,
 
+    // JIS keyboards only
+    [kVK_JIS_Yen] = Q_KEY_CODE_YEN,
+    [kVK_JIS_Underscore] = Q_KEY_CODE_RO,
+    [kVK_JIS_KeypadComma] = Q_KEY_CODE_KP_COMMA,
+    [kVK_JIS_Eisu] = Q_KEY_CODE_MUHENKAN,
+    [kVK_JIS_Kana] = Q_KEY_CODE_HENKAN,
+
     /*
      * The eject and volume keys can't be used here because they are handled at
      * a lower level than what an Application can see.
-- 
2.24.3 (Apple Git-128)


Re: [PATCH] ui/cocoa: Support unique keys of JIS keyboards
Posted by Gerd Hoffmann 3 years, 3 months ago
> +    // JIS keyboards only
> +    [kVK_JIS_Yen] = Q_KEY_CODE_YEN,
> +    [kVK_JIS_Underscore] = Q_KEY_CODE_RO,
> +    [kVK_JIS_KeypadComma] = Q_KEY_CODE_KP_COMMA,
> +    [kVK_JIS_Eisu] = Q_KEY_CODE_MUHENKAN,
> +    [kVK_JIS_Kana] = Q_KEY_CODE_HENKAN,

Added to UI patch queue.

thanks,
  Gerd