MCPcopy Create free account
hub / github.com/emberian/evdev / new_scroll_mouse_event

Function new_scroll_mouse_event

examples/virtual_mouse.rs:87–95  ·  view source on GitHub ↗
(direction: MoveDirection, distance: u16)

Source from the content-addressed store, hash-verified

85}
86
87fn new_scroll_mouse_event(direction: MoveDirection, distance: u16) -> InputEvent {
88 let (axis, distance) = match direction {
89 MoveDirection::Up => (RelativeAxisCode::REL_WHEEL.0, i32::from(distance)),
90 MoveDirection::Down => (RelativeAxisCode::REL_WHEEL.0, -i32::from(distance)),
91 MoveDirection::Left => (RelativeAxisCode::REL_HWHEEL.0, -i32::from(distance)),
92 MoveDirection::Right => (RelativeAxisCode::REL_HWHEEL.0, i32::from(distance)),
93 };
94 InputEvent::new_now(EventType::RELATIVE.0, axis, distance)
95}

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…