mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-26 03:36:32 +11:00
Android: Improved multi-touch (#1783)
* Improved multi-touch * Update feature matrix * Generate cancelled events for all pointers * Changed back features matrix layout * Reduced code duplication * Updated changelog * Revert changelog update
This commit is contained in:
parent
6ddee9a8ac
commit
8fb7aa5cef
2 changed files with 17 additions and 4 deletions
|
@ -202,7 +202,7 @@ Legend:
|
||||||
|Cursor icon |✔️ |✔️ |✔️ |✔️ |**N/A**|**N/A**|✔️ |
|
|Cursor icon |✔️ |✔️ |✔️ |✔️ |**N/A**|**N/A**|✔️ |
|
||||||
|Touch events |✔️ |❌ |✔️ |✔️ |✔️ |✔️ |❌ |
|
|Touch events |✔️ |❌ |✔️ |✔️ |✔️ |✔️ |❌ |
|
||||||
|Touch pressure |✔️ |❌ |❌ |❌ |❌ |✔️ |❌ |
|
|Touch pressure |✔️ |❌ |❌ |❌ |❌ |✔️ |❌ |
|
||||||
|Multitouch |✔️ |❌ |✔️ |✔️ |❓ |✔️ |❌ |
|
|Multitouch |✔️ |❌ |✔️ |✔️ |✔️ |✔️ |❌ |
|
||||||
|Keyboard events |✔️ |✔️ |✔️ |✔️ |❓ |❌ |✔️ |
|
|Keyboard events |✔️ |✔️ |✔️ |✔️ |❓ |❌ |✔️ |
|
||||||
|Drag & Drop |▢[#720] |▢[#720] |▢[#720] |❌[#306] |**N/A**|**N/A**|❓ |
|
|Drag & Drop |▢[#720] |▢[#720] |▢[#720] |❌[#306] |**N/A**|**N/A**|❓ |
|
||||||
|Raw Device Events |▢[#750] |▢[#750] |▢[#750] |❌ |❌ |❌ |❓ |
|
|Raw Device Events |▢[#750] |▢[#750] |▢[#750] |❌ |❌ |❌ |❓ |
|
||||||
|
|
|
@ -193,14 +193,27 @@ impl<T: 'static> EventLoop<T> {
|
||||||
}
|
}
|
||||||
_ => None, // TODO mouse events
|
_ => None, // TODO mouse events
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Some(phase) = phase {
|
if let Some(phase) = phase {
|
||||||
for pointer in motion_event.pointers() {
|
let pointers: Box<
|
||||||
|
dyn Iterator<Item = ndk::event::Pointer<'_>>,
|
||||||
|
> = match phase {
|
||||||
|
event::TouchPhase::Started
|
||||||
|
| event::TouchPhase::Ended => Box::new(
|
||||||
|
std::iter::once(motion_event.pointer_at_index(
|
||||||
|
motion_event.pointer_index(),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
event::TouchPhase::Moved
|
||||||
|
| event::TouchPhase::Cancelled => {
|
||||||
|
Box::new(motion_event.pointers())
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
for pointer in pointers {
|
||||||
let location = PhysicalPosition {
|
let location = PhysicalPosition {
|
||||||
x: pointer.x() as _,
|
x: pointer.x() as _,
|
||||||
y: pointer.y() as _,
|
y: pointer.y() as _,
|
||||||
};
|
};
|
||||||
|
|
||||||
let event = event::Event::WindowEvent {
|
let event = event::Event::WindowEvent {
|
||||||
window_id,
|
window_id,
|
||||||
event: event::WindowEvent::Touch(
|
event: event::WindowEvent::Touch(
|
||||||
|
|
Loading…
Add table
Reference in a new issue