winit-core:winit: add tablet input support

The API is integrated into the `WindowEvent::Pointer*` API and is
present in form of `TabletTool` variant on corresponding data entries.

For now implemented for Web, Windows, and with limitations for Wayland.

Fixes #99.

Co-authored-by: daxpedda <daxpedda@gmail.com>
This commit is contained in:
Kirill Chibisov 2025-10-07 21:42:36 +09:00 committed by GitHub
parent ffcdf80192
commit f046e778aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 1206 additions and 204 deletions

View file

@ -8,3 +8,10 @@ These files are created by [Mads Marquart](https://github.com/madsmtm) using
[draw.io](https://draw.io/), and compressed using [svgomg.net](https://svgomg.net/).
They are licensed under the [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/) license.
## tool_*.webp
These files are converted versions of
[W3C Pointer Events spec images](https://github.com/w3c/pointerevents/tree/93938ae7fe0172e2ae7587ad7d7c4fc8562d7153/images)
by [patrickhlauke](https://github.com/patrickhlauke). It is licensed under the
[W3C Software and Document License](https://www.w3.org/copyright/software-license).

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View file

@ -87,6 +87,7 @@ changelog entry.
- Add `Ime::DeleteSurrounding` to let the input method delete text.
- Add more `ImePurpose` values.
- Add `ImeHints` to request particular IME behaviour.
- Add Pen input support on Wayland, Windows, and Web via new Pointer event.
### Changed
@ -210,6 +211,7 @@ changelog entry.
- Move `EventLoopExtRunOnDemand` from platform module to `winit::event_loop::run_on_demand`.
- Use `NamedKey`, `Code` and `Location` from the `keyboard-types` v0.8 crate.
- Deprecate `Window::set_ime_allowed`, `Window::set_ime_cursor_area`, and `Window::set_ime_purpose`.
- `Force::normalized()` now takes a `Option<ToolAngle>` to calculate the perpendicular force.
### Removed
@ -249,6 +251,7 @@ changelog entry.
- Remove `NamedKey::Space`, match on `Key::Character(" ")` instead.
- Remove `PartialEq` impl for `WindowAttributes`.
- `WindowAttributesExt*` platform extensions; use `WindowAttributes*` instead.
- Remove `Force::Calibrated::altitude_angle` in favor of `ToolAngle::altitude`.
### Fixed
@ -264,3 +267,4 @@ changelog entry.
- On Windows, `Window::theme` will return the correct theme after setting it through `Window::set_theme`.
- On Windows, `Window::set_theme` will change the title bar color immediately now.
- On Windows 11, prevent incorrect shifting when dragging window onto a monitor with different DPI.
- On Web, device events are emitted regardless of cursor type.