GNOME Bugzilla – Bug 322696
keyboard shortcuts with latin letters don't work in non-latin kb layout
Last modified: 2012-12-07 13:31:25 UTC
This used to work with an old version of GTK (I think 2.4). Then it became broken. In Inkscape, I had to work around this bug: http://cvs.sourceforge.net/viewcvs.py/inkscape/inkscape/src/event-context.cpp?r1=1.40&r2=1.41&sortby=date See get_group0_keyval() where I force group to be 0 to get the latin letter of the shortcut. Then I had to use get_group0_keyval(event) everywhere instead of just event->key.keyval. This works, but: - This still does not work on Windows for some reason. - Other apps that did not do this workaround are still broken. For example, it's one of the most frequent complaints with GTK builds of Firefox, from Russian users. Having to switch back to Latin layout in order to use any ctrl+letter or alt+letter shortcuts is extremely annoying. I didn't report that before, as I thought it to be a simple mistake that will clear itself soon. But it persists. Please PLEASE fix it soon. Thanks!
Reporter, you mention Windows. I did not manage to reproduce in Linux. Could you please verify whether this is an issue in Windows only, and if so, change the OS setting for this bug report to Windows;
No. It is not Windows only. This does not work everywhere. I just did a probably wrong workaround attempt in Inkscape which does not work in Windows. But it MUST work everywhere without any workarounds. Old versions of GTK (I think 2.4) did not have this problem on any platform.
I run Ubuntu 8.04, with US English and Greek keyboard layouts. I start Inkscape showing English UI messages, I then switch to writing Greek. Now, if I press Ctrl+F or Ctrl+Φ (that is, either layout), I get the Find dialog in both cases. If I press Alt-F or Alt-Φ (that is, either layout), I get the File menu appearing. Could you please verify whether the above examples do not work for you (it's ok to have English+Russian)? Could you please show the output of the command xprop -root | grep XKB
First of all, in Russian Ctrl+F and Ctrl+Φ are different physical keys. When in Latin layout, Ctrl+F works. In Russian layout, Ctrl+<Russian key which is on the same physical key as latin F> only works on Linux thanks to my workaround in Inkscape code (see first message) and does not work on Windows at all. In GTK programs where there's no such workaround, such as Nautilus or Gimp or Firefox, it does not work at all on any platform. Yet it USED TO WORK in old GTK versions. $ xprop -root | grep XKB _XKB_RULES_NAMES(STRING) = "xorg", "pc104", "ru", "", "grp_led:scroll,grp:caps_toggle"
I am not able to duplicate the behavior you get on Linux. I believe that there might be some special setting enabled the causes the differences. First, in the xpror -root|grep XKB it shows that you only can write in Russian. Do you have any additional software that you use to switch between layouts? What distribution are you using? Is the variable GTK_IM_MODULE set? If so, what is the value it has?
I use Kubuntu 6.06 and use its standard keyboard switcher. It's called KDE Keyboard Tool. Here are the simplest steps to reproduce: start gtk-demo press Alt+I and Alt+S while in English layout to switch Source/Info pages - works switch to Russian layout and do the same - DOES NOT WORK
I don't know Ubuntu versioning very well, but 6.06 sounds like it predates the relevant changes in GTK+. What version of gtk+ are you trying this with ?
My GTK is much more recent, I update it often. Right now it is 2.15.4.
Here's an even easier way to reproduce: run testinput from tests subdir of GTK, and press Ctrl+S. It says, "I got an s" in console. Now switch to Russian keyboard and press the same. It says "I got some other key" meaning it's not ASCII. How are programmers supposed to work around this? Obviously Ctrl+S must work regardless of which keyboard mode you are in! At least it works always in any Windows software, and it used to work with old versions of GTK. At some point this got broken and never fixed.
Shortcuts like Alt-I, Ctrl-S work just fine here, in us locale with russian keymap.
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of bug 136280 ***