Questions tagged [evdev]

Generic input event interface in Linux

evdev is a generic input event interface in the Linux kernel.

It generalizes raw input events from device drivers and makes them available through character devices in the /dev/input/ directory.

See here for further information.

124 questions
0
votes
1 answer

Return result from Daemon thread watching evdev input events

I am trying to return the results of a Daemon thread. I am using evdev to monitor touch input events and if there is more than 0 touch events then I want to return True. I am trying to pass a list as an arg to the thread's target function and in…
0
votes
0 answers

read two infrared sensors with raspberrypi and python

I'm developing a project in python with raspberry pi and two infrared sensors. The infrared emitter is on an Arduino and is continuously sending a code every 50ms and this rate cannot be changed. I need the raspberrypi python script to check the two…
0
votes
0 answers

question about python evdev rfid card scanner data

Can anyone help me figure out how to use evdev python module? I have a usb card scanner that I want to use to scan a card and make a raspberry pi play some music file through Kodi media player. I can scan the card and get the info from it but since…
lucian
  • 350
  • 4
  • 18
0
votes
1 answer

evdev: Find the "rest" value of a gamepad axis

How to find what is the at-rest value of any axis of a game controller? For example, on my Dualshock 4, here is the relevant data from evtest: Event code 0 (ABS_X) Value 126 Min 0 Max 255 Flat 15 Event code 1 (ABS_Y) …
strNOcat
  • 913
  • 2
  • 8
  • 22
0
votes
1 answer

Can someone explain to me this keys variable does

I am developing a door lock using USB RFID and raspberry. I searched and almost all the python scripts I found with familiar code have the following variable keys. So can someone explain to me why they use it or why I have to use it too. Thank you…
Cheekou
  • 35
  • 6
0
votes
1 answer

grab() after device.leds() turns off led

I can read the NUML_LED state using evdev. But if I grab() the device after reading the leds when I exit the program the led is off even though the state is still on as far as the system is concerned. import evdev device =…
FoxSam12
  • 179
  • 1
  • 9
0
votes
1 answer

Doing things (driving servos, turning on led) using joystick input

I'm building a basic DVa Mech robot (hobby). This is non-bipedal. Wheeled chassis. All code in python. How do I continuously perform activities while holding down a button, pushing a joystick? And can I even do two (or more) at once: move wheels…
0
votes
1 answer

USB event capture in While True Loop

I'm looking to capture single USB keyboard events within a "while True" loop which includes a timer function as well. Evdev is close to what I need but it's device.read_loop does not allow for inclusion of a clock function - it's a closed loop. Any…
0
votes
1 answer

Track multiple touch down's / up's with libevdev

I'm using libevdev and having trouble understanding how I can detect multiple touch downs / ups. As shown on this libevdev tutorial you can see that on the last example on the page, there are two touches occuring. However, only twoBTN_TOUCHevents…
default
  • 2,637
  • 21
  • 44
0
votes
1 answer

How to (reliably) read USB barcode scanner in embedded (headless) Linux?

I need to interface generic USB scanners (not a single, defined, model) with an embedded Linux device (mips32/MT7620 running Linux 3.18, if it matters). All scanners operate in "keyboard emulation mode" and, sure enough, if plugged into a desktop…
ZioByte
  • 2,690
  • 1
  • 32
  • 68
0
votes
0 answers

TypeError: 'InputDevice' object is not iterable

Im going to paste my entire function here before the question. def trackBoth(): #if event determination variable is 1 it has both K and M if it is 2 it is only K or M if 3 then none x_max = 800 #defines largest position mouse can go (19th…
0
votes
3 answers

Linux module compiling: struct evdev member not found

So, I am trying to modify evdev.c, which is an event handler driver for input devices like mouse on linux. The problem I am having is that when I try to compile the module, I get a ton of errors saying the members of evdev cannot be…
user623879
  • 4,066
  • 9
  • 38
  • 53
0
votes
1 answer

Python evdev not finding devices

I'm writing a game using python, and I need to monitor keyboard events using evdev. I'm new to this lib, so I followed the tutorial online. The following is the script mentioned in the tutorial: >>> import evdev >>> devices =…
Swi Jason
  • 471
  • 1
  • 3
  • 10
0
votes
1 answer

Local variable not declared - cannot be fixed with any current stack solutions

I understand this is a question asked several times on here, but even after viewing and attempting to use all solutions on this site none fix my problem. Here is my code: def trackMouse(): global x, y x = 0 y = 0 x_max = 1000 …
0
votes
0 answers

Why I cannot clear buffer before I use read() command? (linux, evdev-input, read, flush)

Please execuse me for my english I am not native. Linux input device: /dev/input/event0 or /dev/input/by-id/usb-Logitech_G29_Driving_Force_Racing_Wheel-event-joystick Problem: I don’t want to read buffered data. Dear Stackoverflow, 1 - I opened an…
ankebut
  • 21
  • 4
1 2 3
8 9