From 8f3f04b4d083fe40db6e9106e7e44f25475874c1 Mon Sep 17 00:00:00 2001 From: xdavidwu Date: Mon, 16 May 2022 16:59:01 +0800 Subject: [PATCH] uinput-pointer: simplify use of uinput submodule --- tools/uinput-pointer/main.ha | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/uinput-pointer/main.ha b/tools/uinput-pointer/main.ha index 9239266..e1b60ab 100644 --- a/tools/uinput-pointer/main.ha +++ b/tools/uinput-pointer/main.ha @@ -16,17 +16,17 @@ export fn main() void = { evdev::enable_event_code(evdev, evdev::EV_KEY, evdev::BTN_MIDDLE, null)!; evdev::enable_event_code(evdev, evdev::EV_KEY, evdev::BTN_RIGHT, null)!; - const uinput = match (evdev::uinput::create_from_device(evdev, evdev::uinput::OPEN_MANAGED)) { - case let uinput: evdev::uinput::uinput => + const uinput = match (uinput::create_from_device(evdev, uinput::OPEN_MANAGED)) { + case let uinput: uinput::uinput => yield uinput; case let err: rt::errno => fmt::fatalf("Failed to create uinput dev: {}", rt::strerror(err)); }; - defer evdev::uinput::destroy(uinput); + defer uinput::destroy(uinput); for (let i = 0; i < 100; i += 1) { - evdev::uinput::write_event(uinput, evdev::EV_REL, evdev::REL_X, 1)!; - evdev::uinput::write_event(uinput, evdev::EV_SYN, evdev::SYN_REPORT, 0)!; + uinput::write_event(uinput, evdev::EV_REL, evdev::REL_X, 1)!; + uinput::write_event(uinput, evdev::EV_SYN, evdev::SYN_REPORT, 0)!; time::sleep(10 * time::MILLISECOND); }; }; -- 2.45.2