- March 15, 2010 at 3:23 pm #30078
Hi, this is probably a naive question: when I use PVRShellGet(prefPointerLocation) in the PC Emulation SDK I get the current mouse coordinates, even if the mouse just moves and no button is pressed. Since the pointer location is likely to correspond to a touch position on a mobile device, wouldn’t it make sense to report the pointer location only if a mouse button is pressed? Otherwise it is hard to emulate the ways users are interacting with a touch interface using a mouse (since touch events are less continuous than mouse movements).
Just wondering.March 16, 2010 at 11:33 am #33783
This would make sense if you wanted to only emulate touch enabled platforms, but if developing for a platform with a mouse this would be limiting behaviour.
Through PVRShellGet() it is also possible to get the button state (prefButtonState) – combining this with the pointer location should enable better emulation of touch events.March 16, 2010 at 11:56 am #33784
Yes, that works. (I’m only accepting new positions if 0 != PVRShellGet(prefButtonState); the result should always be -1 on the iPhone if I read the code correctly.)
Thanks, Gordon.April 20, 2010 at 7:52 pm #33785
Hello, there is a detail that I’m not quite getting. When I ask for PVRShellGet(prefPointerLocation), how do you get the individual x and y values?April 21, 2010 at 8:18 am #33786
I’m not sure I understand your question. Are you looking for something like this?
if (NULL != (vec2PointerLocation = (float *)PVRShellGet(prefPointerLocation)))
x = vec2PointerLocation;
y = vec2PointerLocation;