Barcode scanner works in keyboard emulation mode. That is, it’s like another keyboard hooked up. The device /dev/hidraw1 . I can read it with the following code:
#include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> int main() { int fd = open("/dev/hidraw1", O_RDONLY); if (fd < 0) { printf("error opening device: %d\n", errno); return 1; } char buffer[256]; int bytes; while (1) { bytes = read(fd, buffer, sizeof buffer); if (bytes == -1) break; printf("read %d bytes\n", bytes); } return 0; } But, if it is launched in the console, then additionally the recognition result is automatically displayed in the console, but it is necessary that only my program receive it and not even show it anywhere. That is, that the second keyboard behaved simply as a device from which you can read something.
buffer? - avphidraw1device is (like) a second keyboard. That is, automatically writes there on what the focus. How can I disable it? - user239133stty -F /dev/hidraw1 raw -echo- avp/dev/input/help is not created? and if in the end the car will work with X'ami, then it is possible to switch off input by their means ... - Fat-Zerxinput --disable id-устройства.idcan be obtained, for example, from the output of the programxinput- aleksandr barakin