Page 1 of 1
Touch screen commands on Safari Browser
Posted: Thu Nov 10, 2022 10:42 pm
by Russ Srole
Are they supposed to work on a browser? The only touch screen I have is on an iPhone (12 mini, latest os).
The ExamineTouchScreen() function does return true, but the TouchY() and TouchDeltaY() always return 0.
Re: Touch screen commands on Safari Browser
Posted: Fri Nov 11, 2022 9:43 pm
by bembulak
Do you have some sort of example code, we can use for testing?
Maybe the code is missing something. If not, we'll be able to do further investigations. I'm sure the commands are supposed to work.
Re: Touch screen commands on Safari Browser
Posted: Sat Nov 12, 2022 9:14 pm
by Russ Srole
I tried to dummy up something and the results were odd. I'm not sure it has anything to do with spiderbasic. I added some code like this:
Code: Select all
#TouchTimer = $5000
After creating the window:
AddWindowTimer(Window_0,#TouchTimer,100)
BindEvent(#PB_Event_Timer, @TimerEvents())
and the procedure is:
Code: Select all
Procedure TimerEvents()
Define finger
Define a$
If ExamineTouchScreen()
For finger = 0 To 4
a$ = a$ + " " + Str(TouchY(finger)) + "-" + Str(TouchDeltaY(finger))
Next
EndIf
SetWindowTitle(Window_0,"timer: " + Hex(EventTimer()) + " " + Str(ExamineTouchScreen()) + " " + a$)
EndProcedure
What is completely confusing is that if I run either the debug or fully compiled html/js I see the title bar and the timer number ($5000) and one zero which is correct because I don't have any touch devices on my desktop. But when I put this code on the aws bucket, the timer never fires at all, so the title bar never changes. I don't have another way to test it right now, but should at some point.
thanks
// Added Code-Tags (Peter)
Re: Touch screen commands on Safari Browser
Posted: Sun Nov 13, 2022 12:14 am
by Paul
Have you tried the TouchScreen.sb example in the help file under "2D Games & Multimedia Libraries/Touch Screen" ?