pub fn new(mods: impl Into<Option<RawMods>>, key: impl IntoKey) -> Self {
        HotKey {
            mods: mods.into().unwrap_or(RawMods::None),
            key: key.into_key(),
        }
        .warn_if_needed()
    }
/// Create a new hotkey.
///
/// The first argument describes the keyboard modifiers. This can be `None`,
/// or an instance of either [`SysMods`], or [`RawMods`]. [`SysMods`] unify the
/// 'Command' key on macOS with the 'Ctrl' key on other platforms.
///
/// The second argument describes the non-modifier key. This can be either
/// a `&str` or a [`KbKey`]; the former is merely a convenient
/// shorthand for `KbKey::Character()`.
///
/// # Examples
/// ```
/// use druid_shell::{HotKey, KbKey, RawMods, SysMods};
///
/// let select_all = HotKey::new(SysMods::Cmd, "a");
/// let esc = HotKey::new(None, KbKey::Escape);
/// let macos_fullscreen = HotKey::new(RawMods::CtrlMeta, "f");
/// ```
///
/// [`Key`]: keyboard_types::Key
/// [`SysMods`]: enum.SysMods.html
/// [`RawMods`]: enum.RawMods.html
Create a new hotkey.
The first argument describes the keyboard modifiers.

The second argument describes the non-modifier key.
Create a new hotkey . The first argument describes the keyboard modifiers . The second argument describes the non - modifier key .
pub fn new(mods: impl Into<Option<RawMods>>, key: impl IntoKey) -> Self {
        HotKey {
            mods: mods.into().unwrap_or(RawMods::None),
            key: key.into_key(),
        }
        .warn_if_needed()
    }
pub fn new ( mods : impl Into < Option < RawMods > > , key : impl IntoKey ) -> Self { HotKey { mods : mods . into ( ) . unwrap_or ( RawMods :: None ) , key : key . into_key ( ) , } . warn_if_needed ( ) }
Create a new hotkey.
Create a new hotkey .
mods
impl Into<Option<RawMods>>
key
impl IntoKey
mods
impl Into<Option<RawMods>>
key
impl IntoKey
examples
```
use druid_shell::{HotKey, KbKey, RawMods, SysMods}.

let select_all = HotKey::new(SysMods::Cmd, "a");
let esc = HotKey::new(None, KbKey::Escape);
let macos_fullscreen = HotKey::new(RawMods::CtrlMeta, "f");
```

[`Key`]: keyboard_types::Key
[`SysMods`]: enum.SysMods.html
[`RawMods`]: enum.RawMods.html
` ` ` use druid_shell :: { HotKey KbKey RawMods SysMods } . let select_all = HotKey :: new ( SysMods :: Cmd " a " ) ; let esc = HotKey :: new ( None KbKey :: Escape ) ; let macos_fullscreen = HotKey :: new ( RawMods :: CtrlMeta " f " ) ; ` ` ` [ ` Key ` ] : keyboard_types :: Key [ ` SysMods ` ] : enum . SysMods . html [ ` RawMods ` ] : enum . RawMods . html