-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gestures] Tap gesture not properly recognized on Raspberry Pi #3335
Comments
@ubkp were you working on gestures lately? or was somebody else? |
@raysan5 I was back in july, but was mostly fixing gestures for
I don't think I reviewed it for If you don't mind keeping this open for a few days, I can review it after the split. Edit: This will also be a lot easier/faster to fix after the split. And less prone to break web and desktop too. |
@ubkp Agree. OK, no problem, no hurries. |
Thanks Guys. Has there been any thought put into multi-gestures, not sure that's the right word? Basically multiple at the same time, so multiple taps for instance. |
@AndrewCapon https://github.com/raysan5/raylib/blob/master/src/rgestures.h#L405-L408 Edit: Sorry, I think I've read your message too quickly:
|
Hi @ubkp Thanks for the info, I was thinking of the second case but really the idea of multiple controls (say sliders or lists for example) on the screen each being able to have their own gesture handling. I have had a look at RayGui but that seems to be based on the Mouse code so is not multi touch either. I'll have a look what I can knock up... Cheers Andy |
@AndrewCapon The following are my personal opinions:
Edit: edits. |
Hi @ubkp Yep I fully understand :) |
@ubkp 100% agree with all the mentioned points, specially with One of the biggest concerns with raylib at the moment is maintenance, it's already very difficult to maintain the library, not only the source code with its issues/PRs but also all the ecosystem around it (social networks, community, webpage, examples, sample games...), so, adding more features could just make it more difficult. |
@raysan5 Yeah, that's way too much. Some things that could help:
|
@AndrewCapon @raysan5 Temporarily working from the current master branch (c8a6093) while the split is in progress. Did a similar test:
It appears that the gestures are correctly detected and processed. When a tap ( ProblemThe problem with Nevertheless, I've reviewed all commits I did to the gesture module and none of them should have had any effect into that. So I rolled back to master branch before all those (fdc28fc) and it wasn't working for SolutionRegarding how to solve this, the ideal would be Give me a few days to think some workaround for it. I just don't want to break (or have to heavily patch) the gesture module to handle just this at the cost of all other platforms. EnvironmentTested Edit 1, 2: added the test environment. |
@ubkp Thank you very much for investigating this issue. It expectable that |
Thanks guys, there is no hurry at all from my point. |
@ubkp @michaelfiber do you think this issue could be somewhat addressed now that the platform-split has been completed? |
@raysan5 I'm working on it right now. Trying to get it solved today, but it's a tricky issue. I'll do my best. |
@ubkp No hurries and no pressure, take it easy! I'm just reviewing the last open issues in case something can be easely addressed but I think |
@raysan5 I just noticed I missed adding the gesture handling to I'll try to fix both together since, without callbacks, both |
@ubkp Oh, I just checked the gestures system yesterday, do you think the gestures system could be moved to |
@raysan5 As of right now, I think just part of it could. The But the But I'd advise against moving it right now. Since |
@raysan5 Fixed the gesture system for |
@ubkp thanks for the review! Agree that gestures system could be quite callback-dependant, better review it after new release. |
@raysan5 I think I found why the Edits: 1. typo; 2. correction. |
@ubkp thanks for investigating this issue! Considering the touch positions are updated on a secondary thread, maybe it could be related to some race-condition... |
@raysan5 Yeah, I spent the afternoon trying to confirm it, but there are so many events overlapping ( |
@raysan5 After trying basically everything I gave up fighting the threads and just moved everything related to I'll append it all to the very end of |
@ubkp thanks for the review! No worries about the threads, I know they can be problematic, moving to single-thread is fine for me, actually, afaik, only mouse should be in a second thread. Take your time! |
@raysan5 Found a solution. I'm crafting the PR, will send it shortly. |
Issue description
Using 'core_input_gestures' I see an issue where only HOLD, DRAG, PINCH IN and PINCH OUT are recognised.
I have had a look at the code, starting with why TAP is not recognised as I'm guessing if this started working the rest would!
So with the help of some debug logging:
[0xf78cf040] is the main thread, [0xf0155440] is the event handling thread :
'UpdateGestures()' is called via 'EndDrawing()' -> 'PollInputEvents()' every frame.
I am logging the current gesture at the start of the main loop.
If we look at the code for 'UpdateGestures()' we can see the first thing it does is change the TAP (1) to HOLD (4)
So I'm guessing this probably once worked and something may have changed?
There is no synchronisation between the threads so I guess its fairly random what might happen but this seems to be the issue I am seeing all the time.
Anyone any ideas?
Cheers
Andy
The text was updated successfully, but these errors were encountered: