# Keyboard repeat doesn't work correctly

## audiodef

When holding down a key - mostly arrow keys - something will stop the repeat at some point so that I have to press the key again to keep going. Sometimes the key is "stuck" immediately. Where does this problem stem from? There is nothing physically wrong with my keyboard. I'm thinking evdev or hal.

----------

## aCOSwt

Under which environment does it occur ? console ? KDE ? else ?

----------

## audiodef

I use Eterm in Fluxbox. I've never had this problem in Eterm in Fluxbox on other machines, so my first thought is that Eterm isn't at fault.

----------

## audiodef

Bump? This is extremely annoying and I'd appreciate like crazy any advice!

----------

## d2_racing

Hi, can you post this :

```

# emerge --info

# cat /etc/X11/xorg.conf

# rc-update show

# rc-status

```

----------

## audiodef

emerge --info:

```

Portage 2.2_rc61 (default/linux/amd64/10.0, gcc-4.4.2, glibc-2.11-r1, 2.6.31.6-rt19 x86_64)

=================================================================

System uname: Linux-2.6.31.6-rt19-x86_64-AMD_Opteron-tm-_Processor_248-with-gentoo-2.0.1

Timestamp of tree: Thu, 28 Jan 2010 16:30:01 +0000

ccache version 2.4 [disabled]

app-shells/bash:     4.0_p37

dev-java/java-config: 2.1.10

dev-lang/python:     2.6.4-r1, 3.1.1-r1

dev-python/pycrypto: 2.1.0

dev-util/ccache:     2.4-r8

dev-util/cmake:      2.8.0-r1   

sys-apps/baselayout: 2.0.1      

sys-apps/openrc:     0.6.0-r1   

sys-apps/sandbox:    2.2        

sys-devel/autoconf:  2.13, 2.65 

sys-devel/automake:  1.7.9-r2, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1

sys-devel/binutils:  2.20       

sys-devel/gcc-config: 1.4.1     

sys-devel/libtool:   2.2.6b     

virtual/os-headers:  2.6.30-r1  

ACCEPT_KEYWORDS="amd64 ~amd64"  

ACCEPT_LICENSE="* -@EULA"       

CBUILD="x86_64-pc-linux-gnu"    

CFLAGS="-O2 -pipe"              

CHOST="x86_64-pc-linux-gnu"     

CONFIG_PROTECT="/etc /etc/conf.d/hostname /etc/conf.d/hwclock /etc/conf.d/modules /etc/conf.x/xdm /etc/locale.gen /usr/share/X11/xkb /usr/share/config"         

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"                 

CXXFLAGS="-O2 -pipe"            

DISTDIR="/usr/portage/distfiles"

FEATURES="assume-digests distlocks fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"   

GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"

LDFLAGS="-Wl,-O1"               

MAKEOPTS="-j3"                  

PKGDIR="/usr/portage/packages"  

PORTAGE_CONFIGROOT="/"          

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"       

PORTDIR="/usr/portage"          

PORTDIR_OVERLAY="/usr/local/portage/layman/pro-audio"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="3dnow 3dnowext X aac acl acpi alsa amd64 apache2 apm aspell automount berkdb bzip2 cairo caps cdda cddb clamdtop cleartype cli consolekit cracklib crypt ctype cups cxx dbus dri dssi dvd encode escreen exif extras faac faad fam ffmpeg filter flac fluidsynth fortran freebob gdbm gif gmp gnutls gpm gtk hal hddtemp icecast iconv id3tag ieee1394 imlib ipv6 jack jackmidi java jpeg ladspa lame lash libnotify lm_sensors lv2 midi mmx modules mp2 mp3 mp4 mpeg mtp mudflap multilib musicbrainz mysql mysqli nautilus ncurses nls nptl nptlonly ogg opengl openmp pam patch_loader pcre pdf perl plugins png policykit pppd projectm pulseaudio python qt3support quicktime readline reflection samba scrobbler sdl sensord session shout sndfile spell spl sse sse2 ssl startup-notification suid svg sysfs tcpd threads tiff truetype twolame unicode vamp vorbis vst wavpack x264 xcf xorg xpm xscreensaver xulrunner zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="*" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia" 

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

```

cat /etc/X11/xorg.conf:

```

Section "ServerLayout"

        Identifier     "X.org Configured"

        Screen      0  "Screen0" 0 0

        InputDevice    "Mouse0" "CorePointer"

        InputDevice    "Keyboard0" "CoreKeyboard"

EndSection

Section "Files"

        ModulePath   "/usr/lib64/xorg/modules"

        FontPath     "/usr/share/fonts/misc/"

        FontPath     "/usr/share/fonts/TTF/"

        FontPath     "/usr/share/fonts/OTF"

        FontPath     "/usr/share/fonts/Type1/"

        FontPath     "/usr/share/fonts/100dpi/"

        FontPath     "/usr/share/fonts/75dpi/"

EndSection

Section "Module"

        Load  "glx"

        Load  "extmod"

        Load  "record"

        Load  "dri2"

        Load  "dbe"

        Load  "dri"

EndSection

Section "InputDevice"

        Identifier  "Keyboard0"

        Driver      "kbd"

EndSection

Section "InputDevice"

        Identifier  "Mouse0"

        Driver      "mouse"

        Option      "Protocol" "auto"

        Option      "Device" "/dev/input/mice"

        Option      "ZAxisMapping" "4 5 6 7"

EndSection

Section "Monitor"

        Identifier   "Monitor0"

        VendorName   "Monitor Vendor"

        ModelName    "Monitor Model"

EndSection

Section "Device"

        ### Available Driver options are:-

        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",

        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"

        ### [arg]: arg optional

        #Option     "SWcursor"                  # [<bool>]

        #Option     "HWcursor"                  # [<bool>]

        #Option     "NoAccel"                   # [<bool>]

        #Option     "ShadowFB"                  # [<bool>]

        #Option     "UseFBDev"                  # [<bool>]

        #Option     "Rotate"                    # [<str>]

        #Option     "VideoKey"                  # <i>

        #Option     "FlatPanel"                 # [<bool>]

        #Option     "FPDither"                  # [<bool>]

        #Option     "CrtcNumber"                # <i>

        #Option     "FPScale"                   # [<bool>]

        #Option     "FPTweak"                   # <i>

        #Option     "DualHead"                  # [<bool>]

        Identifier  "Card0"

        Driver      "nv"

        VendorName  "nVidia Corporation"

        BoardName   "NV11 [GeForce2 MX/MX 400]"

        BusID       "PCI:1:5:0"

EndSection

Section "Screen"

        Identifier "Screen0"

        Device     "Card0"

        Monitor    "Monitor0"

        SubSection "Display"

                Viewport   0 0

                Depth     24

        EndSubSection

EndSection

```

rc-update show:

```

                  lvm | boot                                          

                 dbus |      default                                  

                 fsck | boot                                          

                 hald |      default                                  

                 mtab | boot                                          

                 root | boot                                          

                 swap | boot                                          

                 udev |                                 sysinit       

              keymaps | boot                                          

                devfs |                                 sysinit       

                dmesg |                                 sysinit       

                fcron |      default                                  

                local |      default          nonetwork               

                mysql |      default                                  

            savecache |              shutdown                         

              sensord |      default                                  

              metalog |      default                                  

           localmount | boot                                          

          consolefont | boot                                          

              modules | boot                                          

             hostname | boot                                          

             mount-ro |              shutdown                         

               net.lo | boot                                          

             net.eth0 |      default                                  

               procfs | boot                                          

             netmount |      default                                  

               sysctl | boot                                          

              urandom | boot                                          

               webmin |      default                                  

         termencoding | boot                                          

              apache2 |      default                                  

       udev-postmount |      default                                  

              hwclock | boot                                          

             bootmisc | boot                                          

        device-mapper | boot                                          

            killprocs |              shutdown  

```

rc-status:

```

Runlevel: default

 dbus                                                                                                              [  started  ]

 metalog                                                                                                           [  started  ]

 hald                                                                                                              [  started  ]

 net.eth0                                                                                                          [  started  ]

 netmount                                                                                                          [  started  ]

 mysql                                                                                                             [  started  ]

 fcron                                                                                                             [  started  ]

 apache2                                                                                                           [  started  ]

 sensord                                                                                                           [  started  ]

 udev-postmount                                                                                                    [  started  ]

 webmin                                                                                                            [  started  ]

 local                                                                                                             [  started  ]

Dynamic Runlevel: hotplugged

 net.eth0                                                                                                          [  started  ]

Dynamic Runlevel: needed

 sysfs                                                                                                             [  started  ]

 consolekit                                                                                                        [  started  ]

Dynamic Runlevel: manual

```

I have a nagging feeling solving this will help solve my xscreensaver not consistently kicking in problem, too.

----------

## d2_racing

Hi, can you try this one :

```

Section "ServerLayout"

        Identifier     "X.org Configured"

        Screen      0  "Screen0" 0 0

EndSection

Section "Monitor"

        Identifier   "Monitor0"

        VendorName   "Monitor Vendor"

        ModelName    "Monitor Model"

EndSection

Section "Device"

        Identifier  "Card0"

        Driver      "nv"

        VendorName  "nVidia Corporation"

        BoardName   "NV11 [GeForce2 MX/MX 400]"

        BusID       "PCI:1:5:0"

EndSection

Section "Screen"

        Identifier "Screen0"

        Device     "Card0"

        Monitor    "Monitor0"

        SubSection "Display"

                Viewport   0 0

                Depth     24

        EndSubSection

EndSection 

```

----------

## audiodef

Keyboard repeat works fine with that one. So something in my original xorg.conf must be screwing it up. What would it be?

----------

## d2_racing

It's because you have evdev,hal and dbus combo and for an unknown reason, you need to remove all the input stuff from your /etc/X11/xorg.conf to have a working keyboard  :Razz: 

----------

## audiodef

Ah. Well, thanks, d2, I appreciate it!   :Cool: 

My hunch about xscreensaver was wrong. I think it might be graphic - possibly driver - related. But I'm still clueless on that one.

----------

## d2_racing

Open a new thread about that problem and someone will take a look for sure.

----------

## audiodef

I did. I think it's "stump night" on that thread. I might check out the xscreensaver home page and see if I can contact someone there.

----------

## audiodef

Not solved, after all. The problem came back after restarting the computer. What happened?

----------

## d2_racing

Your keyboard problem or the other one ?

----------

## audiodef

My keyboard repeat problem. Should have been more clear, sorry!

----------

## d2_racing

Can you post this :

```

# cd /etc/hal/fdi/policy

# ls -la

```

If you have something there, post the content of the file.

----------

## audiodef

This is what I get:

```

total 0

drwxr-xr-x 2 root root  88 Jan 20 16:06 .

drwxr-xr-x 5 root root 128 Jan  7 18:48 ..

-rw-r--r-- 1 root root   0 Jan 20 16:06 .keep_sys-apps_hal-0

```

.keep_sys-apps_hal-0 is an empty file.

----------

## d2_racing

Well I have no idea.

Can you post your xorg log ?

----------

## Mekoryuk

What about for those of us who don't want to use HAL/DBUS?

Before HAL was "mandatory" in xorg, using the evdev driver was just fine.

----------

## d2_racing

But nowadays evdev needs hal and dbus I think.

----------

## mikegpitt

This may or may not help you.  When I updated to xorg-server-1.6 my key repeat delay had changed and took too long to start.  I include this command when I start X:

```
xset r rate 200 25
```

I'm wondering if it might help in your case...

----------

## audiodef

Interestingly enough, adding "keyboard mouse" to "evdev" in my INPUT_DEVICES seems to help. I don't know if this indicates a shortcoming or mis-configuration of HAL or evdev.

----------

## d2_racing

There is one way to do it :

```

# emerge -av udev hal dbus evdev

```

----------

## audiodef

Nope. Adding keyboard and mouse does NOT solve it. 

I'll try re-emerging things next.

----------

## drbergie

I upgraded to xorg-server 1.6.5-r1 and had keyboard repeat problems with ONLY left, and down arrow keys.  Adding 

```
xset r 113; xset r 116
```

 to my startup script ( ~/.profile ) solved it for me.

Hope this helps.

----------

## audiodef

I'll give that a try. Did you simply append that to the end of .profile?

----------

## drbergie

Yep, thats all I did  :Smile: 

(found it at the thread https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-input-evdev/+bug/278078 )

Good luck

----------

## VoidMage

As I look at that ubuntu bug, I'm coming to conclusion, that it's bogus.

A major part of it seems to be covered by our hal/evdev sticky,

in particular the part about not mixing hal settings with xorg.conf/DE settings.

As I don't use a DE that has a "Slow Keys" settings, I can't really tell

what that does, so right now I can't tell what exactly goes wrong.

----------

## audiodef

The tip drbergie gave me seems to have fixed it, but I'll know for sure after a few days of not having any keyboard repeat problem.   :Cool: 

----------

