mirror of
https://github.com/moparisthebest/uinput-mapper
synced 2024-11-24 08:52:14 -05:00
Fix configuration + Exception.
This commit is contained in:
parent
d3b23386bf
commit
a340b28289
@ -119,10 +119,10 @@ class InputDevice(object):
|
||||
def open_uinput():
|
||||
try:
|
||||
f = os.open('/dev/uinput', os.O_WRONLY | os.O_NONBLOCK)
|
||||
except IOError:
|
||||
except OSError:
|
||||
try:
|
||||
f = os.open('/dev/input/uinput', os.O_WRONLY | os.O_NONBLOCK)
|
||||
except IOError:
|
||||
except OSError:
|
||||
print 'FAIL MUCH?'
|
||||
return None
|
||||
return f
|
||||
|
@ -71,7 +71,7 @@ class KeyMapper(object):
|
||||
"""
|
||||
_type = ev.type
|
||||
|
||||
if _type in self._config:
|
||||
if (fd, _type) in self._config:
|
||||
typemaps = self._config[(fd, _type)]
|
||||
if ev.code in typemaps:
|
||||
info = typemaps[ev.code]
|
||||
|
@ -1,13 +0,0 @@
|
||||
.PHONY: default clean
|
||||
|
||||
CFLAGS+=-ansi -pedantic -Wall -Wextra -Werror -Wno-unused-result
|
||||
CFLAGS+=-pipe -O2
|
||||
CFLAGS+=-D_BSD_SOURCE
|
||||
|
||||
default: read
|
||||
|
||||
map: read.c
|
||||
$(CC) read.c $(CFLAGS) -o read
|
||||
|
||||
clean:
|
||||
rm -f read
|
@ -1,3 +0,0 @@
|
||||
Use: evtest /dev/input/by-id/usb-Logitech_USB-PS_2_Optical_Mouse-event-mouse
|
||||
|
||||
Check: http://cgit.freedesktop.org/evtest/tree/evtest.c#n739
|
@ -1,26 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <linux/input.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#define INPUT_PATH "/dev/input/by-id/usb-Logitech_USB-PS_2_Optical_Mouse-event-mouse"
|
||||
|
||||
int main (int argc, char** argv) {
|
||||
int f;
|
||||
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
|
||||
f = open(INPUT_PATH, O_RDONLY);
|
||||
|
||||
if (f < 0) {
|
||||
perror("open");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user