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
Touch input #1736
base: master
Are you sure you want to change the base?
Touch input #1736
Conversation
01c6305
to
9ccdcd7
Compare
Would this enable gestures like pinch-to-zoom, two-finger panning, etc on Macs? |
No, for a number of reasons:
|
@torkeldanielsson Thanks a lot for this. ATM I am working on a home made virtual jukebox UI and use GLFW. I'll control it via a 10" touch screen with a mini PC (Windows 10) and I just need the touch press and release (with coordinates) functions and it seems to be available in your code. |
Hi, in case it can be useful for someone, for raylib I created a single-file gestures.h module to manage gestures for the multiple platforms, receiving simple touch events. |
This is a PR (pull request), which is a set of suggested changes to the master GLFW repository. The .lib/.dll files are created as part of the release process, which is done from time to time based on the master. To use this version you need to clone my GLFW fork, check out this branch, and then build it. This PR includes documentation for the functionality that is added, you can see this by clicking on the "files changed" tab above. |
OK I am going to try to understand how to build it with visual studio 2017. |
Any news on this - currently use glfw as windowing system for a client that recently requested pinch to zoom support. Having this pulled into a release and not hacked into the build would be a massive plus. |
It might be possible to capture touch input in macOS as well. Catalina introduced Sidecar, that can turn iPads into a secondary screen for Macs. I believe I read in the past that the iPad can be used to capture touch events, as well. In that case, |
Anyupdates? I need pin to zoom touch on Mac touchpad. This is support very well in XCode's 3D file viewer. |
This PR proposes to add the generic API from the touch branch for receiving touch input.
There exists at least the following efforts, since at least 2013 (!), to add touch to GLFW:
Now, I have a customer who needs touch to work in our application (voysys.se) so I need touch to work (which it does) at least in a fork for us. Platform for my project is Windows. I added a few hours to the work package to be able to make this PR with these changes to the upstream. (If it is merged is of course an open question for the maintainers/community.)
After reading through the previous efforts on touch, above, I came to the conclusion that I like the callback api in the touch branch. It is based on WM_TOUCH, which is available from windows 7. The effort in PR #532 to add Wayland support indicates that the approach will work for other platforms too. Raw touch points with id, state (press/move/release), and position are passed in. It is up to the user to add inertia, gestures, whatever. I think this is a clean, sane low level api for touch and that it is the right approach. Because who knows what people want to do with the touches.
What I have done:
I have tested this now on my laptop which has a touchscreen (surface book 2) and starting next week I will run tests on the target displays which are external multitouch monitors.
[2020-11-02] Update: this is running and working well on customer's site for a few months. Touch is the only input used, on two external touch monitors per pc. No issues has been reported.