mirror of
https://github.com/moparisthebest/uinput-mapper
synced 2025-02-17 23:40:12 -05:00
Try harder to open /dev/uinput or /dev/input/uinput
This commit is contained in:
parent
b4eb639cd3
commit
6dcd3a22dd
12
map.c
12
map.c
@ -31,8 +31,6 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#define UINPUT_PATH "/dev/uinput"
|
|
||||||
|
|
||||||
/* Reverse mapping, for later use */
|
/* Reverse mapping, for later use */
|
||||||
static const struct _key_to_str {
|
static const struct _key_to_str {
|
||||||
char *name;
|
char *name;
|
||||||
@ -106,10 +104,14 @@ int main(int argc, char** argv) {
|
|||||||
for(j = 0; j < JOYCOUNT; j++) {
|
for(j = 0; j < JOYCOUNT; j++) {
|
||||||
/* Memset because we are already setting the absmax/absmin */
|
/* Memset because we are already setting the absmax/absmin */
|
||||||
memset(&uidev, '\0', sizeof(struct uinput_user_dev));
|
memset(&uidev, '\0', sizeof(struct uinput_user_dev));
|
||||||
js[j] = open(UINPUT_PATH, O_WRONLY | O_NONBLOCK);
|
js[j] = open("/dev/uinput", O_WRONLY | O_NONBLOCK);
|
||||||
if (js[j] < 0) {
|
if (js[j] < 0) {
|
||||||
perror("Could not open:" UINPUT_PATH);
|
perror("(NOT FATAL YET) Could not open: /dev/uinput");
|
||||||
return 1;
|
js[j] = open("/dev/input/uinput", O_WRONLY | O_NONBLOCK);
|
||||||
|
if (js[j] < 0) {
|
||||||
|
perror("(FATAL) Could not open: /dev/input/uinput");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define H_CONFIGURE_JOYSTICKS
|
#define H_CONFIGURE_JOYSTICKS
|
||||||
|
Loading…
Reference in New Issue
Block a user