hack ThinkPad shockmgr from Perl

miyagawa on 2006-06-13T12:58:30

If anybody has ThinkPad with HDAPS support and ActivePerl installed, try this script.

The script goes in a loop to check if your ThinkPad laptop is moved, by opening its ShockMgr device with Perl. You need Win32API-File package to run the script (ppm install Win32API-File). That means, when you lean/move/smack your laptop, it says "MOVED!" on STDOUT. Very cool.


Cool

SuperCruncher on 2006-06-14T08:04:58

Just tried this on my R52 now - works nicely. Experimenting with $depth and $threshold is quite interesting too. I'm wondering if you can get any other information beyond the X and Y coordinates.

I think this could be quite useful as a CPAN module.

Re:Cool

miyagawa on 2006-06-14T08:08:03

That'd be great. Can you also try This? It turns your ThinkPad into a lightsaber. If you run from ActivePerl, you need Win32API::File, Win32::GUI and Win32::Sound. The svn repository has .exe file as well.

Yeah, I'll definitely make it a CPAN module. I'm not sure if we can get more information than the X Y coordinate. Needs more reverse engineering.

Re:Cool

jmm on 2006-06-17T14:03:53

Hmm, if the X and Y values are reasonably accurate, you can use that as a left-right up-down pair of scroll wheels. Imagine that the display of the laptop is a magnifying glass and you just move it around to have the image move "underneath" it. (I once proposed that concept for a Linux on a watch, you don't need a separate mouse, you just move your arm around.

bad link

elwarren on 2006-06-14T21:40:49

I'd like to try this on my X40 but the link is dead :-(

Now you can be cool like Erling Ellingsen…

Aristotle on 2006-06-16T07:52:19

…and make your own Smackbook Pro style hack.

Re:Now you can be cool like Erling Ellingsen&#8230

miyagawa on 2006-06-16T10:36:19

Yeah, I did this: control Google Maps via Tilt. Pretty nice, eh?

Re:Now you can be cool like Erling Ellingsen&#

Aristotle on 2006-06-16T12:21:14

Neat!