MacBook Pro / Windows 7 : remap Cmd key to Ctrl, except Cmd+Tab to Alt+Tab

Solution 1:

#SingleInstance force

#r::Send ^r ;reload
#z::Send ^z ; undo
#y::Send ^y ; redo
#f::Send ^f ; find inside apps
#c::Send ^c ; copy
#x::Send ^x ; cut
#v::Send ^v ; paste
#a::Send ^a ; select all
#t::Send ^t ; new tab in browser (IE, Safari, Firefox, etc)
#s::Send ^s ; save inside apps
LWin & Tab::AltTab ; the motherlode, alt-tab!

#Up::Send {PgUp} ; PgUp
#Down::Send {PgDn} ; PgDown
#Left::Send {home} ; Home
#Right::Send {end} ; End
#LButton::^LButton

•all other Cmd+ goes to Ctrl+

I don't know about that, is it possible or not, but most common options should be covered with that script

P.S You can set AutoHotkey to start automatically when windows starts, like any other program on windows - just copy a shortcut to AutoHotkey to folder

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup"

If you are running windows on virtualbox not with bootcamp, then remeber to change your "Host" key from Left Command to Right Command (from Virtualbox (NOT Virtualbox VM) menu "VirtualBox"->"Preferences"->"Input") to make those shortcuts work

Solution 2:

I'm also using an Apple keyboard with Windows 7 and I think it might be useful to share the setup I'm using to map OS X shortcuts. The below AutoHotKey script has the following features:

  • Command key sends control, alt key sends alt, control key sends Windows key
  • Important OS X shortcuts work, including command-tab and command/alt arrows to move around text
    • Shift-command and shift-alt with arrows also does the text motions with selection
  • Command-click works
  • You can toggle between Apple keyboard mode and normal PC keyboard mode with key location and shortcuts intact. I did this since I'm using this on a laptop and the default mapping on my laptop keyboard is different from the mapping on the Apple keyboard. The current key to toggle is F10, but of course you can change this.

I know it seems like there should be an easier method than specifying each key combination individually, but trying to remap the modifier keys themselves leads to all sorts of issues and I don't think it's possible to achieve the same effect that way.


Mode := "Desktop"

F10::    ;This is the hotkey that toggles modes
If Mode = Desktop
{
Mode := "Mobile"
}
else
{
Mode := "Desktop"
}
return

#If (Mode = "Desktop")

; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;;;Maps Control to Windows;;;
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

^Left::SendInput #{Left}
^Right::SendInput #{Right}
^Up::SendInput #{Up}
^Down::SendInput #{Down}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;Maps Command (Windows Key) to Control;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

LWin & Tab::AltTab ; Command-tab

#LButton::SendInput ^{LButton} ; Left mouse button
#RButton::SendInput ^{RButton} ; Right mouse button

#Left::SendInput {Home} ; Command left
#Right::SendInput {End} ; Command right

#+Left::SendInput, +{Home} ; Shift-command left
#+Right::SendInput, +{End} ; Shift-command right

#Up::SendInput ^{Home} ; Command up
#Down::SendInput ^{End} ; Command down

#+Up::SendInput ^+{Home} ; Shift-command up
#+Down::SendInput ^+{End} ; Shift-command down

!Left::SendInput, ^{Left} ; Alt left
!Right::SendInput, ^{Right} ; Alt right

!+Left::SendInput, ^+{Left} ; Shift-alt left
!+Right::SendInput, ^+{Right} ; Shift-alt right

; All alpha-numerics
#a::SendInput ^a
#b::SendInput ^b
#c::SendInput ^c
#d::SendInput ^d
#e::SendInput ^e
#f::SendInput ^f
#g::SendInput ^g
#h::SendInput ^h
#i::SendInput ^i
#j::SendInput ^j
#k::SendInput ^k
#l::SendInput ^l
#m::SendInput ^m
#n::SendInput ^n
#o::SendInput ^o
#p::SendInput ^p
#q::SendInput ^q
#r::SendInput ^r
#s::SendInput ^s
#t::SendInput ^t
#u::SendInput ^u
#v::SendInput ^v
#w::SendInput ^w
#x::SendInput ^x
#y::SendInput ^y
#z::SendInput ^z
#0::SendInput ^0
#1::SendInput ^1
#2::SendInput ^2
#3::SendInput ^3
#4::SendInput ^4
#5::SendInput ^5
#6::SendInput ^6
#7::SendInput ^7
#8::SendInput ^8
#9::SendInput ^9

#Esc::SendInput ^{Esc}


;;;SHIFT-COMMAND;;;
#+a::SendInput ^+a
#+b::SendInput ^+b
#+c::SendInput ^+c
#+d::SendInput ^+d
#+e::SendInput ^+e
#+f::SendInput ^+f
#+g::SendInput ^+g
#+h::SendInput ^+h
#+i::SendInput ^+i
#+j::SendInput ^+j
#+k::SendInput ^+k
#+l::SendInput ^+l
#+m::SendInput ^+m
#+n::SendInput ^+n
#+o::SendInput ^+o
#+p::SendInput ^+p
#+q::SendInput ^+q
#+r::SendInput ^+r
#+s::SendInput ^+s
#+t::SendInput ^+t
#+u::SendInput ^+u
#+v::SendInput ^+v
#+w::SendInput ^+w
#+x::SendInput ^+x
#+y::SendInput ^+y
#+z::SendInput ^+z
#+0::SendInput ^+0
#+1::SendInput ^+1
#+2::SendInput ^+2
#+3::SendInput ^+3
#+4::SendInput ^+4
#+5::SendInput ^+5
#+6::SendInput ^+6
#+7::SendInput ^+7
#+8::SendInput ^+8
#+9::SendInput ^+9

#+Esc::SendInput ^+{Esc}

F9::MsgBox, Desktop

#If (Mode = "Mobile")

; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;;;Maps Control to Windows;;;
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

^Left::SendInput #{Left}
^Right::SendInput #{Right}
^Up::SendInput #{Up}
^Down::SendInput #{Down}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;Maps Command (Windows Key) to Control;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

!LButton::SendInput ^{LButton} ; Left mouse button
!RButton::SendInput ^{RButton} ; Right mouse button

!Left::SendInput {Home} ; Command left
!Right::SendInput {End} ; Command right

!+Left::SendInput, +{Home} ; Shift-command left
!+Right::SendInput, +{End} ; Shift-command right

!Up::SendInput ^{Home} ; Command up
!Down::SendInput ^{End} ; Command down

!+Up::SendInput ^+{Home} ; Shift-command up
!+Down::SendInput ^+{End} ; Shift-command down

#Left::SendInput, ^{Left} ; Alt left
#Right::SendInput, ^{Right} ; Alt right

#+Left::SendInput, ^+{Left} ; Shift-alt left
#+Right::SendInput, ^+{Right} ; Shift-alt right

; All alpha-numerics
!a::SendInput ^a
!b::SendInput ^b
!c::SendInput ^c
!d::SendInput ^d
!e::SendInput ^e
!f::SendInput ^f
!g::SendInput ^g
!h::SendInput ^h
!i::SendInput ^i
!j::SendInput ^j
!k::SendInput ^k
!l::SendInput ^l
!m::SendInput ^m
!n::SendInput ^n
!o::SendInput ^o
!p::SendInput ^p
!q::SendInput ^q
!r::SendInput ^r
!s::SendInput ^s
!t::SendInput ^t
!u::SendInput ^u
!v::SendInput ^v
!w::SendInput ^w
!x::SendInput ^x
!y::SendInput ^y
!z::SendInput ^z
!0::SendInput ^0
!1::SendInput ^1
!2::SendInput ^2
!3::SendInput ^3
!4::SendInput ^4
!5::SendInput ^5
!6::SendInput ^6
!7::SendInput ^7
!8::SendInput ^8
!9::SendInput ^9

!Esc::SendInput ^{Esc}


;;;SHIFT-COMMAND;;;
!+a::SendInput ^+a
!+b::SendInput ^+b
!+c::SendInput ^+c
!+d::SendInput ^+d
!+e::SendInput ^+e
!+f::SendInput ^+f
!+g::SendInput ^+g
!+h::SendInput ^+h
!+i::SendInput ^+i
!+j::SendInput ^+j
!+k::SendInput ^+k
!+l::SendInput ^+l
!+m::SendInput ^+m
!+n::SendInput ^+n
!+o::SendInput ^+o
!+p::SendInput ^+p
!+q::SendInput ^+q
!+r::SendInput ^+r
!+s::SendInput ^+s
!+t::SendInput ^+t
!+u::SendInput ^+u
!+v::SendInput ^+v
!+w::SendInput ^+w
!+x::SendInput ^+x
!+y::SendInput ^+y
!+z::SendInput ^+z
!+0::SendInput ^+0
!+1::SendInput ^+1
!+2::SendInput ^+2
!+3::SendInput ^+3
!+4::SendInput ^+4
!+5::SendInput ^+5
!+6::SendInput ^+6
!+7::SendInput ^+7
!+8::SendInput ^+8
!+9::SendInput ^+9

!+Esc::SendInput ^+{Esc}

F9::MsgBox, Mobile