mirror of
https://codeberg.org/icewind/evdev-shortcut.git
synced 2026-06-03 10:04:11 +02:00
add ShortcutListener::has
This commit is contained in:
parent
a8079c1b4d
commit
7f555ba931
1 changed files with 6 additions and 2 deletions
|
|
@ -81,7 +81,11 @@ impl ShortcutListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns `true` if the shortcut was previously listened to
|
/// Returns `true` if the shortcut was previously listened to
|
||||||
pub fn remove(&self, shortcut: Shortcut) -> bool {
|
pub fn remove(&self, shortcut: &Shortcut) -> bool {
|
||||||
self.shortcuts.lock().unwrap().remove(&shortcut)
|
self.shortcuts.lock().unwrap().remove(shortcut)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn has(&self, shortcut: &Shortcut) -> bool {
|
||||||
|
self.shortcuts.lock().unwrap().contains(shortcut)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue