#!/bin/sh # /usr/home/jhs/bin/.sh/reskbd # See Also /etc/usbd.conf Untested. To be called by mouse click. # # This script was written to allow me, via my external USB mouse, to invoke a # re-initialisation of my external keyboard, (PS/2 type) which # periodically fails, (only fails when running through USB adapter # to the laptop. # Before this script was written, to get keyboard working # again, I had to unplug & replug the USB adapter into the # laptop. I had wondered if maybe laptop wasn't providing # enough power, or maybe laptop was occasionaly dropping power # to USB adapter, leaving it to reconfigure, so I added a USB # hub with mains power plugged in, it didn't help. My external # mouse ia a USB mouse so still available whenever the lockup # occurs. As I havent tried plugging a serial mouse into the # USB adapter yet, I dont know if its the adapter or keyboard # thats locking up, or USB under FreeBSD, or a problem with # laptop) # The script below runs as expected, switching control, while the hardware # is working OK, But when the keyboard fails, I still have to unplug, # so I need to add a USBD power done & up port control. xs kbdcontrol -k /dev/kbd0 -l uk.iso < /dev/console # xterm -bg red # Show switched to internal UK Keyboard, close with mouse. xs /usr/sbin/usbd -e # Added since last failure, not yet tested xs kbdcontrol -k /dev/kbd1 -l us.unix < /dev/console # xterm -bg green & # Show switched to external USA Keyboard, close with mouse.