Description of problem: I created /etc/X11/xorg.conf.d/01-vk-keyboard.conf: Section "InputClass" Identifier "vk-keyboard" MatchIsKeyboard "on" Option "XkbModel" "pc105+inet" Option "XkbLayout" "us,cz" Option "AutoRepeat" "300 40" Option "XkbOptions" "grp:switch,grp:alt_shift_toggle,terminate:ctrl_alt_bksp," EndSection It works fine except AutoRepeat. It is completely ignored, there is no mention in Xorg.0.log: [ 4619.707] (II) XINPUT: Adding extended input device "DELL DELL USB Keyboard" (type: KEYBOARD) [ 4619.707] (**) Option "xkb_rules" "evdev" [ 4619.707] (**) Option "xkb_model" "pc105+inet" [ 4619.707] (**) Option "xkb_layout" "us,cz" [ 4619.707] (**) Option "xkb_options" "grp:switch,grp:alt_shift_toggle,terminate:ctrl_alt_bksp," Version-Release number of selected component (if applicable): xorg-x11-server-Xorg-1.8.0-12.fc13.x86_64 xorg-x11-drv-evdev-2.4.0-2.fc13.x86_64 How reproducible: Always Steps to Reproduce: 1. Create a config like above 2. Start X with some simple window manager (which doesn't set its autorepeat) - fluxbox in my case 3. Re-attach a keyboard, follow /var/log/Xorg.0.log, read/test the actual autorepeat state (xset q) Actual results: Autorepeat has default values (660 25). No info in /var/log/Xorg.0.log. Expected results: Autorepeat should have configured values (300 40). The log should have some info about Option "AutoRepeat". Additional info: There is an upstream bug for older (1.6) X.Org which may be related: https://bugs.freedesktop.org/show_bug.cgi?id=24336 The only differences are the version and the configuration format. I didn't found any acceptable workaround. I played with udev: the problem is that X.org configuration runs *after* udev tasks. To have whatever working I created and registered a dirty udev script for adding a keyboard: if [ "$ACTION" = "add" ] ; then export ACTION=setmyautorepeat nohup $0 >/dev/null 2>&1 & exit fi if [ "$ACTION" = "setmyautorepeat" ] ; then sleep 2 xset -display :0.0 r rate 300 40 fi
Thanks for the bug report. We have reviewed the information you have provided above, and there is some additional information we require that will be helpful in our diagnosis of this issue. Please attach * your X server config file (/etc/X11/xorg.conf, including those additional files in /etc/X11/xorg.conf.d ... if you have anything else than what's mentioned in the comment 0), * X server log file (/var/log/Xorg.*.log) * output of the dmesg command, and * system log (/var/log/messages) to the bug report as individual uncompressed file attachments using the bugzilla file attachment link above. We will review this issue again once you've had a chance to attach this information. Thanks in advance.
Created attachment 422429 [details] my xorg.conf
Created attachment 422430 [details] /etc/X11/xorg.conf.d/00-system-setup-keyboard.conf - autogenerated keyboard setup
Created attachment 422431 [details] /etc/X11/xorg.conf.d/01-vk-keyboard.conf - my keyboard setup
Created attachment 422432 [details] my ~/.xinitrc
Created attachment 422434 [details] Xorg.0.log You can see at the end of the file how an external USB keyboard is being attached. No AutoRepeat mentioned.
Created attachment 422435 [details] /var/log/messages
Created attachment 422436 [details] dmesg
Hi Matej, thanks for taking this. I attached files you requested but I'm not sure if they help. It seems to me like an upstream feature instead of bug. I can't find the AutoRepeat option in any current man page, maybe it's no longer supported as "too confusing for new users" :-) BR, Oli
I am afraid you are right. yes, kbd(4) says nothing about this option and it seems to me that it is possible that in the new configuration world (https://fedoraproject.org/wiki/Input_device_configuration) this option has not made it. Passing the bug to the developer for confirmation, but I have my doubts.
I'm absorbing the idea the option went away... Anybody following this thread, is there a better way to pass autorepeat parameters than my horrible udev kludge? Sigh. 20 years of UNIX experience isn't enough to configure X. :-) BR Oli
AutoRepeat was removed from the keyboard driver with version 1.4.0. All the repeat code is now handled in the server. besides, only the keyboard driver supported that option, nowadays (unless you tweak the options to avoid hotplugging) we use the evdev driver. Which also relies on autorepeat being set by the session. sorry, you can't tweak this in the config file.
Hi Peter and thanks for the info. I can live with autorepeat having been removed from config files (although it makes no sense to me). Still there's xset(*) and I can use it from .xinitrc. But the question is: How to set autorepeat for hotplug keyboards? I use simple window managers and I need to configure autorepeat outside of them, on a "lower" level. Please, can you give me any advice? TIA Oli (*) I hope xset will not be removed from then next X.org release :-)
you essentially need to run your xset commands each time you plug in a new keyboard. sorry, that's the right approach now - except that ideally the desktop does that. xset won't be removed anytime soon, so don't worry about that.
Thanks for your answer but it didn't address my problem. I know that I have to run xset. The problem is: what is "the right" way to run it automatically. As I've mentioned in the initial message I use a very dirty workaround with udev script. I'll copy and comment it: if [ "$ACTION" = "add" ] ; then # A keyboard has been plugged. It's useless # to run xset here because X.org configuration # will run *after* this udev script. Just # "register" this script to run again in # background with different ACTION and exit. export ACTION=setmyautorepeat nohup $0 >/dev/null 2>&1 & exit fi if [ "$ACTION" = "setmyautorepeat" ] ; then # Now we are in backgroud. Let's wait for some # time so X.org can do its own configuration. sleep 2 # Let's hope: # - the configuration has finished, and # - the display is :0.0 # It's time for xset, eventually. xset -display :0.0 r rate 300 40 fi Do you see why I consider this a dirty workaround? I believe there must be a better way to trigger xset. I hope there was a very good reason to remove AutoRepeat :-) BR, Oli
(In reply to comment #15) > I hope there was a very good reason to remove AutoRepeat :-) the driver had its own repeat code which conflicted with the XKB code. so you end up with different repeat settings, sometimes even for different keys. Once we made XKB mandatory, having _one_ location only that handles key repeats seemed like the right thing to do. as for the udev script - there's race condition in there as you've spotted correctly. if you're running xset before the new device is added to the list, settings will overwrite each other. see also http://who-t.blogspot.com/2010/06/keyboard-configuration-its-complicated.html the correct way to handle this is to write a simple daemon that listens for DevicePresenceNotify or XIHierarchyEvents. http://who-t.blogspot.com/2009/06/xi2-recipies-part-2.html this way you'll only trigger when the device is really present. mind you, it'll probably be better to contact the upstream of your favourite desktop environment and help them with that there.
Hi Peter, thank you very much for being patient with me. I accept the current state as a technical necessity. I'm not going to fork X.org :-) I'll try to find some solution with the developers of my WM. Meanwhile, the udev script has to do its dirty work... Once again, thanks for your answers and blog spots. BR, Oli
Hmm. The real source of the problem is that xorg RESETS the current keyboard repeat rate after a keyboard has connected AND THE FIRST KEY HAS BEEN PRESSED! What the? Test case: 1. # xset r rate 190 70 2. # watch -d -n 0.3 'xset q|grep auto' 3. unplug keyboard 4. REplug keyboard 5. PRESS key 6. watch your custom setting being stomped by xorg-server/xkb/xkbAccessX.c:46:int XkbDfltRepeatDelay = 660; xorg-server/xkb/xkbAccessX.c-47-int XkbDfltRepeatInterval = 40; ...there surely must be a better approach than to reset everything in AccessXInit(), lol C;
as posted above, please read http://who-t.blogspot.com/2010/06/keyboard-configuration-its-complicated.html, especially the "Pulling out the cards" section. xset and xmodmap both share the same problem.
(In reply to comment #15) > Thanks for your answer but it didn't address my problem. > I know that I have to run xset. The problem is: what is > "the right" way to run it automatically. As I've mentioned FYI I use /usr/bin/X -ardelay 200 -arinterval 30 and it works fine with keyboard hotplugging.