Last active
March 15, 2025 11:16
-
-
Save Robert-K/de73024ede628cb15f78273895217538 to your computer and use it in GitHub Desktop.
Map Horizontal Scroll to Windows Volume using AHK & Interception
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 Force | |
#NoTrayIcon | |
Persistent | |
; You need to install the Interception driver & the AutoHotInterception library to use this script | |
; https://github.com/evilC/AutoHotInterception | |
#include <AutoHotInterception> ; Adjust the include if necessary | |
AHI := AutoHotInterception() | |
MX_HANDLE := "Find & copy your Mouse's handle here using the AHI Monitor Script" | |
Subscribe: | |
deviceList := AHI.GetDeviceList() | |
found := false | |
for i, device in deviceList { | |
if device.Handle = MX_HANDLE { | |
found := true | |
break | |
} | |
} | |
if !found { | |
Sleep 5000 | |
goto Subscribe | |
} | |
mouseId := AHI.GetMouseIdFromHandle(MX_HANDLE) | |
AHI.SubscribeMouseButton(mouseId, 6, true, MouseButtonEvent) | |
MouseButtonEvent(state) { | |
if state == 1 { | |
; SoundSetVolume "-5" | |
Send "{Volume_Down}" ; Send makes the Windows volume slider pop up, SoundSetVolume doesn't | |
} else { | |
; SoundSetVolume "+5" | |
Send "{Volume_Up}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I created this to replace the absolutely obnoxious and bloated Logi Options+ App. I only ever used it to control my PC's volume with the horizontal scroll wheel of my MX Master mouse.
This takes care of that.
You need to install the Interception driver & the AutoHotInterception library to use this script.
Should be easy to adjust this to your own usecase.