Skip to content

Instantly share code, notes, and snippets.

Last active March 21, 2023 17:41
What would you like to do?
Use macOS-style shortcuts in Windows

Use macOS-style shortcuts in Windows / keyboard mappings using a Mac keyboard on Windows

Make Windows PC's shortcut act like macOS (Mac OS X) (using AutoHotkey (ahk) script)

With this AutoHotKey script, you can use most macOS style shortcuts (eg, cmd+c, cmd+v, ...) on Windows with a standard PC keyboard.

There is a new, alternative project that does similar things and more, check it out at

How does it work

Here's some examples of how this script work:

you want to press what you're actually pressing AutoHotKey tells Windows
cmd + c alt + c ctrl + c
cmd + v alt + v ctrl + v
cmd + r alt + r F5
cmd + ↑ alt + ↑ Home
cmd + shift + [ alt + shift + [ ctrl + shift + Tab
... ... ...

Note that:

  1. you shouldn't change the modifier keys mapping with keyboard DIP. This script assumes you (1) use a PC keyboard on Mac and have swapped [cmd] and [option] keys via Mac system preferences (2) you are familiar with mac shortcuts in macs (3) you want to use the PC keyboard and mac-style shortcuts on PC.
  2. To use cmd + shift + ↑ / ↓ / ← / → (select text between cursor and top / bottom / beginning of line / end of line), You should disable the Between input languages shotcut from Control Panel\Clock, Language, and Region\Language\Advanced settings > Change lanugage bar hot keys due to conflicting.
  3. Some Windows built-in keyboard shortcuts will be overridden. For example: win + ↑ / ↓ / ← / → (snap window to side). Change mac.ahk accordingly if you prefer to keep the default behavior.

To Run Once (until reboot)

  1. Install
  2. Copy and save the content of mac.ahk in a text file, named as mac.ahk
  3. Double click on mac.ahk file

Auto start after Windows startup

Complete the step of "To Run Once" section first.

Place mac.ahk file (or make a shortcut) at C:\Users\<USERNAME>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Docs:
; Ref
; You need to disable "Between input languages" shotcut from Control Panel\Clock, Language, and Region\Language\Advanced settings > Change lanugage bar hot keys
; Universal shotcuts
$!x::Send ^x
$!c::Send ^c
$!v::Send ^v
$!s::Send ^s
$!a::Send ^a
$!z::Send ^z
$!+z::Send ^y
$!w::Send ^w
$!f::Send ^f
$!n::Send ^n
$!q::Send !{f4}
$!r::Send ^{f5}
$!m::Send {LWin Down}{Down}{LWin Up}
$!`::Send {Alt Down}{Shift Down}{Tab}{Shift Up}
; Quick Switch Tab shotcuts
$!1::Send ^1
$!2::Send ^2
$!3::Send ^3
$!4::Send ^4
$!5::Send ^5
$!6::Send ^6
$!7::Send ^7
$!8::Send ^8
$!9::Send ^9
$!0::Send ^0
; Chrome shotcuts
$!t::Send ^t
$!+t::Send ^+t
$!+]::Send {Ctrl Down}{Tab Down}{Tab Up}{Ctrl Up}
$!+[::Send {Ctrl Down}{Shift Down}{Tab Down}{Tab Up}{Shift Up}{Ctrl Up}
$!l::Send ^l
; input methods
; $+,::Send ^,
; $+.::Send ^.
; navigation, selection, delete a word/till end
$!Left::Send {Home}
$!Right::Send {End}
$!Up::Send {Lctrl down}{Home}{Lctrl up}
$!Down::Send {Lctrl down}{End}{Lctrl 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}
$!+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}
!BS::Send {LShift down}{Home}{LShift Up}{Del}
#BS::Send {LCtrl down}{BS}{LCtrl up}
$#Space::Send {Ctrl Down}{LWin Down}{Space}{LWin Up}{Ctrl Up}
Copy link

edoardoc commented Mar 4, 2022

@aditnryn @joaquim-oliveira-neto
2 - it is indeed impossible :/ and there is an ongoing discussion about the reasons and some surrogates at

Copy link

Thanks a lot!
Also internal windows screenshot tool mapping
+!4::Send {LWin Down}{Shift Down}{S}{Shift Up}{LWin Up}

Copy link

Sl4yZ commented Aug 1, 2022

this doesn't work for me #July 2022

Copy link

Trying to create a better solution for this here:
Feedback welcome!

Copy link

@stevenilsen123 That is cool!!!

I rarely use Windows PC now. I would love to try it out next time when I get a chance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment