8

I'm using a MacBook Pro running Windows 7 under bootcamp. I'm used to switching between Mac kb / MacOS X software and Windows kb / Windows software but the crazy mixup of Mac kb / Windows software forces me to think think with every keystroke.

I had the idea to remap the Cmd key to Ctrl (as I mapped the Capslock key to Ctrl, which I like on any OS, Windows, Mac or Linux) but then Cmd+Tab would be wrong.

Any recommendations to do the following customization?

  • Cmd+Tab goes to Alt+Tab
  • Cmd+Right-Arrow goes to End
  • Cmd+Left-Arrow goes to Home
  • Cmd+Up-Arrow goes to PgUp
  • Cmd+Up-Arrow goes to PgDn
  • all other Cmd+ goes to Ctrl+

I think this sort of key layout would save my sanity, but I want some as reliable as completely remapping Win-key to Ctrl-key with a small number of exceptions.

Any ideas? Should I just dive in with Autohotkey, my old standby, or is there something more reliable that doesn't require an explicit list of keys -- and remembering to start up my AHK script after each reboot?

2 Answers 2

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

2
  • 1
    You may want to format your answer. When you edit it, in the right side there is small box telling about formatting. You can use four spaces in the beginning of the line to quote your code meaningfully, and backticks (`) around filenames and commands to quote those.
    – Olli
    Mar 3, 2011 at 5:35
  • Thank you for the Command-Tab combination, you are my savour dear sir!
    – Art
    May 2, 2012 at 0:29
4

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
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .