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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 49
Registered: ‎03-27-2013
My Device: z10
My Carrier: Banglalink
Accepted Solution

TouchEvent in Blackberry 10

As far as I know there are four types of Touch Type in Blackberry 10- 1. Down 2. Move 3. Up 4. Cancel

In slot onTouch() I check for these four type of events and do some of my task there. Like below-

 

if (event->isDown())
{
	// implementing my task
}
if (event->isUp())
{
	// implementing my task
}
if (event->isMove())
{
	// implementing my task
}
if (event->isCancel())
{
	// implementing my task
}

 

 

So, what is my problem? While executing some of my task in isUp() codeblock and at the same time I touch the screen. But I am not getting any isDown() event in my code while my isUp() is running. After finishing the task inside isUp() then I get the isDown event.

My target is to get isDown() event while I am touching my screen to stop execution inside isUp().

How can I implement this into Blackberry 10?

Thanks in advance.

 

Highlighted
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: TouchEvent in Blackberry 10

Hi,

A better forum section for this question is Cascades one.

Do not perform lengthy operations in signal handlers. This will block the event processing loop which isn't a good idea.

If you need to wait before performing another action, use a timer (QTimer) to schedule another method to execute later. It's a C++ class and you'll have to export it to QML first.

In case you're performing a CPU intensive calculation, start a new thread for it.

Andrey Fidrya, @zmeyc on twitter
Retired
Posts: 54
Registered: ‎06-26-2012
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: TouchEvent in Blackberry 10

Zmey is rigth, you need to create another thread and send signals to it. You could convert your touch events into
pulses (MsgSendPulse()) to this thread and then do what ever you want in this thread.