summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakao Fujiwara <tfujiwar@redhat.com>2016-04-15 18:09:37 +0900
committerFrediano Ziglio <fziglio@redhat.com>2016-04-18 09:57:01 +0100
commit2293b293e83a95a9b939a04a916adf8abed1a100 (patch)
tree4e7a9f6fe74f8d42e3a323049513e2cd343985be
parent046de27c2eea2b3ee2ade80780f51b2ca140f92d (diff)
Send Hangul key in KR keyboardHEADmaster
Korean keyboard assigns Hangul key on the position of Right Alt and Left Alt and Hangul keys have the different scancodes but MapVirtualKey() returned the same scancode and could not use Hangul key on Linux desktop. The fix is to send the right scancode of VK_HANGUL.
-rw-r--r--src/spice-widget.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/spice-widget.c b/src/spice-widget.c
index 4878e00..617cd26 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -30,6 +30,7 @@
#endif
#ifdef G_OS_WIN32
#include <windows.h>
+#include <dinput.h>
#include <ime.h>
#include <gdk/gdkwin32.h>
#ifndef MAPVK_VK_TO_VSC /* may be undefined in older mingw-headers */
@@ -1487,6 +1488,14 @@ static gboolean key_event(GtkWidget *widget, GdkEventKey *key)
}
}
break;
+ case MAKELANGID(LANG_KOREAN, SUBLANG_KOREAN):
+ if (key->hardware_keycode == VK_HANGUL && native_scancode == DIK_LALT) {
+ /* Left Alt (VK_MENU) has the scancode DIK_LALT (0x38) but
+ * Hangul (VK_HANGUL) has the scancode 0x138
+ */
+ scancode = native_scancode | 0x100;
+ }
+ break;
}
/* Emulate KeyRelease events for the following keys.