Skip navigation

 

Version 2.0 of this application is available in another post. It has MANY new features and is much more solid than this version. Find the article here:

http://savij.com/2009/12/25/multiple-mouse-speeds-in-windows/

 

As I write this post, I have my laptop with it’s nifty TrackPad (TouchPad). I recently added a BlueTooth mouse to the mix. Ok, so I couldn’t use my mouse with my laptop while sitting on the couch! Where was I to put my mouse? I already own a Belkin lap pad thing to keep the flaming inferno of heat off of my crotch, but still my mouse sat next to me on the couch yearning to be touched. So enter ANOTHER device I got from Logitech. A small platform that I put on top of the Belkin lap pad. My Laptop sits on top of the Logitech platform and it has a pull out mouse pad. FINALLY, I can use my mouse. So I sync the BlueTooth mouse, piece of cake. But I now noticed that the resolution of the mouse is WAY more accurate than the TrackPad. What this means is that while the trackpad works fine, breathing on the mouse causes my pointer to go off the screen at warp factor 5.6. So, I figure, just head off to the control panel and setup both right? WRONG! Windows 7 STILL does not have built in support for more than one pointing device. While this could be a shortcoming of my mouse, it is bluetooth and I should not have to install extra drivers for it. I know you say if I have a mouse, why worry about the damn trackpad at all, but sometimes I am mobile. Sometimes I dont have my mouse with me. After all, one of the things I love about laptops is that I can just grab it and go.

The SOLUTION

I noticed that a lot of people have this problem. I also could not find an easy solution out there. Then I thought, “Stupid ass!” I am a programmer. So I just made one. It is really simple and could use a lot of refinement, but I didnt want this to be a big project. So I threw it together in about an hour and a half.

It uses a call to the API SystemParametersInfo to control the mouse. I did find some help online with it’s implementation. Then I made a little sys-tray app out of it. You can set how ever many devices you want to control. For instance I have a mouse and a trackpad. So I set it to 2 devices. I then adjust the slider for device 1 to set the speed for my mouse. I then change the dropdown to device 2 and set the speed for my trackpad. Then I just minimize the app. It disappears to the sys-tray where I can right click it to switch between the device 1 and device 2 settings. I can also double click it to bring the application window back up. All of the settings get saved in isolated storage and the app installs to the startup folder so it runs when windows starts. YAY!

 

See the link at the top of this post for the latest download. Let me know what you think….

I noticed that a few people are looking at my old blog post for WCF. While that may have been a way to do things, there is a much easier way now. It’s not to say that you still cant do it that way, but in an interest of saving some time. I would like to investigate the built in tools for WCF that comes with Visual Studio 2008. I am using the .net framework 3.5 SP1.

Here are some simple steps to create a wcf service and test project to use it:

1. Open a new vs2008 instace and create a windows project.

2. In that same solution, create a new web site (right click solution, new web site). In that dialog instead of asp.net website choose WCF Service

3. Build the web project (it comes with default wcf interfaces for two services, one is a simple call, and the other uses a composite type to pass back and forth as samples)

4. Add 1 testbox and two buttons to your winform project.

5. Add a service reference to your winform project and click the discover button. Rename your namespace to WCFWebTest. If you want to use aync calls, then click the advanced button on the add servicec reference dialog and select the Gnerate async operations.

6. In the button1 click event add the following code:

Dim oWCFService As New WCFWebTest.ServiceClient

Dim response As String = oWCFService.GetData(TextBox1.Text)

MessageBox.Show(response)

7. In the button 2 click event add the following:

Dim oWCFService As New WCFWebTest.ServiceClient

Dim oCompositeType As New WCFWebTest.CompositeType

oCompositeType.StringValue = "My String Value YAY! "

oCompositeType.BoolValue = True

Dim oCompType As CompositeType = oWCFService.GetDataUsingDataContract(oCompositeType)

MessageBox.Show(oCompType.StringValue)

8. Run the web project (set it as default) and debug the winform project like described in the article.

Viola! That just works with a LOT less work.

Follow

Get every new post delivered to your Inbox.