Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'd like an especially high repeat rate and low delay on my backspace key, but a regular delay and rate on every other key. This command works, but sets it for every key:

xset r rate 120 30

Is there a way to have different settings for individual keys?

share|improve this question
    
xset r 22 r rate 120 30 should do what you're looking for but at my laptop it doesn't work. The keycode for backspace is 22 though. –  turbo Sep 25 '12 at 11:28
    
That command appears to turn the backspace key on, and then set every key to have a given rate. It(and the similar 'xset -r 22 r 120 30') didn't set only the backspace key to have that rate. –  Michael Burge Sep 26 '12 at 16:30
add comment

2 Answers

up vote 5 down vote accepted
+100

I think the answer to your question is no, there is no way to achieve this short of modyfying the X.org sources.

Here is an explanation why xset won't work; I am creating an answer because it corresponds to comments found in both the OP and the answer above.

xset r has several alternative ways of being called. Mutually exclusive, that is:

xset r 22

..will turn the repeating for keycode 22 (backspace) on, while xset -r 22 will turn it off.

Alternatively, it is possible to specify keyboard rates, but only for all keys:

xset r rate [num1 [num2]]

You cannot combine the two.

As for the 08 / 22 confusion: 08 is the ASCII code for the ASCII character backspace, and 22 is the X windows keycode for the particular physical key.

Unfortunately, the two settings (rate / delay and per-key repeat on-off) are handled by two different X extensions:

  • "rate/delay" is handled by the XF86Misc extension. xset changes the rate / delay using function XF86MiscGetKbdSettings( display, values ). The values XF86MiscKbdSettings structure contains only fields for repeat rate and delay (and two others of no importance here), and there is no way of applying it but general.
  • the "per key on-off" is controlled by the XKB extension. The XKB extension allows to control selected keys, but the structure that holds information on these keys only contains a field that can take one of three values: default, no repeat, repeat.

In short, this seems to be impossible to achieve in the current X.org setup.

share|improve this answer
    
Thanks for this answer. I'm likely going to turn repeating off for all keys, and selectively enable it for backspace/arrow keys. –  Michael Burge Sep 28 '12 at 17:10
add comment

Try:

xset r 8 rate 120 30

The the xset manpage at www.x.org gives some help on the command. I also found Keyboard Keys and Key Code Values, which is on Adobe's website but I think that the key codes should be correct.

share|improve this answer
    
everywhere that I have looked says that the keycode for backspace is 8 –  Malachi Sep 27 '12 at 19:36
    
If you enter xev in the terminal and then press backspace it will say that the keycode is 22. –  user76204 Sep 27 '12 at 19:53
    
some of the sites that I have looked at don't give the key that is assigned to 22, and others say that 22 is the Page Down key. unfortunately I am not close to my Linux box to be able to test any of this. –  Malachi Sep 27 '12 at 20:02
    
You can use xev to find out what the keycodes are on your own system; press a key on your keyboard and it will give you the keycode. –  user76204 Sep 27 '12 at 20:07
    
I am on Windows right now –  Malachi Sep 27 '12 at 20:16
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.