-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rotatescreen.ahk
38 lines (33 loc) · 1.15 KB
/
Rotatescreen.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
VarSetCapacity(DEVMODE, 220, 0)
NumPut(220, DEVMODE, 68, "short") ; dmSize
DllCall("EnumDisplaySettingsW", "ptr", 0, "int", -1, "ptr", &DEVMODE)
width := NumGet(DEVMODE, 172, "uint")
height := NumGet(DEVMODE, 176, "uint")
^!Left::
<^>!Left::
NumPut(width, DEVMODE, 176, "int")
NumPut(height, DEVMODE, 172, "int")
NumPut(DMDO_90 := 1, DEVMODE, 84, "int") ; dmDisplayOrientation
DllCall("ChangeDisplaySettingsW", "ptr", &DEVMODE, "uint", 0)
return
^!Down::
<^>!Down::
NumPut(width, DEVMODE, 172, "int")
NumPut(height, DEVMODE, 176, "int")
NumPut(DMDO_180 := 2, DEVMODE, 84, "int") ; dmDisplayOrientation
DllCall("ChangeDisplaySettingsW", "ptr", &DEVMODE, "uint", 0)
return
^!Right::
<^>!Right::
NumPut(width, DEVMODE, 176, "int")
NumPut(height, DEVMODE, 172, "int")
NumPut(DMDO_270 := 3, DEVMODE, 84, "int") ; dmDisplayOrientation
DllCall("ChangeDisplaySettingsW", "ptr", &DEVMODE, "uint", 0)
return
^!Up::
<^>!Up::
NumPut(width, DEVMODE, 172, "int")
NumPut(height, DEVMODE, 176, "int")
NumPut(DMDO_DEFAULT := 0, DEVMODE, 84, "int") ; dmDisplayOrientation
DllCall("ChangeDisplaySettingsW", "ptr", &DEVMODE, "uint", 0)
return