You are not logged in.

#1 2012-12-16 15:17:52

aardwolf
Member
From: Belgium
Registered: 2005-07-23
Posts: 310

Modifying keyboard driver?

Hello,

I have a good keyboard but sometimes it double-registers a key. When it does that, the two characters appear at the same time on screen, so I think that this problem can be solved in software, by making it not register a keystroke if it follows very fast after the previous one.

I didn't find any such setting in the keyboard driver for Linux. Does anyone know if there exists one anyay? I do NOT mean autorepeat. I mean: not registering a key if it follows too fast (e.g. < 10ms) after a previous one.

If not, I'd like to modify the keyboard driver. I know some C, but don't know much about the Linux kernel, and expect a horrible spaghetti mess.

Do you think this is what I need to do if I want to achieve what I mentioned, or are there better ways?

What would I need to do to try this?

The first problem is that in the place where the source code for the kernel should I think be (/usr/src/linux-3.6.5-1-ARCH) only contains Kconfig files, no C code. How do I get the correct source code?

How can I ensure that my hack will always be in that code no matter how many pacman upgrades I do to Archlinux after that?

Thanks!

P.S. there's a "Bounce keys" setting in KDE that does what I want, EXCEPT, its minimum setting is 100ms, which is a too long delay, I do type two keys in a row faster than that. I want to set it to 10ms but KDE doesn't support that.

Last edited by aardwolf (2012-12-16 15:34:39)

Offline

#2 2012-12-16 17:52:23

chris_l
Member
Registered: 2010-12-01
Posts: 390

Re: Modifying keyboard driver?

aardwolf wrote:

I have a good keyboard but sometimes it double-registers a key.

I don't think good keyboards do that ^_^
Hmm, how about using the r switch of xset with the delay parameter?
From the man xset:

       r       The r option controls the autorepeat.  Invoking with "-r", or "r off", will disable autorepeat, whereas "r", or "r on" will enable autorepeat.  Following the "-r" or "r" option with an integer keycode between 0 and 255 will disable or enable  autore‐
               peat on that key respectively, but only if it makes sense for the particular keycode.  Keycodes below 8 are not typically valid for this command.  Example: "xset -r 10" will disable autorepeat for the "1" key on the top row of an IBM PC keyboard.

               If the server supports the XFree86-Misc extension, or the XKB extension, then a parameter of 'rate' is accepted and should be followed by zero, one or two numeric values. The first specifies the delay before autorepeat starts and the second specifies
               the repeat rate.  In the case that the server supports the XKB extension, the delay is the number of milliseconds before autorepeat starts, and the rate is the number of repeats per second.  If the rate or delay is not given, it will be  set  to  the
               default value.

Last edited by chris_l (2012-12-16 17:56:30)


"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.

Offline

#3 2012-12-16 18:10:10

aardwolf
Member
From: Belgium
Registered: 2005-07-23
Posts: 310

Re: Modifying keyboard driver?

Thanks, but I already tried autorepeat, and none of the autorepeat delay and rate settings help.

The thing is, autorepeat is for holding the key down. But even if you'd set autorepeat delay and rate to 1000 seconds, then still pressing the key twice in a row will result in two characters, not one.

And I press the key once myself, but mechanically somehow it gets triggered twice anyway. I'd like to solve that in software.

Offline

#4 2012-12-16 20:06:30

boast
Member
Registered: 2010-09-28
Posts: 219

Re: Modifying keyboard driver?

maybe changing the USB polling rate


Asus M4A785TD-V ;; Phenom II X4 @ 3.9GHz ;; Ripjaws 12GB DDR3-1600 ;; 128GB Samsung 830 ;; MSI GTX460 v2 w/ blob ;; Arch Linux + KDE 4.x

Offline

Board footer

Powered by FluxBB