Code Monkey home page Code Monkey logo

Comments (9)

Federico-Ciuffardi avatar Federico-Ciuffardi commented on May 20, 2024 1

Hi @harry-peirse, your comment on the delay made me think about how and when I was detecting a tap, and also what the definition of tap is.

I just changed the implementation (on this branch) so that instead of waiting for the end of the timer, it waits at most for that time, and if it detects that the touch is released before a the timer end a tap event is emitted.

This solves both the delay you mentioned and the detection of fast taps that @golddotasksquestions mentioned.

I wonder if it is correct to have a time limit for the detection of a tap. Perhaps it is better to remove the time limit and add a check that the press and release position do not differ by more than a certain threshold.

Please check if the new implementation suits your needs and tell me your opinion on what I talk about in the paragraph, if you can.

Thanks!

from godottouchinputmanager.

Federico-Ciuffardi avatar Federico-Ciuffardi commented on May 20, 2024

For high frequency taps to work, you need to lower the value of const TOUCH_DELAY_TIME on InputManager.gd, but be careful if it is too low, it might cause some false positives.

You may also consider using InputEventSingleScreenTouch with pressed == true for high frequency taps.

Regarding the reliability of Twist, Pinch and Multiple finger drag, it depends on your use case, what I mean is that when they are triggered it's because you are actually doing that gesture (maybe it's subtle and you're not realizing), this is good for cases where you want a high level of precision, for example if you are using the plugin to control a 2D camera. On the other hand, if you want to avoid mixing gestures because they trigger important events, you must filter the subtle gestures, for this you can define a threshold for each gesture so the action will be filtered if the relative attribute of the gesture is not greater than the defined threshold, for example:

if event is InputEventMultiScreenDrag and event.relative.length() > multiScreenDragThreshold:

instead of:

if event is InputEventMultiScreenDrag:

Modify the threshold of each gesture until you get to filter all the subtle gestures without ignoring the important ones.

Try all that and do not hesitate to tell me how it went, whether it worked or not.
If I was not clear enough with something also tell me.

Thank you for trying the addon and giving me feedback!

from godottouchinputmanager.

golddotasksquestions avatar golddotasksquestions commented on May 20, 2024

Thank you for the fast and detailed response, I will try all that!

from godottouchinputmanager.

golddotasksquestions avatar golddotasksquestions commented on May 20, 2024

Lowering const TOUCH_DELAY_TIME did not help. I tried 0.01 but then no tabs are registered at all. with 0.1 only some taps are registered. with 0.05 almost no taps are registered, it feels very unreliable whatever TOUCH_DELAY_TIME setting I choose.

I could not figure out what you mean with: "You may also consider using ʻInputEventSingleScreenTouchwithpressed = true` for high frequency taps."
Where would I be using that? What means "using" in this case?

from godottouchinputmanager.

Federico-Ciuffardi avatar Federico-Ciuffardi commented on May 20, 2024

Ok, maybe some work could be done on the tap event support high frequency taps. Actually, when I implemented the tap event, I didn't think about fast taps.

Either way I advice you to try the alternative I proposed. What I meant was "You may also consider using InputEventSingleScreenTouch with pressed == true for high frequency taps".
In this case using means to do something like this:

if event is InputEventSingleScreenTouch and event.pressed:

instead of this:

if event is InputEventSingleScreenTap:

Please try that and let me know if it worked.

And did setting thresholds solve your problems with Pinch and Twist?

from godottouchinputmanager.

harry-peirse avatar harry-peirse commented on May 20, 2024

Hi! I'm trying out this plugin and finding it incredibly useful. I am finding that the default 200 millisecond delay for tap events makes the game feel quite unresponsive as the delay between the tap and the action is recognisable, but when I shorten it there's a risk of not capturing the taps of course. I'm going to play around with InputEventSingleScreenTouch to see if that can improve things, but I just wanted to comment here as well so you're aware there's some needs not covered. If I find a nice solution I'll post it and potentially look into a merge request if you're interested.
Thanks for a great plugin!

from godottouchinputmanager.

harry-peirse avatar harry-peirse commented on May 20, 2024

Hey, thanks a lot for doing that so quickly - it works great!
I think it's good to have the threshold (configurable ideally) as you may want to recognise a hold without moving separately from a tap. The idea of a separate threshold for position differences would be nice for separating a hold event from drag however. Holding to bring up a context menu is a good use case (one I have actually)

from godottouchinputmanager.

Federico-Ciuffardi avatar Federico-Ciuffardi commented on May 20, 2024

Thank you for your feedback! I will merge the changes soon and release a new version.

from godottouchinputmanager.

golddotasksquestions avatar golddotasksquestions commented on May 20, 2024

Personally I would expect the same behaviour as Input static class:

tab = Input.is_action_just pressed() <-- no delay, no timer
tab_hold = Input.is_action_pressed()
tab_released = Input.is_action_just_released()

from godottouchinputmanager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.