mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-03 12:21:29 +03:00
proper frame events
This commit is contained in:
@@ -114,9 +114,10 @@ fn udp_loop(connection: &protocol::Connection, pointer: &Vp, keyboard: &Vk, q: E
|
||||
loop {
|
||||
if let Some(event) = connection.receive_event() {
|
||||
match event {
|
||||
protocol::Event::Mouse { t, x, y } => { pointer.motion(t, x, y); pointer.frame(); }
|
||||
protocol::Event::Button { t, b, s } => { pointer.button(t, b, s); pointer.frame(); }
|
||||
protocol::Event::Axis { t, a, v } => { pointer.axis(t, a, v); pointer.frame(); }
|
||||
protocol::Event::Mouse { t, x, y } => { pointer.motion(t, x, y); }
|
||||
protocol::Event::Button { t, b, s } => { pointer.button(t, b, s); }
|
||||
protocol::Event::Axis { t, a, v } => { pointer.axis(t, a, v); }
|
||||
protocol::Event::Frame { } => { pointer.frame(); },
|
||||
protocol::Event::Key { t, k, s } => { keyboard.key(t, k, u32::from(s)); pointer.frame(); },
|
||||
protocol::Event::KeyModifier { mods_depressed, mods_latched, mods_locked, group } => {
|
||||
keyboard.modifiers(mods_depressed, mods_latched, mods_locked, group);
|
||||
|
||||
@@ -364,6 +364,9 @@ impl Dispatch<wl_pointer::WlPointer, ()> for App {
|
||||
let e = protocol::Event::Axis { t: time, a: (axis.into_result().unwrap()), v: value };
|
||||
app.connection.send_event(&e);
|
||||
}
|
||||
wl_pointer::Event::Frame {} => {
|
||||
app.connection.send_event(&protocol::Event::Frame{});
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user