I created an easy way to enable/disable one of the mice attached to my computer. When VirtualBox is running, that mouse is captured within VB (for my daughter to play with). However, when VB isn't running, I don't want that mouse interfering with my mouse, so I created a batch file to enable and disable it using Microsoft's devcon utility. Unfortunately, the legal way to get it is to download the huge WDK (Windows Driver Kit).

My wife's new HP Envy, which has Windows 8.1, doesn't have a way to disable its touchscreen or touchpad. So I wanted to use a variatoin of my script to do that as well. (In the end, I got the script to work for the touchscreen, but not the touchpad... which is run by a different kind of driver so needs a different method).

Under Windows 8, this worked in a simple batch file:

    devcon.exe enable "USB\VID_046D&PID_C501"

 

I did not even need to elevate to admin priveleges for that to enable/disable the mouse.

I updated to 8.1 last night and the batch file stopped working. Using the same batch file, devcon SAYS it enabled the device (below), but the mouse was actually NOT enabled if I tried to move it around (and vice versa if I enabled it in Device Manager and then tried to disable via devcon... it did not disable). I could enable/disable perfectly fine in the Device Manager GUI.

    USB\VID_046D&PID_C501\5&3514F6C9&0&1                        : Enabled
    1 device(s) are enabled.

 

I made sure I was using the x64 version of devcon on my x64 Windows 8.1. I tried doing it as elevated to admin rights as well as not elevated (both for the batch file and devcon itself). I also tried it in a few different compatibility modes.

I googled and googled and did not find anyone else having an issue with devcon on 8.1 and all of the example I saw matched what I was already doing.

I decided to read through the help screen again, and I saw the restart command. Once I put it after the enable/disable command, it started working. Finally.

    devcon.exe enable "USB\VID_046D&PID_C501"
    devcon.exe restart "USB\VID_046D&PID_C501"

 

The restart command requires elevation to admin rights. So I created two shortcut files to the batch file (one to enable and one to disable) and set the shortcuts to run as administrator. And then I use the shortcuts to run the batch file.
 
Tags

Converting version control repositories from Bazaar to Git (bzr to git)

Bazaar is great on Windows. Several years later, git's tools for Windows still.... (ahem) are lacking or too commercial. However, official development on it has ended and git is so much more popular now. So I think the time has come to convert all my beloved bzr repositories to git.

First we need note some prerequisites:

Adding a hardware clock to Raspberry Pi (DS3231)

The popular clock module is uses the DS1307 real time clock chip, which is not very precise. For just a few dollars more, you can get a module with a much more precise DS3231 RTC chip. The one I got was SunFounder's module from Amazon for $9 (free shipping for Prime). It plugs right onto the Raspberry Pi's 40 pin header and doesn't even interfere with the plastic case I have. I have a Model B, but this module should also work on Model A and Model B+. The instructions refer to DS1307, but the chips use the same I2C commands, so it also works for DS3231.

How to run a PiPresents show when you don't have a Raspberry Pi

PiPresents is some pretty cool software that will run a PowerPoint-like presentation. But with lots more flexibility. It was originally written for the Raspberry Pi.

However.... perhaps someone else has your Pi. Perhaps you don't even have one. It is possible to run a PiPresents show on  your good ol' desktop computer (Windows, Linux, or Mac). Here's how.