Brightness control with the mouse wheel

Suggestions, feature requests and bug reports.
Post Reply
kavusha
Posts: 7
Joined: Jun 3rd, ’18, 07:46

Post by kavusha » Feb 6th, ’25, 14:03

Hi everybody,

it would be great to have a setting in the "Functions" section to control brightness with the mouse wheel. Much the same as it is the case with volume. For example placing the cursor on the bottom of the screen.

Regards.

Kavi.
User avatar
Marko
Posts: 1860
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Feb 7th, ’25, 17:58

Search the Library - there are Brightness Up/Down commands available and you can trigger them with any shortcut. For example you could use
Ctrl + WheelUp - Brightness Up
Ctrl + WheelDown - Brightness Down
bitsper2nd
Posts: 10
Joined: Jan 2nd, ’22, 18:05

Post by bitsper2nd » Feb 7th, ’25, 19:32

You can add this to the startup script.

Code: Select all

;-----------------------------------------------------------------------------
; Change brightness using scroll wheel in the left side of the screen
;-----------------------------------------------------------------------------

CoordMode, Mouse, Screen
#If isMouseAtEdge()
WheelDown::
    Brightness(-5)
Return

WheelUp::
    Brightness(5)
Return
#If

isMouseAtEdge(){
    MouseGetPos, x
    return x <= 1  ; Changed to check left edge
}

Brightness(Offset) {
    static wmi := ComObjGet("winmgmts:\\.\root\WMI")
        , last := wmi.ExecQuery("SELECT * FROM WmiMonitorBrightness").ItemIndex(0).CurrentBrightness
    level := Min(100, Max(1, last + Offset))
    if (level != last) {
        last := level
        wmi.ExecQuery("SELECT * FROM WmiMonitorBrightnessMethods").ItemIndex(0).WmiSetBrightness(0, level)
    }
}
Post Reply