You are not logged in.

#1 2013-01-05 22:17:18

Jindur
Member
Registered: 2011-09-29
Posts: 184

Xorg - SHIFT key bugs out randomly after TV-hardware is connected

I'm on Xfce4. When I hold down left SHIFT key and press some other keys, after a while the SHIFT key may "unregister" itself. What I mean is, it stops working as if I had released it, although I'm still pressing it down. Ie I'm suddenly writing lower-case again and stuff. This behaviour is application-independant apparently.

I tried running 'showkey' and it correctly reported pressing+releasing of the SHIFT key (keycode 42) when I actually physically pressed and released it. It did NOT report release of the SHIFT key when it in fact stopped working. So it doesn't seem to be a keyboard hardware problem or something.

The right SHIFT key (showkey says keycore 54 for this one) seems to work correctly though (but it's not really a comfortable work-around..).

Is there maybe a trick that could be used as a workaround, to somehow switch the right and left shiftkey's key codes? Maybe that could "fix" it. >:)
I had a look at xmodmap, but that shows entirely different "keycodes" for SHIFT keys so I'm a bit stumped:

$ xmodmap -pk
..for "keycode 42" it had this line:
42    	0x0067 (g)	0x0047 (G)	0x0067 (g)	0x0047 (G)	0x03bf (eng)	0x03bd (ENG)	0x03bf (eng)	0x03bd (ENG)
..and for left shift key it had "50" in the "keycode" column:
50    	0xffe1 (Shift_L)	0x0000 (NoSymbol)	0xffe1 (Shift_L)	0x0000 (NoSymbol)	0xffe1 (Shift_L)

Anyway, I tried out https://wiki.archlinux.org/index.php/Xmodmap:

xmodmap -pke > ~/.Xmodmap
..then edited that file and changed the Shift_L (50) and Shift_R (62) lines, and did
xmodmap ~/.Xmodmap

..and my X froze up completely, not even registering mouse clicks, might wanna correct the Wiki there^^.
After a reboot, my xmodmap -pke showed the two lines swapped as intended though - but 'showkey' still shows keycode 42 for left and 54 for right, so swapping didn't work here.
Funny thing is, now after a fresh reboot I seem unable to reproduce the bug, so I'll wait and see what happens I guess.

Now I have read about people getting a bug where SHIFT key is suddenly _pressed_ on its own, unlike my prob where it is released, and those people always write that it happens when a TV card is connected, and that it is detected as "keyboard" according to X0.log.
So I just connected my usual bunch of USB stuff that I had disconnected earlier just while that reboot happened after which my problem didn't surface.
My X0.log:

[   647.676] (II) config/udev: Adding input device UVC Camera (eb1a:2571) (/dev/input/event13)
[   647.676] (**) UVC Camera (eb1a:2571): Applying InputClass "evdev keyboard catchall"
[   647.676] (II) Using input driver 'evdev' for 'UVC Camera (eb1a:2571)'
[   647.676] (**) UVC Camera (eb1a:2571): always reports core events
[   647.676] (**) evdev: UVC Camera (eb1a:2571): Device: "/dev/input/event13"
[   647.676] (--) evdev: UVC Camera (eb1a:2571): Vendor 0xeb1a Product 0x2571
[   647.677] (--) evdev: UVC Camera (eb1a:2571): Found keys
[   647.677] (II) evdev: UVC Camera (eb1a:2571): Configuring as keyboard
[   647.677] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5.1/1-5.1:1.0/input/input13/event13"
[   647.677] (II) XINPUT: Adding extended input device "UVC Camera (eb1a:2571)" (type: KEYBOARD, id 14)
[   647.677] (**) Option "xkb_rules" "evdev"
[   647.677] (**) Option "xkb_model" "evdev"
[   647.677] (**) Option "xkb_layout" "de"
[   654.995] (II) config/udev: Adding input device Arduino LLC Arduino Leonardo (/dev/input/event14)
[   654.995] (**) Arduino LLC Arduino Leonardo: Applying InputClass "evdev pointer catchall"
[   654.995] (**) Arduino LLC Arduino Leonardo: Applying InputClass "evdev keyboard catchall"
[   654.995] (II) Using input driver 'evdev' for 'Arduino LLC Arduino Leonardo'
[   654.995] (**) Arduino LLC Arduino Leonardo: always reports core events
[   654.995] (**) evdev: Arduino LLC Arduino Leonardo: Device: "/dev/input/event14"
[   654.996] (--) evdev: Arduino LLC Arduino Leonardo: Vendor 0x2341 Product 0x8036
[   654.996] (--) evdev: Arduino LLC Arduino Leonardo: Found 3 mouse buttons
[   654.996] (--) evdev: Arduino LLC Arduino Leonardo: Found scroll wheel(s)
[   654.996] (--) evdev: Arduino LLC Arduino Leonardo: Found relative axes
[   654.996] (--) evdev: Arduino LLC Arduino Leonardo: Found x and y relative axes
[   654.996] (--) evdev: Arduino LLC Arduino Leonardo: Found keys
[   654.996] (II) evdev: Arduino LLC Arduino Leonardo: Configuring as mouse
[   654.996] (II) evdev: Arduino LLC Arduino Leonardo: Configuring as keyboard
[   654.996] (II) evdev: Arduino LLC Arduino Leonardo: Adding scrollwheel support
[   654.996] (**) evdev: Arduino LLC Arduino Leonardo: YAxisMapping: buttons 4 and 5
[   654.996] (**) evdev: Arduino LLC Arduino Leonardo: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[   654.996] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5.4/1-5.4:1.2/input/input14/event14"
[   654.996] (II) XINPUT: Adding extended input device "Arduino LLC Arduino Leonardo" (type: KEYBOARD, id 15)
[   654.996] (**) Option "xkb_rules" "evdev"
[   654.996] (**) Option "xkb_model" "evdev"
[   654.996] (**) Option "xkb_layout" "de"
[   654.998] (II) evdev: Arduino LLC Arduino Leonardo: initialized for relative axes.
[   655.001] (**) Arduino LLC Arduino Leonardo: (accel) keeping acceleration scheme 1
[   655.001] (**) Arduino LLC Arduino Leonardo: (accel) acceleration profile 0
[   655.001] (**) Arduino LLC Arduino Leonardo: (accel) acceleration factor: 2.000
[   655.001] (**) Arduino LLC Arduino Leonardo: (accel) acceleration threshold: 4
[   655.005] (II) config/udev: Adding input device Arduino LLC Arduino Leonardo (/dev/input/mouse3)
[   655.005] (II) No input driver specified, ignoring this device.
[   655.005] (II) This device may have been added with another device file.

Now I'm wondering, my webcam gets detected as "keyboard" (id 14) ^^' well and so does my Arduino, but that's natural for Leonardo models.
I started up the webcam, so the uvc modules are now loaded, but still I'm now unable to reproduce the bug for some reason. With either SHIFT key. Well that's good sort of, but then again, not so good to track what causes it when it happens hmm And why does X think that webcams and tv  cards are keyboards?
Will post again when the bug surfaces again I guess.

Ok, after plugging in a usb-tv box, the bug started happening again, except this time it's the rigth shift key that doesnt work correctly, while the left shift key seems fine.
So it seems the xmodmap change worked, although showkey still shows 42 for left and 54 for right.
This might do as a workaround for now, although someone should figure out why tv cards (and tv usb boxes in my case) mess up the shift key in Xorg.
Apparently the IR-receiver part of my tv-box was recognized as "keyboard":

[ 17549.633] (II) config/udev: Adding input device IR-receiver inside an USB DVB receiver (/dev/input/event15)
[ 17549.633] (**) IR-receiver inside an USB DVB receiver: Applying InputClass "evdev keyboard catchall"
[ 17549.633] (II) Using input driver 'evdev' for 'IR-receiver inside an USB DVB receiver'
[ 17549.634] (**) IR-receiver inside an USB DVB receiver: always reports core events
[ 17549.634] (**) evdev: IR-receiver inside an USB DVB receiver: Device: "/dev/input/event15"
[ 17549.634] (--) evdev: IR-receiver inside an USB DVB receiver: Vendor 0xccd Product 0x38
[ 17549.634] (--) evdev: IR-receiver inside an USB DVB receiver: Found keys
[ 17549.634] (II) evdev: IR-receiver inside an USB DVB receiver: Configuring as keyboard
[ 17549.634] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-1/input/input15/event15"
[ 17549.634] (II) XINPUT: Adding extended input device "IR-receiver inside an USB DVB receiver" (type: KEYBOARD, id 16)
[ 17549.634] (**) Option "xkb_rules" "evdev"
[ 17549.634] (**) Option "xkb_model" "evdev"
[ 17549.635] (**) Option "xkb_layout" "de"

Can I somehow find out which modules were loaded when I plugged it in so I can unload those?
Also, I tried

$ lsmod |grep dvb
dvb_usb_cinergyT2       6645  2147483647 
dvb_usb                15171  1 dvb_usb_cinergyT2
dvb_core               79241  1 dvb_usb
rc_core                11081  1 dvb_usb
usbcore               126764  7 uhci_hcd,uvcvideo,dvb_usb,ehci_hcd,dvb_usb_cinergyT2,usbhid,cdc_acm
i2c_core               16944  7 drm,i915,i2c_i801,dvb_usb,drm_kms_helper,i2c_algo_bit,videodev
$ rmmod dvb_usb_cinergyT2 
rmmod: ERROR: Module dvb_usb_cinergyT2 is in use

but I don't have any media player running anymore, so why is the module in use and how do I see by what it is in use? Forced removal via rmmod -f worked by the way. Then I was able to remove the other two dvb_usb_ modules, and usbcore and i2c_core disappeared automatically.. but the bug still occurs! Any way to find out which other modules were possibly loaded, or what was done by the system, when I plugged in the tv box?

Last edited by Jindur (2013-01-06 05:08:51)

Offline

Board footer

Powered by FluxBB