Introduce window::Id to Event subscriptions

And remove `window::Id` from `Event` altogether.
This commit is contained in:
Héctor Ramón Jiménez 2024-06-04 23:20:33 +02:00
parent 49affc44ff
commit e400f972c1
No known key found for this signature in database
GPG key ID: 4C07CEC81AFA161F
19 changed files with 95 additions and 91 deletions

View file

@ -18,7 +18,7 @@ where
#[derive(Hash)]
struct OnKeyPress;
subscription::filter_map((OnKeyPress, f), move |event, status| {
subscription::filter_map((OnKeyPress, f), move |event, status, _window| {
match (event, status) {
(
core::Event::Keyboard(Event::KeyPressed {
@ -45,8 +45,9 @@ where
#[derive(Hash)]
struct OnKeyRelease;
subscription::filter_map((OnKeyRelease, f), move |event, status| {
match (event, status) {
subscription::filter_map(
(OnKeyRelease, f),
move |event, status, _window| match (event, status) {
(
core::Event::Keyboard(Event::KeyReleased {
key,
@ -56,6 +57,6 @@ where
core::event::Status::Ignored,
) => f(key, modifiers),
_ => None,
}
})
},
)
}