Sometimes I read webpages or e-books without having my keyboard on me (I don't have a proper desk). If I have a word I want to look up in a dictionary (and this happens quite often as I like to understand every word I read), I need to do acrobatics with the keyboard and type it in and then put the keyboard away again. Not comfortable, and not necessary when you have AHK.
So, I threw together a small script to do this using the mouse. You highlight a word (by double-clicking it) and then middle-click the mouse to look it up in Encarta. This is meant to be running only while you're reading a long document without a keyboard, of course.
I assume this might have already been done, and most probably more elegantly and generically than in my implemention... But anyway, this is my quick little hack for it.
The "IfInString" just checks for a space in the end of the word, because some programs select the trailing space as a part of the word (like Firefox, for instance).
What it does:
1) You double-click the word to mark it
2) Middle-click to look it up
3) Scroll up and down with the mousewheel as usual
4) To flip one defintion backwards in the glossary, press RButton and scroll up. The move one def forward, Rbutton and scroll down
5) To return the mouse to its original position, middle-click again while in the Encarta window.
The mouse wouldn't really return the the exact original position (I have no idea why -- does anyone know? ) but it will be pretty close. It also won't really activate the original window with the click -- I'm not sure why.
Another small quirk is that on my LiteStep system, whenever I get out of the defined workarea for the desktop, the script fires. Really weird. Like it catches an MButton click -- but there's no click, just a mouse move to some off-screen coords. Weird.
Anyway, this is it:
MButton:: IfWinActive,Microsoft Encarta World English Dictionary { CoordMode,Mouse,Screen MouseClick,Left,StartMouseX,StartMouseY,4,0 } IfWinNotActive, Microsoft Encarta World English Dictionary { MouseGetPos,StartMouseX,StartMouseY,StartMouseWin send,^c if %clipboard% { StringRight,EndOfString,clipboard,1 PunctString = " .,!' IfInString,EndOfString,%A_Space% { StringTrimRight,clipboard,clipboard,1 } winactivate,Microsoft Encarta World English Dictionary send,!f^v{ENTER} MouseMove,300,300 } } return ~RButton & WheelUp:: IfWinActive,Microsoft Encarta World English Dictionary { Controlclick,bsbtn1,A,,,2 } return ~RButton & WheelDown:: IfWinActive,Microsoft Encarta World English Dictionary { controlclick,bsbtn2,A } return