smackbook (SmackPad) and macsaber (ThinkSaber) for thinkpad
By ET
This is a video from YouTube showing how a software called smackBook allows people to switch virtual screens on a MacBook. The idea is very cool, it relies on a new hardware device on MacBook laptops to sense the motion of the laptop.
Another idea is called MacSaber, which gives you the full Jedi Knight experience. Move your Mac from side-to-side or backwards and forwards to duel the foe of your choice.
My 3-year old ThinkPad has the same hardware, it is generally used to prevent the Hard Drive from being hurt by impacts. So, my question is: can I do the same thing with my ThinkPad. It turned out that I can!
Let me first put down the Perl code below.
use Win32API::File qw(:ALL);
use Win32::Sound;
Win32::Sound::Volume('100%');
Win32::Sound::Play("on0.wav");
Win32::Sound::Stop();
my ($meanx,$meany)=(641, 634);
while(1){
my $pos=get_pos(0);
my ($x,$y)=split(/,/,$pos);
print "$xt$yn";
if ( abs($x-$meanx)>5 ){
Win32::Sound::Play("swing2.wav");
Win32::Sound::Stop();
} elsif (($x-$meanx)<-5){
Win32::Sound::Play("swing3.wav");
Win32::Sound::Stop();
} elsif (($y-$meany)>5){
Win32::Sound::Play("hit1.wav");
Win32::Sound::Stop();
} elsif (($y-$meany)<-5){
Win32::Sound::Play("hit4.wav");
Win32::Sound::Stop();
}
sleep(1);
}
sub get_pos {
my $base = shift;
my $file = createFile("//./ShockMgr", "r ke") or die "Can't get ShockMgr device";
DeviceIoControl($file, 0x733fc, [], 0, my($buf), 0x24, my($bytes), []);
my @data = unpack "x4s*", $buf;
return join ",", ($base ? @data[3, 2] : @data[1, 0]);
}
In the above code, you may need to change your “meanx”, “meany”, I suspect that this is different across different laptops. I only included 4 sounds in the list, but you can feel free to add more sounds depending on the subtle changes in position. For convenience, I’m putting the zipped perl code here: sound.zip.
I realized I don’t have a program for whackbook after posting this blog, the main reason is that I don’t really have a good virtual screen application. I’ll post something very cool next time, say, how about navigating through Word or FireFox with tilting your computer?

April 28th, 2007 at 12:46 am
From here: http://www.lenovoblogs.com/insidethebox/?p=55
If you want to play along, below are some instructions of what you need to do. Before you do this, it is important I point out that this is technically not supported by Lenovo or IBM. Hard disk drives are designed to work when the system is stable and are not designed for a system that is constantly moving around. There is a small but measurable chance that doing this might cause the drive to crash and you could lose your data. If you are uncomfortable with the risks, then it is best to leave this alone and just enjoy the videos available online. In all cases, use common sense. Treat your ThinkPad with respect and you should be fine.
1. You need a ThinkPad with an Active Protection System chip built in. The ThinkPad T41 and newer, X40 and newer, all Z series, and R50 and newer all have these built in
2. Go to the following web site http://www.almaden.ibm.com/cs/people/marksmith/sdl.html and read the instructions for enabling your system, plus more of the history behind this project
3. Download the file http://osxbook.com/misc/SDLAccel.zip you will need.
4. Download a compatible game http://www.libsdl.org/games.php from here. There are over 50 available. The research page suggests TuxRacer and NeverBall as good examples. I also suggest that if you are a Tetris fan, that you try Blazetris. As someone who has spent hundreds of hours playing Tetris on the original Nintendo, this is by far my favorite.
5. Using the instructions provided on the site, replace the stock .dll file with the modified file you downloaded in step 3.
6. Have fun!
When playing, I found that I had the sensitivity of the APS sensor set too high and got unpredictable results. You can lower the sensitivity of the APS sensor using the icon in Windows Control Panel called ThinkVantage Active Protection. There is also an icon in your system tray that if you double click it, it will do the same thing. Drag the slider lever for the shock detection sensitivity down to low for the best playing experience. After you are finished playing the game, you should set the slider back to its original position for the best protection for your HDD.
APS Config Screen
Besides games, there are also other ways to use an interface like this. A fashion vendor in Italy is playing around with the idea of having a user walk around a 3D handbag model and control the experience using their ThinkPads.
Another enterprising person has written an API to interface with Google Maps.
SmackPad is an application where you can use the accelerometer to switch between open application windows. Unfortunately, I think it is Linux only at this point. Check out this video of it working on a Mac.
Give these a try and share your experiences with us. Also, if you know of any other applications for this type of technology, feel free to share them too. Have fun, and dont waste too much time at the office.