Ubuntu keyboard detection from bash script
Posted
by Ryan Brubaker
on Server Fault
See other posts from Server Fault
or by Ryan Brubaker
Published on 2010-03-25T16:02:58Z
Indexed on
2010/03/25
16:03 UTC
Read the original article
Hit count: 813
Excuse my ignorance of linux OS/hardware issues...I'm just a programmer :)
I have an application that calls out to some bash scripts to launch external applications, in this case Firefox. The application runs on a kiosk with touch screen capability. When launching Firefox, I also launch a virtual keyboard application that allows the user to have keyboard input.
However, the kiosk also has both PS/2 and USB slots that would allow a user to plug-in a keyboard. If a keyboard were plugged in, it would be nice if I didn't have to launch the virtual keyboard and provide more screen space for the Firefox window.
Is there a way for me to detect if a keyboard is plugged in from the bash script? Would it show up in /dev, and if so, would it show up at a consistent location? Would it make a difference if the user used a PS/2 or USB keyboard?
Thanks!
© Server Fault or respective owner