Skip to content

Instantly share code, notes, and snippets.

@chrisfcarroll
Last active September 5, 2024 23:55
Show Gist options
  • Save chrisfcarroll/e85a85f89d8bfcae7d9ce9e332aa3bea to your computer and use it in GitHub Desktop.
Save chrisfcarroll/e85a85f89d8bfcae7d9ce9e332aa3bea to your computer and use it in GitHub Desktop.
MacKeyboardOnPc Minimal.ahk
#Requires AutoHotkey v2.0
;
; AutoHotKey 2.0 typographic relief for Mac keyboard users on Windows, whether
;
; — plugging a Mac Keyboard into a PC
; — or just missing the extended typographic symbols that the Mac puts on the Alt keys.
;
; Set these Switches to true/false to match your preferences
;
;
isMacKeyboard := true
isUkKeyboard := true
;
addCommonMacOSisms := true
openCharMapOnWinShiftDot := true
openFoldersOnWinShift := true
addMacOsAltTypographicSymbols := true
andTypographicSymbolsOnAltGrNumberKeys := true
andTypographicSymbolsOnLeftAltShiftNumberKeys := true
addVulgarFractionsOnAltGrShiftNumberKeys := true
; =======================================================================
#HotIf openCharMapOnWinShiftDot
#+.::Run "charmap.exe"
#HotIf
#HotIf openFoldersOnWinShift
#+o::Run EnvGet("OneDrive")
#+h::Run EnvGet("UserProfile")
#+r::Run Format("{1}\repos", EnvGet("UserProfile"))
#+l::Run Format("{1}\Favorites\Links", EnvGet("UserProfile"))
#+g::Run "https://gist.github.com/chrisfcarroll/"
#HotIf
; === Common macos-isms =================================================
;
#HotIf addCommonMacOSisms
#h::WinMinimize( "A" )
#c::^c
#v::^v
#z::^z
#HotIf
; === Mac Keyboard for a Mac User on Windows ============================
;
; Basic: Plugging a Mac keyboard into a windows computer leaves you with certain keys unavailable
; unless you have installed a keyboard layout such
; as http://www.cafe-encounter.net/p84/apple-uk-keyboard-layout-for-windows
;
#HotIf isMacKeyboard
¬::~
"::@
@::"
~::|
#::\
#HotIf
#HotIf isMacKeyboard && isUkKeyboard
+3::#
!+3::£
!+2::€
!+1::¡
#HotIf
; === Extended typography ===================================================
;
; Macs have a load of typographic symbols on the keyboard.
;
#HotIf addMacOsAltTypographicSymbols && andTypographicSymbolsOnAltGrNumberKeys
>!1::¡
>!2::™
>!3::‹
>!4::€ ; used to be ¢ ?
>!5::∞
>!6::§
>!7::¶
>!8::•
>!9::ª
>!0::º
#HotIf
#HotIf isMacKeyboard && not isUkKeyboard && andTypographicSymbolsOnLeftAltShiftNumberKeys
!+3::‹
#HotIf
#HotIf addMacOsAltTypographicSymbols && andTypographicSymbolsOnLeftAltShiftNumberKeys
!+4::›
!+6::fl
!+7::‡
!+8::°
!+9::·
!+0::‚
#HotIf
#HotIf addMacOsAltTypographicSymbols
!-::–
!+-::—
!=::!=
!+=::±
![::“
!+[::”
!]::‘
!+]::’
!;::…
!'::æ
!+'::Æ
!\::«
!+\::»
!,::<=
!+,::¯
!.::>=
;!+.::breve
!/::÷
!+/::¿
!_::—
>!a::å
>!+a::Å
>!b::∫
;!+b::i
>!c::ç
>!+c::Ç
>!d::∂
!+d::Î
>!e::´
>!+e::‰
>!f::ƒ
>!+f::Ï
>!g::©
>!+g::Ì
;!h::overdot
>!+h::Ó
>!i::^
>!+i::È
>!j::δ
>!+j::Ô
>!k::°
>!+k::⌘
>!l::¬
>!+l::Ò
>!m::µ
>!+m::˜
>!n::~
>!+n::ˆ
>!o::ø
>!+o::Ø
>!p::π
>!+p::Π
>!q::œ
>!+q::Œ
>!r::®
>!+r::Â
>!s::ß
>!+s::Í
>!t::†
>!+t::Ê
>!u::¨
>!+u::Ë
>!v::v
;!+v::lozenge
>!w::ε
>!+w::„
>!x::≅
>!+x::Ù
>!y::¥
>!+y::Á
>!z::ω
>!+z::Ω
#HotIf
#HotIf addVulgarFractionsOnAltGrShiftNumberKeys
>!+2::½
>!+3::⅓
>!+4::¼
#HotIf
#HotIf addVulgarFractionsOnBackslashSequence
::1\\2::½
::1\\3::⅓
::1\\4::¼
#HotIf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment