I adapted this script to
use the "Scroll Lock" key as the modifier (instead of the spacebar,
so it wouldn't affect my normal typing speed). I mapped my mouse's "back" thumb button to "Scroll Lock", and added some code to the script to make it
application sensitive (the thumb by itself gives me an Esc in AutoCAD, or my mouse's default "browser back" in IE - I'd gotten used to using the "back" and "forward" buttons while browsing).
FYI, I use a Logitech Mx500
Below is my script - you can modify it to suit your needs (for example, I type "6" with my left index finger instead of the "standard" right index, so I use 5 & 6 for symbols). I'm also
not finished mapping T, Y, & Tab to [, ], and \ (I stretch my left index to Y when using one hand).
Install AutoHotkey, map your mouse's thumb button to "Scroll Lock", and run the script. If you like it, add the script to your Startup items so it will always be running when you log in.
Code:
; This version by Lionel J. Camara
; Last updated: 9/8/05
;
; Assigned mouse's thumb button (Logitech Mx500) to Scroll Lock.
; Thumb button is an Esc in AutoCAD or Browser Back in most else.
; Thumb button is also the modifier access the right-side keys.
;
; Note: currently only flips one way (use left hand on keyboard)
;
; Sometimes the ScrollLock gets "stuck" on when locking/unlocking the workstation.
; To fix: Ctrl-ScrollLock toggles
; Many thanks to Chris for helping me out with this script.
SetStoreCapslockMode Off ; Allows Capslock to be ON to send remapped keys in uppercase.
; number row (change)
mirror_1 = 0
mirror_2 = 9
mirror_3 = 8
mirror_4 = 7
;mirror_5 = 6
mirror_5 = -
;mirror_6 = = ;is there a way to do this? I tried '= and {=}
; top row
mirror_q = p
mirror_w = o
mirror_e = i
mirror_r = u
;mirror_t = y
; need others
; home row
mirror_a = `;
mirror_s = l
mirror_d = k
mirror_f = j
mirror_g = h
; need others
; bottom row
mirror_z = /
mirror_x = .
mirror_c = ,
mirror_v = m
mirror_b = n
; right-hand side - for completeness (no need)
;mirror_6 = 5
;mirror_7 = 4
;mirror_8 = 3
;mirror_9 = 2
;mirror_0 = 1
;mirror_y = t
;mirror_u = r
;mirror_i = e
;mirror_o = w
;mirror_p = q
;mirror_h = g
;mirror_j = f
;mirror_k = d
;mirror_l = s
;mirror_n = b
;mirror_m = v
return
; This key may help, as the space-on-up may get annoying, especially if you type fast.
;Control & NumpadLeft::Suspend
; These keys are optional, but they may help if you are typing on the left-hand side.
;CapsLock::Send, {BackSpace}
;Space & CapsLock::Send, {Enter}
; If spacebar didn't modify anything, send a real space keystroke upon release.
;NumpadLeft::
;Send {NumpadLeft}
;return
; For if you forget modifier (and makes quicker/easier to use):
Shift & CapsLock::Send, {"}
ScrollLock & `::Send, {BackSpace}
;ScrollLock & CapsLock::Send, {'} ;DOESN'T HANDLE " (WITH SHIFT)
;THIS HANDLES SHIFT (AND OTHER MODIFIERS):
ScrollLock & CapsLock::
MirrorKey = '
Modifiers =
GetKeyState, state1, LWin
GetKeyState, state2, RWin
state = %state1%%state2%
if state <> UU ; At least one Windows key is down.
Modifiers = %Modifiers%#
GetKeyState, state1, Control
if state1 = D
Modifiers = %Modifiers%^
GetKeyState, state1, Alt
if state1 = D
Modifiers = %Modifiers%!
GetKeyState, state1, Shift
if state1 = D
Modifiers = %Modifiers%+
Send %Modifiers%{%MirrorKey%}
return
;Couln't figure out how to set a varable to the "=" key, so use this instead:
ScrollLock & 6::
Modifiers =
GetKeyState, state1, LWin
GetKeyState, state2, RWin
state = %state1%%state2%
if state <> UU ; At least one Windows key is down.
Modifiers = %Modifiers%#
GetKeyState, state1, Control
if state1 = D
Modifiers = %Modifiers%^
GetKeyState, state1, Alt
if state1 = D
Modifiers = %Modifiers%!
GetKeyState, state1, Shift
if state1 = D
Modifiers = %Modifiers%+
Send %Modifiers%{=}
return
;ScrollLock::
;IfWinNotActive, AutoCAD
;{
;Send, !{NumpadLeft}
; return
;}
;Send, {esc}
; return
ScrollLock::
IfWinActive, AutoCAD
{
Send, {esc}
return
}
IfWinActive, Microsoft Excel
{
Send, {esc}
return
}
IfWinActive, Save Drawing As
{
Send, !2
return
}
IfWinActive, Save a file
{
Send, {backspace}
return
}
Send, !{NumpadLeft}
return
; number row
ScrollLock & 1::
ScrollLock & 2::
ScrollLock & 3::
ScrollLock & 4::
ScrollLock & 5::
; top row
ScrollLock & q::
ScrollLock & w::
ScrollLock & e::
ScrollLock & r::
;ScrollLock & t::
; home row
;ScrollLock & CapsLock::
ScrollLock & a::
ScrollLock & s::
ScrollLock & d::
ScrollLock & f::
ScrollLock & g::
; bottom row
ScrollLock & z::
ScrollLock & x::
ScrollLock & c::
ScrollLock & v::
ScrollLock & b::
; right side
;ScrollLock & `;::
;ScrollLock & ,::
;ScrollLock & .::
;ScrollLock & /::
;ScrollLock & 6::
;ScrollLock & 7::
;ScrollLock & 8::
;ScrollLock & 9::
;ScrollLock & 0::
;ScrollLock & y::
;ScrollLock & u::
;ScrollLock & i::
;ScrollLock & o::
;ScrollLock & p::
;ScrollLock & h::
;ScrollLock & j::
;ScrollLock & k::
;ScrollLock & l::
;ScrollLock & n::
;ScrollLock & m::
; Determine the mirror key, if there is one:
;if A_ThisHotkey = space & `;
; MirrorKey = a
;else if A_ThisHotkey = space & ,
; MirrorKey = c
;else if A_ThisHotkey = space & .
; MirrorKey = x
;else if A_ThisHotkey = space & /
; MirrorKey = z
;if A_ThisHotkey = space & CapsLock
; MirrorKey = '
;else ; To avoid runtime errors due to invalid var names, do this part last.
{
StringRight, ThisKey, A_ThisHotkey, 1
StringTrimRight, MirrorKey, mirror_%ThisKey%, 0 ; Retrieve "array" element.
if MirrorKey = ; No mirror, script probably needs adjustment.
return
}
Modifiers =
GetKeyState, state1, LWin
GetKeyState, state2, RWin
state = %state1%%state2%
if state <> UU ; At least one Windows key is down.
Modifiers = %Modifiers%#
GetKeyState, state1, Control
if state1 = D
Modifiers = %Modifiers%^
GetKeyState, state1, Alt
if state1 = D
Modifiers = %Modifiers%!
GetKeyState, state1, Shift
if state1 = D
Modifiers = %Modifiers%+
Send %Modifiers%{%MirrorKey%}
return