Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
spoutnik
Posts: 39
Registered: ‎07-06-2012
My Device: DevAlpha, PlayBook

Multitouch problems

Hi,

I got a simple game kind of app where the user has sort of a joystick and a fire button. The thing is that when you hold down the joystick (custom component - onTouch event listener) and at the same time you hit on the 'fire' button (also a custom component with onTouch listener) the 'fire' button does not receive an onTouch event. 

If you check the cowbell example:

https://github.com/blackberry/Cascades-Samples/tree/master/cowbell

you hold down the bell and you hit the cow at the same time .. there is no mooouuu

I can not figure out how to get this working. Does anyone know?

Thank you,

Toby

Please use plain text.
Super Contributor
JeffLemon
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook

Re: Multitouch problems

I've also just descovered this.

 

Can someone provide an answer?

--------------------------------------------------------------------------------------------------
BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Please use plain text.
Developer
spoutnik
Posts: 39
Registered: ‎07-06-2012
My Device: DevAlpha, PlayBook

Re: Multitouch problems

.. I have not found any solution . The problem persists in Beta 4.

The only thing I can confirm is that it does not seem to be a hardware limitation. If you use 2 standard buttons you can hold one down and press the other one at the same time. It must be related to the custom components.

Please use plain text.
Super Contributor
JeffLemon
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook

Re: Multitouch problems

Could someone from BlackBerry provide the answer, it's really hiderencing my app.

--------------------------------------------------------------------------------------------------
BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Please use plain text.
Super Contributor
JeffLemon
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook

Re: Multitouch problems

Seriously, can someone from BB answer this???

--------------------------------------------------------------------------------------------------
BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Please use plain text.
Contributor
hieupious
Posts: 27
Registered: ‎11-14-2012
My Device: Curve 8900

Re: Multitouch problems

In my opinion, onTouch event cant handle two controls at the same time. So you should think of gesture handler. It can emit multiple signals when its gesture is detected.

Please use plain text.
Super Contributor
JeffLemon
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook

Re: Multitouch problems

Thanks, I've implemented a tap handler by using the code described here:

 

https://developer.blackberry.com/cascades/reference/bb__cascades__taphandler.html

 

TapHandler *pTapHandler = TapHandler::create().onTapped(myImageView, SLOT(onTappedHandler(bb::cascades::TapEvent*)));

	container->addGestureHandler(pTapHandler);

 But it doesnt work:

 

Warning: Object::connect: No such slot bb::cascades::ImageView::onTappedHandler(bb::cascades::TapEvent*) in ../src/app.cpp:161
Warning: Object::connect:  (receiver name: 'myImageView')

 Any idea where I'm going wrong?

--------------------------------------------------------------------------------------------------
BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Please use plain text.
Super Contributor
JeffLemon
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook

Re: Multitouch problems

Nevermind, I've worked it out had the wrong slot name.

--------------------------------------------------------------------------------------------------
BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Please use plain text.
Super Contributor
JeffLemon
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook

Re: Multitouch problems

This solution does not work for me.

 

I need to be able to get the name of the object pressed and to find out if the user has stopped pressing the item.

 

How can I implement this with a tap event?

--------------------------------------------------------------------------------------------------
BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Please use plain text.