Linux exclusive access to keyboard events
location: linuxexchange.com - date: January 1, 1970
I am working on a program that is supposed to run every time a USB keyboard is inserted in a computer. I am capturing the event with udev but I need a way to exclusively capture keyboard events (keypresses) and not propagate them any further until my program is complete.
This is supposed to be a Linux only program. Currently I am using C and C++ but I could use any technlogy to achieve this.
Any ideas how it could be done?
How can I capture keyboard events and use a monitor as a textdisplay on Linux?
- date: June 17, 2015
I have a server running in multi-user mode that is connected to a keyboard and a monitor. On a separate computer, I would like to SSH to the server and run a program that captures input from the keyboard and prints text to the monitor. The keyboard and monitor will never be used for any other purpose.
Right now, when the server boots, a (text) login screen is displayed on the monitor. I know that I can write to the corresponding /dev/tty device. However, the keyboard also writes to the same place.
How can I capture keyboard events and use a monitor as a text-display on Linux?
I may be missing some of the basics around hardware interfacing on Linux. What do I need to know?
Running out of bounty time - If someone wants to flesh this out further I'll award accordingly:
I did the following to prevent any login programs from starting:
systemctl mask [email protected]
systemctl mask systemd-logind
systemctl mask [email protected]
Then I am running my program when required with:
Getting exclusive access to a tty device from a root program on Linux
location: linuxexchange.com - date: March 28, 2009
I have a program running as root on Linux, talking to a tty (actually an LCD implemented as a tty). The device for what it's worth is /dev/ttyUSB0. I'd like to have my program that writes to this device be able to have exclusive access to the device, so as to not have any interference from other instances of the program running at the same time.
I see that there's a ioctl option called TIOCEXCL which will prevent additonal open's of the device to wit "multiple open() calls to the same file will succeed unless the TIOCEXCL ioctl is issued. This will prevent additional opens except by root-owned processes." I tested this and it works just as advertised: if a non-root user tries to open /dev/ttyUSB0 (once I changed the permissions) then the open fails with something like "device busy" and if a root user tries to open it, it works.
What I ideally want is a way to this exclusive access to the tty to work for root users. So I'd have multiple root users using the program that writes to the
Linux and trapping keyboard input
location: linuxquestions.com - date: July 25, 2007
I'm designing a small embedded system. It will only have a serial terminal active, but has a PS/2 keyboard connector. I would like to use a keyboard to activate certain functions on the system.
My question is how do I go about trapping keyboard input from a daemon? Is there any way to directly access the raw keyboard input? Running as root is no problem.
Ideally the daemon will be coded in Python, but I have a feeling this is a task that can only be implemented in C... which isn't nice, being that I don't know C.
Ok, the in-depth description:
I'm making a hardware device that will have about six hardware switches on it. I'm probably using one of the ~$100 boards from a company like EWayCo (www.ewayco.com) and building it into a custom enclosure. The board doesn't offer GPIO, and from what I've heard, serial switches would require a custom made board to work. So I looked at the keyboard encoders from Hagstrom Electronics (http://www.hagstromelectronics.com/) which allow you
MIDI and Linux (interface w. keyboard, transcription)
location: linuxquestions.com - date: August 12, 2004
I have a client who is currently an Apple user but wants to make the jump to Linux. He needs to purchase a new computer soon with the intent of:
1. Capturing MIDI input from what he plays on a keyboard
2. Graphically modifying and cleaning up what was captured
3. Printing in full musical notation the final file so he doesn't have to transcribe it by hand
How feasable is this in Linux? I need to be able to set up a system that he can operate as a fairly sophisticated average user when I'm not there.
Could somebody point me in the right direction? I've done a few searches, but since I don't even know how to phrase what I'm looking for, so I haven't found anything.
putty to connect to my linux server, the keyboard(keypad=number:1,2,3...)cannot use?
location: linuxquestions.com - date: August 12, 2008
Hi, I having one problem regarding i am using putty from winxp pc to connect to my linux server, than i found a problem is i can press the keypad number like 1,2,3,4... on normal, but when i am using command vim to edit the file than all the keypad number key when i press than not come out 1,2,3,4 correct key, just come out A,B,D,F... why? I have try to change the setting on keyboard from putty, but still same. How to solve this problem? thank you very much.
Pocket LINUX PC with Keyboard?
location: ubuntuforums.com - date: October 20, 2012
I was considering buying a new small size PC that would welcome Linux (Ubuntu).
Would you know any else than Zaurus?
- an USB port
- a mechanical keyboard
what about this one? Which one might it be?
How linux driver notify asynchrnous events to user space
location: linuxquestions.com - date: January 15, 2014
I am looking methods to implements asynchronous events handing in kernel & send data to userspace.
I saw there are many ways to handle asynchrnous event in linux eg. fasync, poll etc.
My requirement is as soon as receive the event in kernel space, send event notification along with the data to user space.
Can any one send the best mechanism/ sample code use in linux?
Keystroke Dynamics, Keyboard Events, linuxrt
location: ubuntuforums.com - date: March 17, 2009
To implement a keystroke dynamics program, i need to capture keyup & keydown events, and also the time elapsed between these events.
1. How to capture keyup and keydown events in C? Any specific functions or library i can make use of? Or any way to hook to keyboard interrupts?
2. How to ensure that the timing is accurate and consistent? Should i make use of Ubuntu's linux-rt realtime kernel? Doesn't the CONFIG_PREEMPT_PATCH yield to other processes is the realtime app is waiting for I/O (keyboard??) ?
Any help or suggestions are welcome. Thanks.
Linux Mint International Keyboard
location: linuxquestions.com - date: May 30, 2015
I'm a new linux user. I also use Windows 7.
I write in English & French using the USA International Keyboard on Windows ... this works well with 'overstike' (eg, '+e = é). I'm sure there's a linux term for this.
I don't mind making a full keyboard definition myself, but I don't know how & there must be a simple way to get this done.
I really need a full, detailed reference to doing this ... including where to find the various directories (I HAVE found the 'Terminal', but that's it !).
Just a link to a doc or wiki would be welcome ... the web searches I've done have given answers that are too cryptic for my level.
Page: 1 2 3 4 5 6 7 8 9 10