Brightness adjust via scroll wheel

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ethanross1a
Posts: 16
Joined: 18 Sep 2019, 18:36

Brightness adjust via scroll wheel

15 Nov 2019, 02:22

HI Guys, this is way beyond me.

Back in Windows Xp, I found and used a script that could let me change brightness via Ctrl + Shift + Scroll wheel.

Is there a script that can do this properly in Windows 10?
Properly as in, not just reducing RGB color values, but actually changing the physical backlight. Same as dragging the windows brightness slider.

Any help is much appreciated.

Have a great weekend everyone!
colt
Posts: 291
Joined: 04 Aug 2014, 23:12
Location: Portland Oregon

Re: Brightness adjust via scroll wheel

15 Nov 2019, 12:38

You could use this powershell code to control brightness if you are running on a laptop. I couldn't get it to run directly from autohotkey without throwing errors in powershell.

Code: Select all

;for 50% brightness
(Get-WmiObject -Namespace root/WMI -Class WmiMonitorBrightnessMethods).WmiSetBrightness(1,50)
ethanross1a
Posts: 16
Joined: 18 Sep 2019, 18:36

Re: Brightness adjust via scroll wheel

17 Nov 2019, 19:30

Yea I'm on a laptop.

So you mean this has to be entered via powershell?

can't be set to be controlled by scroll wheel via AHK for example?
colt
Posts: 291
Joined: 04 Aug 2014, 23:12
Location: Portland Oregon

Re: Brightness adjust via scroll wheel

18 Nov 2019, 10:24

I tried to run the powershell command from autohotkey but it was throwing errors in powershell. This is probably due environmental variables when autohotkey is launching powershell vs when entered manually. It is possible just not readily apparent.

Alternatively, if there is a existing hotkey on your keyboard to change the brightness you could just remap the scroll wheel to press that key combo. If that key combo involves the "fn" function key then you will need to take a look at this thread https://autohotkey.com/board/topic/282-fn-key-on-a-notebook/

Code: Select all

^WheelUp::
	send ^u ;edit this per existing hotkey
	tooltip up
return
 
^WheelDown::
	send ^d ;edit this per existing hotkey
	tooltip down
return
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Brightness adjust via scroll wheel

20 Nov 2019, 01:11

Here are some links that might help you to write native AHK code for WmiMonitorBrightnessMethods.
Windows screen brightness fine tune (autohotkey) · GitHub
https://gist.github.com/krrr/3c3f1747480189dbb71f
windows - How to query GetMonitorBrightness from C# - Stack Overflow
https://stackoverflow.com/questions/18083982/how-to-query-getmonitorbrightness-from-c-sharp

And here are some other ideas re. getting/setting the brightness:
3 ways to dim the screen - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=39580

@colt: Perhaps you need to specify the working directory parameter, when using Run.

Cheers.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 364 guests