blino's website

Free software developer and more

I finally bought my own Wiimote (and a cheap bluetooth adapter), I am thus ready for more fun ;-) For example, I can now play TORCS using the Wiimote as a wheel!


Wiimote-torcs
Uploaded by blino

By patching latest WMD with the patch pigeon made for Fligthgear, the Wiimote can be used as a classical joystick in Linux (using a /dev/js0 device).

Only a minor modification was required to pick other axis as events sources, since the Wiimote is not handled the same way as a wheel as it was when used as a joystick (with Fligthgear).

Then, the joystick needs to be calibrated using jscal -s /dev/js0. I have also packaged the jscalibrator joystick calibration utility, but it does not seem to handle the "joystick" center correctly.

The WMD patch send events through the uinput interface (user input), and just specifying in uinput that we support EV_ABS and ABS_X makes the joydev module automatically use the uinput device as a joystick, thanks to this code in drivers/input/joydev.c:

static struct input_device_id joydev_ids[]= {
        {
                .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_ABSBIT,
                .evbit = { BIT(EV_ABS) },
                .absbit = { BIT(ABS_X) },
        },
...
MODULE_DEVICE_TABLE(input, joydev_ids);

In cooker, I have also updated CWiid to version 0.3.00 (with IR support). The next Mandriva release will probably be Wiimote-ready for real \o/



Comments are closed for this story.

Trackbacks are closed for this story.

blosxom Optimised for standards.
Olivier Blin (2005)