mirror of
https://codeberg.org/icewind/evdev-shortcut.git
synced 2026-06-04 02:24:11 +02:00
updates
This commit is contained in:
parent
b972b91c79
commit
831345ea74
3 changed files with 241 additions and 268 deletions
12
src/lib.rs
12
src/lib.rs
|
|
@ -45,7 +45,6 @@ use std::collections::HashSet;
|
|||
use std::fmt::{self, Debug, Display, Formatter};
|
||||
use std::path::PathBuf;
|
||||
use std::str::FromStr;
|
||||
use thiserror::Error;
|
||||
|
||||
mod keycodes;
|
||||
|
||||
|
|
@ -56,12 +55,19 @@ mod listener;
|
|||
pub use listener::ShortcutListener;
|
||||
|
||||
/// Error emitted when an input device can't be opened
|
||||
#[derive(Debug, Clone, Error)]
|
||||
#[error("Failed to open device {device:?}")]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct DeviceOpenError {
|
||||
pub device: PathBuf,
|
||||
}
|
||||
|
||||
impl Display for DeviceOpenError {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "Failed to open device {:?}", self.device)
|
||||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for DeviceOpenError {}
|
||||
|
||||
/// Modifier key for shortcuts
|
||||
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Display, FromStr)]
|
||||
#[repr(u8)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue