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: 23
Joined: Wed Jan 29, 2020 12:13 pm

EVT_KEY_DOWN event NOT triggered on Linux for accented chars

Post by cocoabsb »

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
Super wx Problem Solver
Super wx Problem Solver
Posts: 474
Joined: Wed Jul 29, 2020 6:06 pm
Location: NRW, Germany

Re: EVT_KEY_DOWN event NOT triggered on Linux for accented chars

Post by doublemax@work »

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: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: EVT_KEY_DOWN event NOT triggered on Linux for accented chars

Post by PB »

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: 23
Joined: Wed Jan 29, 2020 12:13 pm

Re: EVT_KEY_DOWN event NOT triggered on Linux for accented chars

Post by cocoabsb »

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: 23
Joined: Wed Jan 29, 2020 12:13 pm

Re: EVT_KEY_DOWN event NOT triggered on Linux for accented chars

Post by cocoabsb »

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