Questions tagged [uinput]

uinput is a user level input subsystem. Basically it is a linux kernel module that allows to handle the input subsystem from user land

uinput is a user level input subsystem. Basically it is a kernel module that allows to handle the input subsystem from userspace. It can be used to create and to handle input devices from an application. It creates a character device in /dev/input directory. The device is a virtual interface, it doesn't belong to a physical device.

Once the uinput module is installed (via modprobe or insmod), a character device is created, named as /dev/input/uinput (or /dev/uinput on some systems). This device represents the interface between the application and the kernel input subsystem.

52 questions
8
votes
1 answer

Lib(s)uinput: creating joystick with more than one button

I can't find information, how create joystick with several buttons on it using uinput/suinput. Example on python using python-uinput: import uinput def main(): events = ( uinput.BTN_JOYSTICK, uinput.ABS_X + (0, 255, 0, 0), …
val - disappointed in SE
  • 1,475
  • 3
  • 16
  • 40
6
votes
2 answers

linux uinput: simple example?

I'm having some problems getting both sides of code using uinput working. Based on Getting started with uinput: the user level input subsystem[dead link; archived] I put together the following writer (minus error handling): int main(int ac, char…
Magnus
  • 4,644
  • 1
  • 33
  • 49
5
votes
0 answers

Failed to create a device file using `uinput` module. Python3 on Ubuntu for Windows

I have a python script that runs on python3.4 and uses the package keyboard to allow for keybinds; keyboard.add_hotkey("enter", self.listener.stop, suppress=True) keyboard.add_hotkey("shift+enter", self.listener.finish, suppress=True) When I run…
5
votes
1 answer

Is it efficient to use epoll with devices (/dev/event/...)?

I am working on a monothreaded process applet which creates a proxy virtual device (more precisely a virtual Xbox 360 pad); I do manage to create it with the uinput interface, I set it up properly and it works just fine. In order to feed commands to…
Emanuele
  • 1,408
  • 1
  • 15
  • 39
4
votes
0 answers

evdev cannot simulate touch input

I am trying to use evdev to simulate touch input. from evdev import UInput, AbsInfo, ecodes as e cap = { e.EV_KEY : [e.KEY_A, e.KEY_B], e.EV_ABS : [ (e.ABS_X, AbsInfo(value=0, min=0, max=255, fuzz=0,…
ovg
  • 1,486
  • 1
  • 18
  • 30
4
votes
2 answers

How to get name (path) of uinput created device

I have successfully set up a small program to create a uinput device which I plan to use to automate testing of an application receiving keyboard input events. I have followed both tutorials as found in this very nice answer. When my program creates…
Antonio Pérez
  • 6,702
  • 4
  • 36
  • 61
4
votes
1 answer

Uinput and Raspberry Pi

I tried to ask this question on the Raspberry Pi forums, but I have received no responses at all. I thought I might query the minds of the StackOverflow community that has been so helpful in the past. I'm writing a userspace driver for the…
PyroAVR
  • 719
  • 1
  • 8
  • 19
3
votes
0 answers

uinput and setting file permissions by chmod or rules

I'm writing a pseudo-chorded keyboard remapper here using evdev and uinput. I don't want to give my regular user the permission to read and write to /dev/input/event* and /dev/uinput so I have created a new user (hopr) with the sole purpose of…
athoren
  • 443
  • 4
  • 12
3
votes
1 answer

How to generate key strokes events with the Input Subsystem

I am writing a Key board emulator program in Linux, As a start I was able to render key strokes into X11 window but this is not working in virtual terminals and try out a different way. I referred to http://thiemonge.org/getting-started-with-uinput…
Dig The Code
  • 658
  • 2
  • 15
  • 32
2
votes
1 answer

Automate mouse pointer motion in Wayland on Debian (Not X11/X Window System)

I am trying to find a way to simulate/automate mouse motion using the Wayland protocol on a debian based OS as did using Xlib in X11/X Window System giving the x and y coordinates: from Xlib.display import Display from Xlib.ext.xtest import…
theEarlyRiser
  • 134
  • 12
2
votes
0 answers

Make mouse move via a virtual mouse device (none Xorg)

My goal is to remap a physical device (Aimtrak Lightgun) which acts like a mouse, towards different button input (the X,Y are fine). Currently the trigger registers as a right mouse click, but I want this to become a left mouse click. I did follow…
DeDenker
  • 397
  • 3
  • 14
2
votes
0 answers

uinput seems to break while sending inputs in quick succession

I have been trying to use the uinput kernel module to send mouseclicks in quick succession to other programs. This works fine if the delay between the clicks is 25ms or greater but it breaks if it is lower. When it breaks I can see the events with…
2
votes
1 answer

Make Xorg recognize libevdev virtual device

I've been trying to create a simple program using libevdev to make a virtual device that will simply move the mouse by 50 points on the X axis every second. The program runs just fine, however Xorg won't recognize the newly created virtual device. I…
hoz
  • 176
  • 1
  • 7
2
votes
1 answer

Why my code is not able to create simple input device using uinput?

I am trying to learn using /dev/uinput in linux and copied simple code from kernel.org/doc/html/v4.12/input/uinput.html which is below: #include void emit(int fd, int type, int code, int val) { struct input_event ie; ie.type…
Alok Prakash
  • 191
  • 1
  • 9
2
votes
1 answer

Can't write touch events to uinput using python-uinput

I am trying to write touch events. I am using a camera to track hands so I need two pointers and I need to display them. This is what I have tried but it does nothing: import uinput import time device = uinput.Device([ uinput.BTN_TOUCH, …
ovg
  • 1,486
  • 1
  • 18
  • 30
1
2 3 4