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

Only consider as touchCapable if primary pointer is touch #2167

Merged
merged 1 commit into from
Nov 4, 2023
Merged

Only consider as touchCapable if primary pointer is touch #2167

merged 1 commit into from
Nov 4, 2023

Conversation

conjuncts
Copy link
Contributor

I think an improvement is that when mathVirtualKeyboardPolicy is 'auto', the virtual keyboard should only be shown (by default) if the user's device's primary pointer is touch, not just if touchscreen is supported.

My personal use case is as follows. I have a touchscreen laptop with two modes of input, keyboard and touchscreen. In normal use, I only use the regular keyboard, and the virtual keyboard is not useful. In this case, window.matchMedia("(pointer: coarse)").matches == false. Although I am able to use the touchscreen when upright, in most cases I don't. Instead, when I wish to use the touchscreen, I physically fold the laptop. This causes an OS level change that disables the keyboard and also causes chrome to say window.matchMedia("(pointer: coarse)").matches == true. Thus, changing this one line conveniently addresses my use case.

I don't think this change would affect traditional desktops or plain touch devices; it only improves UX for devices with both touch and keyboard. This described behavior is consistent to the behavior of most other apps on my laptop: only when I enter "fold mode" does the OS virtual keyboard appear.

@arnog
Copy link
Owner

arnog commented Nov 4, 2023

Yes, that's a good point. I should probably rename isTouchCapable to isTouchModeEnabled to be more descriptive.

@arnog arnog merged commit 829a675 into arnog:master Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants