02-18-2013 03:02 AM
Hi,
I have overriden a onTouch event for my container. What I want basically
is to respond to "clicks" on my container (just like button clicks). How
to achieve similar functionality to a "click" using the onTouch????
I mean how to know, using an onTouch, that an action similar to "click" has occured???
When I have purely
onTouch { .. some action ... }I think this gets called twice, once when the user clicks the container area, and second time, once the user
releases the mouse button.
02-18-2013 03:09 AM
Hi,
here is the reference for onToch with some sample codes:
http://developer.blackberry.com/cascades/documenta
cheers,
chriske
02-18-2013 03:56 AM
What about using the TapHandler as a gestureHanlder on your container ... works fine for my usecase.
Container{
gestureHandlers: [
TapHandler {
onTapped: {
... some action ...
}
}
}
]
}
02-18-2013 04:01 AM
02-18-2013 04:18 AM
As far as i'm aware, there is no "up" or "down" state like you have with the onTouch (cfr your calling twice of the event), but do correct me if i'm wrong ("new" developer on this OS).
More info can be found here: http://developer.blackberry.com/cascades/documenta
You can also add DoubleTapHandlers and LongPressHandlers to differentiate various scenario's/gestures.
02-18-2013 08:12 AM
Hi,
These events can be differentiated:
onTouch: {
if (event.isDown()) {
// ...
}
}