You are not logged in.

#1 2013-05-27 20:35:42

jc.saaddupuy
Member
Registered: 2013-05-27
Posts: 5

[SOLVED] Keyboard issue - fn+key "KeyRelease" event not triggered

Hi Archers :)

First post, sorry if not in the right section.

I have a quite anoying bug. I bought a no name laptop, imported by Textorm, model M116 SU7300, same model as this one (http://www.textorm.com/pc-portable/pc-p … 22%5D.html)

On the keyboard, the '<' and '>' symbols are mapped on "fn+W" and "fn+MAJ+W".

Everything works fine in a TTY console. All others fn-KEY are working well.

The problem is with a Xorg environment : when pressing fn+W or fn+MAJ+W, it seems that the release key is never triggered, acting like if I was pressing the key in continue.

When pressing another key, the crazy '<' input stop, but then, fn+W won't works again... until I trigger a press/release event with 'acpi_fakekey 86'.
Then, same scenario.

I booted a live Archbang,  same result (well, I wasn't very surprised), and a live Sabayon... same result.

Using xev, I can see that when pressing/releasing fn+W, the KeyReleased event is never triggered. I can provide a log if needed.

So it seems related to the Xorg driver....

I tryied to use the kbd driver by adding an xorg.conf

Section "InputDevice"
    Identifier    "Generic Keyboard"
    Driver        "kbd"
    Option        "CoreKeyboard"
    Option        "XkbRules"    "xorg"
    Option        "XkbModel"    "pc105"
    Option        "XkbLayout"    "fr"  # "fr-oss" pour Feisty et +
    Option        "XkbVariant"    "latin9"
EndSection

Section "ServerFlags"
        Option "AutoAddDevices" "Off"
EndSection

I can confirm that the kbd driver was in use with Xorg log :

[   900.371] (II) LoadModule: "kbd"
[   900.371] (II) Loading /usr/lib/xorg/modules/input/kbd_drv.so
[   900.371] (II) Module kbd: vendor="X.Org Foundation"
[   900.371]    compiled for 1.14.0, module version = 1.7.0
[   900.371]    Module class: X.Org XInput Driver
[   900.371]    ABI class: X.Org XInput driver, version 19.1
...
[   900.780] (II) Using input driver 'kbd' for 'Generic Keyboard'
[   900.780] (**) Option "CoreKeyboard" "on"
[   900.780] (**) Generic Keyboard: always reports core events
[   900.780] (**) Generic Keyboard: always reports core events
[   900.780] (**) Option "Protocol" "standard"
[   900.780] (**) Option "XkbRules" "xorg"
[   900.780] (**) Option "XkbModel" "pc105"
[   900.780] (**) Option "XkbLayout" "fr"
[   900.780] (**) Option "XkbVariant" "latin9"
[   900.780] (II) XINPUT: Adding extended input device "Generic Keyboard" (type: KEYBOARD, id 6)   

... no luck. Same comportement.

I tryed the xorg-input-evdev git version, no luck. (But if I understand, xorg-input-evdev use kbd as underlying driver?)

I also tryed xorg-server-dev 1.14.99.1-1

So for now, I use a ugly hack : I mapped "W-W" and "S-W-W" in my openbox rc.xml to execute "acpi_fakekey 86". Nearly working all the time.

I know this isn't directly related to Arch, but if someone has any pointers... I take any ideas.

Thanks in advance!

PS :
xorg-server 1.14.1-1
xf86-input-evdev 2.8.0-1

Last edited by jc.saaddupuy (2013-05-28 18:28:05)

Offline

#2 2013-05-28 17:07:08

drhill1
Member
Registered: 2013-03-27
Posts: 31

Re: [SOLVED] Keyboard issue - fn+key "KeyRelease" event not triggered

I've been having similar issues and after quite a lot of googling and browsing the Arch wiki, I think I'm finally getting somewhere.

Run

/usr/lib/udev/keymap -i /dev/input/event0

from a VT as root and use this to get a list of keycodes which are giving problems.  You may need to change "event0" to event1, event2 etc until it works.

In my case, this showed the following keycodes:

scan code: 0xA0   key code: mute
scan code: 0xAE   key code: volumedown
scan code: 0xB0   key code: volumeup

Then find the correct serio device:

root@work rules.d# ls -l /sys/bus/serio/devices/serio*/force_release
-rw-r--r-- 1 root root 4096 May 28 17:33 /sys/bus/serio/devices/serio0/force_release

root@work rules.d# cat /sys/bus/serio/devices/serio0/force_release 
369-370

Finally, add the correct keycodes to the force_release parameter, having converted the hex values above to decimal:

echo 369-370,160,174,176 > /sys/bus/serio/devices/serio0/force_release

This has solved my repeating volume key problem, now I just need to find a way of adding it to the udev rules in the same way as in /usr/lib/udev/rules.d/95-keyboard-force-release.rules

Offline

#3 2013-05-28 18:14:38

jc.saaddupuy
Member
Registered: 2013-05-27
Posts: 5

Re: [SOLVED] Keyboard issue - fn+key "KeyRelease" event not triggered

Wow thanks!
I confirm that this is working.

Thanks to your infos, I investigate the udev stuff.
You will have to know the vendor and product name of your machine :

cat /sys/class/dmi/id/{sys_vendor,product_name}

Thats the strings your udev rule have to match in ENV{DMI_VENDOR} and ATTR{[dmi/id]product_name}.
For me, both was empty, so I use a wildcard :

ENV{DMI_VENDOR}=="*", ATTR{[dmi/id]product_name}=="*"

Then, you'll have to specify which codes needs to trigger a key release (sames as found with keymap -i)

Add a file in /usr/lib/udev/keymaps/force-release/  whith the hex values (one per line)

I named mine 'textorm'

/echo 0x56 > /usr/lib/udev/keymaps/force-release/textorm

And add it in the RUN of your udev rule (not the full file name):

ENV{DMI_VENDOR}=="*", ATTR{[dmi/id]product_name}=="*", RUN+="keyboard-force-release.sh $devpath textorm"

Knowing your serio ( /sys/bus/serio/devices/serio0), you can test the keyboard-force-release.sh script (the serio parameter HAVE TO NOT begin with /sys/)

/usr/lib/udev/keyboard-force-release.sh bus/serio/devices/serio0 textorm

You can then check the /sys/bus/serio/devices/serio0/force_release content.

Works like a charm :)

Offline

#4 2013-05-28 18:36:01

drhill1
Member
Registered: 2013-03-27
Posts: 31

Re: [SOLVED] Keyboard issue - fn+key "KeyRelease" event not triggered

Thanks, you've helped me out on the udev side too and mine's now working perfectly.

Offline

#5 2013-06-06 15:39:18

GloW_on_dub
Member
Registered: 2013-03-13
Posts: 357

Re: [SOLVED] Keyboard issue - fn+key "KeyRelease" event not triggered

I'm having same problem here. Working on it.

Offline

#6 2013-06-06 16:07:06

GloW_on_dub
Member
Registered: 2013-03-13
Posts: 357

Re: [SOLVED] Keyboard issue - fn+key "KeyRelease" event not triggered

Thanks to you, it's working very well, for unlocking my "less" and "more" key.

EDIT: I jsut noticed that my udev rules in 95-keyboard-force-release.rules disapeared after update.

So i've created a dedicated rules so it will stay.

Last edited by GloW_on_dub (2013-06-07 18:17:41)

Offline

#7 2014-01-12 13:01:04

jc.saaddupuy
Member
Registered: 2013-05-27
Posts: 5

Re: [SOLVED] Keyboard issue - fn+key "KeyRelease" event not triggered

Hi.

I wake up this thread, as the problem poped up again hmm

More precisely, I don't have the scripts keyboard-force-release.sh and the /lib/udev/keymap tool anymore.

The file /etc/udev/rules.d/60-keyboard.rules has changed a lot, and I don't know how to make it work with udev at start up.

Does anyone here have updated his config? How do you manage to have it to work with udev now ?

Offline

#8 2014-01-12 14:41:39

drhill1
Member
Registered: 2013-03-27
Posts: 31

Re: [SOLVED] Keyboard issue - fn+key "KeyRelease" event not triggered

Hi again,
I also spotted it stopped working a few months ago and spent a while trying to fix it again.  I didn't have much luck with udev so I cheated by creating a shell script containing:

#!/usr/bin/bash
echo 369-370,160,174,176 > /sys/bus/serio/devices/serio0/force_release

which I run at boot from a new .service file within /etc/systemd/system:

[Unit]
Description=Stop the VOL+ VOL- and MUTE buttons from repeating

[Service]
ExecStart=/usr/local/bin/keyboard-force-release.sh

[Install]
WantedBy=multi-user.target 

It may not be as clever as the udev rule, but it works fine once you know the values to add into the script.

Offline

#9 2014-01-12 15:28:48

jc.saaddupuy
Member
Registered: 2013-05-27
Posts: 5

Re: [SOLVED] Keyboard issue - fn+key "KeyRelease" event not triggered

Elegant enough for me.
Thanks again smile

Offline

#10 2014-01-12 19:17:15

GloW_on_dub
Member
Registered: 2013-03-13
Posts: 357

Re: [SOLVED] Keyboard issue - fn+key "KeyRelease" event not triggered

It still working here, just follow drhill1 and jc.saaddupuy instructions.
The only change is the location of udev rules, wich are now only located in /usr/lib/udev/rules.d/ , not in /etc/udev

Just create your own rule in this folder.

Last edited by GloW_on_dub (2014-01-12 19:19:17)

Offline

#11 2014-08-08 23:41:06

jc.saaddupuy
Member
Registered: 2013-05-27
Posts: 5

Re: [SOLVED] Keyboard issue - fn+key "KeyRelease" event not triggered

Hi there.

To fully automate the thing accross arch reinstallation (I know this day will come), I've made a PKGBUILD which create the two files (bash script + systemd service) and enable/starts the service.

If anyone is interested, it is on github. You will just have to adapt the values in the echo line to suits your needs.

Offline

Board footer

Powered by FluxBB