30

This is one of the wackiest and weirdest problems I have ever encountered. My keyboard was working absolutely fine untill yesterday on Ubuntu 13.04. However, when I boot to Ubuntu today, I suddenly find that all the keys work, but I have to press and keep on holding them for about a second for them to work.

  • This behavior is true for all the keys except for Num Lock, Caps Lock and Scroll Lock keys, the indicator for them on my keyboard lights up as soon as I press those keys.

  • The keyboard works fine at the login screen where I put my password.

  • The keyboard also works normally if I use the Guest session instead of my normal user account.

  • I have not done any key-remappings and using the standard English (US) keyboard layout.

  • I have fiddled around with the settings for Keyboard in System Settings, but to no avail.

  • I have Windows 7 as dual-boot and the keyboard works perfectly well on it.

Why am I facing such a behavior and how to normalize this?

PS: Using Logitech Classic Keyboard K100 (USB Model).

Radu Rădeanu
  • 174,089
  • 51
  • 332
  • 407
Aditya
  • 13,616

11 Answers11

30

Because probably you put on the Slow Keys option from System SettingsUniversal AccessTyping. Turn it off:

slow keys

Radu Rădeanu
  • 174,089
  • 51
  • 332
  • 407
7

I had a similar problem. I stumbled on the answer while trying the solution here. Somehow the screen reader was turned on, and this was causing erratic behavior. Check it under System Settings → Universal Access → Seeing. Make sure the Screen Reader is set to OFF. Screen Reader OFF

3

Ubuntu has apparently mirrored the "slow keys" functionality in Windows, and by default set this up so it's enabled by holding down Shift key for too long automatically turns on this setting!

The appearance of this setting in recent years has been driving many people nuts, and the habit of holding down Shift while thinking of what to type means that it's easy to turn on this setting by accident.

The accepted answer does not work anymore in latest version of Ubuntu, there is no "Slow Keys" option anymore in gnome-control-center.

The only way I've found to reliably disable this is via command line:

# Get current value of keyboard accessibility (enabled = true , disabled = false)
gsettings get org.gnome.desktop.a11y.keyboard enable
# Get current value of slowkeys-enable
gsettings get org.gnome.desktop.a11y.keyboard slowkeys-enable
# Turn it off!
gsettings set org.gnome.desktop.a11y.keyboard slowkeys-enable false

Get current value of stickykey-enable

gsettings get org.gnome.desktop.a11y.keyboard stickykeys-enable

Turn it off!

gsettings set org.gnome.desktop.a11y.keyboard stickykeys-enable false

Finally, turn the entire keyboard accessibility options off (this should disable the SHIFT key shortcuts)

gsettings get org.gnome.desktop.a11y.keyboard enable false

Pablo Bianchi
  • 17,371
TrinitronX
  • 3,394
1

I can not post a proper answer with images and all cause I am on a windows only public computer right now but, try going to the keyboard settings and check to see if there is a key sensitivity setting, then maybe you can adjust it there...also try unplugging keyboard and then plugging it back in. Maybe this will reset it... Just suggestions!

Hope it helps... Good Luck!

SoCalDiegoRob
  • 621
  • 1
  • 7
  • 18
0

As described in the question, in the login screen I had no delay but in the window manager (awesome wm), there was an irregular keyboard lag (sometimes short/long delay). Before, I had put the following code in /etc/X11/xorg.conf

Section "Device"
Identifier  "Card0"
Driver      "intel"
Option      "Backlight"  "/sys/class/backlight"
EndSection

to make xbacklight work. It turned out that the the above lines caused the keyboard delay in my case.

phinz
  • 121
0

TL&DR: Turn of Screen Reader through the Universal Access options in Ubuntu 20.04+.

Instructions:

  1. Open the Activities overview and start typing "Accessibility".

  2. Click Universal Access to open the menu.

  3. Click Screen Reader in the Seeing section, then switch the Screen Reader setting on in the dialog.

Explanation: The Screen Reader feature is really meant for those who have trouble reading, or are visually impaired. This has been shown to cause delays in keyboard presses.

FlyingV
  • 979
0

After much troubleshooting and trying all other solutions, I found one the possible problems: the Compton window manager. I suspect many others are seeing the same as this one and I have not seen this solution online yet.

If you are using xfce (i.e. XFCE) (or any other desktop that use compton), try disabling Compton.

In Mint, this is: Mint button > Session and Startup > Application Autostart tab > Untick Window Manager (Window Manager Startup)

If you hover your mouse over this option you will see that - at least for xfce - the command for this is xfce-autostart-wm. This file is located at /usr/bin/xfce-autostart-wm and happens to be a Python Script.

In this script, the command compton --backend glx --vsync opengl-swc is executed if your window manager is Compton.

To see what your configured Compton manager is, start python3 and do:

import sys
import os
import gettext
import subprocess
import gi
from gi.repository import Gio
settings = Gio.Settings("com.linuxmint.desktop")
print(settings.get_string("xfce-window-manager"))

i.e.

/usr/bin$ python3
Python 3
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import os
>>> import gettext
>>> import subprocess
>>> import gi
>>> from gi.repository import Gio
>>> settings = Gio.Settings("com.linuxmint.desktop")
>>> print(settings.get_string("xfce-window-manager"))
xfwm4-compton

Once I started compton --backend glx --vsync opengl-swc the key delay issue immediately starts happening.

Disable Compton and see how you go. If you use XFCE the following script update (sudo vi /usr/bin/xfce-autostart-wm) may suffice:

    #subprocess.Popen(["compton", "--backend", "glx", "--vsync", "opengl-swc"])
    subprocess.Popen(["compton", "--backend", "glx", "--vsync", "opengl-swc", "--xrender-sync", "--xrender-sync-fence"])

Around line 33.

Bug here: https://github.com/chjj/compton/issues/255

0

This could happen when there is a daemon program catching keystrokes (like onboard). As a trial, open gnome-system-monitorand look if there is any bash script or even python scripts running. Try closing onboard if it's running.

Python Student
  • 558
  • 7
  • 16
0

I know that what I will recommend is almost the most easy and ugly solution out there:

Move the .* directories to somewhere else:

mkdir ~/backup
mv ~/.config ~/.dbus ~/.gconf ~/backup/

now restart your session. The problem should have go away. If the issue goes away, you can restore back one by one the innocent with

cp -nr ~/backup/.dbus ~/.dbus

Restart the session, issue is there again? Remove the directory and copy instead one by one the contents of the subdirectories. Same with the other 2 directories.

cp -nr ~/backup/.config ~/.config
cp -nr ~/backup/.gconf ~/.gconf

I know is quite brutish the method, but since I couldn't find the exact file/dconf/gconf/xinput that could cause this, a little quick hack should suffice.

Braiam
  • 69,112
0

Another possible reason for delay while switching keyboard layout: according to issue #1370953 (and #1370953), such behavior may be related to poor disk performance. See Maxim Kravets comment:

Every layout change alternates ~/.config/dconf/user file. Layout change is slow when disk is busy.

There is one thing (not only one) to step over disk issue - to change disk queue scheduler. By default Ubuntu is configured to use the deadline scheduler, however for a slower HDD its better to use cfq scheduler instead.

See instruction.

sempasha
  • 101
0

Inacceptable text entry lag might also have a completely different reason than the ones stated here (like Sticky Keys), and I found it:

By mistake I had the option 'Screen Magnifier' (Accessibility Options) switched on. That setting may slow texting down if you are running a low spec Netbook, like I do (ASUS X206HA)... It made me half crazy.

When I switched the Magnifier off, everything is back to quick and smooth again.