-
Notifications
You must be signed in to change notification settings - Fork 920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Back
button/KeyCode
on Android
#2304
Comments
@MarijnS95 is this still an issue? |
@kchibisov I don't see |
@kchibisov note that while searching for EDIT: Turns out that refactor happened in #2662 :) |
I guess everything is fine, right? |
@kchibisov it's not exactly fine as we cannot handle that keycode yet, it's not mapped. What's worse, we don't have a way to optionally mark the keycode as used at runtime (e.g. given how inconsistently we're forced to handle volume keys now since #2748) as users would likely want to back out of some menu stack. Once they are at the bottom of the stack, they will set |
But you can define a filter mask on event loop builder whether we want to accept or not? Like |
Was that built already? Your comment sounded like a suggestion but I'll check it out. Most important question: can we change the contents of the |
Well, it's not here, but nothing stops you from defining such a thing. You can change the event delivery at runtime, for example we have similar concept with |
Sure, I'll think about it but doubt I can find the time. Am I right in assuming that you're suggesting this route because going the extension way on |
Right, and because events are just data which could be send between threads. |
Exactly, we have to call EDIT: I still haven't decided whether we should give the user the event if it is in the "don't mark this as handled" |
Started playing about with
VirtualKeyCode
on Android, and it seems there's no mapping forKeyCode::Back
which would be needed to handle a graceful app exit (or going to the previous page) when the user presses it. The implementation forVirtualKeyCode::Back
reads:winit/src/event.rs
Lines 962 to 964 in f04fa5d
So I don't think we should add a new
Back
VirtualKeyCode
and rename existing uses toBackspace
, as that's really hard to notice for end-users upgrading theirwinit
. Perhaps we can piggybackNavigateBackward
but android already supports that asKeyCode::NavigatePrevious
:How do you think we should go forward?
Originally posted by @MarijnS95 in #2226 (comment)
The text was updated successfully, but these errors were encountered: