Android: Do not mark unhandled events as handled. (#1820)

This commit is contained in:
alula 2021-01-12 08:25:56 +01:00 committed by GitHub
parent 9d63fc7ca0
commit d1a7749df5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View file

@ -4,6 +4,7 @@
- On Windows, change the default window size (1024x768) to match the default on other desktop platforms (800x600).
- On Windows, fix bug causing mouse capture to not be released.
- On Windows, fix fullscreen not preserving minimized/maximized state.
- On Android, unimplemented events are marked as unhandled on the native event loop.
# 0.24.0 (2020-12-09)

View file

@ -176,6 +176,7 @@ impl<T: 'static> EventLoop<T> {
if let Some(input_queue) = ndk_glue::input_queue().as_ref() {
while let Some(event) = input_queue.get_event() {
if let Some(event) = input_queue.pre_dispatch(event) {
let mut handled = true;
let window_id = window::WindowId(WindowId);
let device_id = event::DeviceId(DeviceId);
match &event {
@ -191,7 +192,10 @@ impl<T: 'static> EventLoop<T> {
MotionAction::Cancel => {
Some(event::TouchPhase::Cancelled)
}
_ => None, // TODO mouse events
_ => {
handled = false;
None // TODO mouse events
}
};
if let Some(phase) = phase {
let pointers: Box<
@ -235,9 +239,12 @@ impl<T: 'static> EventLoop<T> {
}
}
}
InputEvent::KeyEvent(_) => {} // TODO
InputEvent::KeyEvent(_) => {
// TODO
handled = false;
}
};
input_queue.finish_event(event, true);
input_queue.finish_event(event, handled);
}
}
}