Hacker News new | ask | show | jobs
by yoran 2415 days ago
Is there a reliable way to detect touch screens and screen readers?

This way, you can enable hover controls only if the user is not on a touch screen or a screen reader.

1 comments

It's not really a clear distinction, though. I have a laptop that has a touchscreen, but also a regular touchpad and sometimes I use an actual mouse with it. Sometimes I touch the screen if it's easier even if I have a mouse connected. I also sometimes remote into it. Then there's my tablet: I can use a bluetooth mouse with that if I want. Or an external touchpad.
I imagine I'd err on the safe side. If the screen has touch functionality (includes laptops with touchscreen), then don't do actions on hover. Is there a way to reliably detect the existence of touch functionality through the browser?