The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Previous Message  |  Next Message 
 USB keyboards + usbd = fun
Author: Doug White 
Date:   19-12-01 02:59

After a bit of experimentation I've found that you can (ab)use usbd to reset the console keyboard for you.

Insert a block like this into /etc/usbd.conf then kill -HUP usbd:

Device "Keyboard"
devname "ukbd[0-9]+"
attach "/usr/sbin/kbdcontrol -k /dev/kbd1 < /dev/console"

This causes usbd to reset the console keyboard to kbd1, which is usually always the USB keyboard you've just plugged in. If you plug in multiple USB keyboards then you'll have to switch them manually, but I don't exactly find that a common configuration. :) Some creative scripting could improve the intelligence if you regularly use lots of USB keyboards.

When you unplug the keyboard, syscons automatically reverts to kbd0, which will be the atkbd if you've cleared the flags on it.

More information can be found on the usbd.conf(5) man page.

 Reply To This Message  |  Forum List  |  Flat View   Newer Topic  |  Older Topic 

 Topics Author  Date
 USB keyboards + usbd = fun   new
Doug White 19-12-01 02:59 
 Re: USB keyboards + usbd = fun   new
paul 13-01-03 05:17 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org