Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi everyone,
I have this weird experiment I would like to do.
I am running Ubuntu 9.04 and I would like to run this little experiment.
Can anyone tell me where do USB keyboards mount themselves or get initialized (a brief explanation will be great)?
How can I capture key strokes without using the standard IO libraries in C language or whichever way it is done in bash script?
For example:
I would like to connect two USB keyboards to my system, and I would like to write a small script that will only accept a specific keyboard's input. Therefore, using standard in will not quite do it for me.
Sometimes people ask a question that's the "wrong" question for the solution to the problem they are trying to solve. So it is very difficult to answer.
What we'd like to know is: "What, exactly, are you trying to achieve?". Tell us the scenario, not why you are trying "only accept a specific keyboard's input."
thank you tredegar,
Here is what I am trying to do. I'll put it in simpler terms as well as the exact senario I am working to acheive.
I plugged my USB keyboard into the Ubuntu system, and when I type the follow command (dmesg | tail) I get the following:
root@ubuntu:~# dmesg | tail
sda: sda1
sd 0:0:0:0: [sda] Attached SCSI removable disk
eth0: link up, 10 Mb/s, half duplex, flow control disabled
NET: Registered protocol family 10
eth0: no IPv6 routers present
usb 1-1: USB disconnect, address 2
usb 1-1: new low speed USB device using orion-ehci and address 3
usb 1-1: configuration #1 chosen from 1 choice
input: DELL DELL USB Keyboard as /devices/platform/orion-ehci.0/usb1/1-1/1-1:1.0/input/input0
generic-usb 0003:413C:2005.0001: input: USB HID v1.10 Keyboard [DELL DELL USB Keyboard] on usb-orion
-ehci.0-1/input0
root@ubuntu:~#
I would like to write some C program or script that will listen to this input specifically (input0).
I know that in C, I can write a simple scanf() statement, but I would like to be able to specify the input instead (input0) - no dependency on standard IO in C.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.