Discuss Scratch

pedrolg
Scratcher
42 posts

What are the coordinates of the mouse on a mobile device when you're not tapping the screen?

I am trying to detect whether you are using a mobile device, and was thinking that the x and y coordinates of the “mouse” on a mobile device would be something like N/A, which I could then detect and find out if you're using a mobile device, but I don't know if this will work. Can anyone with a mobile device test this out? TYSM
when green flag clicked
if <(mouse y) = [None]> then
say [MOBILE DEVICE USER!!!]
end
p-p-p-p-p-p-p-p-p-p-
Scratcher
1000+ posts

What are the coordinates of the mouse on a mobile device when you're not tapping the screen?

You can also tell if a user is on mobile by asking them to press a key to continue but that's not a foolproof way.
PhiPhenomenon
Scratcher
500+ posts

What are the coordinates of the mouse on a mobile device when you're not tapping the screen?

Coordinates on mobile function the same as on computer. The only thing different is how the mouse x and mouse y change. You can use this mobile detector, since it's mostly accurate.
alebro6DW
Scratcher
100+ posts

What are the coordinates of the mouse on a mobile device when you're not tapping the screen?

when green flag clicked
forever
if <<not <(mouse x) = (x)>> and <not <(mouse y) = (y)>>> then
mobile code :: grey
else
computer code :: grey
end
end

when this sprite clicked
set [x v] to (mouse x)
set [y v] to (mouse y)


or

p-p-p-p-p-p-p-p-p-p- wrote:

You can also tell if a user is on mobile by asking telling them to press a key to continue but that's not a foolproof way.
pedrolg
Scratcher
42 posts

What are the coordinates of the mouse on a mobile device when you're not tapping the screen?

alebro6DW wrote:

when green flag clicked
forever
if <<not <(mouse x) = (x)>> and <not <(mouse y) = (y)>>> then
mobile code :: grey
else
computer code :: grey
end
end

when this sprite clicked
set [x v] to (mouse x)
set [y v] to (mouse y)




p-p-p-p-p-p-p-p-p-p- wrote:

You can also tell if a user is on mobile by asking telling them to press a key to continue but that's not a foolproof way.
Thanks @alebro6DW

Powered by DjangoBB