no longer used to detect touch devices?

Is it just me or can’t be used to detect touch devices anymore?
On both of my desktops, is not null.

Hi @Newbie_Coder,

Do your desktops have a touch input device?

Usually we enable with the browser debug tools a touch emulator e.g. a mobile/tablet device to test on desktop. seems to work for me.

My devices have touchpads (to control mouse) but not a touch screens :thinking:

Just checked using navigator touchpoints, returns 256 on my lap :face_with_raised_eyebrow: That’s why is not null.

However, even if I didnt had any touch points my engine-only project loads

touch: new pc.TouchDevice(document.body)

, for all devices, so the check using won’t make sense in my case

const hasCursor = window.matchMedia('(pointer:fine)').matches

so far this gave me the most accurate results (giving that phones have no pointer/cursor)

1 Like