• Antonio Larrosa's avatar
    Translate ISO_Left_Tab to Meta_Tab · 564f2dfb
    Antonio Larrosa authored
    Short description:
    ISO_Left_Tab shouldn't be translated to Tab (just like regular Tab)
    otherwise there's no way to differentiate between Tab and Shift-Tab
    on text mode. This commit changes ckbcomp to translate ISO_Left_Tab
    to Meta_Tab.
    
    Long description:
    Currently, in most Linux distribution, most keyboard layouts in text
    mode assign the Tab and Shift-Tab key presses the same code.
    This can be checked by pressing ctrl-alt-f1, logging in and running:
    "showkey -a"
    
    Pressing Tab and Shift-Tab generate the same code (0x09), so for
    example, when Yast runs with ncurses, Tab moves the focus to the next
    focusable item, but Shift-Tab can't be used as it behaves just like
    Tab and there's no way applications can differentiate both.
    
    Changing the keyboard layout with "loadkeys es", "loadkeys de" or
    "loadkeys fr" doesn't help.
    
    I investigated this and found that ckbcomp was translating the
    ISO_Left_Tab symbol to Tab just like it does with Tab, which doesn't
    make sense since Shift-Tab should produce a "Left Tab" (in many
    keyboards it's even printed in the Tab key over the regular Right-Tab
    drawing).
    
    Looking at how the keyboard layouts were defined before xkb layouts
    were parsed, I noticed legacy layouts were defined like:
    
    keycode 15 = Tab
        shift  keycode 15 = Meta_Tab
    
    So ISO_Left_Tab is now translated to Meta_Tab to fix this and let it
    generate the same code it did in the past.
    
    Now "showkey -a" shows the (0x09) code for Tab and (0x1b 0x09) for
    Shift-Tab which can be recognized by text applications as different
    and automatically fixes Yast.
    
    In SUSE/openSUSE distributions, after applying this change and
    rebuilding the kbd package with the generated console-setup (which
    regenerates the kbd keymaps with the fixed ckbcomp script) fixes this.
    I guess other distributions would also need to rebuild kbd after
    applying this patch.
    564f2dfb
Name
Last commit
Last update
Fonts Loading commit data...
Keyboard Loading commit data...
acm Loading commit data...
config Loading commit data...
debian Loading commit data...
doc Loading commit data...
init Loading commit data...
man Loading commit data...
.gitignore Loading commit data...
CHANGES Loading commit data...
COPYRIGHT Loading commit data...
FAQ Loading commit data...
GPL-2 Loading commit data...
Makefile Loading commit data...
README Loading commit data...
README.legacyfonts Loading commit data...
copyright.fonts Loading commit data...
copyright.xkb Loading commit data...
describe_unicodes Loading commit data...
rules.mk Loading commit data...
setupcon Loading commit data...
xorg.lst Loading commit data...