Android, duplicate touch source ID with stylus


I've been running my Orx based Android application on a Samsung Galaxy Note 10.1, which has a stylus.

I've, possibly wrongfully, assumed that payload->stTouch.u32ID would be unique for every continuous touch source. Or that at least, I wouldn't receive two orxSYSTEM_EVENT_TOUCH_BEGIN events for the same ID without a orxSYSTEM_EVENT_TOUCH_END event in-between.

This assumption had held true, until I've tried to use the stylus in combination with my fingers on the Orx based app. Apparently, stylus based touch events CAN have identical ID's to those that emerge from non-stylus sources.

Is this a bug, or expected behavior? Is there any other way to distinguish touch sources?



  • edited January 2015
    mmmh... intersting, never tried with a stylus, I should check what's the behaviour with my Nvidia Shield tablet...

    you can try to debug this
    in /extern/android Android Studio project.
    try to add some log information in the callback

    public boolean onTouch(View v, MotionEvent event)

    try to log event.getSource() for example.

    dont forget to rebuild the .aar and use it in your application.
    './gradlew assembleRelease' will build the .aar in /orx-lib/build/outputs/aar
  • edited February 2015
    Thanks, I'll do that and share the results.
Sign In or Register to comment.