Scripting

Keyboard Repeat Issues

Keyboard Repeat after resume

There seems to be an issue with later versions of xorg/udev (Ubuntu 10.4 Lucid) where on resume, the keyboard repeat is turned off.

This thread mentions a way if a keyboard is hotplugged. https://bugzilla.redhat.com/show_bug.cgi?id=601853

It seems to correctly diagnose that xorg disables repeat settings and runs after udev thus blatting any settings the keyboard may have. You therefore have to delay the running of the xset command until xorg has had a chance to initialise. My case was a problem with resume rather than hotplugging so I hacked the scripts around a bit.

1 - make a file : /usr/local/bin/xset.sh with contents:

#echo "xset starting `date`" > /tmp/xset.log
sleep 5
xset -display :0.0 r rate 300 40
#echo "xset ending `date`" >> /tmp/xset.log

You can uncomment out the echos if you need help for diagnosis.

2 - then make another file : /etc/pm/sleep.d/50_xset with contents:

#!/bin/bash
case "$1" in
    thaw|resume)
     nohup /usr/local/bin/xset.sh & 
    ;;
esac

3 - chmod both to be runnable:

chmod +x /etc/pm/sleep.d/50_xset
chmod +x /usr/local/bin/xset.sh