My Tips/Tricks for hotkeys

Put simple Tips and Tricks that are not entire Tutorials in this forum
MindCaged
Posts: 19
Joined: 19 Jun 2014, 12:33

My Tips/Tricks for hotkeys

18 Jul 2014, 15:24

This is just some random stuff I've come up with while playing with Autohotkey over the years. They are just my opinions and you're welcome to disagree with them.
  • When making global hotkeys, use care using hotkeys with only ctrl, alt, and/or shift and function/letter keys as there's a very real possibility these will conflict with program hotkeys in some programs. I think over the years I've seen programs use just about every combination of letters/F1-12 and the standard modifiers. Even some with the number keys and a handful with keys like + - [ ], etc. non-alphanumeric keys.
  • Some alternatives to the above:
    • Windows Key - Only a relative handful of the Win+Hotkey are actually used and off the top of my head only the Shift-Win-M actually uses any other modifier keys, so you're free to use combinations of Alt-Shift-Ctrl(Do be aware that at least on my keyboard the left control key isn't picked up with the windows key) modifiers. I personally like Alt-Win since they're right next to each other.
    • CapsLock - If you've browsed this and the original autohotkey forum you've seen tons of things use the CapsLock key, I have far too many uses to limit it to a single function, so I use it as a modifier. I also put code so that a double tap will toggle it in the rare instance I actually need to turn it on. You could also have another hotkey toggle. Adding ctrl-shift-alt-win modifiers is not as straight forward as other hotkeys with the CapsLock key, but it is possible to code them. See also the documentation on SetCapsLockState for locking the CapsLock state so it doesn't accidentally get changed.
    • ScrollLock - Like above, although it's not an ideal hotkey modifier since it's kind of out of the way, still it could be used for less often used hotkeys or hotkeys you don't want to accidentally trigger. Be aware though that I recently discovered that you can't use Ctrl-ScrollLock as it gets converted to CtrlBreak because of some antiquated standard. You /can/ however seem to use Shift-Ctrl or Alt-Ctrl, or Shift-Alt-Ctrl I think.
    • AppsKey(Menu key) - I personally like this one, the key itself is rarely used and it's right next to the other modifier keys, which as far as I've seen don't conflict at all with it, so you can use any combination of Alt-Shift-Ctrl with it(Although you may need to put it in code instead of a general hotkey). One drawback is that some modern keyboard manufacturers are dropping the AppsKey from the keyboard(Logitech for example) and making it a combination key with say a Fn key. Something I find rather annoying as it can't really cost that much to include.
    • Combination of Left/Right modifiers - A perhaps lesser known feature is that you can specify with the standard modifiers whether you mean the left or right key. For example <+P:: would be LShift-P. The AltGr key on some keyboards works like this by sending LCtrl+RAlt I believe.(I think this might be controlled by language settings or something since I had an AltGr key that just worked like a plain Alt key), anyway, using this you could make a hotkey require you to hit modifiers on both sides of the keyboard, preventing non-deliberate triggering. For example <+>+Space:: would make it so you have to hold down both shift keys while hitting space. Of course this method has the drawback of being better for keys near the bottom of the keyboard as it's rather awkward to reach higher keys while holding modifiers on both sides.
    • For numberpad hotkeys, either on the main keyboard or if you have a separate stand-alone numberpad. I've found that NumpadClear(Numpad5 with NumLock off) makes a great modifier key as I'm personally not aware of anything that makes use of it. I personally rebind it to a shift key so I can use the arrow keys on the numberpad to select text. Then you can make hotkey combinations with the /, *, +, -, Enter, Del, Ins(, sometimes backspace on external numpad) keys to do various functions. I personally have something setup so I can copy/paste/etc with only the numberpad.
    • Multimedia/Internet keys. If you're lucky enough to have a keyboard that actually has all of these as actual keys(most 'multimedia' keyboards nowadays only have maybe the media control keys and maybe some keys for launching the media player/calculator/my computer. and some keyboards simply add a Fn key to modify the function keys, something I think is a ripoff as you can do the exact same thing with a standard keyboard and AutoHotkey and be able to modify /all/ the keyboard keys and not just the function keys.) I happened to find a really cheap multimedia keyboard that still has the main 18 of these keys at MicroCenter it's the Inland 337386 Multimedia Keyboard, Currently less than $6. It's not perfect since it has the annoying power,sleep,wake keys, and they moved down the PrintScreen, ScrollLock, Pause keys to squish together with the home group, but that's minor. The order of the multimedia keys isn't the best since for some reason they have the next track key to the left of the previous track key, but again minor, you could probably fix that with autohotkey if it really bothered you. I only use the media keys really, so that leaves 11 keys to do whatever you want, and they're pretty much guaranteed not to be intercepted by whatever program you're using them on. I was thinking of using them for game macro keys assuming the game can be sent to with autohotkey.
  • A somewhat easy way to chain keys. Say hit CapsLock & Tab and then A to perform some function.... Menus. Simply have a regular hotkey create and display a context menu, and use the menu accelerators or mouse/arrow keys to select which action you want. I personally have something like this setup to perform a large variety of operations on the clipboard, also with the numberpad thing I mentioned above to allow copy/paste/etc. I also have a menu bound to Alt-Win-E to popup a list of all explorer windows and I just select one to switch to it. Be aware though that sometimes menus can get stuck open, so I've had to add a dummy close menu item to my menus that does nothing. It also has the advantage of reminding you what each key does.
99mVThresholdStart
Posts: 9
Joined: 05 Sep 2014, 16:02

Re: My Tips/Tricks for hotkeys

18 Sep 2014, 12:53

Good guide but you need to learn to bold and
Title: and
[indent=]indent - [/indent]
and summarize.

Return to “Tips and Tricks (v1)”

Who is online

Users browsing this forum: No registered users and 4 guests