diff options
author | Mikhail Burakov <mburakov@mailbox.org> | 2023-10-17 10:33:24 +0200 |
---|---|---|
committer | Mikhail Burakov <mburakov@mailbox.org> | 2023-10-17 10:33:24 +0200 |
commit | 9aa119e6765568103f5a41b401b305dff509e13a (patch) | |
tree | fdedde63346f64238c328cd814d8dfd6b372cc2f /input.c | |
parent | e9f288fd0912cde18cddd78eae030e0e877c228c (diff) |
Allow disabling uhid interop from the commandline
Diffstat (limited to 'input.c')
-rw-r--r-- | input.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -36,7 +36,7 @@ struct InputHandler { int uhid_fd; }; -struct InputHandler* InputHandlerCreate(void) { +struct InputHandler* InputHandlerCreate(bool disable_uhid) { struct InputHandler* input_handler = malloc(sizeof(struct InputHandler)); if (!input_handler) { LOG("Failed to allocate input handler (%s)", strerror(errno)); @@ -47,7 +47,8 @@ struct InputHandler* InputHandlerCreate(void) { }; BufferCreate(&input_handler->buffer); - input_handler->uhid_fd = open("/dev/uhid", O_RDWR); + input_handler->uhid_fd = + open(disable_uhid ? "/dev/null" : "/dev/uhid", O_RDWR); if (input_handler->uhid_fd == -1) { LOG("Failed to open uhid device (%s)", strerror(errno)); goto rollback_input_handler; |