Page 1 of 1

Any chanse to get Alt key with non-latin characters working with GTK backend?

Posted: Mon Dec 09, 2019 9:00 pm
by unxed
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.

Re: Any chanse to get Alt key with non-latin characters working with GTK backend?

Posted: Mon Dec 09, 2019 10:47 pm
by ONEEYEMAN
Hi,
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?

Posted: Tue Dec 10, 2019 7:56 am
by unxed
ONEEYEMAN wrote:
Mon Dec 09, 2019 10:47 pm
Hi,
What's your wx version?
Can you try Git master? I think Vadim fixed this problem recently...

Thank you.
Thanks for quick reply! I am building with 3.0 which is default on Ubuntu 18.04.
I have never built wx by myself, will try to digg into it :)

Re: Any chanse to get Alt key with non-latin characters working with GTK backend?

Posted: Tue Dec 10, 2019 6:13 pm
by ONEEYEMAN
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.

Re: Any chanse to get Alt key with non-latin characters working with GTK backend?

Posted: Wed Dec 11, 2019 9:34 am
by unxed
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
Successfully got Alt+"б" KeyUp event in text sample with wx from git, thanks again!

Re: Any chanse to get Alt key with non-latin characters working with GTK backend?

Posted: Wed Dec 11, 2019 2:57 pm
by unxed
ONEEYEMAN wrote:
Mon Dec 09, 2019 10:47 pm
I think Vadim fixed this problem recently...
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?

Posted: Wed Dec 11, 2019 3:25 pm
by ONEEYEMAN
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.

Re: Any chanse to get Alt key with non-latin characters working with GTK backend?

Posted: Sat Dec 21, 2019 12:35 pm
by unxed
ONEEYEMAN wrote:
Wed Dec 11, 2019 3:25 pm
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.
Hope I am doing it right :) https://groups.google.com/forum/#!topic ... H5qzP5mxtM

Re: Any chanse to get Alt key with non-latin characters working with GTK backend?

Posted: Sat Dec 21, 2019 12:50 pm
by doublemax
Yes, your message is visible. Thanks.

But don't expect responses as fast as here on the forum, especially around the holidays.