From a340b282894f1ba4dc269f8ff728c9edeff4b29b Mon Sep 17 00:00:00 2001 From: Merlijn Wajer Date: Sat, 18 May 2013 22:25:17 +0200 Subject: [PATCH] Fix configuration + Exception. --- cinput.py | 4 ++-- mapper.py | 2 +- read-device/Makefile | 13 ------------- read-device/README | 3 --- read-device/read.c | 26 -------------------------- 5 files changed, 3 insertions(+), 45 deletions(-) delete mode 100644 read-device/Makefile delete mode 100644 read-device/README delete mode 100644 read-device/read.c diff --git a/cinput.py b/cinput.py index 46d7d3f..668d950 100644 --- a/cinput.py +++ b/cinput.py @@ -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 diff --git a/mapper.py b/mapper.py index a5ae27e..a2b96b5 100644 --- a/mapper.py +++ b/mapper.py @@ -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] diff --git a/read-device/Makefile b/read-device/Makefile deleted file mode 100644 index b3db7ae..0000000 --- a/read-device/Makefile +++ /dev/null @@ -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 diff --git a/read-device/README b/read-device/README deleted file mode 100644 index d6f90b7..0000000 --- a/read-device/README +++ /dev/null @@ -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 diff --git a/read-device/read.c b/read-device/read.c deleted file mode 100644 index 64f63f0..0000000 --- a/read-device/read.c +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include -#include - -#include -#include - -#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; -}