mirror of
https://github.com/italicsjenga/muda.git
synced 2025-01-11 12:21:30 +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
|
/// A keyboard shortcut that consists of an optional combination
|
||||||
/// of modifier keys (provided by [`Modifiers`](crate::accelerator::Modifiers)) and
|
/// of modifier keys (provided by [`Modifiers`](crate::accelerator::Modifiers)) and
|
||||||
/// one key ([`Code`](crate::accelerator::Code)).
|
/// one key ([`Code`](crate::accelerator::Code)).
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash, Copy)]
|
||||||
pub struct Accelerator {
|
pub struct Accelerator {
|
||||||
pub(crate) mods: Modifiers,
|
pub(crate) mods: Modifiers,
|
||||||
pub(crate) key: Code,
|
pub(crate) key: Code,
|
||||||
|
|
|
@ -162,7 +162,7 @@ fn key_to_vk(key: &Code) -> VIRTUAL_KEY {
|
||||||
Code::MediaPlayPause => VK_MEDIA_PLAY_PAUSE,
|
Code::MediaPlayPause => VK_MEDIA_PLAY_PAUSE,
|
||||||
Code::LaunchMail => VK_LAUNCH_MAIL,
|
Code::LaunchMail => VK_LAUNCH_MAIL,
|
||||||
Code::Convert => VK_CONVERT,
|
Code::Convert => VK_CONVERT,
|
||||||
key => panic!("Unsupported modifier: {}", key),
|
key => panic!("Unsupported key: {}", key),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue