From 6945d551317f9edcb106cfa528cf08499b7a636d Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 9 May 2025 07:04:31 -0400 Subject: print /sys path to input device if debugging. --- marsond.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'marsond.c') diff --git a/marsond.c b/marsond.c index 2bc65f0..f438aa0 100644 --- a/marsond.c +++ b/marsond.c @@ -313,7 +313,7 @@ int main(int argc, char **argv) { if(ioctl(outfd, UI_SET_KEYBIT, i) >= 0) { /* we don't wanna be *that* verbose */ } else { - die("UI_SET_KEYBIT failed: %s", strerror(errno)); + die("UI_SET_KEYBIT %d failed: %s", i, strerror(errno)); } } debug("UI_SET_KEYBIT OK"); @@ -338,7 +338,14 @@ int main(int argc, char **argv) { /* I was hoping the return value of this ioctl would be the device number, but it's just 0 for no error. */ if(ioctl(outfd, UI_DEV_CREATE) >= 0) { - debug("created virtual keyboard device"); + if(debugging) { + char name[64]; + if(ioctl(outfd, UI_GET_SYSNAME(sizeof(name)), name) >= 0) { + debug("created virtual keyboard device: /sys/devices/virtual/input/%s/", name); + } else { + debug("created virtual keyboard device but couldn't get its name (weird)"); + } + } } else { die("UI_DEV_CREATE failed: %s", strerror(errno)); } -- cgit v1.2.3