Ubuntu – CTRL and ALT keys mapped to Shift for some reason

driverskeyboardkeyboard-layoutusbhid

I installed Ubuntu 14.04, and I'm loving it. However, when playing a game called Garry's Mod I noticed that my CTRL and ALT keys on my wired keyboard were both being detected as Shift. I looked at the keyboard layout chart and confirmed this. I also noticed that my Windows, or Super Key, Right CTRL and Right ALT are all being mapped to Left Shift.

They're all working perfect, they're just being detected wrong. I have selected the United States layout which is what my keyboard is supposed to be and is in Windows. Can anyone help? My keyboard is being detected as a SONiX USB Keyboard (the actual keyboard brand is Avazz).

  • my xev -event keyboard output is this for every single one:

    KeyRelease event, serial 28, synthetic NO, window 0x4a00001,
        root 0xdc, subw 0x0, time 2446369, (730,547), root:(795,599),
        state 0x1, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
        XLookupString gives 0 bytes: 
        XFilterEvent returns: False
    

    The only thing that changes is the time.

  • The sudo evtest command shows all the modifier keys as

    type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e1v type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0
    
  • for lsusb, the driver it's using is the usbhid driver.

    lsusb shows something confusing; the same port as my keyboard is being shown in other commands is showing up in lsusb as my wireless mouse's driver, Logitech, Inc. Unifying Receiver. This may be the problem, but I'm probably simply mistaken in what port it is on. Due to this, I'm not sure what driver is what. I'm going to post all of them, although this might be annoying. I have a separate keyboard plugged in along side my main one to use the CTRL, Super, or ALT by the way, so don't be confused by the Logitech Classic Keyboard Driver.

    Bus 001 Device 009: ID 0bda:8172 Realtek Semiconductor Corp. RTL8191SU 802.11n WLAN Adapter
    Bus 001 Device 008: ID 046d:c315 Logitech, Inc. Classic Keyboard 200
    Bus 001 Device 007: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
    Bus 001 Device 006: ID 0480:0200 Toshiba America Info. Systems, Inc. 
    Bus 001 Device 004: ID 0c45:6340 Microdia 
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 004: ID 0d8c:013c C-Media Electronics, Inc. CM108 Audio Controller
    Bus 002 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver
    Bus 002 Device 002: ID 0c45:7603 Microdia 
    Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    

    For lsusb -t, the driver being used is usbhid.

  • for i in $(ls /sys/module/usbhid/parameters/); do echo -ne "$i\t"; more /sys/module/usbhid/parameters/$i; done is:

    ignoreled   0
    mousepoll   0
    quirks  (null),(null),(null),(null)
    
  • I don't think you need this since I said it's usbhid, but here's it anyways.

    for i in $(ls /sys/module/hid/parameters/); do echo -ne "$i\t"; more /sys/module/hid/parameters/$i; done's output.

    debug 0
    ignore_special_drivers 0

  • modinfo usbhid's output is:

    filename:       /lib/modules/3.18.3-031803-generic/kernel/drivers/hid/usbhid/usbhid.ko
    license:        GPL
    description:    USB HID core driver
    author:         Jiri Kosina
    author:         Vojtech Pavlik
    author:         Andreas Gal
    srcversion:     A395FA22EA2729BAC1557C9
    alias:          usb:v*p*d*dc*dsc*dp*ic03isc*ip*in*
    depends:        hid
    intree:         Y
    vermagic:       3.18.3-031803-generic SMP mod_unload modversions 
    signer:         Magrathea: Glacier signing key
    sig_key:        29:DB:FD:FC:5A:CC:82:3C:C5:2C:39:4C:C1:C7:4C:01:C3:BE:BF:78
    sig_hashalgo:   sha512
    parm:           mousepoll:Polling interval of mice (uint)
    parm:           ignoreled:Autosuspend with active leds (uint)
    parm:           quirks:Add/modify USB HID quirks by specifying  quirks=vendorID:productID:quirks where vendorID, productID, and quirks are all in 0x-prefixed hex (array of charp)
    
  • cat /sys/kernel/debug/usb/usbmon/2u > /tmp/usb.mon.out is telling me not found even though I changed 2 to my bus ID. What am I doing wrong here? Clarify if you can please, kinda confused there. I tried putting 2, 02 and 002. The output of
    sudo ls /sys/kernel/debug/usb/usbmon/ is
    0s 0u 1s 1t 1u 2s 2t 2u

Best Answer

My keyboard is a Perixx P1800. It as the same lsusb identification (0c45:7603 Microdia) Apparently, it uses the same board also as the azio L70 keyboard.

The linux driver for the keyboard was hand-made and is available at this address.

On Debian, it works very well for me (after update-initramfs) except for a single key close to Enter (* in Azerty keyboard, the * of the keypad is working well).

Related Question