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
Contributor
hishamBakr
Posts: 45
Registered: ‎04-11-2012
My Device: Z10 Limited Edition

TouchEvent Down and Up sometimes fire and sometimes not

[ Edited ]

Hello all,

 

bb::cascades::TouchEvent mouse down and mouse up some times fired and some times not

 

here isa a sample of my code

I put imageButton in QML

 

     ImageView {
                         id: imgHand
                         imageSource: "asset:///images/swipe3.png"
                         scalingMethod: ScalingMethod.Fill
            horizontalAlignment: HorizontalAlignment.Center
            verticalAlignment: VerticalAlignment.Center
            onTouch: {
                                _aio.handleTouch(event);
                            }
        }

 

and CPP:

 

void Aio::handleTouch(bb::cascades::TouchEvent* event) {
	if (event->touchType() == TouchType::Move) {
		fprintf(stderr, "Debug:move %f\n", event->windowX());
	} else if (event->touchType() == TouchType::Up) {
		fprintf(stderr, "Debug:up %f\n", event->windowX());
		
	}else if (event->touchType() == TouchType::Down) {
		fprintf(stderr, "Debug:down %f\n", event->windowX());
		
	}
}

 

 

I found that "Up" and "Down" sometimes called and sometimes not.  

 

Please test this on your devixe and let me know if you have the same issue or not.

 

Thank you,

Hisham

When you are young, work to learn. Not to earn !
Please use plain text.