Hmm, it seems there is something of a bug at play here. I took a different approach, but am encountering very much the same problem so far.
The manual says it is supposed to remove the touch event from it's own internal list, but sometimes when you lift one finger (not the last) and touch the screen again, it can 'copy' any of the existing / active touch events, both in terms of it's event ID, but also in terms of touch event touch time, which is of course something it shouldn't really ever do (unless perhaps you count simultaneous presses as a two-finger touch, but there's time in between these particular touches so it shouldn't count as double-touch so to speak). If you lift and touch that finger again, it won't respond or count the touch.
Now I am wondering though... is this due to the lists of these events not being looped through backwards? If you remove something from a list, it is better to decrease it down to zero so no indexes looped through still containing relevant data are being skipped or resorted.
In fact, this reminds me; it would be nice if we can loop through AppGameKit 2 'for next' loops backwards.
// Project: Touch E. Franken PHeMoX
// Created: 2018-03-27
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "touch" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
type mytouchData
index as integer
endtype
global myTouchList as mytouchData[]
global thisTouch as mytouchData
do
Print( ScreenFPS() )
for i = 0 to 9
if GetRawTouchCount(i) > myTouchList.length+1
thisTouch.index=GetRawFirstTouchEvent(i)
myTouchList.Insert(thisTouch)
endif
next i
for i=0 to myTouchList.Length
if GetRawTouchReleased(myTouchList[i].index)
if myTouchList[i].index > 0
myTouchList.Remove(i)
endif
endif
next i
for i=0 to myTouchList.Length
print("myTouchList.index = "+str(myTouchList[i].index)+" time passed since touch:"+str(GetRawTouchTime(myTouchList[i].index)))
next i
Print("Total list length :"+str(myTouchList.length+1))
Sync()
loop