Windows uses Mac shortcut keys

Commonly used keyboard shortcut mapping

When using the keyboard, the personal feel of Command+C and other shortcuts on Mac is more comfortable than Windows’ Ctrl+C. Therefore, through AHK, I’ve implemented Windows to use Mac shortcut keys that better align with my operating habits. The following is the source code.

; Mapping Ctrl to Alt
!d::send {delete}
!b::send {backspace}
!c::Send ^c
!x::Send ^x
!v::Send ^v
!z::Send ^z
!r::Send #r
!s::Send ^s
;Mapping the Caps Lock key to Enter, Alt/Shift + Caps Lock retains the original Caps Lock functionality$CapsLock::Enter
$CapsLock::Enter
!CapsLock::CapsLock
+CapsLock::CapsLock

In actual usage, operations like copy and paste can be controlled not only using Ctrl but also Alt, making this set of shortcuts more convenient during fast typing, as per personal testing.

At the same time, the frequency of using the Caps Lock key is very low; generally, Shift is used instead. On the other hand, the Enter key is used frequently. To balance the usage frequency of these two keys, I changed the original Caps Lock key to the Enter key. This way, when using it, both hands can quickly hit Enter, providing a good feel 😂.

If you need to use the Caps Lock functionality, you can enable it through Shift/Alt + Caps Lock.

Implementing Mac’s Command+W to close the current window and Command+Q to quit the software shortcuts on Windows

In addition to the above shortcuts, what I find most useful on Mac is Command+W to close the current window and Command+Q to quit the software. I’ve also implemented these using AutoHotKey. However, the initial code, when used in browsers like Chrome and Edge, would close the entire browser instead of just the current tab. Therefore, I made some improvements. Note that this code is only effective for Chrome. If you’re using a different browser, you’ll need to adjust it accordingly.

; Alt+W to close the current window, Alt+Q to force end the current process after holding for 2 seconds
!q:: ; Triggered when pressed.
    If StartTime
        return
    StartTime := A_TickCount
return

!q up:: ; Triggered when released.
    TimeLength := A_TickCount - StartTime
    if (TimeLength < 1000)
    {
        TrayTip, AHK Warning, Press Alt+Q for 2 seconds to force end the current task upon key release, 1
    }
    else if (TimeLength >= 2000)
    {
        WinGet, active_id, PID, A
        run, taskkill /PID %active_id% /F,,Hide
    }
    StartTime := ""
return

#IfWinNotActive ahk_class Chrome_WidgetWin_1 ; Exclude Chrome
    !w:: Send !{F4}
Return
#IfWinNotActive

#IfWinActive ahk_class Chrome_WidgetWin_1 ; For Chrome, Alt+W is defined as Ctrl+W (close the current tab)
    !w:: send ^{w}
#IfWinActive

In addition to these features, another commonly used one is Mac’s hot corners, which can also be implemented in Windows using Mac shortcut keys. However, it requires separate editing for each corner. You can refer to this article for more details.

Scroll to Top