Is there a way to use normal keys as modifier keys? Assuming my keyboard correctly records my pressing S and F together, is there a way for me to use the combination as a keyboard shortcut like Ctrl+S?
Specifically:
- How do I test that my keyboard is capable of detecting simultaneous keypresses?
- How can I remap the combination so that it can be used by an application like Emacs?
Best Answer
Q: How do I test that my keyboard is capable of detecting simultaneous keypresses?
A: You could use KeyCodes to monitor what Windows sees when pressing keyboard keys. In the picture below are three keys pressed simultaneously.
OnKeyDown
meens it's currently pressed andOnKeyUp
triggers when you release the button.Q: How can I remap the combination so that it can be used by an application like Emacs?
One possible way is to use AutoHotKey. I recommend the portable version of AutoHotKey to avoid the installation of additional software
The example shows how to remap key A to key B
It's also possible to add modifiers like Win(#), Alt(!), Ctrl(^) or Shift(+). Read the AHK manual section HotKeys for more info
Our main problem is that AHK cannot bind more than one base key. Base keys are all keyboard keys except modifier keys.
Luckily there is a trick. We only use S to trigger a small macro where we next check if F is pressed. If yes, we send our new key combination Ctrl+S
~
in front of a key which means the native function should not be blocked^{S}
or else AHK will send an additional Shift keystroke. I have no clue why. However, a lowercase^{s}
works as expectedHere is a AutoHotKey beginners guide on Youtube together with some useful links