Detecting the keyboard

Apr 20, 2004 2 Replies

Hello Friends, How can an application written for Linux environment detect USB Keyboard connected to the system? Regards


Mandar Sarpotdar


Hi Mandar,

By talking to the usb/kernel drivers, like the hotplug program does.

There are a few different ways to get USB keyboard support working, make sure you're using the correct way for your particular setup.

Regards,

-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Damion de Soto - Software Engineer email: snipped-for-privacy@snapgear.com SnapGear - A CyberGuard Company --- ph: +61 7 3435 2809 | Custom Embedded Solutions fax: +61 7 3891 3630 | and Security Appliances web:

formatting link
--- Free Embedded Linux Distro at
formatting link
---

I have my own tiny distro called Puppy Linux, and I have only just got usb keyboard and mouse working (latest version 0.8.5).

I also did not know how to auto-detect the keyboard. I did this:

modprobe usbkbd modprobe usbmouse cat /proc/usb/devices | grep "keyboard"

...um, I'm typing this from memory, hope it's right. If "keyboard" cannot be found, unload those two modules.

For usb mouse, you only need: modprobe usbmouse

This is only if you have usbkbd and usbmouse turned on and as modules in the kernel config file.

Regards, Barry Kauler

formatting link

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required