use { crate::utils::vecset::VecSet, kbvm::Components, std::{ cell::{Ref, RefCell}, rc::Rc, }, uapi::OwnedFd, }; linear_ids!(KeyboardStateIds, KeyboardStateId, u64); pub struct KeyboardState { pub id: KeyboardStateId, pub map: Rc, pub map_len: usize, pub pressed_keys: VecSet, pub mods: Components, } pub trait DynKeyboardState { fn borrow(&self) -> Ref<'_, KeyboardState>; } impl DynKeyboardState for RefCell { fn borrow(&self) -> Ref<'_, KeyboardState> { self.borrow() } }