autohotkey_recipes
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| autohotkey_recipes [2011/09/20 20:41] – [General] tkbletsc | autohotkey_recipes [2017/10/23 20:00] (current) – tkbletsc | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| ====== Recipes ====== | ====== Recipes ====== | ||
| - | Below are some useful recipes. | + | Below are some useful recipes. |
| + | * [[Using AutoHotKey to map keys on the Amtelco KB163 Unified Keyboard]]. | ||
| + | * [[Using AutoHotkey to make a second mouse into a multimedia control]] | ||
| ===== General ===== | ===== General ===== | ||
| Line 20: | Line 22: | ||
| # | # | ||
| - | ; Win+Backtick | + | ; Win+F12 = Sleep |
| - | #`:: | + | #F12:: |
| + | |||
| + | ; Win+M = toggle mute | ||
| + | #m::Send {Volume_Mute} | ||
| + | |||
| + | ; Alt+Backtick -> Shift+Win_Right (move window to next monitor) -- a shortcut I used on Ultramon for years | ||
| + | !`::Send +#{Right} | ||
| + | |||
| </ | </ | ||
| + | ===== Hold down any key ===== | ||
| + | < | ||
| + | ; do right win key + whatever to hold that key down (if it's listed below) | ||
| + | ># | ||
| + | ># | ||
| + | ># | ||
| + | ># | ||
| + | ># | ||
| + | ># | ||
| + | ># | ||
| + | ># | ||
| + | ># | ||
| + | </ | ||
| + | |||
| + | ===== Map gamepad buttons to winamp controls ===== | ||
| + | All the function gunk around Joy2 and Joy3 is for keyboard auto-repeat of Win+A and Win+S (which I map to winamp volume control elsewhere). | ||
| + | < | ||
| + | ; winamp control (if winamp is running) | ||
| + | #If WinExist(" | ||
| + | Joy1::Send {Media_Play_Pause} | ||
| + | Joy4::Send {Media_Stop} | ||
| + | Joy6::Send {Media_Next} | ||
| + | Joy8::Send {Media_Prev} | ||
| + | |||
| + | Joy2:: | ||
| + | Send {LWin down}{s down} | ||
| + | SetTimer, WaitForJoy2, | ||
| + | return | ||
| + | |||
| + | WaitForJoy2: | ||
| + | if not GetKeyState(" | ||
| + | { | ||
| + | Send {LWin up}{s up} ; Release the spacebar. | ||
| + | SetTimer, WaitForJoy2, | ||
| + | return | ||
| + | } | ||
| + | ; Since above didn't " | ||
| + | Send {LWin down}{s down} ; Send another Spacebar keystroke. | ||
| + | return | ||
| + | |||
| + | Joy3:: | ||
| + | Send {LWin down}{a down} | ||
| + | SetTimer, WaitForJoy3, | ||
| + | return | ||
| + | |||
| + | WaitForJoy3: | ||
| + | if not GetKeyState(" | ||
| + | { | ||
| + | Send {LWin up}{a up} ; Release the spacebar. | ||
| + | SetTimer, WaitForJoy3, | ||
| + | return | ||
| + | } | ||
| + | ; Since above didn't " | ||
| + | Send {LWin down}{a down} ; Send another Spacebar keystroke. | ||
| + | return | ||
| + | #If ; EndIf | ||
| + | </ | ||
| + | |||
| + | ===== Make the top edge of the main monitor " | ||
| + | If you have a second monitor //above// the main one, this script will help you still be able to click stuff at the top of the screen without accidentally wandering into the upper monitor. | ||
| + | < | ||
| + | SetupClipCheck() ; enable the mouse confinement system (defined below) | ||
| + | |||
| + | ; get access to the winapi ClipCursor function, which limits cursor boundaries | ||
| + | ClipCursor( Confine=True, | ||
| + | { | ||
| + | | ||
| + | | ||
| + | } | ||
| + | |||
| + | ; count the number of loop iterations the mouse has been near the top and un-confine the mouse if there' | ||
| + | SetupClipCheck() { | ||
| + | | ||
| + | | ||
| + | } | ||
| + | |||
| + | top_tick_count := 0 | ||
| + | ClipCheck: | ||
| + | | ||
| + | | ||
| + | ; | ||
| + | |||
| + | If (y < 10) { | ||
| + | | ||
| + | } Else { | ||
| + | | ||
| + | } | ||
| + | |||
| + | if (top_tick_count> | ||
| + | | ||
| + | } Else { | ||
| + | | ||
| + | } | ||
| + | | ||
| + | </ | ||
| + | |||
| + | ===== Extended mouse buttons mapped to media control ===== | ||
| + | < | ||
| + | XButton2:: | ||
| + | XButton1:: | ||
| + | </ | ||
| + | |||
| + | ===== Mouse click spam ===== | ||
| + | Press F7 to toggle auto-clicking over and over as fast as possible. | ||
| + | < | ||
| + | i:=0 | ||
| + | F7:: | ||
| + | |||
| + | Spam: | ||
| + | Click | ||
| + | Send {LButton} | ||
| + | return | ||
| + | </ | ||
| + | |||
| + | ===== Winkey shortcut overrides ===== | ||
| + | Windows by default binds Win+X, Win+B, and Win+Space to stuff I don't care about. | ||
| + | < | ||
| + | ; WinAmp+Launchy remaps | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | ; ^ Win+Space -> Ctrl+Shift+Space | ||
| + | |||
| + | ; old simple winamp remaps -- the newer ones above let it work for non-winamps, | ||
| + | ;#x::#^x | ||
| + | ;#b::#^b | ||
| + | </ | ||
| ===== Auto mouse ===== | ===== Auto mouse ===== | ||
| < | < | ||
| Line 54: | Line 194: | ||
| ===== FoxIt ===== | ===== FoxIt ===== | ||
| - | The F5 for reload only works if the active file is the most recently opened. The F6 will switch to a MinTTY session and issue a "make again" command. | + | The F5 for reload only works if the active file is the most recently opened. |
| < | < | ||
| - | ; FoxIt keys: F5=reload | + | ; FoxIt keys: F5=reload |
| # | # | ||
| - | F5::Send ^w!f1 | + | F5::Send ^w!fr1 |
| - | F6:: | + | |
| - | WinActivate ahk_class mintty | + | |
| - | Send make again{enter} | + | |
| - | WinActivate ahk_class classFoxitReader | + | |
| - | return | + | |
| # | # | ||
| </ | </ | ||
| Line 73: | Line 208: | ||
| # | # | ||
| MButton:: | MButton:: | ||
| - | SetTimer DoClick, | + | SetTimer DoClick, |
| - | SoundBeep 880,50 | + | SoundBeep 880,50 |
| - | return | + | return |
| MButton up:: | MButton up:: | ||
| - | SetTimer DoClick, | + | SetTimer DoClick, |
| - | SoundBeep 440,50 | + | SoundBeep 440,50 |
| - | return | + | return |
| # | # | ||
| </ | </ | ||
| + | |||
| + | ===== Suppress F1 in Explorer, Word, and Excel ===== | ||
| + | The code below will replace the annoying help popup with a low-pitched beep. Change " | ||
| + | < | ||
| + | ; Suppress F1 in Explorer/ | ||
| + | # | ||
| + | F1:: | ||
| + | # | ||
| + | F1:: | ||
| + | # | ||
| + | F1:: | ||
| + | # | ||
| + | </ | ||
| ===== Minecraft movement ===== | ===== Minecraft movement ===== | ||
autohotkey_recipes.1316576501.txt.gz · Last modified: by tkbletsc
