You are not logged in.
Hi there!
I'm interested in in writing an input handler for Linux to be able to handle input without X. For some reason, any Google result gives me example using XInput (such annoying that Linux in our days means Linux Kernel + X server =\ ).
Any ideas or material to read? Thanks!
dotfiles
git pull strings master-of-puppets
Offline
If you're wanting raw events, you should probably read up on the kernel module documentation for the devices, e.g. usbhid, psmouse, synaptics, etc.
A link to get you started:
https://www.kernel.org/doc/Documentatio … /input.txt
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Thanks for the quick reply!
Maybe I misused the word "raw". I know there is evdev (or udev?) that sort of unifies the events from different devices. Can someone point me in that direction?
dotfiles
git pull strings master-of-puppets
Offline
evdev is a part of Xorg, so I don't think that will be much use to you. The source code is available on the xorg website if you want to look at it though.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
This part was very confusing. At some point I was sure evdev is part of the kernel.
Some there is no unified input access to the kernel apart from querying each device individually?
dotfiles
git pull strings master-of-puppets
Offline
My bad, yes it is a kernel module too, it's described in the first link I posted.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
For keyboard input you can use the output from /dev/input/eventX. I have a very simple keylogger that does this, it should be fairly straightforward but you can ask me if you have any questions: https://github.com/gsingh93/simple-key-logger
Offline
Do you need something as gsingh93 suggests, or are you just writing console/tty programs that need keyboard and mouse input. The latter is much easier. Just set a couple term settings to get the raw keyboard input and disable echoing (and/or use ncurses to do this for you) and use something like gpm (and/or ncurses) to handle mouse input.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline