4

My USB keyboard doesn't work in Xubuntu, but does in Gnome, Unity or the console. Details below...

I have a Logitech unifying USB receiver that connects to a K330 keyboard and a mouse. I have two machines both running Xubuntu 14.04. On one, they both work perfectly. On the other, the mouse works fine, and the keyboard works at the console (after pressing Ctrl-Alt-F1 to switch on the laptop keyboard), and at the lightdm login screen, but not at all once logged in to an X session.

I've run xev and it shows no keypress events coming from the USB keyboard (but it does show events from the laptop keyboard).

How can I debug and solve this problem?

Results of investigations suggested so far

lsusb outputs:

Bus 003 Device 043: ID 046d:c52b Logitech, Inc. Unifying Receiver

xinput list - when the receiver is connected, adds the following on both machines:

Logitech Unifying Device. Wireless PID:401b       id=15   [slave  pointer  (2)]
Logitech Unifying Device. Wireless PID:4016       id=16   [slave  pointer  (2)]

Note that both 401b and 4016 are listed under Virtual core pointer as pointer devices and both seem to be mouse devices when looked at with `--long``

xinput list --long on 4016 gives:

Logitech Unifying Device. Wireless PID:4016     id=13   [slave  pointer  (2)]
    This device is disabled
    Reporting 6 classes:
            Class originated from: 13. Type: XIButtonClass
            Buttons supported: 7
            Button labels: "Button 0" "Button Unknown" "Button Unknown" "Button Wheel Up" "Button Wheel Down" "Button Horiz Wheel Left" "Button Horiz Wheel Right"
...

This device is disabled only appears on the computer it's not working on!

xinput list --long on 401b gives:

Logitech Unifying Device. Wireless PID:401b     id=12   [slave  pointer  (2)]
    Reporting 7 classes:
            Class originated from: 12. Type: XIButtonClass
            Buttons supported: 24
            Button labels: "Button Left" "Button Middle" "Button Right" "Button Wheel Up" "Button Wheel Down" "Button Horiz Wheel Left" "Button Horiz Wheel Right" "Button Side" "Button Extra" "Button Forward" "Button Back" "Button Task" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown"
...
David Fraser
  • 1,787

1 Answers1

3

Since xinput list shows that your keyboard has device ID 12 what you need is xinput enable 12 and now your keyboard should work. This does not help explain why Xubuntu isn't enabling it nor does it help if you unplug it and replug it. In my experience the device ID is always the same.


You can make a watchdog script to enable the keyboard if it's disabled:

  1. Run sudo mkdir -p /usr/local/bin to create the local binaries folder if doesn't exists.
  2. Run sudo touch /usr/local/bin/keyboard_watchdog to create a file on that folder.
  3. Run sudo chmod 777 /usr/local/bin/keyboard_watchdog to give it permissions to edit.
  4. Run gedit /usr/local/bin/keyboard_watchdog to edit the file.
  5. Paste in it this:

    #!/bin/bash
    
    while :; do
        xinput enable 12
        sleep 1
    done
    
  6. Save the file.
  7. Open Settings Manager and select Session and Startup.
  8. On the Application Autostart tab, click on the Add button.
  9. On the dialog that opens write the name of the application (i.e. Keyboard fix) and the command that runs the application (/usr/local/bin/keyboard_watchdog).
  10. Once you click OK the application will be added to the list and will automatically be started on the next session login.
0x2b3bfa0
  • 9,110
  • 7
  • 38
  • 55
jester66
  • 249