mirror of
https://github.com/italicsjenga/muda.git
synced 2025-01-11 04:11:32 +11:00
feat: derive Copy
for Accelerator
This commit is contained in:
parent
e587421c64
commit
e80c113d8c
5
.changes/accel-copy.md
Normal file
5
.changes/accel-copy.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"muda": "patch"
|
||||
---
|
||||
|
||||
Derive `Copy` for `Accelerator` type.
|
|
@ -33,7 +33,7 @@ use std::{borrow::Borrow, hash::Hash, str::FromStr};
|
|||
/// A keyboard shortcut that consists of an optional combination
|
||||
/// of modifier keys (provided by [`Modifiers`](crate::accelerator::Modifiers)) and
|
||||
/// one key ([`Code`](crate::accelerator::Code)).
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash, Copy)]
|
||||
pub struct Accelerator {
|
||||
pub(crate) mods: Modifiers,
|
||||
pub(crate) key: Code,
|
||||
|
|
|
@ -162,7 +162,7 @@ fn key_to_vk(key: &Code) -> VIRTUAL_KEY {
|
|||
Code::MediaPlayPause => VK_MEDIA_PLAY_PAUSE,
|
||||
Code::LaunchMail => VK_LAUNCH_MAIL,
|
||||
Code::Convert => VK_CONVERT,
|
||||
key => panic!("Unsupported modifier: {}", key),
|
||||
key => panic!("Unsupported key: {}", key),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue