Aiz0 / dotless

My dotless files
2 stars 0 forks source link

Keyboard repeat rate resets #6

Closed Aiz0 closed 3 years ago

Aiz0 commented 4 years ago

Sometimes my keyboard repeat rate is reset to default. I set my repeat rate with xset r rate [delay] [rate] in my sxrc. For some reason the repeat rate is sometimes reset and i have to run the command again. This is somewhat annoying since it shouldn't do that.

Aiz0 commented 4 years ago

This seems to happen when my keyboard gets reconnected i.e. when i accidentally remove the usb cable and have to plug it in again. I know the cause know so looking for a solution should be much easier.

Aiz0 commented 3 years ago

There are two solutions to this.

  1. Pass -ardelay and -arinterval to the X server on startup.
  2. Wait for X.org 1.21 which reintroduces the deprecated AutoRepeat option. See this article

Since I use sx to start the X server and sx doesn't allow passing options I would have to copy it to my ~/bin and add the options manually.

Since this issue isn't a big deal, I just have to run a command every time i plug in a keyboard, I've decided to wait for X.org 1.21.

Aiz0 commented 3 years ago

woo X.Org server 1.21 just dropped for me. I went ahead and added the line Option "AutoRepeat" "275 40" to the /etc/X11/xorg.conf.d/00-keyboard.conf file generated by systemd-localed.

While the delay stays the same upon reconnecting my keyboard, the repeat rate does not. So it half works for now.

Aiz0 commented 3 years ago

Turns out that repeat rate in this context refers to the delay between repeats instead of the number of repeats per second. xset r rate 275 40 then becomes Option "AutoRepeat" "275 25" since 1/40 = 0.025 which is 25ms. Since I no longer need to worry about my repeat rate resetting on either X or Wayland this can now be closed.