guac-vue icon indicating copy to clipboard operation
guac-vue copied to clipboard

Added Touchscreen & Touchpad Capabilities

Open calebcoverdale opened this issue 4 years ago • 3 comments

Hello!

I added 2 files to the libs folder: GuacTouchpad.js GuacTouchscreen.js

These come right from the guacamole documentation here.

On line 230 I added in the touchpad reference:

this.touchpad = new Guacamole.Touchpad(displayElm);

And also line 252:

this.touchpad.onmousedown = this.touchpad.onmousemove = this.touchpad.onmouseup = this.handleMouseState;

As per ApacheGuacamole's documentation Guacamole.Touchpad/Touchscreen are just additions to the Guacamole.mouse state.

For future reference - if anyone wants touchscreen (note - no multitouch here.... no easy scrolling.... problems with accuracy) just do a find replace for "touchpad" with "touchscreen" - should work you.

Thank you so much for the work you put into the project so far, it's so fast!

calebcoverdale avatar Sep 23 '21 02:09 calebcoverdale

I tried to use some of the code inside this PR for one of my projects and I've noticed that both "guacamole-touchscreen" and "guacamole-touchpad" didn't fulfill all the requirements to fully use touch capabilities (at least the more used ones). First of all I've changed the the 2 files so they support typescript and then I changed them to be composables and removed the "this" from the scope. Then I focused mainly on the "guacamole-touchpad" and currently it supports:

  • tap
  • double tap (solved issue with clicking over the cursor and getting the wrong target)
  • tap+drag
  • 2 fingers tap (right click)
  • 2 fingers drag (vertical and horizontal scroll)

If you like I can share my code.

vandelpavel avatar Nov 07 '23 08:11 vandelpavel

That would be incredible!

This felt like ages ago.

It was definitely one of my first stabs at programming.

calebcoverdale avatar Nov 09 '23 15:11 calebcoverdale

I tried to use some of the code inside this PR for one of my projects and I've noticed that both "guacamole-touchscreen" and "guacamole-touchpad" didn't fulfill all the requirements to fully use touch capabilities (at least the more used ones). First of all I've changed the the 2 files so they support typescript and then I changed them to be composables and removed the "this" from the scope. Then I focused mainly on the "guacamole-touchpad" and currently it supports:

  • tap
  • double tap (solved issue with clicking over the cursor and getting the wrong target)
  • tap+drag
  • 2 fingers tap (right click)
  • 2 fingers drag (vertical and horizontal scroll)

If you like I can share my code.

I am working on a similar project and am seeing some issues with implementing the touchpad. Can I take a look at your code if possible? Thanks !

VidipG avatar Jan 23 '24 21:01 VidipG