I would like to swap the behaviors of ctrl-tab and alt-tab (and also swap the behaviors of ctrl-shift-tab and alt-shift-tab), while keeping the rest of ctrl- and alt- shortcuts unchanged (e.g., ctrl-c is still copy).

Can I do it using xkb on Linux?

  • I don't think you can lie about modifiers, even with XKB. Can't you swap the keyboard shortcuts around? – Gilles 'SO- stop being evil' Apr 14 '17 at 22:06
  • I tried to swap the shortcuts on Ubuntu shortcut setting, but no effect.. – AhLeung Apr 14 '17 at 22:40
  • Btw, I can successfully map Alt-Tab to Ctrl-Tab using XKB with "level3(lalt_switch)", but not Ctrl-Tab to Alt-Tab yet.. – AhLeung Apr 14 '17 at 22:46
  • Ah, so you should be able to do what you want by defining a different set of levels for the <TAB> key. Look in /usr/share/X11/xkb/symbols/level3 for inspiration. – Gilles 'SO- stop being evil' Apr 14 '17 at 22:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.