Home » U++ Library support » U++ Widgets - General questions or Mixed problems » How can I detect Button press / release
Re: How can I detect Button press / release [message #29487 is a reply to message #29486] |
Sat, 23 October 2010 20:20 |
|
jerson wrote on Sat, 23 October 2010 18:22 | Can someone point me to a callback for button which does the following
WhenPush - I know this one
WhenRelease - does this exist?
|
Hi Jerson,
WhenAction is called when the mouse button is released above the button widget. If you also need to detect when user moves the mouse pointer out of the widgets area (which you probably want, otherwise your I/O pin would stay in high state), then you can either inherit from Button and overwrite MouseLeave() to take care of that. Other solution (without making your own class) might be some ugly use of WhenRepeat with timecallbacks setting turning the state of pin after some time unless another WhenRepeat is called, but that would be ugly and error prone.
Best regards,
Honza
|
|
|
Goto Forum:
Current Time: Fri May 17 23:16:02 CEST 2024
Total time taken to generate the page: 0.01479 seconds
|