Comments (9)
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.
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.
Thank you for the fast and detailed response, I will try all that!
from godottouchinputmanager.
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.
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.
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.
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.
Thank you for your feedback! I will merge the changes soon and release a new version.
from godottouchinputmanager.
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)
- Condition "!is_visible_in_tree()" is true HOT 1
- Only works on the edges of the screen when using a Control Node instead Node2d HOT 5
- Missing CollisionObject input_event integration. HOT 4
- Support LongPress gesture. HOT 1
- Invalid get index '0' on InputEventSingleScreenLongPress HOT 15
- InputEventMultiScreenDrag fingers not reset HOT 1
- Godot 4 Support HOT 6
- InputEventMultiScreenTap - Feature Request HOT 2
- single_taps not recognized after resuming from pause menu HOT 2
- multi_tap arbitrary distance support HOT 2
- it's not working in godot 4 beta HOT 1
- Memory Leaks at RawGesture.gd and Util.gd HOT 3
- Swipe, tap input not received when use get_tree().paused on Mobile device HOT 2
- Bad download hash HOT 3
- Suggestion: any_tap signal HOT 2
- event.position in InputEventScreenPinch not centered during first few events HOT 3
- Inconsistent usage of event attributes HOT 3
- Pinch not working when over buttons. HOT 3
- Method for detecting swipe release HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from godottouchinputmanager.