Skip to content

Instantly share code, notes, and snippets.

@paul-hansen
Last active July 18, 2021 19:17
Show Gist options
  • Save paul-hansen/286e73c9ae93de127c88e732d1e390dc to your computer and use it in GitHub Desktop.
Save paul-hansen/286e73c9ae93de127c88e732d1e390dc to your computer and use it in GitHub Desktop.
AutoHotKey script to treat a long press of the up arrow key as shift. Useful for laptops like the Razer Blade stealth 13 since the up arrow is where shift should be.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Up::
; Wait for time to see if it is still pressed
KeyWait, Up, T0.07
if (ErrorLevel){
; Still being pressed, treat as shift
Send {Shift Down}
KeyWait, Up
Send {Shift Up}
} else {
; Was released before the timeout. Send normal up arrow
Send {Up}
}
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment