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

Post your working scripts, libraries and tools
XShayanX
Posts: 33
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: 475
Joined: 13 Feb 2017, 13:44
GitHub: DelPyth
Location: Somewhere in the US

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.
XShayanX
Posts: 33
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: 475
Joined: 13 Feb 2017, 13:44
GitHub: DelPyth
Location: Somewhere in the US

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.
Vh_
Posts: 201
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”

Who is online

Users browsing this forum: Bill, Bing [Bot], JoeWinograd and 21 guests