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: 587
Registered: ‎04-01-2009
My Device: Z10, PlayBook
My Carrier: NA

screen_get_event_property and testing in a simulator

I want to be able to click on things in the simulator and get the x/y coordinates, etc.

 

When I click things in the simulator, I get SCREEN_EVENT_POINTER events rather than SCREEN_EVENT_MTOUCH_TOUCH events.

 

I expect I can do:

 

screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_POSITION, ...);

 

But I can't seem to find any documentation that says what type of struct needs to be passed as the last argument.

 

This appears to be the most relevant documentation:

 

https://bdsc.webapps.blackberry.com/native/reference/com.qnx.doc.screen.lib_ref/topic/rscreen_get_ev...

 

... but it doesn't make any indication.

Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: screen_get_event_property and testing in a simulator

my guess is you should use 

screen_get_event_property_pv()

and interpreting results as an array of two long integers.

Highlighted
Developer
Posts: 587
Registered: ‎04-01-2009
My Device: Z10, PlayBook
My Carrier: NA

Re: screen_get_event_property and testing in a simulator

Retired
Posts: 54
Registered: ‎10-26-2011
My Device: Playbook
My Carrier: Rogers

Re: screen_get_event_property and testing in a simulator

When using SCREEN_PROPERTY_POSITION, it expects an array of 2 integers to be passed as the last argument. 

Retired
Posts: 54
Registered: ‎10-26-2011
My Device: Playbook
My Carrier: Rogers

Re: screen_get_event_property and testing in a simulator

Sorry, just realized that SCREEN_PROPERTY_POSITION is to set the position of the window. To get the position, you probably want to get SCREEN_PROPERTY_SOURCE_POSITION. Try that and see how you make out.
Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: screen_get_event_property and testing in a simulator

>When using SCREEN_PROPERTY_POSITION, it expects an array of 2 integers to be passed as the last argument. 

Like:

int x[2];
screen_get_event_property_pv( ev, pname, &x );

 right?