This is very interesting issue. With wx 3.1.4, Alt+NonLatinLetter generates KeyUp and KeyDown with empty key code (but it can be deduced by RawKeyFlags which contains hardware keycode under GTK), but no OnChar.
Same is with wx 3.0.4 under Ubuntu 20.04 (GTK 3.24).
But with the same wx 3.0.4 under Ubuntu 18.04 (GTK 3.22) there is no KeyUp/KeyDown at all for such combinations!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you authored the thread.
Okay, 3.0.4 behavior difference between 18.04 and 20.04 is caused by additional backports from 3.0.5 in 20.04, see archive.ubuntu.com/ubuntu/pool/universe/w/wxwidgets3.0/wxwidgets3.0_3.0.4+dfsg-15build1.debian.tar.xz
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you authored the thread.
keyup/keydown events absence issue indeed fixed in 3.1 branch.
still I am not sure if it is correct to send 0 as keycode for such combinations. shouldn't we detect keysym by hardware key code instead?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you authored the thread.
still I am not sure if it is correct to send 0 as keycode for such combinations. shouldn't we detect keysym by hardware key code instead?
The scan code should be already available via GetRawKeyFlags()
. I'm not sure if we can do anything better, but suggestions are welcome, of course.
Other than that I'm confused: do we still this problem in master or not? This comment seemed to say that we still do, has it been fixed since then?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you authored the thread.
suggestions are welcome, of course
It seems logical to put Latin key value to keycode field of Alt+NonLatinLetter keydown/up events, as actual local letter resides in UnicodeChar, but sometimes we need to know pressed key, not letter.
To get Latin keycode from GetRawKeyFlags() some translation is needed, like:
static int HardwareKeyCodeToKeySym(int code)
{
// Returns keysym corresponding to passed GTK hardware keycode
// Returns zero for every key except non-numeric character keys
switch (code) {
// Hardware key codes are defined in /usr/share/X11/xkb/keycodes/xfree86
case 20: return '-';
case 21: return '=';
// 22 is Backspace
// 23 is Tab
case 24: return 'Q';
case 25: return 'W';
case 26: return 'E';
case 27: return 'R';
case 28: return 'T';
case 29: return 'Y';
case 30: return 'U';
case 31: return 'I';
case 32: return 'O';
case 33: return 'P';
case 34: return '[';
case 35: return ']';
// 36 is Enter
// 37 is RCtrl
case 38: return 'A';
case 39: return 'S';
case 40: return 'D';
case 41: return 'F';
case 42: return 'G';
case 43: return 'H';
case 44: return 'J';
case 45: return 'K';
case 46: return 'L';
case 47: return ';';
case 48: return '\'';
case 49: return '`';
// 50 is LShift
case 51: return '\\';
case 52: return 'Z';
case 53: return 'X';
case 54: return 'C';
case 55: return 'V';
case 56: return 'B';
case 57: return 'N';
case 58: return 'M';
case 59: return '.';
case 60: return '.';
case 61: return '/';
}
return 0; // not applicable
}
Also where is strange behavior of <
key with Shift modifier: its keycode is <
character in keyup/down events, but it should be ,
. <
should be in onchar. It is the common behavior with Shift for keys like >
, /
, ;
, '
, etc. But for <
it's different.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you authored the thread.
Other than that I'm confused: do we still this problem in master or not?
Problem of KeyDown/KeyUp events not firing for Alt+NonLatinLetter is definitely solved in master.
Problem of OnChar event events not firing for Alt+NonLatinLetter has another issue, #18637
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you authored the thread.
To get Latin keycode from GetRawKeyFlags() some translation is needed, like:
Working example of such translation.
As for the problem of zero keycode in such events
Now there is a separate issue for it: #23379
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
Fixed in #23410
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
Closed #17643 as completed via 2c0f6a2.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
2016-08-29 14:35:50: elfmz created the issue
@elfmz finally fixed :)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.