summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/src/keyboard/modifiers.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/src/keyboard/modifiers.rs b/core/src/keyboard/modifiers.rs
index 383b9370..e61f145a 100644
--- a/core/src/keyboard/modifiers.rs
+++ b/core/src/keyboard/modifiers.rs
@@ -28,6 +28,18 @@ bitflags! {
}
impl Modifiers {
+ /// The "command" key.
+ ///
+ /// This is normally the main modifier to be used for hotkeys.
+ ///
+ /// On macOS, this is equivalent to `Self::LOGO`.
+ /// Ohterwise, this is equivalent to `Self::CTRL`.
+ pub const COMMAND: Self = if cfg!(target_os = "macos") {
+ Self::LOGO
+ } else {
+ Self::CTRL
+ };
+
/// Returns true if the [`SHIFT`] key is pressed in the [`Modifiers`].
pub fn shift(self) -> bool {
self.contains(Self::SHIFT)