Different keycodes for shifted characters under Wayland vs X11

"[email protected]" <[email protected]>
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>

wxWidgets 3.2.2.1, built from source

Linux (Ubuntu 22.04 LTS)

Run the 'keyboard' sample and press <shift>-3 to type a ‘#’ character.

Under X11 (forced by setting GDK_BACKEND=x11 env var), I get the same 
behavior I see on MacOS and Windows: keydown on ‘3 (code=51)’, with shift 
modifier set.

$ GDK_BACKEND=x11 ./wxWidgets-3.2.2.1/buildgtk/samples/keyboard/keyboard 


Under Wayland (no env var set, default for Ubuntu 22.04), I see keydown on 
‘#’ (code=35), with shift modifier set.

$ ./wxWidgets-3.2.2.1/buildgtk/samples/keyboard/keyboard 

My app makes use of unmodified keys for shortcuts (like GIMP and Inkscape); 
so the operation bound to ‘#’ is now unusable on Wayland, because my code 
is expecting <shift>-3, not <shift>-#.

Found this on wxPython. I’m assuming it’s a GTK issue, not wxWidgets. 
Frustrating that multiple layers of cross-platform toolkits (Gtk, 
wxWidgets, wxPython) are exposing an inconsistency within one platform! But 
also interesting that Inkscape, a GTK app that does run on Wayland, has 
default shortcuts bound to both ‘3’ and ‘#’ that appear to work correctly. 
So maybe it is wxGTK?


Either way: what’s the recommended approach here? Do I just declare I don’t 
support Wayland, or start special-casing code for X11 vs Wayland?


Thanks for any help/suggestions.

-ck



-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/fd44efb3-62fc-4796-976f-fcd0904d316fn%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.