backend: add syspath and devnode to input devices
This commit is contained in:
parent
813f87faaa
commit
283e438d1b
9 changed files with 107 additions and 64 deletions
|
|
@ -3,6 +3,7 @@ use {
|
|||
backend::InputDevice,
|
||||
ifs::wl_seat::PX_PER_SCROLL,
|
||||
state::{DeviceHandlerData, InputDeviceData, State},
|
||||
tasks::udev_utils::{udev_props, UdevProps},
|
||||
utils::asyncevent::AsyncEvent,
|
||||
},
|
||||
std::{cell::Cell, rc::Rc},
|
||||
|
|
@ -22,6 +23,10 @@ pub fn handle(state: &Rc<State>, dev: Rc<dyn InputDevice>) {
|
|||
ae: ae.clone(),
|
||||
};
|
||||
let handler = state.eng.spawn(oh.handle());
|
||||
let props = match dev.dev_t() {
|
||||
None => UdevProps::default(),
|
||||
Some(dev_t) => udev_props(dev_t, 3),
|
||||
};
|
||||
state.input_device_handlers.borrow_mut().insert(
|
||||
dev.id(),
|
||||
InputDeviceData {
|
||||
|
|
@ -29,6 +34,8 @@ pub fn handle(state: &Rc<State>, dev: Rc<dyn InputDevice>) {
|
|||
id: dev.id(),
|
||||
data,
|
||||
async_event: ae,
|
||||
syspath: props.syspath,
|
||||
devnode: props.devnode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue