Skip to content

Commit 2293b29

Browse files
fujiwaratFrediano Ziglio
authored and
Frediano Ziglio
committed
Send Hangul key in KR keyboard
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.
1 parent 046de27 commit 2293b29

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/spice-widget.c

+9
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#endif
3131
#ifdef G_OS_WIN32
3232
#include <windows.h>
33+
#include <dinput.h>
3334
#include <ime.h>
3435
#include <gdk/gdkwin32.h>
3536
#ifndef MAPVK_VK_TO_VSC /* may be undefined in older mingw-headers */
@@ -1487,6 +1488,14 @@ static gboolean key_event(GtkWidget *widget, GdkEventKey *key)
14871488
}
14881489
}
14891490
break;
1491+
case MAKELANGID(LANG_KOREAN, SUBLANG_KOREAN):
1492+
if (key->hardware_keycode == VK_HANGUL && native_scancode == DIK_LALT) {
1493+
/* Left Alt (VK_MENU) has the scancode DIK_LALT (0x38) but
1494+
* Hangul (VK_HANGUL) has the scancode 0x138
1495+
*/
1496+
scancode = native_scancode | 0x100;
1497+
}
1498+
break;
14901499
}
14911500

14921501
/* Emulate KeyRelease events for the following keys.

0 commit comments

Comments
 (0)