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
dbigham
Posts: 496
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.

Please use plain text.
Developer
BGmot
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.

Please use plain text.
Developer
dbigham
Posts: 496
Registered: ‎04-01-2009
My Device: Z10, PlayBook
My Carrier: NA

Re: screen_get_event_property and testing in a simulator

Please use plain text.
BlackBerry Development Advisor
anhu
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. 

Please use plain text.
BlackBerry Development Advisor
anhu
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.
Please use plain text.
Developer
BGmot
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?

Please use plain text.