dasher-project / dasher-web

Dasher text entry in HTML, CSS, JavaScript, and SVG
https://dasher-project.github.io/dasher-web/browser/
MIT License
43 stars 8 forks source link

Cannot zoom with pointer device on touch-screen devices #28

Open hawkinsji opened 3 years ago

hawkinsji commented 3 years ago

Steps to reproduce:

  1. Connect a Bluetooth trackpad to an Android device.
  2. Navigate to the GitHub pages proof-of-concept for Dasher Version Six, here: https://dasher-project.github.io/redash/browser/
  3. Use the trackpad to move the pointer.

A pointer will be displayed and can be moved with the trackpad. If you click on a button in the control panel, it will respond same as if it had been tapped. However, if you move the pointer over the zooming area, there isn't any zooming.

The reason is that the code registers either touch event handlers or mouse event handlers, but not both. Code is near here: https://github.com/dasher-project/redash/blob/750c94d432b5f0220eba753a09d4c3aae3ffae5d/browser/dasher/pointer.js#L150

The choice of which to register is based on the presence of touch event support in the browser. Code is near here: https://github.com/dasher-project/redash/blob/750c94d432b5f0220eba753a09d4c3aae3ffae5d/browser/dasher/pointer.js#L11

The current rule is:

The solution might be as simple as changing the rule to: