config: add various new functions
This commit is contained in:
parent
f1a3705699
commit
e24a61bc62
12 changed files with 435 additions and 28 deletions
|
|
@ -11,10 +11,16 @@ use {
|
|||
};
|
||||
|
||||
pub fn handle(state: &Rc<State>, dev: Rc<dyn InputDevice>) {
|
||||
let props = match dev.dev_t() {
|
||||
None => UdevProps::default(),
|
||||
Some(dev_t) => udev_props(dev_t, 3),
|
||||
};
|
||||
let data = Rc::new(DeviceHandlerData {
|
||||
seat: Default::default(),
|
||||
px_per_scroll_wheel: Cell::new(PX_PER_SCROLL),
|
||||
device: dev.clone(),
|
||||
syspath: props.syspath,
|
||||
devnode: props.devnode,
|
||||
});
|
||||
let ae = Rc::new(AsyncEvent::default());
|
||||
let oh = DeviceHandler {
|
||||
|
|
@ -24,10 +30,6 @@ 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 {
|
||||
|
|
@ -35,8 +37,6 @@ 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