├── README.md └── MacKeyboard.ahk /README.md: -------------------------------------------------------------------------------- 1 | Use Mac keyboard with AutoHotkey under Windows 2 | ============================================== 3 | 4 | This [AutoHotkey](https://www.autohotkey.com/) configuration file makes usual keyboard shortcuts work with an Apple keyboard on Windows. It has been testet with a german keyboard layout, but should work under different layouts as well. 5 | 6 | If it's not working for applications running with admin permissions, it might be the problem that AHK is not, see [this question on StackOverflow](https://stackoverflow.com/a/8457852/723769). 7 | 8 | Installation 9 | ------------ 10 | 11 | - Install [AutoHotkey](https://www.autohotkey.com/) 12 | - Run the `MacKeyboard.ahk` file 13 | - Put the `MacKeyboard.ahk` file or a shortcut to the file in your Autostart folder to run it automatically on startup. -------------------------------------------------------------------------------- /MacKeyboard.ahk: -------------------------------------------------------------------------------- 1 | ;----------------------------------------- 2 | ; Mac keyboard to Windows Key Mappings 3 | ;========================================= 4 | 5 | ; -------------------------------------------------------------- 6 | ; NOTES 7 | ; -------------------------------------------------------------- 8 | ; ! = ALT 9 | ; ^ = CTRL 10 | ; + = SHIFT 11 | ; # = WIN 12 | ; 13 | ; Debug action snippet: MsgBox You pressed Control-A while Notepad is active. 14 | 15 | #InstallKeybdHook 16 | #SingleInstance force 17 | SetTitleMatchMode 2 18 | SendMode Input 19 | 20 | ; -------------------------------------------------------------- 21 | ; Mac-like screenshots in Windows (requires Windows 10 Snip & Sketch) 22 | ; -------------------------------------------------------------- 23 | 24 | ; Capture entire screen with CMD/WIN + SHIFT + 3 25 | #+3::send #{PrintScreen} 26 | 27 | ; Capture portion of the screen with CMD/WIN + SHIFT + 4 28 | #+4::#+s 29 | 30 | ; -------------------------------------------------------------- 31 | ; media/function keys all mapped to the right option key 32 | ; -------------------------------------------------------------- 33 | 34 | RAlt & F7::SendInput {Media_Prev} 35 | RAlt & F8::SendInput {Media_Play_Pause} 36 | RAlt & F9::SendInput {Media_Next} 37 | F10::SendInput {Volume_Mute} 38 | F11::SendInput {Volume_Down} 39 | F12::SendInput {Volume_Up} 40 | 41 | ; swap left command/windows key with left alt 42 | ;LWin::LAlt 43 | ;LAlt::LWin ; add a semicolon in front of this line if you want to disable the windows key 44 | 45 | ; Remap Windows + Left OR Right to enable previous or next web page 46 | ; Use only if swapping left command/windows key with left alt 47 | ;Lwin & Left::Send, !{Left} 48 | ;Lwin & Right::Send, !{Right} 49 | 50 | ; Eject Key 51 | ;F20::SendInput {Insert} ; F20 doesn't show up on AHK anymore, see #3 52 | 53 | ; F13-15, standard windows mapping 54 | F13::SendInput {PrintScreen} 55 | F14::SendInput {ScrollLock} 56 | F15::SendInput {Pause} 57 | 58 | ;F16-19 custom app launchers, see http://www.autohotkey.com/docs/Tutorial.htm for usage info 59 | F16::Run http://twitter.com 60 | F17::Run http://tumblr.com 61 | F18::Run http://www.reddit.com 62 | F19::Run https://facebook.com 63 | 64 | ; -------------------------------------------------------------- 65 | ; OS X system shortcuts 66 | ; -------------------------------------------------------------- 67 | 68 | ; Make Ctrl + S work with cmd (windows) key 69 | #s::Send, ^s 70 | 71 | ; Selecting 72 | #a::Send, ^a 73 | 74 | ; Copying 75 | #c::Send, ^c 76 | 77 | ; Pasting 78 | #v::Send, ^v 79 | 80 | ; Cutting 81 | #x::Send, ^x 82 | 83 | ; Opening 84 | #o::Send ^o 85 | 86 | ; Finding 87 | #f::Send ^f 88 | 89 | ; Undo 90 | #z::Send ^z 91 | 92 | ; Redo 93 | #y::Send ^y 94 | 95 | ; New tab 96 | #t::Send ^t 97 | 98 | ; close tab 99 | #w::Send ^w 100 | 101 | ; Close windows (cmd + q to Alt + F4) 102 | #q::Send !{F4} 103 | 104 | ; Remap Windows + Tab to Alt + Tab. 105 | Lwin & Tab::AltTab 106 | 107 | ; minimize windows 108 | #m::WinMinimize,a 109 | 110 | 111 | ; -------------------------------------------------------------- 112 | ; OS X keyboard mappings for special chars 113 | ; -------------------------------------------------------------- 114 | 115 | ; Map Alt + L to @ 116 | !l::SendInput {@} 117 | 118 | ; Map Alt + N to \ 119 | +!7::SendInput {\} 120 | 121 | ; Map Alt + N to © 122 | !g::SendInput {©} 123 | 124 | ; Map Alt + o to ø 125 | !o::SendInput {ø} 126 | 127 | ; Map Alt + 5 to [ 128 | !5::SendInput {[} 129 | 130 | ; Map Alt + 6 to ] 131 | !6::SendInput {]} 132 | 133 | ; Map Alt + E to € 134 | !e::SendInput {€} 135 | 136 | ; Map Alt + - to – 137 | !-::SendInput {–} 138 | 139 | ; Map Alt + 8 to { 140 | !8::SendInput {{} 141 | 142 | ; Map Alt + 9 to } 143 | !9::SendInput {}} 144 | 145 | ; Map Alt + - to ± 146 | !+::SendInput {±} 147 | 148 | ; Map Alt + R to ® 149 | !r::SendInput {®} 150 | 151 | ; Map Alt + N to | 152 | !7::SendInput {|} 153 | 154 | ; Map Alt + W to ∑ 155 | !w::SendInput {∑} 156 | 157 | ; Map Alt + N to ~ 158 | !n::SendInput {~} 159 | 160 | ; Map Alt + 3 to # 161 | !3::SendInput {#} 162 | 163 | 164 | 165 | ; -------------------------------------------------------------- 166 | ; Custom mappings for special chars 167 | ; -------------------------------------------------------------- 168 | 169 | ;#ö::SendInput {[} 170 | ;#ä::SendInput {]} 171 | 172 | ;^ö::SendInput {{} 173 | ;^ä::SendInput {}} 174 | 175 | 176 | ; -------------------------------------------------------------- 177 | ; Application specific 178 | ; -------------------------------------------------------------- 179 | 180 | ; Google Chrome 181 | #IfWinActive, ahk_class Chrome_WidgetWin_1 182 | 183 | ; Show Web Developer Tools with cmd + alt + i 184 | #!i::Send {F12} 185 | 186 | ; Show source code with cmd + alt + u 187 | #!u::Send ^u 188 | 189 | #IfWinActive 190 | 191 | --------------------------------------------------------------------------------