view libervia/web/pages/_browser/tools.py @ 1574:4ab4bc3ae462

browser: new `tools` module with a first method to detect touch devices
author Goffi <goffi@goffi.org>
date Wed, 22 Nov 2023 16:31:36 +0100
parents
children
line wrap: on
line source

"""Common useful tools"""
from browser import window


def is_touch_device():
    return hasattr(window, 'ontouchstart')