Use bitflags for keyboard::Modifiers
This commit is contained in:
parent
735cfb7908
commit
b57d567981
6 changed files with 78 additions and 72 deletions
|
|
@ -43,18 +43,8 @@ impl Application for App {
|
|||
}
|
||||
|
||||
fn menu(&self) -> Menu<Message> {
|
||||
let alt = Modifiers {
|
||||
alt: true,
|
||||
control: false,
|
||||
logo: false,
|
||||
shift: false,
|
||||
};
|
||||
let ctrl_shift = Modifiers {
|
||||
control: true,
|
||||
shift: true,
|
||||
logo: false,
|
||||
alt: false,
|
||||
};
|
||||
let alt = Modifiers::ALT;
|
||||
let ctrl_shift = Modifiers::CTRL | Modifiers::SHIFT;
|
||||
|
||||
Menu::with_entries(vec![
|
||||
menu::Entry::dropdown(
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ impl Application for Example {
|
|||
Event::Keyboard(keyboard::Event::KeyPressed {
|
||||
modifiers,
|
||||
key_code,
|
||||
}) if modifiers.is_command_pressed() => handle_hotkey(key_code),
|
||||
}) if modifiers.command() => handle_hotkey(key_code),
|
||||
_ => None,
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue