https://github.com/crsjimo/qtwin32directmanipulatehelper
A Qt integration of Win32 Direct Manipulate APIs
https://github.com/crsjimo/qtwin32directmanipulatehelper
com direct-manipulation gesture qt touchpad win32 windows
Last synced: about 1 month ago
JSON representation
A Qt integration of Win32 Direct Manipulate APIs
- Host: GitHub
- URL: https://github.com/crsjimo/qtwin32directmanipulatehelper
- Owner: CrSjimo
- License: apache-2.0
- Created: 2025-04-04T10:39:31.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-06T12:24:22.000Z (about 1 year ago)
- Last Synced: 2025-04-09T20:46:23.319Z (about 1 year ago)
- Topics: com, direct-manipulation, gesture, qt, touchpad, win32, windows
- Language: C++
- Homepage:
- Size: 15.6 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QtWin32DirectManipulateHelper
A Qt integration of Win32 Direct Manipulate APIs
## Usage
To enable Direct Manipulation on a `QWindow`, call
```c++
QWDMH::DirectManipulationSystem::registerWindow(window);
```
To disable, call
```c++
QWDMH::DirectManipulationSystem::unregisterWindow(window);
```
After Direct Manipulation is enabled on a `QWindow`, a `QNativeGestureEvent` with `QNativeGestureEvent::gestureType()` to be `Qt::ZoomNativeGesture` will be sent when the user pinches on the touchpad, and a `QWheelEvent` will be sent when the user swipes on the touchpad with two fingers.
It is also supported to specify configuration and device type when registering a window, for example
```c++
QWDMH::DirectManipulationSystem::registerWindow(
window,
QWDMH::DirectManipulationSystem::TranslationX | QWDMH::DirectManipulationSystem::TranslationY,
QWDMH::DirectManipulationSystem::Touchpad);
```
The example above makes the window processes only translation without inertia, and accepts input only from the touchpad.