Shortcut keys with multiple keybord layouts

Simon Kågedal <simon at helgo dot net>

Written: 2009-02-02
Latest update: 2009-02-03

The problem

This document aims to describe the current inconsistency in behavior of access keys and shortcut keys on the X desktop. The basic problem is that users of non-latin keyboard layouts need to be able to use shortcuts and access keys composed of a modifier and a latin character, even when their keymap does not have latin characters. Various toolkits and individual applications have solved this problem in slightly different ways, leading to inconsistent behavior.

Definitions

Keycodes
"Physical keys", or scan codes – for example, one keycode represents the left-most key of the first row.
Symbols
"Logical keys", such as "Escape" or "Q".
Keyboard layout
Mapping of keycodes to symbols – see XKB Configuration Guide.
Key group
The X keyboard extension allows for the keyboard to switch between different character groups. This is usually done for making a keyboard behave like a keyboard of a different language. In this context, the set of characters that are generated by the keyboard are called a group, and a keyboard can switch to a different group at any time.(Wikipedia)
Access key
Gives access to all controls in the user interface without using a mouse by pressing Alt + <underlined key>.
Shortcut key
Used to quickly reach often-used commands, e. g., Ctrl+S for save.

Use cases

The following use cases are designed to illustrate the various conflicting needs.

Situation today

I tested this on a Ubuntu 8.10 system running GNOME. GNOME (GTK+) was tested using gedit. KDE (Qt) was tested using kate. OpenOffice (Writer) and Mozilla Firefox uses GTK+, but have their own system for handling keyboard input. I also tested Windows for comparison.

Right now I have only tested shortcuts, but I guess access keys work similarly.

PersonWindowsGTK+GTK+ 2.15.3KDEFirefoxOpenOffice
Basem OK? OK OK OK if France is first OK OK if France is first
Adrienne OK Fail OK Fail OK OK
Jennifer OK? Fail Fail Fail OK if France is first OK if France is first
Steven Fail Fail Fail OK if QWERTY first Fail Fail

Proposed standard

To be continued... What alternatives do we have? Of the current solutions on the X desktop, it seems to me that the Firefox behavior is best. Personally I feel that the way (I think) Windows works would be the best, i.e. that the keymaps themselves contain the correct information on how modifiers should work – that is, the Arabic key map always behaves the same way, no matter what other key groups you have. That seems most logical to me... But is it possible?

Resources