There is long standing bug in wx (http://trac.wxwidgets.org/ticket/17643) with key events (EVT_KEY_DOWN/EVT_KEY_UP/EVT_CHAR) do not fireing if letter key is pressed together with Alt and non-latin keyboard layout is selected.
For example, you can not bind event listener to shortcuts like "alt+б" (russian letter, placed on "," key).
Okay, menu shortcuts are keyboard layout independent, so this can be used to workaround an issue (if you do not want menu, just an action on key combination, you can create hidden menu with shorcuts for all needed keys), but you can't bind menu shortcut to non-alphanumeric keys like ",".
The only solution I found is to check for next keypresses via wxGetKeyState() every 10000 usecs in a separate thread if Alt keypress was fired previously. But this is CPU consuming and looks like an ugly hack.
May be there are some better solutions? Thanks.
Any chanse to get Alt key with non-latin characters working with GTK backend?
Re: Any chanse to get Alt key with non-latin characters working with GTK backend?
Hi,
What's your wx version?
Can you try Git master? I think Vadim fixed this problem recently...
Thank you.
What's your wx version?
Can you try Git master? I think Vadim fixed this problem recently...
Thank you.
Re: Any chanse to get Alt key with non-latin characters working with GTK backend?
Hi,
This is very simple.
1. Install git client package
2. Clone wxWidgets repository (documentation at wxWidgets.org explains how to do that. See: http://www.wxwidgets.org/develop/code-repository/)
3. Do this:
cd wxWidgets && mkdir buildGTK && cd buildGTK && ../configure --enable-debug && make -j2
4. Do this after successful completion of the previous command(s):
cd samples/text && make -j2 && ./minimal
I presume the text sample is the one where you can easily see the problem.
Thank you.
This is very simple.
1. Install git client package
2. Clone wxWidgets repository (documentation at wxWidgets.org explains how to do that. See: http://www.wxwidgets.org/develop/code-repository/)
3. Do this:
cd wxWidgets && mkdir buildGTK && cd buildGTK && ../configure --enable-debug && make -j2
4. Do this after successful completion of the previous command(s):
cd samples/text && make -j2 && ./minimal
I presume the text sample is the one where you can easily see the problem.
Thank you.
Re: Any chanse to get Alt key with non-latin characters working with GTK backend?
Successfully got Alt+"б" KeyUp event in text sample with wx from git, thanks again!ONEEYEMAN wrote: ↑Tue Dec 10, 2019 6:13 pm 1. Install git client package
2. Clone wxWidgets repository (documentation at wxWidgets.org explains how to do that. See: http://www.wxwidgets.org/develop/code-repository/)
3. Do this:
cd wxWidgets && mkdir buildGTK && cd buildGTK && ../configure --enable-debug && make -j2
cd samples/text && make -j2 && ./minimal
Re: Any chanse to get Alt key with non-latin characters working with GTK backend?
Still there is a minor issue in this case: event.GetKeyCode() for such key combinations (like Alt+"б") always return zero. event.GetUnicodeKey() values are correct though, so still usable, but a bit annoying. Should I open a new bug report about this, or it is expected behavour?
Also EVT_CHAR events are fired for Alt+latin_letters and not fired for Alt+non_latin_letters.
Re: Any chanse to get Alt key with non-latin characters working with GTK backend?
Hi,
Try to send an e-mail to wx-users ML first. There you will catch core developers of the library (Vadim included) and you will get a responce whether it is a bug(s) or expected behavior.
Thank you.
Try to send an e-mail to wx-users ML first. There you will catch core developers of the library (Vadim included) and you will get a responce whether it is a bug(s) or expected behavior.
Thank you.
Re: Any chanse to get Alt key with non-latin characters working with GTK backend?
Yes, your message is visible. Thanks.
But don't expect responses as fast as here on the forum, especially around the holidays.
But don't expect responses as fast as here on the forum, especially around the holidays.
Use the source, Luke!