EVT_KEY_DOWN event NOT triggered on Linux for accented chars

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
cocoabsb
Earned a small fee
Earned a small fee
Posts: 19
Joined: Wed Jan 29, 2020 12:13 pm

EVT_KEY_DOWN event NOT triggered on Linux for accented chars

Post by cocoabsb » Tue Jul 06, 2021 1:45 pm

Hi,

I need to create a custom wxTextCtrl class and so I am inheriting wxTextCtrl class in my custom class.
In order to understand a few things I have added a wxLogMessage to the text sample's OnKeyDown handler and I have noticed that under Linux it never gets called if I type an accented character such as á, é, ã, etc. On Windows and Mac OS it does get called but NOT on Linux.

Text sample's text.cpp code with the added wxLogMessage call:
void MyTextCtrl::OnKeyDown(wxKeyEvent& event)
{
if ( ms_logKey )
LogKeyEvent( "Key down", event);

=====>>>> wxLogMessage("OnKeyDown. event.GetKeyCode() = %d", event.GetKeyCode()); <<== Never gets called for accented chars on Linux, but does get called on Windows and Mac OS.

event.Skip();
...

I am using Linux Ubuntu 18.04.

Does anyone have any clues on this issue?

Thanks in advance.

User avatar
doublemax@work
Earned some good credits
Earned some good credits
Posts: 131
Joined: Wed Jul 29, 2020 6:06 pm

Re: EVT_KEY_DOWN event NOT triggered on Linux for accented chars

Post by doublemax@work » Tue Jul 06, 2021 2:19 pm

wxWidgets version?

Can you build and run the "keyboard" sample that comes with wxWidgets and check if it does the same?

PB
Part Of The Furniture
Part Of The Furniture
Posts: 3087
Joined: Sun Jan 03, 2010 5:45 pm

Re: EVT_KEY_DOWN event NOT triggered on Linux for accented chars

Post by PB » Tue Jul 06, 2021 3:59 pm

Did you check it is not XIM related:
http://wxwidgets.org/docs/faq/gtk/#xim

cocoabsb
Earned a small fee
Earned a small fee
Posts: 19
Joined: Wed Jan 29, 2020 12:13 pm

Re: EVT_KEY_DOWN event NOT triggered on Linux for accented chars

Post by cocoabsb » Thu Jul 08, 2021 12:54 am

doublemax@work wrote:
Tue Jul 06, 2021 2:19 pm
wxWidgets version?

Can you build and run the "keyboard" sample that comes with wxWidgets and check if it does the same?
I will try to do this and get back here to post the results!
Thanks

cocoabsb
Earned a small fee
Earned a small fee
Posts: 19
Joined: Wed Jan 29, 2020 12:13 pm

Re: EVT_KEY_DOWN event NOT triggered on Linux for accented chars

Post by cocoabsb » Thu Jul 08, 2021 12:56 am

PB wrote:
Tue Jul 06, 2021 3:59 pm
Did you check it is not XIM related:
http://wxwidgets.org/docs/faq/gtk/#xim
I will check this out.
Thanks

Post Reply