From 0b8d9a73335bdd69aa600a0aae42645374cecae9 Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Sat, 18 Jul 2009 16:59:46 +0200
Subject: extras/keymap: teach findkeyboards about USB keyboards

---
 extras/keymap/findkeyboards | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'extras/keymap')

diff --git a/extras/keymap/findkeyboards b/extras/keymap/findkeyboards
index e39084cde9..4fafc7775d 100755
--- a/extras/keymap/findkeyboards
+++ b/extras/keymap/findkeyboards
@@ -21,12 +21,17 @@ keyboard_devices() {
 
     # standard AT keyboard
     for dev in $input_devs; do
-        info=`udevadm info --attribute-walk --path=$dev`
+        walk=`udevadm info --attribute-walk --path=$dev`
+        env=`udevadm info --query=env --path=$dev`
         
-        if echo "$info" | grep -q 'DRIVERS=="atkbd"'; then
+        if echo "$walk" | grep -q 'DRIVERS=="atkbd"'; then
             echo -n 'AT keyboard: '
             udevadm info --query=name --path=$dev
         fi
+        if echo "$env"| grep -q '^ID_CLASS=kbd' && echo "$env" | grep -q '^ID_USB_DRIVER=usbhid'; then
+            echo -n 'USB keyboard: '
+            udevadm info --query=name --path=$dev
+        fi
     done
 
     # modules
-- 
cgit v1.2.3-54-g00ecf