![]() |
[Announce] Accelerometer Mouse Control
1 Attachment(s)
I don't know whether anybody has done this yet, but I got inspired by the mouse in my friend's Wii and decided to write a program to allow me to do the same with my N900. Currently I only have a OSX version of the script, because I won't have access to a Linux or Windows computer until this evening and there doesn't seem to be any cross-platform way to move the mouse pointer.
Note that this will only work if you connect your N900 to the same Wifi network as your computer! To Use:
Please tell me what you think! I know I really should make it threaded to smooth the movement but I hate threading, I will work on that though. |
Re: [Announce] Accelerometer Mouse Control
1 Attachment(s)
Update: Now with threading. Mouse moves much more smoothly. However, I get some errors in terminal about a pool not released which I don't understand. It says it may be leaking memory but I don't see that - I let it run and the memory consumption didn't go up. And does anybody know how to stop a threaded program? Control+c doesn't work reliably, I sometimes have to kill it by closing the window. Use threaded version at your own risk.
|
Re: [Announce] Accelerometer Mouse Control
Quote:
Best way imho would be to emulate mouse device like bluemaemo. |
Re: [Announce] Accelerometer Mouse Control
1 Attachment(s)
I looked over the pymouse code, and rather than making users have to install it first I simply integrated it into my app. Here is the new version: it is threaded, hopefully cross-platform, and mouse movement is now very smooth. Unfortunately, it is still rather hard to kill, I don't know why. I will look into that.
|
Re: [Announce] Accelerometer Mouse Control
1 Attachment(s)
The system is now very usable, I have been using it instead of my mouse for the last 15 minutes. I still need to implement clicking though. I now have the ability to stop it however: to terminate it at any time, press control+D.
|
Re: [Announce] Accelerometer Mouse Control
Could anybody tell me whether this works on Linux or Windows?
|
Re: [Announce] Accelerometer Mouse Control
You need python2 and python-xlib packages to run it under linux. The cursor seems to go up when I want it to go down and down when I want it to go up, otherwise it seems to work.
|
Re: [Announce] Accelerometer Mouse Control
Quote:
Code:
x = (lx*8+(average(l3x)/800.0+0.5)*height)/9Code:
x = (lx*8+(average(l3x)/(-800.0)+0.5)*height)/9I should add a command line flag for that. |
Re: [Announce] Accelerometer Mouse Control
Quote:
|
Re: [Announce] Accelerometer Mouse Control
1 Attachment(s)
I added the command line flags --fx and --fy to flip the x and y axes, respectively. Using both is equivalent to turning the phone around.
Quote:
Meanwhile, I will try and add some buttons so that you can click and scroll. |
| All times are GMT. The time now is 04:00. |
vBulletin® Version 3.8.8