-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: Adds touch support to Winforms based GameForm #1664
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…Winforms implementation)
azeno
added a commit
to vvvv/VL.StandardLibs
that referenced
this pull request
Oct 14, 2025
…and extend into title bar features. Merge once stride3d/stride#1664 is merged.
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds touch support to the WinForms-based GameForm using the WM_POINTER API, aligning it with the existing SDL touch functionality.
- Introduces PointerWinforms and wires up touch press/move/release events from GameForm.
- Moves GetFingerId logic to PointerDeviceBase for reuse across backends.
- Adds Win32 interop (TouchUtils) and updates GameForm WndProc to dispatch finger events.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| sources/engine/Stride.Input/Windows/PointerWinforms.cs | New WinForms pointer device that listens to GameForm touch events and pushes normalized pointer events. |
| sources/engine/Stride.Input/Windows/InputSourceWinforms.cs | Registers the new PointerWinforms device alongside keyboard/mouse. |
| sources/engine/Stride.Input/SDL/PointerSDL.cs | Removes local GetFingerId in favor of base class implementation. |
| sources/engine/Stride.Input/PointerDeviceBase.cs | Adds shared GetFingerId mapping for consistent finger indexing across backends. |
| sources/engine/Stride.Games/Desktop/Win32Native.cs | Adds TouchUtils P/Invoke types and helpers for WM_POINTER. |
| sources/engine/Stride.Games/Desktop/GameForm.cs | Adds touch events and WM_POINTER handling in WndProc to emit finger events. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…vvvv/stride into dev/joreg/add-touch-to-winforms
xen2
added a commit
that referenced
this pull request
Oct 23, 2025
Adds touch support to Winforms based GameForm
Acissathar
added a commit
to Acissathar/stride
that referenced
this pull request
Oct 23, 2025
commit aaae940 Merge: ee81d20 325a7fa Author: xen2 <virgile@stride3d.net> Date: Thu Oct 23 18:22:23 2025 +0900 Merge pull request stride3d#1664 from vvvv/dev/joreg/add-touch-to-winforms Adds touch support to Winforms based GameForm commit ee81d20 Author: Eideren <contact@eideren.com> Date: Wed Oct 22 16:18:35 2025 +0200 fix: Instantiate() behavior for Prefab and Entity references (stride3d#2914) commit 325a7fa Merge: 77e2101 82f7fae Author: joreg <joreg@vvvv.org> Date: Wed Oct 22 11:13:44 2025 +0200 Merge branch 'dev/joreg/add-touch-to-winforms' of https://github.com/vvvv/stride into dev/joreg/add-touch-to-winforms commit 77e2101 Author: joreg <joreg@vvvv.org> Date: Wed Oct 22 11:13:35 2025 +0200 fixed potentially problematic cast commit 82f7fae Author: joreg <joreg@vvvv.org> Date: Wed Oct 22 11:12:19 2025 +0200 Update sources/engine/Stride.Games/Desktop/GameForm.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> commit 1956f70 Author: joreg <joreg@vvvv.org> Date: Tue Oct 21 14:37:15 2025 +0200 Update sources/engine/Stride.Input/Windows/PointerWinforms.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> commit 2c1bc62 Author: joreg <joreg@vvvv.org> Date: Tue Oct 14 15:22:12 2025 +0200 Touch position is now normalized 0..1 like in other implementations commit 13d11c8 Merge: c73271b b74a54d Author: joreg <joreg@vvvv.org> Date: Tue Oct 14 14:05:36 2025 +0200 Merge branch 'master' into dev/joreg/add-touch-to-winforms commit c73271b Author: joreg <joreg@vvvv.org> Date: Thu May 18 13:03:58 2023 +0200 PointerSDL now uses GetFingerId() from baseclass (to be in line with Winforms implementation) commit 4ab9f70 Author: joreg <joreg@vvvv.org> Date: Thu May 18 13:03:10 2023 +0200 add touch support for Winforms based GameForm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Details
Similar to #504, this adds touch support to the Winforms based GameForm.
Description
Adds a PointerWinfoms class (corresponding to the PointerSDL class) and adds FingerPress/Move/Release events to the GameForm class. The GameForm in its WndProc() listens to the WM_POINTER messages and fires the finger-events accordingly.
The GetFingerId() method is now shared by PointerSDL and PointerWinforms by having it moved to their baseclass: PointerDeviceBase.
Related Issue
Motivation and Context
The SDL based GameForm had touch support for a while now but it turned out that at least on Windows it has issues (probably due to the SDL2 touch implementation being based on the obsolete WM_TOUCH api). Sometimes touches would not be released, simple to reproduce by pressing ALT+Tab while having a finger on the screen.
This PR adds touch support based on the WM_POINTER api and does not show the same issue.
Types of changes
Checklist