bluerobotics / cockpit

An intuitive and customizable cross-platform ground control station for remote vehicles of all types.
https://blueos.cloud/cockpit/docs/latest/usage/overview/
Other
57 stars 20 forks source link

Support trackpad regions as axis inputs/sliders #653

Open ES-Alexander opened 10 months ago

ES-Alexander commented 10 months ago

No idea if this is possible (I'm not sure what the browser gets access to), but it'd be really cool to be able to assign regions of the trackpad as input sliders for controls, e.g. if I slide my finger up/down the right edge then I can make my lights1 dimmer/brighter, but if I do it on the left edge it does lights2 instead...

We could also then have the left and right halves of the trackpad used for motion control, which could be useful for testing purposes, or in emergencies if the joystick dies or something.

ES-Alexander commented 10 months ago

May be possible using the Touch events API, but from an initial read I'm unsure whether it provides access to touch positions relative to the pad, or just something based on previous mouse positions or something. The descriptions seem to be focused on what a touchscreen would have (where you literally touch parts of the page), but the API does specify it can apply to both touch screens and trackpads...

rafaellehmkuhl commented 10 months ago

Oh you went far with that one 😅

I liked it, but apparently this is not yet supported by any browser api, although there is the pointer lock api, which is very cool and maybe has some synergy with that kind of feature.

ES-Alexander commented 6 months ago

In case it's relevant, there's also the proposed GamepadTouch Interface, but I don't believe it has browser support yet either.