0

Quickly, press the control key and hold it. Then release it. Nothing happens. This is my problem. I could add so much more functionality to my keyboard if I made shift, ctrl, and alt do something when pressed standalone. I was wondering if there was any way to do this software-wise in Arch Linux. If there is official documentation on this that you know of, please let me know. I also wanted to do things like mix and mash modification keys. For example, holding shift before one of the other modification keys would change what that key did. Similar to how it capitalizes normal letter keys. I know that there are probably programs similar to auto hotkey that work on Linux, but I was hoping for something that will work on a bare bones installation of Arch, or something that I can port to different operating systems, like a custom keyboard layout that also changes the modification keys.

1 Answer 1

1

I could add so much more functionality to my keyboard if I made shift, ctrl, and alt do something when pressed standalone. I was wondering if there was any way to do this software-wise in Arch Linux.

Assuming you're using X11 (via Xorg), there are two answers – one for making shortcuts which affect the keyboard itself, and one for everything else:

Xorg has a few built-in modifier-only shortcuts to change keyboard layouts, for example ShiftAlt (similar to the one in Windows) or Alt alone or Ctrl alone. For example, to activate ShiftAlt run setxkbmap -option grp:alt_shift_toggle. See base.lst for other possible options, such as grp:alts_toggle.

There is also a built-in modifier-only shortcut to emulate Caps Lock, in case you have remapped the actual Caps Lock to do something more useful. The shortcut is LShift+RShift, and the setxkbmap option is shift:both_capslock.

For everything else that's not covered by XKB itself, modifier-only shortcuts are somewhat tricky to do in a generic way, but it can be done using xcape (though it merely maps a modifier-only shortcut to a 'normal' shortcut).

I also wanted to do things like mix and mash modification keys. For example, holding shift before one of the other modification keys would change what that key did.

Well, that's not unusual, but it doesn't change what the modifier itself does – it just changes what modifiers the modified key receives. For example, it is completely normal to define CtrlA and CtrlShiftA as different keyboard shortcuts.

1
  • I am going to upload a separate question about the keyboard layout idea I mentioned. I came up with it while I was typing this question and I actually think it would be my prefered solution. I think that using setxkbmap is not a valid option because I would have to use other programs for things not supported by setxkbmap and it would just be a mess. Commented Aug 9, 2020 at 16:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .