Last active
May 4, 2024 21:42
-
-
Save darianmorat/e0c871e6e62e08814f1f345abc2df1d2 to your computer and use it in GitHub Desktop.
Scripts AutoHotKey v1
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
#Requires AutoHotkey v1.1.33+ | |
#SingleInstance Force ; The script will Reload if launched while already running | |
#NoEnv ; Recommended for performance and compatibility with future AHK releases | |
#KeyHistory 0 ; Ensures user privacy when debugging is not needed | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory | |
SendMode Input ; For new scripts due to its superior speed and reliability | |
; ==================== | |
; ==== KEYBD MAIN ==== | |
; ==================== | |
; Layer 1-3: | |
; LSpace to LAlt | |
; LAlt to Fn (Old Fn become Win) | |
; Fn-z moved to Fn-a | |
; Layer 2: ? | |
; Navigation | |
!j:: | |
send, {down} | |
return | |
!k:: | |
send, {up} | |
return | |
!h:: | |
send, {left} | |
return | |
!l:: | |
send, {right} | |
return | |
; Symbols | |
!o:: ;{ | |
send, {Asc 123} | |
return | |
!p:: ;} | |
send, {Asc 125} | |
return | |
![:: | |
send, [ | |
return | |
!]:: | |
send, ] | |
return | |
!9:: | |
send, ( | |
return | |
!0:: | |
send, ) | |
return | |
!f:: ;% | |
send, {Asc 37} | |
return | |
!w:: | |
send, {^} | |
return | |
!e:: | |
send, {$} | |
return | |
!s:: | |
send, {#} | |
return | |
!d:: | |
send, {*} | |
return | |
!r:: | |
send, {&} | |
return | |
!-:: | |
send, {_} | |
return | |
!=:: | |
send, {+} | |
return | |
!\:: | |
send, | | |
return | |
!;:: | |
send, : | |
return | |
!':: | |
send, " | |
return | |
!,:: | |
send, < | |
return | |
!.:: | |
send, > | |
return | |
!/:: | |
send, ? | |
return | |
; Esc to grave | |
*Esc:: | |
send, `` | |
return | |
*+Esc:: | |
send, ~ | |
return | |
; ================== | |
; ===== BRIGHT ===== | |
; ================== | |
!+-:: ;Brightness Down | |
AdjustScreenBrightness(-10) | |
Return | |
!+=:: ;Brightness Up | |
AdjustScreenBrightness(10) | |
Return | |
AdjustScreenBrightness(step) { | |
service := "winmgmts:{impersonationLevel=impersonate}!\\.\root\WMI" | |
monitors := ComObjGet(service).ExecQuery("SELECT * FROM WmiMonitorBrightness WHERE Active=TRUE") | |
monMethods := ComObjGet(service).ExecQuery("SELECT * FROM wmiMonitorBrightNessMethods WHERE Active=TRUE") | |
minBrightness := 5 | |
for i in monitors { | |
curt := i.CurrentBrightness | |
break | |
} | |
if (curt < minBrightness) | |
curt := minBrightness | |
toSet := curt + step | |
if (toSet > 100) | |
return | |
if (toSet < minBrightness) | |
toSet := minBrightness | |
for i in monMethods { | |
i.WmiSetBrightness(1, toSet) | |
break | |
} | |
} | |
; ================== | |
; ===== TASKBR ===== | |
; ================== | |
; Single press FlowL | |
; LCtrl:: | |
; send, !u | |
; return | |
; Toogle taskbar visibility | |
!g:: | |
Toggle := !Toggle | |
If (Toggle) | |
WinSet, Transparent, 0, ahk_class Shell_TrayWnd | |
Else | |
WinSet Transparent, 255, ahk_class Shell_TrayWnd | |
Return | |
; ================== | |
; ==== MODIFIER ==== | |
; ================== | |
; Shift / CapsLock | |
shift:: | |
if (A_TimeSincePriorHotkey < 250) && (A_PriorHotkey = A_ThisHotkey) | |
SetCapsLockState, % GetKeyState("CapsLock","T")?"Off":"On" | |
return | |
; Caps to Esc / Ctrl | |
g_LastCtrlKeyDownTime := 0 | |
g_AbortSendEsc := false | |
g_ControlRepeatDetected := false | |
*CapsLock:: | |
if (g_ControlRepeatDetected) | |
{ | |
return | |
} | |
send,{Ctrl down} | |
g_LastCtrlKeyDownTime := A_TickCount | |
g_AbortSendEsc := false | |
g_ControlRepeatDetected := true | |
return | |
*CapsLock Up:: | |
send,{Ctrl up} | |
g_ControlRepeatDetected := false | |
if (g_AbortSendEsc) | |
{ | |
return | |
} | |
current_time := A_TickCount | |
time_elapsed := current_time - g_LastCtrlKeyDownTime | |
if (time_elapsed <= 160) | |
{ | |
SendInput {Esc} | |
} | |
return | |
~*^a:: | |
~*^b:: | |
~*^c:: | |
~*^d:: | |
~*^e:: | |
~*^f:: | |
~*^g:: | |
~*^h:: | |
~*^i:: | |
~*^j:: | |
~*^k:: | |
~*^l:: | |
~*^m:: | |
~*^n:: | |
~*^o:: | |
~*^p:: | |
~*^q:: | |
~*^r:: | |
~*^s:: | |
~*^t:: | |
~*^u:: | |
~*^v:: | |
~*^w:: | |
~*^x:: | |
~*^y:: | |
~*^z:: | |
~*^1:: | |
~*^2:: | |
~*^3:: | |
~*^4:: | |
~*^5:: | |
~*^6:: | |
~*^7:: | |
~*^8:: | |
~*^9:: | |
~*^0:: | |
~*^Space:: | |
~*^Backspace:: | |
~*^Delete:: | |
~*^Insert:: | |
~*^Tab:: | |
~*^Return:: | |
~*^,:: | |
~*^.:: | |
~*^/:: | |
~*^;:: | |
~*^':: | |
~*^[:: | |
~*^]:: | |
~*^\:: | |
~*^-:: | |
~*^=:: | |
~*^`:: | |
~*^F1:: | |
~*^F2:: | |
~*^F3:: | |
~*^F4:: | |
~*^F5:: | |
~*^F6:: | |
~*^F7:: | |
~*^F8:: | |
~*^F9:: | |
~*^F10:: | |
~*^F11:: | |
~*^F12:: | |
g_AbortSendEsc := true | |
return | |
; ================ | |
; ==== CHROME ==== | |
; ================ | |
#IfWinActive, ahk_exe chrome.exe | |
Alt::Return | |
; Ctrl - Home / End | |
!w:: | |
send, {Home} | |
return | |
!+w:: | |
send, {ShiftDown}{Home}{ShiftUp}} | |
return | |
!e:: | |
send, {End} | |
!+e:: | |
send, {ShiftDown}{End}{ShiftUp}} | |
return | |
; Ctrl - Right / Left | |
!d:: | |
send, {CtrlDown}{Right}{CtrlUp} | |
return | |
!+d:: | |
send, {CtrlDown}{ShiftDown}{Right}{CtrlUp}{ShiftUp} | |
return | |
!s:: | |
send, {CtrlDown}{Left}{CtrlUp} | |
return | |
!+s:: | |
send, {CtrlDown}{ShiftDown}{Left}{CtrlUp}{ShiftUp} | |
return | |
#IfWinActive |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment