-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMac but PC.ahk
239 lines (198 loc) · 6.24 KB
/
Mac but PC.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
;-----------------------------------------
; AutoHotKey Script for Almost Complete Mac Keyboard Transformation for Windows 11 but for PC Keyboards
; AutoHotKey Version: 1.x
; Language: English
; Platform: Windows 10/11
; Author: TheBitStick
;=========================================
; --------------------------------------------------------------
; Key
; --------------------------------------------------------------
; ! = Option (Command)
; ^ = Control
; + = Shift
; # = Meta
; --------------------------------------------------------------
; Setup
; --------------------------------------------------------------
#InstallKeybdHook
#InstallMouseHook
#SingleInstance Force
SetTitleMatchMode 2
SendMode Input
if !InStr(A_AhkPath, "_UIA.exe") {
newPath := RegExReplace(A_AhkPath, "\.exe", "U" (A_Is64bitOS ? 64 : 32) "_UIA.exe")
Run % StrReplace(DllCall("Kernel32\GetCommandLine", "Str"), A_AhkPath, newPath)
ExitApp
}
;RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Policies\System, DisableLockWorkstation, 0
; --------------------------------------------------------------
; Base System Remappings
; --------------------------------------------------------------
LAlt:: LCtrl
LWin:: return
CapsLock:: return
; --------------------------------------------------------------
; Additional System Remappings
; --------------------------------------------------------------
!+z:: Send, ^y
!#Esc:: Send, ^+{Esc}
!^Space:: Run, charmap.exe ; buggy, be sure to press Command first before pressing Control
!^f:: Send, {F11}
<!Tab:: AltTab
!+3:: Send, ~#{PrintScreen}
!+4:: Send, ~#+s
!,:: Send, ^,
!^q:: DllCall("LockWorkStation")
!+q:: DllCall("ExitWindowsEx")
!#v:: Send, ^!v
#IfWinActive ahk_exe explorer.exe
!#v:: Send, ^v
#IfWinActive
![:: Send, !{Left}
!]:: Send, !{Right}
!^Up:: Send, !{Up}
!+BS:: FileRecycleEmpty
!#+BS:: FileRecycleEmpty
!F3:: Send, #d
!+{:: Send, ^l
!+}:: Send, ^r
!+\:: Send, ^e
!#f:: Send, ^f
!#c:: Send, ^!c
!#+v:: Send, ^!+v
; --------------------------------------------------------------
; Basic Translations (from Control+* to Command+* [and some Command+Shift+*])
; --------------------------------------------------------------
!a:: Send, ^a
!b:: Send, ^b
!c:: Send, ^c
!d:: Send, ^d
!e:: Send, ^e
!f:: Send, ^f
!g:: Send, ^g
!h:: Send, ^h
!i:: Send, ^i
#IfWinActive ahk_exe explorer.exe
!i:: Send, !{Enter}
#IfWinActive
!j:: Send, ^j
!k:: Send, ^k
!l:: Send, ^l
!m:: WinMinimize, A
!n:: Send, ^n
!o:: Send, ^o
#IfWinActive ahk_exe explorer.exe
!o:: Send, {Enter}
#IfWinActive
!p:: Send, ^p
!q:: Send, !{F4}
!r:: Send, ^r
!s:: Send, ^s
!t:: Send, ^t
!u:: Send, ^u
#IfWinActive ahk_exe explorer.exe
!u:: Send, {F2}
#IfWinActive
!v:: Send, ^v
!w:: Send, ^w
!x:: Send, ^x
!y:: Send, ^y
!z:: Send, ^z
!+a:: Send, ^+a
!+i:: Send, ^+i
!+j:: Send, ^+j
!+m:: Send, ^+m
!+n:: Send, ^+n
!+p:: Send, ^+p
!+s:: Send, ^+s
!+t:: Send, ^+t
!+v:: Send, ^+v
!1:: Send, ^1
#IfWinActive ahk_exe explorer.exe
!1:: Send, ^+3
#IfWinActive
!2:: Send, ^2
#IfWinActive ahk_exe explorer.exe
!2:: Send, ^+5
#IfWinActive
!3:: Send, ^3
#IfWinActive ahk_exe explorer.exe
!3:: Send, ^+8
#IfWinActive
!4:: Send, ^4
#IfWinActive ahk_exe explorer.exe
!4:: Send, ^+1
#IfWinActive
!5:: Send, ^5
#IfWinActive ahk_exe explorer.exe
!5:: Send, ^+6
#IfWinActive
!6:: Send, ^6
!7:: Send, ^7
!8:: Send, ^8
!9:: Send, ^9
!0:: Send, ^0
; --------------------------------------------------------------
; Media Key Remappings
; --------------------------------------------------------------
;F7:: Media_Prev
;F8:: Media_Play_Pause
;F9:: Media_Next
;F10:: Volume_Mute
;F11:: Volume_Down
;F12:: Volume_Up
; --------------------------------------------------------------
; Text Manipulation
; --------------------------------------------------------------
!Left:: Send, {Home}
#IfWinActive ahk_exe firefox.exe
!Left:: Send, !{Left}
#IfWinActive
!Right:: Send, {End}
#IfWinActive ahk_exe firefox.exe
!Right:: Send, !{Right}
#IfWinActive
!Up:: Send, {LCtrl Down}{Home}{LCtrl Up}
#IfWinActive ahk_exe explorer.exe
!Up:: Send, !{Up}
#IfWinActive
!Down:: Send, {LCtrl Down}{End}{LCtrl Up}
#IfWinActive ahk_exe explorer.exe
!Down:: Send, {Enter}
#IfWinActive
!+Left:: Send, {Shift Down}{Home}{Shift Up}
!+Right:: Send, {Shift Down}{End}{Shift Up}
!+Up:: Send, {Ctrl Down}{Shift Down}{Home}{Shift Up}{Ctrl Up}
!+Down:: Send, {Ctrl Down}{Shift Down}{End}{Shift Up}{Ctrl Up}
#Left:: Send, {Ctrl Down}{Left}{Ctrl Up}
#Right:: Send, {Ctrl Down}{Right}{Ctrl Up}
#+Left:: Send, {Ctrl Down}{Shift Down}{Left}{Shift Up}{Ctrl Up}
#+Right:: Send, {Ctrl Down}{Shift Down}{Right}{Shift Up}{Ctrl Up}
!BS:: Send, {LShift Down}{Home}{LShift Up}{Del}
#IfWinActive ahk_exe explorer.exe
!BS:: Send, {Del}
#IfWinActive
#BS:: Send, {LCtrl Down}{BS}{LCtrl Up} ; currently non-working due to LAlt disablement
; --------------------------------------------------------------
; Special Characters (sorry I'm American, no diacritics)
; --------------------------------------------------------------
LWin & -:: Send, –
#If, GetKeyState("LShift", "P")
LWin & -:: Send, —
#If
; --------------------------------------------------------------
; Etc
; --------------------------------------------------------------
!Enter:: Send, ^{Enter}
!+Enter:: Send, ^+{Enter}
<!LButton:: Send, ^{Click}
<^LButton:: Click, Right
; --------------------------------------------------------------
; Rectangle (Mac window manager) shortcuts I use
; --------------------------------------------------------------
^#c::
WinGetTitle, windowName, A
WinGetPos,,, Width, Height, %windowName%
WinMove, %windowName%,, (A_ScreenWidth - Width) / 2, (A_ScreenHeight - Height) / 2
return