Created
May 27, 2024 12:31
-
-
Save Luigi-Pizzolito/0a6fe3a4fc26ad9a57a1e1d653817db8 to your computer and use it in GitHub Desktop.
AHK Script to remap Volume Scroll Wheel of AK75Pro AJAZZ Keyboard, using AHK, ClickMonitorDDC and nircmd
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
Set WshShell = CreateObject("WScript.Shell" ) | |
WshShell.Run """C:\ahk\AZVolumeWheelRemap.ahk""", 0 'Must quote command if it has spaces; must escape quotes | |
Set WshShell = Nothing |
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
#SingleInstance | |
#InstallKeybdHook | |
#Persistent | |
SetWorkingDir C:/ahk | |
; remap AJAZZ volume wheel to primary display brightness and screenshot on click | |
; remap to second display if shift is held | |
; original volume and pause mapping if Meta is held | |
; Temporarily disable Windows keys when other hotkeys are active | |
#If GetKeyState("LWin", "P") || GetKeyState("RWin", "P") | |
LWin::Return | |
RWin::Return | |
#If | |
; Volume Up -> Brightness Up | |
Volume_Up:: | |
{ | |
if GetKeyState("LWin", "P") || GetKeyState("RWin", "P") || GetKeyState("Shift", "P") ; Check if either Windows key is pressed | |
{ | |
Return ; Do nothing if the Windows key is pressed, default action | |
} | |
else | |
{ | |
; Primary Monitor | |
Run nircmd.exe changebrightness +5 | |
ToolTip, Brightness ⬆ | |
SetTimer,RemoveTooltip,500 | |
Return | |
} | |
} | |
+Volume_Up:: | |
{ | |
if GetKeyState("LWin", "P") || GetKeyState("RWin", "P") ; Check if either Windows key is pressed | |
{ | |
Return ; Do nothing if the Windows key is pressed, default action | |
} | |
else | |
{ | |
; Second Monitor | |
; Run ControlMyMonitor.exe /ChangeValue "\\.\DISPLAY2\Monitor0" 10 +10 | |
SendInput {Blind}{Shift Up} | |
SendInput {Shift Down}{Control Down}{F12}{Shift Up}{Control Up} ; ClickMonitorDDC CustomShortcut | |
ToolTip, 2nd Brightness ⬆ | |
SetTimer,RemoveTooltip,500 | |
Sleep, 200 | |
Return | |
} | |
} | |
; Volume Down -> Brightness Down | |
Volume_Down:: | |
{ | |
if GetKeyState("LWin", "P") || GetKeyState("RWin", "P") || GetKeyState("Shift", "P") ; Check if either Windows key is pressed | |
{ | |
Return ; Do nothing if the Windows key is pressed, default action | |
} | |
else | |
{ | |
; Primary Monitor | |
Run nircmd.exe changebrightness -5 | |
ToolTip, Brightness ⬇ | |
SetTimer,RemoveTooltip,500 | |
Return | |
} | |
} | |
+Volume_Down:: | |
{ | |
if GetKeyState("LWin", "P") || GetKeyState("RWin", "P") ; Check if either Windows key is pressed | |
{ | |
Return ; Do nothing if the Windows key is pressed, default action | |
} | |
else | |
{ | |
; Second Monitor | |
; Run ControlMyMonitor.exe /ChangeValue "\\.\DISPLAY2\Monitor0" 10 -10 | |
SendInput {Blind}{Shift Up} | |
SendInput {Shift Down}{Control Down}{F11}{Shift Up}{Control Up} ; ClickMonitorDDC CustomShortcut | |
ToolTip, 2nd Brightness ⬇ | |
SetTimer,RemoveTooltip,500 | |
Sleep, 200 | |
Return | |
} | |
} | |
RemoveTooltip: | |
SetTimer, RemoveTooltip,Off | |
Tooltip | |
Return | |
; Volume Mute -> Screen Clipper | |
Volume_Mute:: | |
{ | |
if GetKeyState("LWin", "P") || GetKeyState("RWin", "P") ; Check if either Windows key is pressed | |
{ | |
Return ; Do nothing if the Windows key is pressed, default action | |
} | |
else | |
{ | |
Run SnippingTool /clip | |
Return | |
} | |
} | |
; Block Windows key up to prevent opening the Start menu | |
~*LWin Up::Return | |
~*RWin Up::Return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment