Skip to content
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

Updated touch structure #952

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Conversation

eriksunden
Copy link

I wanted touch support inside GLFW, for convenience over software setups like TUIO, so continued on your touch branch, and based on previous experiences with multi-touch applications, I have bundled all the touch points into one container before sending them out through the callbacks.

I have merged to "latest" and then later on to "master", so it's up-to-date for a convenient merge (or to new feature branch) and possibly then part of 3.3 (as I saw in an issue was the plan).
I have built this branch with Visual Studio 2015 x64, XCode 8.2.1, gcc-4.8(on two linux systems).

The actual touch support is, as with your previous commits, only supporting WM_TOUCH, i.e. Windows. If desired, I could gather effort on implementing support on x11 and cocoa side.

@@ -870,6 +874,7 @@ extern "C" {
#define GLFW_CURSOR 0x00033001
#define GLFW_STICKY_KEYS 0x00033002
#define GLFW_STICKY_MOUSE_BUTTONS 0x00033003
#define GLFW_TOUCH 0x00030004
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this value not be 0x00033004 to match the surrounding defines?

_glfwPlatformGetWindowSize(window, &width, &height);
_glfwPlatformGetWindowPos(window, &xpos, &ypos);

//Create storage
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indenting is weird here and elsewhere in this file.

@@ -482,6 +494,20 @@ static void joystick_callback(int jid, int event)
}
}

static void touch_callback(GLFWwindow* window, GLFWtouch* touchPoints, int count)
{
printf("Priting info about all touch points");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "priting" vs "printing"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for these flaws. Is it preferred that I fix these things or do any of you desire to do it yourself?

@elmindreda
Copy link
Member

@eriksunden Thank you, will review.

@elmindreda elmindreda self-assigned this Feb 24, 2017
@elmindreda
Copy link
Member

This is related to #42.

@elmindreda elmindreda added enhancement Feature suggestions and PRs Windows Win32 specific (not Cygwin or WSL) labels Feb 27, 2017
@elmindreda
Copy link
Member

It's not a bad-looking interface, but it is more complex than the current one. Is there often more than one related touch event per frame?

@elmindreda elmindreda added the waiting for reply Issues blocked waiting for information label Jul 4, 2017
@elmindreda elmindreda removed their assignment Oct 26, 2017
@eriksunden
Copy link
Author

Sorry for the ultra late reply.
Their is sort of several touch events per frame, if you consider one touch event to be equal to one finger, which one really shouldn't. One event per frame, with a consideration of all touch points that current resides on the touch surface is needed to perform a correct interaction response (even the fingers/touch points which have not changed).
Before you have a list of all touch points on the surface, you don't really now what kind of interaction the user has made, which can in one frame actually can be multiple interactions, if for instance the user had 2 fingers on the surface and performed a rotation and pinch.
There is even touch screens which support pressure, also an attribute part of most low-level touch API such as Windows Touch.

# Conflicts:
#	include/GLFW/glfw3.h
#	src/input.c
#	src/internal.h
#	src/win32_platform.h
@eriksunden
Copy link
Author

eriksunden commented May 18, 2018

I've updated to the latest master, and tested the result as well. As before, it is a Windows only feature at the moment.
Do you plan to merge this pull request soon, or is their something you would like me to alter first?
I would appreciate the merge as their are several projects that use SDL or Qt for simple standalone full screen applications, mainly because of touch support, and I would like these groups to use GLFW instead, as it in general just more awesome :).

@torkeldanielsson torkeldanielsson mentioned this pull request Jul 22, 2020
@elmindreda elmindreda removed the waiting for reply Issues blocked waiting for information label Mar 20, 2022
@elmindreda elmindreda added this to Now in Queue Mar 20, 2022
@elmindreda elmindreda moved this from Now to Urgent in Queue Mar 1, 2023
@elmindreda elmindreda moved this from Urgent to Todo in Queue Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature suggestions and PRs Windows Win32 specific (not Cygwin or WSL)
Projects
Queue
Todo
Development

Successfully merging this pull request may close these issues.

None yet

3 participants