11

I'm trying to get rid of the Caps Lockkey and give it a better use. Since I constantly use the run command Alt+F2, I'd like to make Caps Lock trigger that action.

I've found a couple of questions related, using xmodmap, but none of them try to map Caps Lock to a combination of keys such as Alt+F2

How would I go about doing this?

Thanks!

v2r
  • 9,547
  • After certain versions, you can't use super or cap alone for shortcuts. At least can't configure it that way in the keyboard shortcut gui. – hansioux Apr 18 '11 at 16:35
  • Please have a look here https://askubuntu.com/questions/1041674/can-i-remap-the-caps-lock-key-to-play-audio/1047003#1047003 You should be able to adapt this answer for your purpose. – Sebastian Stark Jun 16 '18 at 10:20

2 Answers2

6
  1. Install Xdotool Install xdotool and CompizConfig Settings Manager Install compizconfig-settings-manager from Ubuntu Software Center

  2. Disable Caps-Lock by opening Keyboard Preferences

    System ▸ Preferences ▸ Keyboard

    Goto tab Layouts then click the button Options...

    Change the key behaviour to CapsLock is disabled

    enter image description here

  3. Open CompizConfig Settings Manager

    • Use Run Command, Alt + F2, and type ccsm
  4. Enable Commands plugin then add the following

    • Add xdotool key alt+F2 to the first available command slot

    • Goto 'Key Bindings' tab. In the same slot number assign Caps Lock key.

      Note: It will show VoidSymbol as the button assigned but this is fine.

      enter image description here

      enter image description here

Cas
  • 8,557
  • When I try to add caps lock to the key bindings, it displays 0xffffff, but no key binding is stored when I close the window – Lou Garczynski Jul 11 '21 at 17:49
1

Going by what you mention here. You can disable CAPS LOCK by going to System ▸ Preferences ▸ Keyboard. Then in the window that opens Layouts ▸ Options.... Here you can change the CapsLock key behaviour and disable it.

  • Ok, and what about having 'capslock' as a substitute of 'alt+f2' for 'run command'? The only issue would be assigning an empty action to that key but still have it enabled, so I can use the 'keyboard settings' module to assign the 'run command' action to 'capslock' and NOT have it actually turn the capslock ON every time I hit it. Can you see what I mean? –  Apr 18 '11 at 19:12