Keyboard repeat rate reset

Kernels & Hardware, configuring network, installing services

Keyboard repeat rate reset

Postby PlunderingPirate9000 » 2017-11-30 15:42

After screen lock in combination with disconnecting keyboard and reconnecting (usb) the keyboard repeat rate is reset to the default value, which is frustrating.

Any idea why this happens?

If you're wondering why I keep unplugging my keyboard it's because I have 2 computers for a project I am working on at the moment, but I don't have another keyboard handy in the office.

I am using Debian 9 with XFCE.
PlunderingPirate9000
 
Posts: 3
Joined: 2017-11-30 15:17

Re: Keyboard repeat rate reset

Postby debiman » 2017-11-30 17:07

i experience the same.
don't know why it happens.
you could write a udev rule that applies things whenever you plug in your keyboard.
http://dt.iki.fi/udev/
User avatar
debiman
 
Posts: 1626
Joined: 2013-03-12 07:18

Re: Keyboard repeat rate reset

Postby PlunderingPirate9000 » 2017-12-12 12:46

I've started writing my udev rules. For future readers, here is what I have so far:

I have created a rule in `/etc/udev/rules.d` called `21_persistent-local.rules` it contains:

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="413c", ATTRS{idProduct}=="2106", RUN+="/home/user/keyboard-connect-test-script.sh"

I obtained the idVendor and idProduct codes from lsusb -v. It will likely be different for your own personal keyboard.

The script `/home/user/keyboard-connect-test-script.sh` contains:

#!/bin/bash
echo "keyboard connected" >> /home/user/keyboard.log

Note that the shebang is important and that it will not work without this.

I now need to figure out how to set the keyboard properties such as repeat rate in this script.

You will need to run

sudo udevadm control --reload-rules

to enable the new rule. You MAY also need to run chmod +x on /home/user/keyboard-connect-test-script.sh. I did this but not sure if it is required.
PlunderingPirate9000
 
Posts: 3
Joined: 2017-11-30 15:17

Re: Keyboard repeat rate reset

Postby PlunderingPirate9000 » 2017-12-12 13:02

I've now finished writing my rule. I additionally edited the script, removed the "echo" line and added

xset r rate 205 45
xset b off
PlunderingPirate9000
 
Posts: 3
Joined: 2017-11-30 15:17

Re: Keyboard repeat rate reset

Postby debiman » 2017-12-15 05:49

^ does it work?
xset will fail if it doesn't recognize itself as running inside a graphical environment.
but the problem has been adressed in one of the articles i linked.
User avatar
debiman
 
Posts: 1626
Joined: 2013-03-12 07:18


Return to System configuration

Who is online

Users browsing this forum: dobre.dani and 4 guests

fashionable