document updated 15 years ago, on Jun 5, 2008
This is a abstract classification of
modifier keys. This document doesn't cover specific implementation details (eg. via AutoIt/AutoHotkey/Win32API/...).
Key things to understand:
- when used by themselves, modifier keys often behave differently, and violate some behaviors of normal keys:
- a key normally triggers an action as soon as it's pressed down
- holding down a key normally causes its action to be repeated
- if a key doesn't trigger an action at any other time, it will at least trigger an action on key-up
- when used in combination with a normal key, a modifier-key produces normal behavior
Studying modifier-keys is important because manufacturing new modifier-keys allows you to rapidly multiply the number of actions your keyboard can perform using two-key combinations.
Timing doesn't matter (can be typed as fast as possible)
Modifier-key does nothing on its own
A key that must be used in combination with other keys to perform any action.
Standard examples: Alt, Shift, Control.
Converting existing keys: Can only be done when you will never need that key's normal functionality. (though you can assign its normal functionality to a combination-hotkey, of course) Candidates for removing their functionality altogether include:
NOTE that there are several pairs of keys (left-alt/right-alt, left-shift/right-shift, left-ctrl/right-ctrl, etc), and many people usually use only one half of the keyboard for modifier-keys. This means that the other half are very useful for personalized hotkeys.
Modifier-key triggers a default action on release
This kind of modifier-key has two separate modes:
- Press, and release, and it does its default action on release. (the default action can not be repeated by holding the key down)
- Hold down, use as a modifier-key in combination with another key. Once this happens, it can continue being used for different modifier-key combinations, but it won't trigger its default on-release action (until it's been released, pressed, and released again).
Standard examples:
- Windows key — hold it down, and note that the Start menu doesn't appear until you release it. Hold it down in combination with "E", and note that, in this case, the Start menu doesn't appear when you release the key.
- Mouse wheel click — click and drag, and it stops the document-scroll mode as soon as you release it. Click and release without moving the mouse at all, and it goes into document-scroll-lock mode.
Converting existing keys: You'll want to find keys that don't need to be used for hold-to-repeat. Also, it shouldn't be a key you use frequently, otherwise you'll probably find it annoying to have it respond only on key-release. Good candidates include:
- keys that never need key-repeat:
- Caps lock, Num lock, or Scroll lock
- VK_VOLUME_MUTE
- VK_MEDIA_PLAY_PAUSE
- printscreen
- keys that usually don't key-repeat
- fourth and fifth mouse buttons (they don't repeat within browsers, but may be used for repeating if you're a heavy gamer)
Toggle on / toggle off
Tap to lock the modifier-key on. In this mode, a few keys may change their behavior. Release and tap to turn it off. In this mode, everything returns to normal.
Standard examples: Caps-lock, Scroll-lock, Num-lock.
Converting existing keys: The difficulty is that you need some kind of visual indication of toggled state. You can have an extra tray icon that shows the state. Or, if you totally disable one of the existing *-lock keys (what do you need that caps-lock for anyway?), you can reappropriate its physical LED for your toggle-modifier-key's use.
Depends on timing (either limits top speed, or risks accidentally triggering)
Double-click
Standard examples: Left mouse button.
Other
[complicated] Use timing to allow for single-key hotkeys
See here.