Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input Modality as a UACH #82

Open
elijahsoria opened this issue Aug 20, 2021 · 4 comments
Open

Input Modality as a UACH #82

elijahsoria opened this issue Aug 20, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@elijahsoria
Copy link

It would be great to have input modality (mouse, touch, etc) be passed on each request by Chrome as a User Agent Client Hint (UACH). It would help in determining how people use sites and allows for different UIs and the like when users are using different input modalities.

Any interest in creating this as a UACH?

@tomayac
Copy link
Contributor

tomayac commented Aug 20, 2021

In CSS, you have pointer or any-pointer (the latter can be used as touch screen proxy if the value is coarse). You can query it from JavaScript like so:

window.matchMedia('(any-pointer: coarse)').matches

In theory, this could be exposed in the form of Sec-CH-Any-Pointer.

@miketaylr
Copy link
Collaborator

I think a collection of client hints to capture input modality, as well as other form-factor / device characteristics could be interesting (e.g., has a screen, or doesn't). Input modality could perhaps capture VR as well?

@amtunlimited
Copy link
Collaborator

I think it's a good idea as a high entropy hint. I do wonder about ossification (I actually think we need some more specific instructions on client hints, but maybe that's for another issue)

Right now, I believe there's only three method available that make a qualifying event: keyboard, mouse, and touch. Those'd probably be a good place to start, and maybe if there's ever any more input events we can add them.

@amtunlimited
Copy link
Collaborator

(I just remembered there's the Gamepad API as well)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants