Mac-Like Hot Corners For Windows 10 To Change Volume And Brightness

Post your working scripts, libraries and tools for AHK v1.1 and older
XShayanX
Posts: 83
Joined: 16 Sep 2018, 04:48

Mac-Like Hot Corners For Windows 10 To Change Volume And Brightness

25 Apr 2019, 17:18

Code: Select all

CheckMousePosition(){
	CoordMode, Mouse, Screen
	MouseGetPos , MouseXFullScreenHotkey, MouseYFullScreenHotkey
	If (MouseXFullScreenHotkey > 1915) AND (MouseYFullScreenHotkey < 5)
		return 2
	If (MouseXFullScreenHotkey < 5) AND (MouseYFullScreenHotkey < 5)
		return 1
}
#If CheckMousePosition() = 2
WheelUp::run A:\nircmd-x64\nircmd.exe changebrightness +10
WheelDown::run A:\nircmd-x64\nircmd.exe changebrightness -10
#If CheckMousePosition() = 1
WheelUp::Volume_Up
WheelDown::Volume_Down
#If
This script will help you change volume and screen brightness by moving your mouse to top corners of the screen and using the mouse wheel.
You will need another program called nircmd for changing screen brightness, download it, and edit the A:\nircmd-x64... according to the path of your nircmd installation.
My screen's resolution is 1920 by 1080, use WindowSpy to change the numbers, 1915, and 5 to your screen resolution accordingly.
You can add more corners following the same procedure with the help of WindowSpy.
Good luck! Hope it helps! :)
User avatar
Delta Pythagorean
Posts: 627
Joined: 13 Feb 2017, 13:44
Location: Somewhere in the US
Contact:

Re: Mac-Like Hot Corners For Windows 10 To Change Volume And Brightness

26 Apr 2019, 13:45

Ok, one very big tip I can give you for scripting, is expect the user to NOT have certain things on their computer. For example:
In your script, you have the max screen size be around 1915, a lot of users do not have that size of a monitor.
You also have it where nircmd.exe is in your A drive, not everyone has an A drive, nor do they have that program.
It is important to take details like this into account. It's safer to check to see if the program/monitor size is what you want/need instead of "enforcing" settings.

[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat

XShayanX
Posts: 83
Joined: 16 Sep 2018, 04:48

Re: Mac-Like Hot Corners For Windows 10 To Change Volume And Brightness

27 Apr 2019, 07:20

I think you didn't understand the script, my screen's max width is not 1915, no such monitor with this screen exists, mine as expected is 1920.
I also explained in detail that the user will need nircmd to change brightness and that they will have to change the A:\nircmd-x64 path to their actual installation path. I think you didn't read my post at all.
User avatar
Delta Pythagorean
Posts: 627
Joined: 13 Feb 2017, 13:44
Location: Somewhere in the US
Contact:

Re: Mac-Like Hot Corners For Windows 10 To Change Volume And Brightness

29 Apr 2019, 15:06

Explaining to someone that you will need to install something else is not a good habit. Yes a hand full of other programs do it but most of those habits have died out and they just made it to download the needed files for usage. As for the screen size, saying that the user would need to adjust their settings according to their own monitor size is again a bad habit to get into. The user should only be able to set the appropriate settings that you'd be unsure to "autofill" or just can't find a solution to have an "autofill" for the settings.

[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat

Vh_
Posts: 203
Joined: 17 Mar 2017, 22:06

Re: Mac-Like Hot Corners For Windows 10 To Change Volume And Brightness

15 May 2019, 10:32

@XShayanX

I like what you've got! I think this could be a possible solution for global users to avoid configuration on their end.

Code: Select all

MaxWidth := A_ScreenWidth
MaxHeight := A_ScreenHeight

HeightTrigger := MaxHeight - 20
WidthTrigger := MaxWidth - 20
MsgBox, Max Width: %MaxWidth%      Max Height: %MaxHeight%`r`n`r`nCalculated H:%HeightTrigger%    Calculated W:%WidthTrigger%
Hope this helps. Cheers! :)

Vh_

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: Chunjee, jchestnut, manbat42 and 73 guests