mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-11 13:31:29 +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
|
@ -202,7 +202,7 @@ Legend:
|
|||
|Cursor icon |✔️ |✔️ |✔️ |✔️ |**N/A**|**N/A**|✔️ |
|
||||
|Touch events |✔️ |❌ |✔️ |✔️ |✔️ |✔️ |❌ |
|
||||
|Touch pressure |✔️ |❌ |❌ |❌ |❌ |✔️ |❌ |
|
||||
|Multitouch |✔️ |❌ |✔️ |✔️ |❓ |✔️ |❌ |
|
||||
|Multitouch |✔️ |❌ |✔️ |✔️ |✔️ |✔️ |❌ |
|
||||
|Keyboard events |✔️ |✔️ |✔️ |✔️ |❓ |❌ |✔️ |
|
||||
|Drag & Drop |▢[#720] |▢[#720] |▢[#720] |❌[#306] |**N/A**|**N/A**|❓ |
|
||||
|Raw Device Events |▢[#750] |▢[#750] |▢[#750] |❌ |❌ |❌ |❓ |
|
||||
|
|
|
@ -193,14 +193,27 @@ impl<T: 'static> EventLoop<T> {
|
|||
}
|
||||
_ => None, // TODO mouse events
|
||||
};
|
||||
|
||||
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 {
|
||||
x: pointer.x() as _,
|
||||
y: pointer.y() as _,
|
||||
};
|
||||
|
||||
let event = event::Event::WindowEvent {
|
||||
window_id,
|
||||
event: event::WindowEvent::Touch(
|
||||
|
|
Loading…
Reference in a new issue