nearlogic.com

a programmer’s blog

Re-mapping Mouse Commands

While testing the Boxee Windows Alpha, I found the need to right click on my touch-screen.  After finding that none of my fingers would send a right-click, I thought it would be useful have an app that would send a right-click to the active window whenever a double-click was detected.

I couldn’t find any apps that did this, so I started with some global message hooking code written by George Mamaladze, posted on codeproject.com.  A double-click is not something that is sent out as a global message, so you have to track the time and space between clicks on the screen.  I’m sure my double-click detection is not as smart as the one used by the OS, but it does the job.

After that, a SendInput command (user32.dll) is sent out with a right-mouse-button-down, then a right-mouse-button-up, and my temporary solution is complete.  There is no installer, and no settings.  Just a tray icon to allow it to be closed.  To run it on startup, add an icon to your Startup folder in the Start Menu.

Here is the source code (VS C# 2008):  doubletoright_src

Here is the exe file: doubletoright (.NET 2.0 Required)

Next I plan to make a floating window that will work like an on-screen keyboard, but with only the keys I need to access some of the extra features of Boxee.

No comments yet. Be the first.

Leave a reply

Banner