1
0
Fork 0
forked from wry/wry

keyboard: use kbvm::Components

This commit is contained in:
Julian Orth 2025-01-07 11:53:00 +01:00
parent e7d5a23af3
commit 51ceba72b0
10 changed files with 106 additions and 44 deletions

View file

@ -1,5 +1,6 @@
use {
crate::utils::vecset::VecSet,
kbvm::Components,
std::{
cell::{Ref, RefCell},
rc::Rc,
@ -7,15 +8,6 @@ use {
uapi::OwnedFd,
};
#[derive(Copy, Clone, Debug, Default)]
pub struct ModifierState {
pub mods_depressed: u32,
pub mods_latched: u32,
pub mods_locked: u32,
pub mods_effective: u32,
pub group: u32,
}
linear_ids!(KeyboardStateIds, KeyboardStateId, u64);
pub struct KeyboardState {
@ -23,7 +15,7 @@ pub struct KeyboardState {
pub map: Rc<OwnedFd>,
pub map_len: usize,
pub pressed_keys: VecSet<u32>,
pub mods: ModifierState,
pub mods: Components,
}
pub trait DynKeyboardState {