Ticket #69 (closed defect: wontfix)

Opened 3 months ago

Last modified 3 months ago

python binding FLAG_REPEAT_BTN seems defective

Reported by: sander Assigned to: dsmith
Priority: major Milestone:
Component: libcwiid Version: 0.5.02
Keywords: Cc:

Description

using the python bindings to create a Wiimote input plugin for the Elisa media center. My problem is that I enable the FLAG_REPEAT_BTN but it doesn't seem to have any effect. Desired: each call to get_mesg retrieves information about all pressed down buttons. Actual: calls to get_mesg only return information when button state changes.

to reproduce:

import cwiid wii = cwiid.Wiimote() wii.rpt_mode = cwiid.RPT_BTN wii.enable(cwiid.FLAG_MESG_IFC | cwiid.FLAG_REPEAT_BTN | cwiid.FLAG_NONBLOCK)

then call wii.get_mesg() a few times while holding down a button, only the first call actually returns the button info...

Change History

08/26/08 17:54:19 changed by dsmith

  • status changed from new to closed.
  • resolution set to wontfix.

That's actually the way it's supposed to work - FLAG_REPEAT_BTN causes all button messages to be delivered, but it won't fabricate fictitious messages. Since you only have button reporting turned on, only button state changes will trigger messages, so the flag doesn't do anything. However, if you turn on, say accelerometer reporting as well, each received message will contain accelerometer information as well as button information, and since accelerometer state generally changes much faster than button state, there will be runs of many messages containing identical button state. Without FLAG_REPEAT_BTN, button messages will only be reported when they change, but with it, they'll be reported regardless.

For the functionality you want, check Wiimote.state - it always carries the current button state.