# keyboard speed reset when display switched off

## someone12345

Hi!

My display has an integrated USB hub which my USB keyboard is connected to. It now occurs that when I switch the display off (or the energy saver kicks in) and I switch it on again the keyboard (repeat rate/delay) is much slower (well, I assume it's reset to some defaults) - I assume because the USB hub is disconnected. But I really don't know where to look into now and how to tackle or even solve this issue.

Any advice?

----------

## BradN

Suggest not connecting your keyboard to that hub.

But seriously...

xset r rate delay repeatrate

This command should reprogram the keyboard's repeat rate.  Replace delay with the delay to first repeat, and repeatrate with the desired repeat rate.  Delay is in milliseconds, repeat rate in count per second.

What I don't know is how to have this automatically reprogrammed when the keyboard is detected again.  One way to implement this might be as a screen saver that reprograms it on exit, or possibly some fiddling with udev/hal config files.  Which brings me back to my initial suggestion  :Smile: 

----------

## Malvineous

I just came across this same issue, but it only surfaced after I removed "AllowEmptyInput false" from xorg.conf to fix another issue after an Xorg upgrade.  With the old Xorg and that option present, the repeat rate was maintained.

Since I removed that directive, hotplugging a keyboard (e.g. by turning my monitor off as per the OP) resets the X11 repeat rate.  I take it nobody is aware of a way to get the old behaviour back, where the repeat rate was independent of the device?

(For the record the cables aren't long enough to reach without going through the hub in the monitor, and I don't really want to buy more cables to fix a software problem...)

----------

## VoidMage

Perhaps you're going wrong way about it.

Unless you need different settings in console than in X, then an udev rule calling kbdrate on device change should probably fix it.

----------

## Malvineous

Perhaps.  I'm not sure how to change the repeat rate for the console *and* X though, running kbdrate has no effect on the X11 rate - I expect because X uses evdev directly, bypassing any keyboard repeat rate settings.

I have ended up putting an icon on my taskbar which runs the 'xset' command, so I just click on that every morning.  Not ideal but an acceptable workaround for the X11 bug until it's (hopefully) fixed.

----------

## VoidMage

As it seems it's a problem with your hardware, it's unlikely to be fixed by anyone but you.

----------

