Skip to content

Instantly share code, notes, and snippets.

@qxj
Forked from ascendbruce/README.md
Last active March 16, 2025 10:51
Show Gist options
  • Select an option

  • Save qxj/b7dd4f1aa29975d450007b82ffd3e5b3 to your computer and use it in GitHub Desktop.

Select an option

Save qxj/b7dd4f1aa29975d450007b82ffd3e5b3 to your computer and use it in GitHub Desktop.

Revisions

  1. qxj revised this gist Mar 16, 2025. 1 changed file with 9 additions and 9 deletions.
    18 changes: 9 additions & 9 deletions macv2.ahk
    Original file line number Diff line number Diff line change
    @@ -59,20 +59,20 @@ CapsLock::Send("{LShift down}{LShift Up}")

    ;;; 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("{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}
    $#+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}")

    ;;; Emacs keybinds

    @@ -111,4 +111,4 @@ LWin & F12:: {
    } Else {
    MsgBox("Emacs Keybind Enabled!")
    }
    }
    }
  2. qxj revised this gist Mar 16, 2025. 1 changed file with 26 additions and 17 deletions.
    43 changes: 26 additions & 17 deletions macv2.ahk
    Original file line number Diff line number Diff line change
    @@ -15,22 +15,22 @@ SetWorkingDir(A_ScriptDir) ; Ensures a consistent starting directory.
    ;;; Universal shotcuts
    ; ^ Ctrl, ! Alt, + Shift, # Win

    $!x::Send("^x")
    $!c::Send("^c") ; copy
    $!v::Send("^v") ; paste
    $!+v::Send("^+v") ; paste text
    $!s::Send("^s") ; save
    $!a::Send("^a") ; select all
    $!z::Send("^z") ; undo
    $!+z::Send("^y") ; redo
    $!w::Send("^w") ; close window
    $!n::Send("^n") ; new window
    $!f::Send("^f") ; find
    $!q::Send("!{f4}") ; close window
    $!r::Send("^{f5}") ; refresh window
    $!m::Send("{LWin Down}{Down}{LWin Up}") ; minimize window
    $!^4::Send("^{PrintScreen}") ; rectangle screen capture (FSCapture)
    $!^l::DllCall("PowrProf\SetSuspendState", "Int", 0, "Int", 0, "Int", 0) ; hibernate or suspend
    $#x::Send("^x")
    $#c::Send("^c") ; copy
    $#v::Send("^v") ; paste
    $#+v::Send("^+v") ; paste text
    $#s::Send("^s") ; save
    $#a::Send("^a") ; select all
    $#z::Send("^z") ; undo
    $#+z::Send("^y") ; redo
    $#w::Send("^w") ; close window
    $#n::Send("^n") ; new window
    $#f::Send("^f") ; find
    $#q::Send("!{f4}") ; close window
    $#r::Send("^{f5}") ; refresh window
    $#m::Send("{LWin Down}{Down}{LWin Up}") ; minimize window
    $#^4::Send("^{PrintScreen}") ; rectangle screen capture (FSCapture)
    $#^l::DllCall("PowrProf\SetSuspendState", "Int", 0, "Int", 0, "Int", 0) ; hibernate or suspend

    ;;; Quick Switch Tab shotcuts

    @@ -59,11 +59,21 @@ CapsLock::Send("{LShift down}{LShift Up}")

    ;;; 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}

    ;;; Emacs keybinds

    $#BS::Send("{LShift down}{Home}{LShift Up}{Del}")
    @@ -102,4 +112,3 @@ LWin & F12:: {
    MsgBox("Emacs Keybind Enabled!")
    }
    }

  3. qxj revised this gist Mar 16, 2025. 1 changed file with 105 additions and 0 deletions.
    105 changes: 105 additions & 0 deletions macv2.ahk
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,105 @@
    SendMode("Input") ; Recommended for new scripts due to its superior speed and reliability.
    SetWorkingDir(A_ScriptDir) ; Ensures a consistent starting directory.

    ; Docs:
    ; https://autohotkey.com/docs/Hotkeys.htm
    ; https://autohotkey.com/docs/KeyList.htm
    ; Ref https://autohotkey.com/board/topic/60675-osx-style-command-keys-in-windows/

    ; You need to disable "Between input languages" shotcut from Control Panel\Clock, Language, and Region\Language\Advanced settings > Change lanugage bar hot keys

    ;;; Switch CapsLock and Control
    ;$LControl::CapsLock
    ;$CapsLock::LControl

    ;;; Universal shotcuts
    ; ^ Ctrl, ! Alt, + Shift, # Win

    $!x::Send("^x")
    $!c::Send("^c") ; copy
    $!v::Send("^v") ; paste
    $!+v::Send("^+v") ; paste text
    $!s::Send("^s") ; save
    $!a::Send("^a") ; select all
    $!z::Send("^z") ; undo
    $!+z::Send("^y") ; redo
    $!w::Send("^w") ; close window
    $!n::Send("^n") ; new window
    $!f::Send("^f") ; find
    $!q::Send("!{f4}") ; close window
    $!r::Send("^{f5}") ; refresh window
    $!m::Send("{LWin Down}{Down}{LWin Up}") ; minimize window
    $!^4::Send("^{PrintScreen}") ; rectangle screen capture (FSCapture)
    $!^l::DllCall("PowrProf\SetSuspendState", "Int", 0, "Int", 0, "Int", 0) ; hibernate or suspend

    ;;; Quick Switch Tab shotcuts

    LWin & Tab::AltTab

    ;;; Chrome shotcuts

    SetTitleMatchMode(2)
    #HotIf WinActive("ahk_exe chrome.exe", )
    $!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")
    $^!z::Send("^+z") ; switch last opened tab
    #HotIf

    ;;; input methods

    ; $+,::Send ^,
    ; $+.::Send ^.
    SetCapsLockState("AlwaysOff")
    +CapsLock::CapsLock
    ;CapsLock::Send("^{space}") ; Swith input methods as macOS
    CapsLock::Send("{LShift down}{LShift Up}")

    ;;; navigation, selection, delete a word/till end

    $!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}")

    ;;; Emacs keybinds

    $#BS::Send("{LShift down}{Home}{LShift Up}{Del}")
    $!BS::Send("{LCtrl down}{BS}{LCtrl up}") ; delete word backword

    $^a::Send("{Home}") ; move to beginning of line
    $^b::Send("{Left}") ; backward char
    $^d::Send("{Del}") ; delete char forward
    $^e::Send("{End}") ; move to end of line
    $^f::Send("{Right}") ; forward char
    $^k::Send("{LShift down}{End}{LShift up}{Del}") ; delete to end of line
    $^n::Send("{Down}")
    $^p::Send("{Up}")
    $^w::Send("{LCtrl down}{BS}{LCtrl up}") ; delete word backword
    $!b::Send("{Alt down}{Left}{Alt up}") ; backward word
    $!d::Send("{LCtrl down}{Del}{LCtrl up}") ; delete word forward
    $!f::Send("{Alt down}{Right}{Alt up}") ; forward word

    LWin & F12:: {
    EmacsKey :=! EmacsKey
    Hotkey("^a", "Toggle")
    Hotkey("^b", "Toggle")
    Hotkey("^d", "Toggle")
    Hotkey("^e", "Toggle")
    Hotkey("^f", "Toggle")
    Hotkey("^k", "Toggle")
    Hotkey("^n", "Toggle")
    Hotkey("^p", "Toggle")
    Hotkey("^w", "Toggle")
    Hotkey("!b", "Toggle")
    Hotkey("!d", "Toggle")
    Hotkey("!f", "Toggle")
    If (EmacsKey) {
    MsgBox("Emacs Keybind Disabled!")
    } Else {
    MsgBox("Emacs Keybind Enabled!")
    }
    }

  4. qxj revised this gist Apr 15, 2022. 1 changed file with 29 additions and 7 deletions.
    36 changes: 29 additions & 7 deletions mac.ahk
    Original file line number Diff line number Diff line change
    @@ -62,7 +62,8 @@ SetTitleMatchMode, 2
    ; $+.::Send ^.
    SetCapsLockState, AlwaysOff
    +CapsLock::CapsLock
    CapsLock::Send ^{space}
    ;CapsLock::Send ^{space} ; Swith input methods as macOS
    CapsLock::Send {LShift down}{LShift Up}

    ;;; navigation, selection, delete a word/till end

    @@ -83,17 +84,38 @@ $#+Down::Send {Ctrl Down}{shift down}{End}{shift up}{Ctrl Up}

    ;;; Emacs keybinds

    $#BS::Send {LShift down}{Home}{LShift Up}{Del}
    $!BS::Send {LCtrl down}{BS}{LCtrl up} ; delete word backword

    $^a::Send {Home} ; move to beginning of line
    $^e::Send {End} ; move to end of line
    $^b::Send {Left} ; backward char
    $^d::Send {Del} ; delete char forward
    $^e::Send {End} ; move to end of line
    $^f::Send {Right} ; forward char
    $^k::Send {LShift down}{End}{LShift up}{Del} ; delete to end of line
    $^n::Send {Down}
    $^p::Send {Up}
    $^w::Send {LCtrl down}{BS}{LCtrl up} ; delete word backword
    $!b::Send {Alt down}{Left}{Alt up} ; backward word
    $!d::Send {LCtrl down}{Del}{LCtrl up} ; delete word forward
    $!f::Send {Alt down}{Right}{Alt up} ; forward word
    $^d::Send {Del} ; delete char
    $!d::Send {LCtrl down}{Del}{LCtrl up} ; delete word
    $^k::Send {LShiftDown}{End}{LShiftUp}{Del} ; delete to end of line

    #BS::Send {LShift down}{Home}{LShift Up}{Del}
    !BS::Send {LCtrl down}{BS}{LCtrl up}
    LWin & F12::
    EmacsKey :=! EmacsKey
    Hotkey, ^a, Toggle
    Hotkey, ^b, Toggle
    Hotkey, ^d, Toggle
    Hotkey, ^e, Toggle
    Hotkey, ^f, Toggle
    Hotkey, ^k, Toggle
    Hotkey, ^n, Toggle
    Hotkey, ^p, Toggle
    Hotkey, ^w, Toggle
    Hotkey, !b, Toggle
    Hotkey, !d, Toggle
    Hotkey, !f, Toggle
    If EmacsKey
    MsgBox, Emacs Keybind Disabled!
    Else
    MsgBox, Emacs Keybind Enabled!
    Return
  5. qxj revised this gist Oct 30, 2021. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion mac.ahk
    Original file line number Diff line number Diff line change
    @@ -26,7 +26,8 @@ $#f::Send ^f ; find
    $#q::Send !{f4} ; close window
    $#r::Send ^{f5} ; refresh window
    $#m::Send {LWin Down}{Down}{LWin Up} ; minimize window
    $#^4::Send ^{PrintScreen} ; rectangle screen capture (FSCapture)
    $#^4::Send ^{PrintScreen} ; rectangle screen capture (FSCapture)
    $#^l::DllCall("PowrProf\SetSuspendState", "Int", 0, "Int", 0, "Int", 0) ; hibernate or suspend

    ;;; Quick Switch Tab shotcuts

  6. qxj revised this gist Oct 28, 2021. 1 changed file with 3 additions and 7 deletions.
    10 changes: 3 additions & 7 deletions mac.ahk
    Original file line number Diff line number Diff line change
    @@ -23,9 +23,8 @@ $#+z::Send ^y ; redo
    $#w::Send ^w ; close window
    $#n::Send ^n ; new window
    $#f::Send ^f ; find
    $#k::Send ^k
    $#q::Send !{f4}
    $#r::Send ^{f5}
    $#q::Send !{f4} ; close window
    $#r::Send ^{f5} ; refresh window
    $#m::Send {LWin Down}{Down}{LWin Up} ; minimize window
    $#^4::Send ^{PrintScreen} ; rectangle screen capture (FSCapture)

    @@ -93,10 +92,7 @@ $!b::Send {Alt down}{Left}{Alt up} ; backward word
    $!f::Send {Alt down}{Right}{Alt up} ; forward word
    $^d::Send {Del} ; delete char
    $!d::Send {LCtrl down}{Del}{LCtrl up} ; delete word
    $^k::Send {Home}{ShiftDown}{End}{Right}{ShiftUp}{Del} ; delete line
    $^k::Send {LShiftDown}{End}{LShiftUp}{Del} ; delete to end of line

    #BS::Send {LShift down}{Home}{LShift Up}{Del}
    !BS::Send {LCtrl down}{BS}{LCtrl up}



  7. qxj revised this gist Oct 15, 2021. 1 changed file with 13 additions and 11 deletions.
    24 changes: 13 additions & 11 deletions mac.ahk
    Original file line number Diff line number Diff line change
    @@ -13,19 +13,21 @@ SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
    ;;; Universal shotcuts

    $#x::Send ^x
    $#c::Send ^c
    $#v::Send ^v
    $#+v::Send ^+v
    $#s::Send ^s
    $#a::Send ^a
    $#z::Send ^z
    $#+z::Send ^y
    $#w::Send ^w
    $#f::Send ^f
    $#n::Send ^n
    $#c::Send ^c ; copy
    $#v::Send ^v ; paste
    $#+v::Send ^+v ; paste text
    $#s::Send ^s ; save
    $#a::Send ^a ; select all
    $#z::Send ^z ; undo
    $#+z::Send ^y ; redo
    $#w::Send ^w ; close window
    $#n::Send ^n ; new window
    $#f::Send ^f ; find
    $#k::Send ^k
    $#q::Send !{f4}
    $#r::Send ^{f5}
    $#m::Send {LWin Down}{Down}{LWin Up}
    $#m::Send {LWin Down}{Down}{LWin Up} ; minimize window
    $#^4::Send ^{PrintScreen} ; rectangle screen capture (FSCapture)

    ;;; Quick Switch Tab shotcuts

  8. qxj revised this gist Oct 15, 2021. 1 changed file with 79 additions and 55 deletions.
    134 changes: 79 additions & 55 deletions mac.ahk
    Original file line number Diff line number Diff line change
    @@ -10,67 +10,91 @@ SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

    ; 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
    ;;; Universal shotcuts

    $#x::Send ^x
    $#c::Send ^c
    $#v::Send ^v
    $#+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}

    ;;; Quick Switch Tab shotcuts

    LWin & Tab::AltTab

    $#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

    SetTitleMatchMode, 2
    #IfWinActive, ahk_exe chrome.exe
    $#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
    $^#z::Send ^+z ; switch last opened tab
    #IfWinActive

    ;;; input methods

    ; $+,::Send ^,
    ; $+.::Send ^.
    SetCapsLockState, AlwaysOff
    +CapsLock::CapsLock
    CapsLock::Send ^{space}

    ; navigation, selection, delete a word/till end
    ;;; 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 {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 {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}

    ;;; Emacs keybinds

    $^a::Send {Home} ; move to beginning of line
    $^e::Send {End} ; move to end of line
    $^b::Send {Left} ; backward char
    $^f::Send {Right} ; forward char
    $^n::Send {Down}
    $^p::Send {Up}
    $!b::Send {Alt down}{Left}{Alt up} ; backward word
    $!f::Send {Alt down}{Right}{Alt up} ; forward word
    $^d::Send {Del} ; delete char
    $!d::Send {LCtrl down}{Del}{LCtrl up} ; delete word
    $^k::Send {Home}{ShiftDown}{End}{Right}{ShiftUp}{Del} ; delete line

    #BS::Send {LShift down}{Home}{LShift Up}{Del}
    !BS::Send {LCtrl down}{BS}{LCtrl 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}
  9. @ascendbruce ascendbruce revised this gist May 30, 2021. 1 changed file with 12 additions and 12 deletions.
    24 changes: 12 additions & 12 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -8,18 +8,18 @@ Note that:

    1. **you shouldn't change the modifier keys mapping with keyboard DIP**. This script assumes you use a standard PC keyboard layout, and wish to use shortcuts as if it was a mac keyboard layout.
    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).

    Here's some examples of how this script work

    | you want to press | keyboard sends signal to PC | 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 |
    | ... | ... | ... |
    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.

    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 |
    | ... | ... | ... |

    ## To Run Once (until reboot)

  10. @ascendbruce ascendbruce revised this gist Feb 16, 2021. 1 changed file with 7 additions and 4 deletions.
    11 changes: 7 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -4,10 +4,13 @@

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

    Note that
    Note that:

    1. **You should disable the `Between input languages` shotcut** from `Control Panel\Clock, Language, and Region\Language\Advanced settings > Change lanugage bar hot keys` because it conflicts with `cmd + shift + ↑ / ↓ / ← / →` (select text between cursor and top / bottom / beginning of line / end of line)
    2. **you shouldn't change the modifier keys mapping with keyboard DIP**. This script assumes you use a standard PC keyboard layout, and wish to use shortcuts as if it was a mac keyboard layout.
    1. **you shouldn't change the modifier keys mapping with keyboard DIP**. This script assumes you use a standard PC keyboard layout, and wish to use shortcuts as if it was a mac keyboard layout.
    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).

    Here's some examples of how this script work

    | you want to press | keyboard sends signal to PC | AutoHotKey tells Windows |
    |-------------------|-----------------------------|--------------------------|
    @@ -18,7 +21,7 @@ Note that
    | cmd + shift + \[ | alt + shift + \[ | ctrl + shift + Tab |
    | ... | ... | ... |

    ## To Run
    ## To Run Once (until reboot)

    1. Install https://www.autohotkey.com/
    2. Copy and save the content of `mac.ahk` in a text file, named as `mac.ahk`
  11. @ascendbruce ascendbruce revised this gist Jan 17, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Use (most) macOS style shortcuts on Windows
    # Use (most) macOS style keyboard shortcuts on Windows

    ## Make Windows PC's shortcut act like macOS (Mac OS X)

    @@ -24,6 +24,6 @@ Note that
    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 PC startup
    ## Auto start after Windows startup

    Place `mac.ahk` file (or make a shortcut) at `C:\Users\<USERNAME>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup`
  12. @ascendbruce ascendbruce revised this gist Feb 13, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,9 @@ Note that
    |-------------------|-----------------------------|--------------------------|
    | 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 |
    | ... | ... | ... |

    ## To Run
  13. @ascendbruce ascendbruce revised this gist Feb 13, 2020. 2 changed files with 9 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@ Note that

    1. Install https://www.autohotkey.com/
    2. Copy and save the content of `mac.ahk` in a text file, named as `mac.ahk`
    3. Double click `mac.ahk` script
    3. Double click on `mac.ahk` file

    ## Auto start after PC startup

    9 changes: 8 additions & 1 deletion mac.ahk
    Original file line number Diff line number Diff line change
    @@ -27,11 +27,18 @@ $!r::Send ^{f5}
    $!m::Send {LWin Down}{Down}{LWin Up}
    $!`::Send {Alt Down}{Shift Down}{Tab}{Shift Up}

    ; Trello shotcuts
    ; 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

  14. @ascendbruce ascendbruce revised this gist Feb 13, 2020. 1 changed file with 7 additions and 4 deletions.
    11 changes: 7 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Use (most) macOS style shortcuts on Windows

    ## Make Windows PC's shortcut acts like Mac OS X
    ## Make Windows PC's shortcut act like macOS (Mac OS X)

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

    @@ -9,9 +9,12 @@ Note that
    1. **You should disable the `Between input languages` shotcut** from `Control Panel\Clock, Language, and Region\Language\Advanced settings > Change lanugage bar hot keys` because it conflicts with `cmd + shift + ↑ / ↓ / ← / →` (select text between cursor and top / bottom / beginning of line / end of line)
    2. **you shouldn't change the modifier keys mapping with keyboard DIP**. This script assumes you use a standard PC keyboard layout, and wish to use shortcuts as if it was a mac keyboard layout.

    | you want to press | keyboard send signal to PC | AutoHotKey tells Windows |
    |-------------------|----------------------------|--------------------------|
    | cmd + c | alt + c | ctrl + c |
    | you want to press | keyboard sends signal to PC | AutoHotKey tells Windows |
    |-------------------|-----------------------------|--------------------------|
    | cmd + c | alt + c | ctrl + c |
    | cmd + v | alt + v | ctrl + v |
    | cmd + ↑ | alt + ↑ | Home |
    | ... | ... | ... |

    ## To Run

  15. @ascendbruce ascendbruce revised this gist Feb 13, 2020. 1 changed file with 11 additions and 2 deletions.
    13 changes: 11 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,17 @@
    # Use (most) macOS style shortcuts on Windows

    ## Make Windows PC's shortcut acts like Mac OS X

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

    Note that this script assumes you use a standard PC keyboard, and you want to use shortcuts as if it was on a native mac keyboards. It means that you think you are pressing `command + c`, you are actually sending `alt + c` to Windows (and it will be picked up by AutoHotKey and translate to `ctrl + c`)
    Note that

    1. **You should disable the `Between input languages` shotcut** from `Control Panel\Clock, Language, and Region\Language\Advanced settings > Change lanugage bar hot keys` because it conflicts with `cmd + shift + ↑ / ↓ / ← / →` (select text between cursor and top / bottom / beginning of line / end of line)
    2. **you shouldn't change the modifier keys mapping with keyboard DIP**. This script assumes you use a standard PC keyboard layout, and wish to use shortcuts as if it was a mac keyboard layout.

    **You should disable the `Between input languages` shotcut** from `Control Panel\Clock, Language, and Region\Language\Advanced settings > Change lanugage bar hot keys` because it conflicts with `cmd + shift + ↑ / ↓ / ← / →` (select text between cursor and top / bottom / beginning of line / end of line)
    | you want to press | keyboard send signal to PC | AutoHotKey tells Windows |
    |-------------------|----------------------------|--------------------------|
    | cmd + c | alt + c | ctrl + c |

    ## To Run

  16. @ascendbruce ascendbruce revised this gist Feb 13, 2020. 1 changed file with 10 additions and 5 deletions.
    15 changes: 10 additions & 5 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,15 @@
    With this AutoHotKey script, you can use most macOS style shortcuts (eg, cmd+c, cmd+v, ...) on Windows with a standard PC keyboard.

    Use https://www.autohotkey.com/ to run the `mac.ahk` script

    Note that this script assumes you use a standard PC keyboard, and you want to use shortcuts as if it was on a native mac keyboards. It means that you think you are pressing `command + c`, you are actually sending `alt + c` to Windows (and it will be picked up by AutoHotKey and translate to `ctrl + c`)

    TODO:
    **You should disable the `Between input languages` shotcut** from `Control Panel\Clock, Language, and Region\Language\Advanced settings > Change lanugage bar hot keys` because it conflicts with `cmd + shift + ↑ / ↓ / ← / →` (select text between cursor and top / bottom / beginning of line / end of line)

    ## To Run

    1. Install https://www.autohotkey.com/
    2. Copy and save the content of `mac.ahk` in a text file, named as `mac.ahk`
    3. Double click `mac.ahk` script

    ## Auto start after PC startup

    * How to set up auto start script
    * Clarification on `Between input languages`
    Place `mac.ahk` file (or make a shortcut) at `C:\Users\<USERNAME>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup`
  17. @ascendbruce ascendbruce revised this gist Feb 13, 2020. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    With this AutoHotKey script, you can use most macOS style shortcuts (eg, cmd+c, cmd+v, ...) on Windows with a standard PC keyboard.

    Use https://www.autohotkey.com/ to run the `mac.ahk` script

    Note that this script assumes you use a standard PC keyboard, and you want to use shortcuts as if it was on a native mac keyboards. It means that you think you are pressing `command + c`, you are actually sending `alt + c` to Windows (and it will be picked up by AutoHotKey and translate to `ctrl + c`)

    TODO:

    * How to set up auto start script
    * Clarification on `Between input languages`
  18. @ascendbruce ascendbruce revised this gist Feb 13, 2020. No changes.
  19. @ascendbruce ascendbruce revised this gist Feb 13, 2020. No changes.
  20. @ascendbruce ascendbruce revised this gist Jun 2, 2018. 1 changed file with 14 additions and 1 deletion.
    15 changes: 14 additions & 1 deletion mac.ahk
    Original file line number Diff line number Diff line change
    @@ -27,6 +27,12 @@ $!r::Send ^{f5}
    $!m::Send {LWin Down}{Down}{LWin Up}
    $!`::Send {Alt Down}{Shift Down}{Tab}{Shift Up}

    ; Trello shotcuts

    $!1::Send ^1
    $!2::Send ^2
    $!3::Send ^3

    ; Chrome shotcuts

    $!t::Send ^t
    @@ -35,6 +41,11 @@ $!+]::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}
    @@ -53,4 +64,6 @@ $!+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}
    #BS::Send {LCtrl down}{BS}{LCtrl up}

    $#Space::Send {Ctrl Down}{LWin Down}{Space}{LWin Up}{Ctrl Up}
  21. @ascendbruce ascendbruce revised this gist May 6, 2017. 1 changed file with 56 additions and 34 deletions.
    90 changes: 56 additions & 34 deletions mac.ahk
    Original file line number Diff line number Diff line change
    @@ -1,34 +1,56 @@
    $!x::
    Send {Ctrl Down}{x}{Ctrl Up}
    Return

    $!c::
    Send {Ctrl Down}{c}{Ctrl Up}
    Return

    $!v::
    Send {Ctrl Down}{v}{Ctrl Up}
    Return

    $!s::
    Send {Ctrl Down}{s}{Ctrl Up}
    Return

    $!a::
    Send {Ctrl Down}{a}{Ctrl Up}
    Return

    $!t::
    Send {Ctrl Down}{t}{Ctrl Up}
    Return

    $!w::
    Send {Ctrl Down}{w}{Ctrl Up}
    Return

    $!f::
    Send {Ctrl Down}{f}{Ctrl Up}
    Return
    $!r::
    Send ^{f5}
    Return
    #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:
    ; https://autohotkey.com/docs/Hotkeys.htm
    ; https://autohotkey.com/docs/KeyList.htm
    ; Ref https://autohotkey.com/board/topic/60675-osx-style-command-keys-in-windows/

    ; 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}

    ; 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

    ; 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}
  22. @ascendbruce ascendbruce revised this gist Dec 20, 2016. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions mac.ahk
    Original file line number Diff line number Diff line change
    @@ -29,3 +29,6 @@ Return
    $!f::
    Send {Ctrl Down}{f}{Ctrl Up}
    Return
    $!r::
    Send ^{f5}
    Return
  23. @ascendbruce ascendbruce created this gist Nov 8, 2016.
    31 changes: 31 additions & 0 deletions mac.ahk
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    $!x::
    Send {Ctrl Down}{x}{Ctrl Up}
    Return

    $!c::
    Send {Ctrl Down}{c}{Ctrl Up}
    Return

    $!v::
    Send {Ctrl Down}{v}{Ctrl Up}
    Return

    $!s::
    Send {Ctrl Down}{s}{Ctrl Up}
    Return

    $!a::
    Send {Ctrl Down}{a}{Ctrl Up}
    Return

    $!t::
    Send {Ctrl Down}{t}{Ctrl Up}
    Return

    $!w::
    Send {Ctrl Down}{w}{Ctrl Up}
    Return

    $!f::
    Send {Ctrl Down}{f}{Ctrl Up}
    Return