GNOME Bugzilla – Bug 672950
egg_accelerator_parse_virtual fails to process 0x## keycodes
Last modified: 2021-06-10 20:51:38 UTC
Previously, egg_accelerator_parse_virtual() worked fine for passing codes such as 0x93. However, this is broken with recent GDK versions. The code does this: keyval = gdk_keyval_from_name (accelerator); if (keyval == 0) { /* If keyval is 0, then maybe it's a keycode. Check for 0x## */ i.e. it is also expecting gdk_keyval_from_name to refuse to process input strings of form "0x##". However, GDK as provided by GTK+-2.24.10 and GDK3 from GTK+-3.2.3 both interpret strings such as this one: Python 2.7.2 (default, Oct 27 2011, 01:36:46) [GCC 4.6.1 20111003 (Red Hat 4.6.1-10)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from gi.repository import Gdk >>> Gdk.keyval_from_name("0x93") 147L So, eggaccelerators should now check if the string is of form 0x## *before* deciding whether to use gdk_keyval_from_name or not.
Or you could simply use gtk_accelerator_parse or its more flexible variant gtk_accelerator_parse_with_keycode, which handle 0x## keycodes nowadays.
Thanks for pointing that out. I opened a ticket at http://bugs.sugarlabs.org/ticket/3412 so that we switch to it at some point. Perhaps this code can be removed from libegg now?
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version of libegg, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libegg/-/issues/ Thank you for your understanding and your help.