Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zero key codes for non-Latin keyboard layouts on Linux/BSD platforms #23410

Closed
wants to merge 23 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0307fb3
set key_code to Latin equivalent of pressed key as wx on Windows do
unxed Mar 30, 2023
fb5b061
minor fixes
unxed Mar 31, 2023
c17c2ca
performance optimization
unxed Mar 31, 2023
0c7c8e5
added xkbcommon requirement for GTK target on linux/bsd systems
unxed Mar 31, 2023
1e2bdf1
moved deinitialization to wxModule, fixed unicode char being lost (as…
unxed Mar 31, 2023
48026eb
add required changes for xkbcommon lib
unxed Mar 31, 2023
587bb9d
minor code style changes
unxed Mar 31, 2023
c713588
adopt test logic to new KeyCode/UnicodeKey behavoir
unxed Mar 31, 2023
51d8711
KeyCode for Latin letter keys should be in upper register to match wx…
unxed Mar 31, 2023
5ddb103
KeyCode for Latin letter keys should be in upper register, try 2
unxed Mar 31, 2023
4cb2c8e
adopt kb test to new KeyCode/UnicodeKey behavior, try 2
unxed Mar 31, 2023
e69dbf5
fixed a typo
unxed Mar 31, 2023
8b1fcd2
trying to fix build under ubuntu 18.04
unxed Mar 31, 2023
20c1d13
temporary revert test changes to inspect CI test failures more accura…
unxed Mar 31, 2023
e775602
removed redundancy
unxed Mar 31, 2023
27956ce
attempting to try to fix kb test
unxed Mar 31, 2023
fe42df6
attempting to try to fix kb test, try 2
unxed Mar 31, 2023
d077e11
fix #17643
unxed Mar 31, 2023
6a256e4
reverted comment back
unxed Mar 31, 2023
2af73b0
trying to fix #17643 better
unxed Mar 31, 2023
291c649
fix #17643 even better
unxed Mar 31, 2023
159e410
cosmetic
unxed Mar 31, 2023
5bfb034
fixed key_code value
unxed Mar 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/gtk/window.cpp
Expand Up @@ -1062,7 +1062,7 @@ wxTranslateGTKKeyEventToWx(wxKeyEvent& event,
xkb_state_key_get_utf8(g_state, gdk_event->hardware_keycode, key_code_str, sizeof(key_code_str));
if (strlen(key_code_str) == 1)
{
key_code = islower(key_code_str[0]) ? toupper(key_code_str[0]) : key_code_str[0];
key_code = key_code_str[0];
force_uni = true;
}
}
Expand Down Expand Up @@ -1118,9 +1118,6 @@ wxTranslateGTKKeyEventToWx(wxKeyEvent& event,
// got one
key_code = keysymNormalized ? keysymNormalized : keysym;

// it key_code is Latin char, it should be in upper register though
// to match wx behavoir on MSW
if (isalpha(key_code)) { key_code = toupper(key_code); }
}
else
#endif // GDK_WINDOWING_X11
Expand Down Expand Up @@ -1161,6 +1158,10 @@ wxTranslateGTKKeyEventToWx(wxKeyEvent& event,

wxLogTrace(TRACE_KEYS, wxT("\t-> wxKeyCode %ld"), key_code);

// it key_code is Latin char, it should be in upper register
// to match wx behavoir on MSW
if (islower(key_code)) { key_code = toupper(key_code); }

event.m_keyCode = key_code;

event.m_uniChar = gdk_keyval_to_unicode(force_uni ? gdk_event->keyval : (key_code ? key_code : gdk_event->keyval));
Expand Down