Reply
Thread Tools
jldiaz's Avatar
Posts: 48 | Thanked: 40 times | Joined on Apr 2008 @ Spain
#1
Hello,

I've developed a small python script which, when run in an xterm in my n810, connects to my Wiimote, read the events it sends, and maps the wiimote buttons to X-window events, such as keypresses or touchscreen taps. This way, I can control any application from my wiimote.

The mapping "wiimote buttons"->"X-window events" is configurable. My default setup allows for a wide range of applications:

Code:
Wiimote   | Action on N810
----------+---------------------------------------
  Up      |   Up
  Down    |   Down
  Right   |   Right
  Left    |   Left
  A       |   Return
  +       |   Zoom/volume +
  -       |   Zoom/volume -
  1       |   Opens application specific menu
  2       |   Opens desktop "Applications" menu
  B       |   "Mode shift" (see below)
----------+----------------------------------------
 B+Up     |   Fullscreen
 B+Down   |   Close window
 B+Right  |   Open window-list menu
 B+Left   |   Escape
 B+A      |   (not used)
 B++      |   (not used)
 B+-      |   (not used)
 B+1      |   (not used)
 B+2      |   (not used)
I think this opens interesting posibiltiies for audio players. You can connect your nokia to your stereo, and control the playlist, volume, etc. from your wiimote. Although it is also possible to control any other application (mplayer, browser, email, etc.) I cannot see any advantage of using a remote for this (except for the coolness factor), because you need to be anyway close to the n810 in order to read the screen.

At the moment, only the Wiimote buttons are read, the accelerometers information is discarded. It is theoretically possible to use it also, but I cannot think any useful application for it (except, perhaps, shaking the wiimote in order to skip a song, but this, although cool, it is not very comfortable).

Currently, the python script is only a quick&dirty hack, kinda "proof of concept", and it only works with my own Wiimote (because the MAC is hardcoded in the script, but it is easy to change it if you know the MAC of your wiimote). However, I plan to make it evolve into a more friendly application.

I would like to publish the script, for feedback. Which would you consider the more convenient way of publishing it? Should I open a new project in the garage?

Ah, I forgot to mention that you can see a demo of this thing in action in Youtube (click on the image):

__________________
--ル Diaz
 

The Following 2 Users Say Thank You to jldiaz For This Useful Post:
Posts: 393 | Thanked: 112 times | Joined on Jul 2007
#2
Open a new project in garage
 

The Following 2 Users Say Thank You to yabbas For This Useful Post:
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#3
I think cwiid already does that, but multiple projects isn't necessarily bad.
 
jldiaz's Avatar
Posts: 48 | Thanked: 40 times | Joined on Apr 2008 @ Spain
#4
Originally Posted by yabbas View Post
Open a new project in garage
I'll do that. Thanks
__________________
--ル Diaz
 
jldiaz's Avatar
Posts: 48 | Thanked: 40 times | Joined on Apr 2008 @ Spain
#5
Originally Posted by Benson View Post
I think cwiid already does that, but multiple projects isn't necessarily bad.
It is not exactly the same goal. As far as I know, cwiid is aimed to provide an interface between wiimote and applications, by creating gamepad and mouse devices which can be read from applications. It requires to install some device controllers through kernel modules. Therefore, the use of the wiimote is restricted to applications which are able to get the input from these device drivers (mostly games and console emulators, I assume).

My goal, instead, is to provide a simple and configurable mean for assigning "macros" to wiimote buttons, without installing any driver or kernel module. Only pure python. These macros can be any sequence of X-window events (keypresses, key releases, mouse movements, stylus taps...). This allows us to control any arbitrary application through the wiimote, even if the app is not joypad-capable.

For example, I want to use the wiimote to control vagalume, using the UP key to mark a track as loved, and the DOWN key to mark a track as banned. Marking a song as loved in vagalume requires, first to tap on the "heart" button (or to press the Ctrl-L accelerator), and then tap on the "OK" button in the confirm dialog (or hit Return). With my script I can assign this sequence of user inputs to the Wiimote UP button, by assigning it the sequence of strings: "k C-L", "k Return" ("k" stands for "keystroke"), or, alternatively, the sequence of strings "t 330 390", "k Return" ("t" stands for "tap with stylus at coordinates...").
__________________
--ル Diaz

Last edited by jldiaz; 2008-04-11 at 23:41. Reason: Fixing typos
 

The Following 2 Users Say Thank You to jldiaz For This Useful Post:
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#6
I thought cwiid did keys and stuff, too; either way, this is a lighter solution, so where it works, it may well be the best choice.
 
Underscore's Avatar
Posts: 276 | Thanked: 74 times | Joined on Feb 2008 @ Missouri, USA
#7
Ummm, awesome. Do you realize how awesome this will be when they release noBounds? Portable media player controlled by Wiimote. Yes please.
 

The Following User Says Thank You to Underscore For This Useful Post:
El Amir's Avatar
Posts: 487 | Thanked: 152 times | Joined on Aug 2007 @ London, UK
#8
Cant wait for this to get released!!

http://www.engadget.com/2008/02/13/e...bile-joystick/

Now were talking "mobile solutions"
__________________
Follow me on twitter HERE!

Applications I've made:
- Vuvuzela
- LTM: London Tube Map
 
jldiaz's Avatar
Posts: 48 | Thanked: 40 times | Joined on Apr 2008 @ Spain
#9
Ok. My project was approved for inclusion in the garage, and I have uploaded the pre-alpha version.

There are no releases yet, but you can get the relevant files from the SVN repository, in case you feel like playing with it. Despite the pre-alpha stage, it is fully functional (at least for me!) If it does not work for you, please report.

I've written a bare documentation, enough to get the demo running, and even to customize the button-action mapping. Python knowledge is not required :-)
__________________
--ル Diaz
 
Posts: 1,038 | Thanked: 737 times | Joined on Nov 2005 @ Helsinki
#10
Man, this seems like the very best project for a long long time. I am so sorry now that I left my n810 at work.

The download link is in here:
https://garage.maemo.org/frs/?group_...elease_id=1735

Now, It would really rock if you could have a UI for making the pairing between the wiimote and the device.

Anyway, I'll definitely try out this thing tomorrow. Kudos jldiaz!
 
Reply


 
Forum Jump


All times are GMT. The time now is 20:56.