pull/324/head
Lucas Nogueira 2 years ago
parent 263041ec71
commit ab5f2a2d67
No known key found for this signature in database
GPG Key ID: FFEA6C72E73482F1

@ -86,7 +86,7 @@ async function registerAll(
* const isRegistered = await isRegistered('CommandOrControl+P'); * const isRegistered = await isRegistered('CommandOrControl+P');
* ``` * ```
* *
* @param shortcut Array of shortcut definitions, modifiers and key separated by "+" e.g. CmdOrControl+Q * @param shortcut shortcut definition, modifiers and key separated by "+" e.g. CmdOrControl+Q
* *
* @since 1.0.0 * @since 1.0.0
*/ */

@ -153,6 +153,9 @@ impl<R: Runtime> GlobalShortcut<R> {
.map_err(Into::into) .map_err(Into::into)
} }
/// Determines whether the given shortcut is registered by this application or not.
///
/// If the shortcut is registered by another application, it will still return `false`.
pub fn is_registered<S: TryInto<ShortcutWrapper>>(&self, shortcut: S) -> bool pub fn is_registered<S: TryInto<ShortcutWrapper>>(&self, shortcut: S) -> bool
where where
S::Error: std::error::Error, S::Error: std::error::Error,

Loading…
Cancel
Save