Created
March 17, 2026 16:16
-
-
Save ThePython10110/361fa831db40be79428258856efd6e80 to your computer and use it in GitHub Desktop.
My AutoHotKey script
This file contains hidden or 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
| #Requires AutoHotkey >=2.0 | |
| SetNumlockState("AlwaysOn") | |
| SetScrollLockState("AlwaysOff") | |
| ; Win+` to open terminal in Quake mode | |
| $#`:: { | |
| DetectHiddenWindows true | |
| if not WinExist("ahk_exe WindowsTerminal.exe") { | |
| Run "wt -w _quake" | |
| } else { | |
| Send("#``") | |
| } | |
| } | |
| /* | |
| Autoclicker (yes, I know this is terribly written code). | |
| Alt+Shift+click: Maximum speed | |
| Ctrl+Alt+Shift+click: Limits speed because some games don't like it when you click that fast. | |
| Works with all three mouse buttons, plus the scroll wheel (for some reason). | |
| */ | |
| LButtonSleep := false | |
| LClick() { | |
| Global LButtonSleep | |
| Click("Left", "Down") | |
| if LButtonSleep { | |
| Sleep(25) | |
| } | |
| Click("Left", "Up") | |
| } | |
| MButtonSleep := false | |
| MClick() { | |
| Global MButtonSleep | |
| Click("Middle", "Down") | |
| if MButtonSleep { | |
| Sleep(25) | |
| } | |
| Click("Middle", "Up") | |
| } | |
| RButtonSleep := false | |
| RClick() { | |
| Global RButtonSleep | |
| Click("Right", "Down") | |
| if RButtonSleep { | |
| Sleep(25) | |
| } | |
| Click("Right", "Up") | |
| } | |
| !+LButton::LAutoClick("whocares", false) | |
| !+MButton::MAutoClick("whocares", false) | |
| !+RButton::RAutoClick("whocares", false) | |
| ^!+LButton::LAutoClick("whocares", true) | |
| ^!+MButton::MAutoClick("whocares", true) | |
| ^!+RButton::RAutoClick("whocares", true) | |
| *!+LButton:: | |
| LAutoClick(hk, fast := "nothing") { | |
| static Toggle := false | |
| Global LButtonSleep | |
| if fast == "nothing" { | |
| fast := GetKeyState("Control") | |
| } | |
| LButtonSleep := fast | |
| Toggle := !Toggle | |
| SetTimer(LClick, Toggle ? fast ? 50 : 1 : 0) | |
| } | |
| *!+MButton:: | |
| MAutoClick(hk, fast := "nothing") { | |
| static Toggle := false | |
| Global MButtonSleep | |
| if fast == "nothing" { | |
| } | |
| fast := GetKeyState("Control") | |
| MButtonSleep := fast | |
| Toggle := !Toggle | |
| SetTimer(MClick, Toggle ? fast ? 50 : 1 : 0) | |
| } | |
| *!+RButton:: | |
| RAutoClick(hk, fast := "nothing") { | |
| static Toggle := false | |
| Global RButtonSleep | |
| if fast == "nothing" { | |
| fast := GetKeyState("Control") | |
| } | |
| RButtonSleep := fast | |
| Toggle := !Toggle | |
| SetTimer(RClick, Toggle ? fast ? 50 : 1 : 0) | |
| } | |
| GetScreenOrientation(MonNumber := 1) { | |
| static DEVMODE := '', dmSize := 220 | |
| NumPut('Short', dmSize, DEVMODE := Buffer(dmSize, 0), 68) | |
| display := '\\.\DISPLAY' MonNumber | |
| DllCall('EnumDisplaySettings', 'Str', display, 'Int', -1, 'Ptr', DEVMODE) | |
| n2 := NumGet(DEVMODE, 84, 'UInt') | |
| return n2 | |
| } | |
| /* | |
| Right alt+arrows to change monitor orientation (I rarely actually use this but it's cool) | |
| I have no idea what this code actually does, because I just copied it from somewhere. | |
| */ | |
| ChangeScreenOrientation(Orientation := 'Landscape', MonNumber:=1) { | |
| static DMDO_DEFAULT := 0, DMDO_90 := 1, DMDO_180 := 2, DMDO_270 := 3, dmSize := 220 | |
| dimension1 := 0, dimension2 := 0 | |
| NumPut('Short', dmSize, DEVMODE := Buffer(dmSize, 0), 68) | |
| display := '\\.\DISPLAY' MonNumber | |
| DllCall('EnumDisplaySettings', 'Str', display, 'Int', -1, 'Ptr', DEVMODE) | |
| n0 := NumGet(DEVMODE, 172, 'UInt') | |
| n1 := NumGet(DEVMODE, 176, 'UInt') | |
| Loop 2 { | |
| dimension%A_Index% := n%(n0 > n1) ^ (A_Index = 1)% | |
| | n%(n0 < n1) ^ (A_Index = 1)% << 32 | |
| } | |
| switch Orientation, false { | |
| case 'Landscape' , 0: i := 1, orientation := DMDO_DEFAULT | |
| case 'Portrait' , 90: i := 2, orientation := DMDO_90 | |
| case 'Landscape (flipped)', 180: i := 1, orientation := DMDO_180 | |
| case 'Portrait (flipped)' , 270: i := 2, orientation := DMDO_270 | |
| default: i := 1, orientation := DMDO_DEFAULT | |
| } | |
| NumPut('Int' , orientation , DEVMODE, 84) | |
| NumPut('Int64', dimension%i%, DEVMODE, 172) | |
| DllCall('ChangeDisplaySettingsEx', 'Str', display, 'ptr', DEVMODE, 'ptr', 0, 'int', 0, 'int', 0) | |
| } | |
| >!Up::ChangeScreenOrientation(0, 1) | |
| >!Down::ChangeScreenOrientation(0, 2) | |
| >!Left::ChangeScreenOrientation(90, 1) | |
| >!Right::ChangeScreenOrientation(90, 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment