Thursday, November 1, 2007

Use middle mouse button for OK outside of NX


I sometimes catch myself hitting the middle mouse button to hit OK and see that nothing ever happens because it's not NX I'm using! This surely is because of the time I spend in NX, but why cannot we use this in say, Options dialog of Internet Explorer ?

Here's a quick solution I've managed to compile. Download this small executable, and it will stay on your traybar waiting for your middle-click. If you hold it longer than 20 milliseconds (which is slightly longer than a single click for most people) it will find the OK button in the active dialog/window and hit it. Also, you can use CTRL+midbutton for Apply.

It has no options yet, but I'll add a few when I have some spare time. Drop me a line if you would like the source file as well…

5 comments:

Anonymous said...

hakan, good work! how can i set it to launch automatically ?

Hakan Sonmezler said...

well, there's not an option for that (yet). You can create a shortcut in your Start/Programs/Startup folder.

Unknown said...

Hakan, Nice program (Nice blog). I would like to have a look at the source.
Thanks.
Patrick

Hakan Sonmezler said...

Patrick,

Here's the source code for the script : (You'll need AutoHotKeys application to be able to run or compile it)

~MButton::
HowLong = 0
Loop
{
HowLong ++
Sleep, 10
GetKeyState, MButton, MButton, P
IfEqual, MButton, U, Break
}


IfLess, Howlong,20, Return
IfGreater, Howlong,20
{

IfWinActive, NX
return

IfWinActive, ahk_class MozillaUIWindowClass
return


IfWinActive, ahk_class ExploreWClass
return


IfWinActive, ahk_class IEFrame
return


send {ENTER}
return
}

Anonymous said...

The program caught my eye too:)I know you put big effort on this blog. Congratulations.