View Single Post
Posts: 482 | Thanked: 550 times | Joined on Oct 2010
#1
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:
  1. Download the .zip archive and extract it. You should have two files, client.py and server.py.
  2. In this case, the N900 is the client and the computer is the server. Move client.py onto the N900 and put it somewhere where you know where it is. (I made a folder named Python and put it in there.)
  3. Find out what your computer's local IP address is. Go to System Preferences > Network and it should tell you your IP address.
  4. Open up Terminal on your computer. If you haven't used it before, it is under Applications/Utilities.
  5. Type this into Terminal:
    Code:
    cd Downloads/MouseControl
  6. Now type
    Code:
    python server.py 2000
    (the 2000 is the port it opens, use a different one if neccessary).
  7. The server script is now waiting for input. On the N900, open up Xterm, and type
    Code:
    cd MyDocs/Python
  8. Now to start the service: Type
    Code:
    python client.py abc.def.ghi.jkl 2000
    where abc.def.ghi.jkl is the IP address you found earlier.
  9. Wave the N900 around and watch the mouse move. Flat on the table should put the cursor in the center of the screen. I have it set up so that you point with the USB port end.
  10. To stop the script, press control+c on the computer and both scripts should stop.

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.
Attached Files
File Type: zip MouseControl.zip (2.1 KB, 140 views)
 

The Following 17 Users Say Thank You to skykooler For This Useful Post: