Oromis / touch-vtt

Introduces touch screen support to FoundryVTT
38 stars 26 forks source link

Touching token is opening character sheet #61

Closed marthiago closed 2 months ago

marthiago commented 1 year ago

Hi! Thak you for your wonderful job on this module. I'm currently using Foundry 11 bulild 304. When I touch my token it opens the character sheet. I can move my token, but it happens behind the sheet, so I do not see what is going on. I did not find a way to touch my token without opening it everytime.

jcapinc commented 1 year ago

I am having the same issue and it is the only thing stopping me from having an awesome in-person vtt setup. I am a web dev and I am teaching one of my dnd players web development, would this be a good issue for us to try and solve and make a pull request for?

Oromis commented 1 year ago

Hi! Yeah that would be great! I'd assume it's not a difficult issue to fix, but I can't do it right now as I don't have access to a touchscreen laptop any more. A PR is definitely welcome!

jcapinc commented 1 year ago

My Tutee and I will start on this tonight.

negativeview commented 1 year ago

My Tutee and I will start on this tonight.

Have you made any progress? I'm also a JS dev, and it would be great if I could resolve this by tomorrow night. If you've got anything even half-working I'd love to take a look at what you have. I took a quick glance and nothing is obviously wrong.

BranerMajszter commented 1 year ago

Experiencing the issue. Even hiding sheets from actors don't work. Temporary workaround is to "minimize" actor sheets and move it out of vision. Any progress?

negativeview commented 1 year ago

Not really. I learned a bit about how this module works under the hood, got some minor progress, and then my players came to session with their own workaround that took touch-vtt out of the equation. I lost steam on this because my players want ipad specifically, and I found a showstopper on iPad unrelated to this module (fair enough, iPad isn't officially supported on foundry).

cfunkexplosion commented 1 year ago

Is this still being worked on? I bought a touch screen and I was really hoping to have this functionality.

Muttles commented 1 year ago

Oromis I can provide a video capture of the bug with the log console open, i really need this to work for my weekly game. https://youtu.be/UVtUIw3L14w

cubecubiac commented 1 year ago

Same issue for me. IR Touch screen of my gaming table is opening character sheets. Moving Tokens is not possible because it gets stuck on the "cursor". would also love to have this working again

moodoovoodoo commented 1 year ago

From what I have heard, @Oromis is no longer working on this module. Anyone else w/Javascript experience want to take a crack? 😅

hishpeck commented 11 months ago

For now I found a manual workaround for this issue. I think this needs to be done every time Foundry is updated.

  1. Open the foundry.js script under [FOUNDRY_INSTALATION_DIR]/resources/app/public/scripts/foundry.js (for Windows it should be located in C:/Program Files/Foundry Virtual Tabletop)
  2. Find the isDouble variable declaration (just CTRL+F it, it should be in the #handleMouseDown method somewhere around line 31812)
  3. Change the declaration to const isDouble = (now - this.lcTime) <= 250 && (now - this.lcTime) > 10; (10 works for me - if you're doing double clicks very fast you may want to decrease it, but going too low might cause this fix to not work every time)

From what I can tell the issue is that there is already an event listener for detecting when the canvas is touched/clicked, so the #handleMouseDown method is triggered twice, which makes it think it's a double click. Unfortunately the source maps are missing, but I think this is caused by PixiJS which is probably registering an event listener of it's own. I think that it's possible to make Touch VTT listen to PixiJS events instead of native events, but I'm not sure how.

I'm fairly new to Foundry, so this might look really dumb, I hope someone more knowledgeable can make use of my findings.

moodoovoodoo commented 10 months ago

Thank you @hiszpek !!! Going to try this today.

felddy commented 9 months ago

I just fielded a question on Discord about applying the suggested fix for this issue to the FoundryVTT container I maintain. I thought I'd post my reply here for anyone else that might find it useful.


The container supports applying patches at startup. Here are the steps:

https://gist.github.com/felddy/bf09dffaefa3f0a469e8effa0a970ea9

The patch will be applied whenever the container is recreated.

Scaby79 commented 9 months ago

The patch provided by @felddy using the workaround suggested by @hiszpek solved the unwanted sheet opening for me. Although I needed a much higher threshold than the suggested 10. (50 is working for me)

Sadly touch-vtt is still not usable for me (foundry version 11.315) because of another remaining issue reported as issue #65 here.

Chris76J commented 7 months ago

Please check this, if it helps to solve your issue: https://github.com/foundryvtt/foundryvtt/issues/10236#issuecomment-1927292942

Thx :)

OmegaRogue commented 7 months ago

Please check this, if it helps to solve your issue: https://github.com/foundryvtt/foundryvtt/issues/10236#issuecomment-1927292942

Thx :)

I am working on my own module thats includes fixing touch as a side goal while staying out of core foundry code as much as possible, replacing the functionality of touchvtt

Aioros commented 2 months ago

This issue has been addressed in the latest release.