diff --git a/espanso-inject/build.rs b/espanso-inject/build.rs index a177c4b..16bd1a4 100644 --- a/espanso-inject/build.rs +++ b/espanso-inject/build.rs @@ -38,7 +38,7 @@ fn cc_config() { println!("cargo:rerun-if-changed=src/evdev/native.h"); println!("cargo:rerun-if-changed=src/evdev/native.c"); cc::Build::new() - .include("src/evdev/native.h") + .include("src/evdev") .file("src/evdev/native.c") .compile("espansoinjectev"); diff --git a/espanso-inject/src/evdev/native.c b/espanso-inject/src/evdev/native.c index 69e52ea..7b42dad 100644 --- a/espanso-inject/src/evdev/native.c +++ b/espanso-inject/src/evdev/native.c @@ -19,6 +19,7 @@ #include "native.h" #include +#include #include unsigned long ui_dev_destroy() @@ -56,15 +57,15 @@ int setup_uinput_device(int fd) void emit(int fd, int type, int code, int val) { - struct input_event ie; - ie.type = type; - ie.code = code; - ie.value = val; - // timestamp values below are ignored - ie.time.tv_sec = 0; - ie.time.tv_usec = 0; + struct input_event ie; + ie.type = type; + ie.code = code; + ie.value = val; + // timestamp values below are ignored + ie.time.tv_sec = 0; + ie.time.tv_usec = 0; - write(fd, &ie, sizeof(ie)); + write(fd, &ie, sizeof(ie)); } void uinput_emit(int fd, unsigned int code, int pressed) {