Skip to content

Categories:

Forum

Guest  

Show or hide header
Welcome Guest, posting in this forum require registration.




Mission: Cognition » wiiusecpp / pywii » General » CButtonBase::isHeld Functionalllity

Pages: [1]
Author Topic: CButtonBase::isHeld Functionalllity
dMaggot
Member
Posts: 1
Post CButtonBase::isHeld Functionalllity
on: July 28, 2009, 11:06

Hello friends, first of all nice job you did on this library. I was searching the web for a good Cpp library or wrapper and this one was defenitely it. I’m right now doing the tests to get up to speed with the API yet I have a great need to use holding detection and it doesn’t look like CButtonBase::isHeld does that for me, what does it do? and how do I do holding detection besides the obvious isPressed – isReleased approach?

Thanks for the help!

jt
Moderator
Posts: 4
Post Re: CButtonBase::isHeld Functionalllity
on: August 31, 2009, 10:52

dMaggot-

First I’d like to welcome you and sincerely apologize for not replying sooner. I was under the misapprehension that as a forum moderator I”d be emailed if somebody posted. And after the first month or so of no activity I think I just stopped looking very carefully for activity.

Hopefully you figured out the solution to your problem on your own but If not let me make an attempt to help. Here is a link which discusses how the button functions are supposed to work in the wiiuse c library: http://www.wiiuse.net/?nav=api#buttons . I created my own test by modifying the example program and each of the four button functions (isPressed, isJustPressed, isHeld, isReleased) all worked as documented in the wiiuse.net link above. However there is one large caveat which I think is what messed you up. A button being held does not generate an event.

What this means is that if you do not have something regularly generating events like an accelerometer you will only see a sequence of two events regardless of how long you hold the button:
pressed / justpressed in the first event (the held flag is not set yet)
released in the second event (and obviously the held flag is not set anymore)

During the entire time between the two events both the pressed and held flags are sent but you would have to poll them manually, not in the event hanlder (from the example). Tracking the hold state on your own using just pressed and release from the event loop may be more suitable for you.

Again, I’m sorry for the long delay. It sounds like you were on the right track so I hope this did not discourage you too much.

JT

Pages: [1]
WP-Forum by: Fredrik Fahlstad, Version: 2.3
Page loaded in: 0.032 seconds.
>

Posted in Uncategorized.

0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.