Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Keyboard repeat rate reset

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
PlunderingPirate9000
Posts: 35
Joined: 2017-11-30 15:17

Keyboard repeat rate reset

#1 Post by PlunderingPirate9000 »

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.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Keyboard repeat rate reset

#2 Post by debiman »

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/

PlunderingPirate9000
Posts: 35
Joined: 2017-11-30 15:17

Re: Keyboard repeat rate reset

#3 Post by PlunderingPirate9000 »

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: 35
Joined: 2017-11-30 15:17

Re: Keyboard repeat rate reset

#4 Post by PlunderingPirate9000 »

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

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Keyboard repeat rate reset

#5 Post by debiman »

^ 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.

Post Reply