Skip to content

Commit

Permalink
Fix Zen/Han key for configuration editor on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
maron2000 committed Nov 24, 2023
1 parent 4475e9a commit 1b0aa31
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/libs/gui_tk/gui_tk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1836,9 +1836,9 @@ static MouseButton SDL_to_GUI(const int button)
static GUI::Char SDLSymToChar(const SDL_Keysym &key) {
/* SDL will not uppercase the char for us with shift, etc. */
/* Additionally we have to filter out non-char values */
if (key.sym == 0 || key.sym > 0x7f) return 0;
/* Hankaku/Zenkaku key (scancode 0x35, sym 0x40000000) should be handled here */
if (key.scancode != 0x35 && (key.sym == 0 || key.sym > 0x7f)) return 0;

//GUI::Char ret = key.sym;
GUI::Char ret = key.scancode;
bool is_shift = key.mod & KMOD_SHIFT;
switch (ret) {
Expand All @@ -1864,7 +1864,7 @@ static GUI::Char SDLSymToChar(const SDL_Keysym &key) {
ret = is_shift ? (GUI::Char)('"') : (GUI::Char)('\'');
break;
case 53: //'`'
ret = is_shift ? (GUI::Char)('~') : (GUI::Char)('`');
ret = is_shift ? (GUI::Char)('~') : (GUI::Char)('`');
break;
case 54: //','
ret = is_shift ? (GUI::Char)('<') : (GUI::Char)(',');
Expand All @@ -1876,6 +1876,7 @@ static GUI::Char SDLSymToChar(const SDL_Keysym &key) {
ret = is_shift ? (GUI::Char)('?') : (GUI::Char)('/');
break;
case 100: //Intl 5
case 135:
ret = is_shift ? (GUI::Char)('_') : (GUI::Char)('\\');
break;
case 137: //JP Yen
Expand Down

0 comments on commit 1b0aa31

Please sign in to comment.