mirror of
https://github.com/moparisthebest/uinput-mapper
synced 2024-11-22 00:12:14 -05:00
Initial input-clone
This commit is contained in:
parent
71557bd433
commit
4918d8669e
13
read-device/Makefile
Normal file
13
read-device/Makefile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
.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
|
3
read-device/README
Normal file
3
read-device/README
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
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
|
26
read-device/read.c
Normal file
26
read-device/read.c
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#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