Remote Control IV: The Powermate Dial on a remote desktop computer
by, 09-04-2013 at 01:46 PM (1556 Views)
DigiPete inspired me to use one of my drawer-full of Powermate dials in conjunction with my Redeye Remote. (Sadly, Redeye has gone belly-up, but this would work with any remote system that can be triggered by URL commands, or any unix command (via ssh, for example), so it is worth writing up.)
In other words, to control stuff on a remote computer or any IP-controllable device, you don't need anything other than ssh and AppleScript. If you want to control an IR-controlled device (like my Nova), then you need some sort of interface like RedEye or GlobalCache.)
I use them to rotate and translate molecules in 3D with molecular graphics software. They replaced SGI dialboxes I had to pay thousands of dollars for in 1998! This was the first time I tried to do something more elaborate than control volume on a local computer.
The dial has left and right rotation, short press, long press, etc, and each physical action can be accompanied by 0 to 4 modifier keys, so that comes out to something like 20 possible programming modes. Since I want to be able to control volume, mute, FF, and so forth regardless of what I am doing on the remote computer, I programmed this as "global" rather than as an independent action. (You could for example associate it with a particular program like Apple's Screen Sharing app. Obviously, it is simpler if you have it attached to the music server itself, but that's not particularly challenging.)
Each action is governed by a key press, or mouse movement emulation, or a variety of other possibilities including AppleScript commands. The latter pretty much allows you to do anything with the use of the highly flexible "do shell script" command. Anything you can do with a unix command can thus be mapped into the dial functionality. In my case, I use primarily ssh commands to my Mac Mini (the music server) or URL get-type commands to my RedEye (using curl -s), which controls via IR and IP. I can control volume* and everything else on my Nova, and needed functionality on Audirvana and iTunes. Here is what the dial programming interface looks like, highlighting a command that stops audirvana playback, waits 1 second, and then quits the app:
* I programmed the volume control to turn it down fast and up slowly, and a quick tap on the dial pauses the music, so I can take a phone call or talk to the dog.