Skip to content

Instantly share code, notes, and snippets.

@aminya
Last active May 3, 2022 00:52
Show Gist options
  • Save aminya/f73ff9a69ad6214feb02a90a585c6a54 to your computer and use it in GitHub Desktop.
Save aminya/f73ff9a69ad6214feb02a90a585c6a54 to your computer and use it in GitHub Desktop.
; Download Autohotkey from https://www.autohotkey.com/download/ to use this
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Event ; Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; copy - F3
F3::^c
; paste - F4
F4::^v
;cut - LAlt+ F3
<!F3:: SendEvent ^{x}
; LWin & F3::SendEvent ^{x} ; alternative method
; save - CapsLock
CapsLock::^s
; undo - redo
Media_Prev::^z
Media_Next::^y
; mouse copy and cut (long press)
$XButton2::
timeHasElapsed := 0
SetTimer, CutCommand, -400 ;if the key was pressed down for more than 200ms send > (negative value to make the timer run only once)
KeyWait, XButton2, U ;wait for the key to be released
if (timeHasElapsed == 0) ;if the timer didn't go off disable the timer and send x
{
SetTimer, CutCommand, OFF
SendEvent ^{c}
}
return
CutCommand:
SendEvent ^{x}
timeHasElapsed := 1
return
;XButton2::^c ; copy only
; mouse paste
XButton1::^v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment