mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
feat(desktop): portal-based Linux global shortcuts and PTT (#3185)
This commit is contained in:
1 parent
5799ef705d
commit
8f58fcc4c4
149 files changed
+26849
-8769
No files matched your search
@@ -185,14 +185,6 @@ pub fn keycode_to_name(code: u16) -> Option<&'static str> {
|
||||
.map(|(_, name)| *name)
|
||||
}
|
||||
|
||||
pub fn name_to_keycode(name: &str) -> u16 {
|
||||
KEY_MAP
|
||||
.iter()
|
||||
.find(|(_, entry_name)| *entry_name == name)
|
||||
.map(|(code, _)| *code)
|
||||
.unwrap_or(0)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
@@ -211,15 +203,6 @@ mod tests {
|
||||
assert_eq!(keycode_to_name(0xffff), None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn name_to_keycode_round_trips_every_entry() {
|
||||
for (code, name) in KEY_MAP {
|
||||
assert_eq!(name_to_keycode(name), *code);
|
||||
}
|
||||
assert_eq!(name_to_keycode("NoSuchKey"), 0);
|
||||
assert_eq!(name_to_keycode(""), 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn evdev_button_matches_dom_convention() {
|
||||
assert_eq!(evdev_button_to_browser_button(BTN_LEFT), Some(0));
|
||||
|
||||
Reference in new issue
Block a user