Skip to content

Instantly share code, notes, and snippets.

@ollieatkinson
Last active December 30, 2025 21:07
Show Gist options
  • Select an option

  • Save ollieatkinson/0264386666c6d2d0aaaa65a5b9c1d682 to your computer and use it in GitHub Desktop.

Select an option

Save ollieatkinson/0264386666c6d2d0aaaa65a5b9c1d682 to your computer and use it in GitHub Desktop.
AHK layout for Keychron Q6 HE for Mac layout on Windows
#Requires AutoHotkey v2.0
#SingleInstance Force
; ============================================
; Mac-style behaviour + UK ISO remaps for Keychron Q6 HE
; Assumes Windows layout: English (United Kingdom)
; ============================================
; --------------------------------------------------
; Prevent Cmd/Win alone from opening Start Menu
; Still works normally when combined with another key
; --------------------------------------------------
RWin Up::Return
; --------------------------------------------
; 0) Mac-UK style symbol tweaks on top of UK ISO
; --------------------------------------------
; SC003 = "2" key
; SC028 = apostrophe key ( ' / @ on UK PC )
; SC056 = ISO key next to Left Shift
; SC02B = key next to Enter (PC UK: \ / |)
; Swap " and @ like Mac UK:
; - Shift+2 -> @
; - Shift+apostrophe -> "
+SC003::Send "@"
+SC028::Send '"'
; Alt/Option+3 -> # (Mac UK style)
!3::Send "#"
; Left ISO key (next to Left Shift) -> ` / ~
; - no Shift -> `
; - with Shift -> ~
*SC056::
{
if GetKeyState("Shift", "P")
Send "~"
else
Send "``" ; two backticks = one literal `
}
; Right ISO key (next to Enter) -> \ / |
; - no Shift -> \
; - with Shift -> |
*SC02B::
{
if GetKeyState("Shift", "P")
Send "|"
else
Send "\"
}
; Key under Esc: § / ± (Mac-UK style)
*SC029::
{
if GetKeyState("Shift", "P")
Send "±"
else
Send "§"
}
; --------------------------------------------
; 1) CapsLock -> Ctrl (optional but handy)
; --------------------------------------------
CapsLock::Ctrl
; --------------------------------------------
; 2) Mac-style Command (Win key as Command)
; --------------------------------------------
; Basic editing
F13 & c::Send "^c"
RWin & c::Send "^c"
F13 & v::Send "^v"
RWin & v::Send "^v"
F13 & x::Send "^x"
RWin & x::Send "^x"
F13 & s::Send "^s"
RWin & s::Send "^s"
F13 & t::Send "^t"
RWin & t::Send "^t"
F13 & w::Send "^w"
RWin & w::Send "^w"
F13 & f::Send "^f"
RWin & f::Send "^f"
F13 & /::Send "^/"
; Spotlight-like search: Cmd+Space -> Win+S
F13 & Space::Send "#s"
RWin & Space::Send "#s"
; Cmd+Tab -> Alt+Tab
F13 & Tab::AltTab
RWin & Tab::AltTab
; Cmd+Q -> Quit (Alt+F4)
F13 & q::Send "!{F4}"
RWin & q::Send "!{F4}"
; Cmd+H -> Minimise
F13 & h::Send "#{Down}"
RWin & h::Send "#{Down}"
; Cmd+4 -> Region screenshot (Win+Shift+S)
F13 & 4::Send "#+s"
RWin & 4::Send "#+s"
; Cmd+Delete -> Forward delete
F13 & Delete::Send "{Del}"
RWin & Delete::Send "{Del}"
; Undo / Redo
F13 & z::
{
if GetKeyState("Shift", "P")
Send "^+z" ; Cmd+Shift+Z = Redo
else
Send "^z" ; Cmd+Z = Undo
}
RWin & z::
{
if GetKeyState("Shift", "P")
Send "^+z"
else
Send "^z"
}
; Cmd+A = true select-all via Home/End
F13 & a::
{
Send "^{Home}" ; go to start of file
Send "^+{End}" ; select to end of file
}
; Cmd+G / Cmd+Shift+G → next / previous match
F13 & g::
{
if GetKeyState("Shift", "P")
Send "^+g" ; Cmd+Shift+G → Ctrl+Shift+G (previous match)
else
Send "^g" ; Cmd+G → Ctrl+G (next match)
}
F13 & r::Send "^r" ; Replace (if you want)
F13 & l::Send "^l" ; Go to line
F13 & p::Send "^p"
F13 & n::Send "^n"
; --------------------------------------------
; 3) macOS-like key behaviour
; --------------------------------------------
; Option+Backspace -> delete previous word
!Backspace::Send "^{Backspace}"
; Cmd+Backspace -> delete to start of line
F13 & Backspace::
RWin & Backspace::
{
Send "+{Home}{Delete}"
}
; Option+Shift+Left/Right -> select word (Ctrl+Shift+Arrow)
!+Left::Send "^+{Left}"
!+Right::Send "^+{Right}"
; Option+Left/Right -> word jump (mac-style)
!Left::Send "^{Left}"
!Right::Send "^{Right}"
; --------------------------------------------
; 4) Navigation
; --------------------------------------------
; Leave Ctrl+Left/Right = default word-jump
; Leave Alt+Left/Right = browser back/forward, etc.
; Cmd+Left/Right -> Home/End (start/end of line)
F13 & Left::Send "{Home}"
RWin & Left::Send "{Home}"
F13 & Right::Send "{End}"
RWin & Right::Send "{End}"
; Optional Emacs-style (uncomment if you want):
^a::Send "{Home}" ; Ctrl+A = beginning of line
^e::Send "{End}" ; Ctrl+E = end of line
; --------------------------------------------
; 5) Extra mac-like goodies
; --------------------------------------------
; Emoji picker: Cmd+Ctrl+Space -> Win+.
^#Space::Send "#."
; Mission Control-ish: Cmd+Up -> Task View (Win+Tab)
F13 & Up::Send "#{Tab}"
RWin & Up::Send "#{Tab}"
; Cmd+Down -> Minimise (Win+Down)
F13 & Down::Send "#{Down}"
RWin & Down::Send "#{Down}"
Windows Registry Editor Version 5.00
; Map Left Windows key (E0 5B) to F13 (0064)
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,64,00,5b,e0,00,00,00,00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment