Introduce window::Id to Event subscriptions
And remove `window::Id` from `Event` altogether.
This commit is contained in:
parent
49affc44ff
commit
e400f972c1
19 changed files with 95 additions and 91 deletions
|
|
@ -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,
|
||||
}
|
||||
})
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue