Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / AGK2 Multi-Touch Oddities!

Author
Message
KultiVator
9
Years of Service
User Offline
Joined: 2nd Jan 2015
Location: Sunny Northamptonshire
Posted: 2nd Jan 2015 00:46
Just started experimenting with AGK2's multi-touch commands on a 10-point multi-touch Windows tablet.

I've noticed some unexpected behaviour regarding the numbering of TouchEvents in AGK2's internally-managed 'event list'.

I'll try to explain my findings and hopefully someone can offer input as to whether this is deliberate behaviour or a bug?


1) You capture your first touch event (e.g. a single finger press & hold) using GetRawFirstTouchEvent and interrogate/store this event's properties. We'll call this event 'TE1' and it's index in AGK2's is 1.

2) Whilst maintaining the first finger-press, you now add a second simultaneous touch event, 'TE2' and use a combination of GetRawFirstTouchEvent() + GetRawNextTouchEvent to interrogate the events.

At this point TE1's index is transposed - and is held at index 2 in AGK2's touch event list, whilst the second touch event is now at index 1.

3) As we add further fingers to generate (up to 10-finger) multi-touch events, each new event transposes the previous events that are still active.

This behaviour seems a little odd - we're left with touch events that are a moving target in terms of their indexing, making it trickier to compare the changing status of individual fingers from frame to frame during execution.

Is this a bug, a side-effect of the event list acting like a stack, or am I missing something fundamental that doesn't appear to be well documented?

Grateful for any thoughts and insight from this excellent community.


Kind Regards,


KultiVator


( Aggravated > Constipated > Mutilated ) < KultiVated
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 2nd Jan 2015 10:58
I spent quite a bit of time on this a while back, it's a little confusing but if you use SetRawTouchValue and GetRawTouchValue you can track which touch event is which much more easily. I agree it's not ideal but once you get your head around it it's not so bad. Actually it makes it easier to find a 'new' touch event because new events will not have this value set yet by your code.
KultiVator
9
Years of Service
User Offline
Joined: 2nd Jan 2015
Location: Sunny Northamptonshire
Posted: 2nd Jan 2015 13:17
Many thanks Baxslash for sharing your experience of the dark art of multi-touch! It will be interesting to experiment further with the next time I'm working in AGK.

Set/GetRawTouchValue have just jumped to the top of my reading & research list

Happy New Year!


KultiVator

( Aggravated > Constipated > Mutilated ) < KultiVated
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 6th Jan 2015 04:02
The IDs are assigned by the device and are only really useful for communication between the device and AppGameKit, each platform will handle it differently.
KultiVator
9
Years of Service
User Offline
Joined: 2nd Jan 2015
Location: Sunny Northamptonshire
Posted: 7th Jan 2015 13:47
Thanks Paul - I've made good progress since submitting the initial post.

I was just experimenting with commands to get a feel for how multi-touch worked - hadn't spotted the ability to Set/Get values and have since found some example code that makes things a lot clearer.

Certainly good to have the option of building some novel touch interfaces!

Thanks again Paul / Baxslash for taking time to post useful info.

( Aggravated > Constipated > Mutilated ) < KultiVated

Login to post a reply

Server time is: 2024-11-25 14:59:11
Your offset time is: 2024-11-25 14:59:11