Last active
July 18, 2021 19:17
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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