From 415276acbf433e3adbdf3ed407d220233a467732 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 20 Nov 2020 09:58:03 +0100 Subject: [PATCH] Handle Korean keys on Windows --- vncviewer/win32.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/vncviewer/win32.c b/vncviewer/win32.c index 92268220..d116ecc3 100644 --- a/vncviewer/win32.c +++ b/vncviewer/win32.c @@ -21,6 +21,7 @@ #define XK_MISCELLANY #define XK_XKB_KEYS +#define XK_KOREAN #include #include @@ -239,6 +240,12 @@ static const int vkey_map_jp[][3] = { { VK_ATTN, XK_Romaji, NoSymbol }, }; +// Korean +static const int vkey_map_ko[][3] = { + { VK_HANGUL, XK_Hangul, NoSymbol }, + { VK_HANJA, XK_Hangul_Hanja, NoSymbol }, +}; + static int lookup_vkey_map(UINT vkey, int extended, const int map[][3], size_t size) { size_t i; @@ -283,6 +290,13 @@ int win32_vkey_to_keysym(UINT vkey, int extended) return ret; } + if (primary_lang == LANG_KOREAN) { + ret = lookup_vkey_map(vkey, extended, + vkey_map_ko, ARRAY_SIZE(vkey_map_ko)); + if (ret != NoSymbol) + return ret; + } + // Windows is not consistent in which virtual key it uses for // the numpad decimal key, and this is not likely to be fixed: // http://blogs.msdn.com/michkap/archive/2006/09/13/752377.aspx -- 2.39.5