Skip to content

Instantly share code, notes, and snippets.

@remlapmot
Last active October 9, 2019 08:28
Show Gist options
  • Save remlapmot/2b796461ff389add328f936351609165 to your computer and use it in GitHub Desktop.
Save remlapmot/2b796461ff389add328f936351609165 to your computer and use it in GitHub Desktop.
Collection of useful AutoHotkey commands
; Uncomment to monitor which key has been pressed (when running script but not compiled script)
; #InstallKeybdHook
; Press ` (accent grave/backtick) to move up a folder in Explorer in Windows 10 (on an ISO UK keyboard)
#IfWinActive ahk_class CabinetWClass
SC029::
SendInput, {LAlt down}
sleep, 1
SendInput, {Up}
sleep, 1
SendInput, {LAlt up}
sleep, 1
return
#IfWinActive
; Remap Caps Lock to Shift
Capslock::Shift
; Suspend AutoHotKey commands
#ScrollLock::Suspend ; Win + Scroll Lock
; Paste without formatting (usefel in MS Office), Ctrl + Win + v
; from: https://autohotkey.com/board/topic/89839-pasting-plain-text-from-the-clipboard/
^#v::
OriginalClipboardContents = %ClipBoardAll%
ClipBoard = %ClipBoard% ; Convert to text
Send ^v
Sleep 100 ; Don't change clipboard while it is pasted
ClipBoard := OriginalClipboardContents ; Restore original clipboard contents
OriginalClipboardContents = ; Free memory
Return
@remlapmot
Copy link
Author

Run script with

AutoHotkeyU64 autohotkey-commands.ahk

Compile script with

Ahk2Exe /in autohotkey-commands.ahk

then run generated autohotkey-commands.exe file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment