Monday, 2 November 2009

Mac-like keyboard switcher in Windows

As I use english and russian keyboard layouts both in XP and Mac OS, I've designed the following AutoHotKey script to enable Alt-Space layout switching in Windows XP:

-----8<-----
!Space::
SetKeyDelay, 1, 1, Play

; For Control-Shift layout combination
SendPlay, {CTRLDOWN}{SHIFTDOWN}{SHIFTUP}{CTRLUP}

; For Alt-Shift layout combination
;SendPlay, {ALTDOWN}{SHIFTDOWN}{SHIFTUP}{ALTUP}
-----8<-----

What it does -- it waits for Alt-Space and then sends combination of the keystrokes into Windows, so it mimic either Control-Shift or Alt-Shift.

Enjoy! :-)

No comments: