Fn Media keys slow/delayed on ubuntu gnome 17.04

Solution 1:

For some reason my Gnome freezes when using Fn keys, or when I try to use 2 keyboards. A friend of mine pointed to me that it occurs when switching to a keyboard layout that has Scroll Lock enabled, so I disabled it in the X11 keyboard layout file for my language and it solved the problem.

The steps I followed are:

  1. Opened the keyboard layout file for my language, in my case:
    sudo nano /usr/share/X11/xkb/symbols/br
  2. Commented the line:
    modifier_map Mod3 { Scroll_Lock };
  3. Logged out and logged in again or run command setxkbmap.

These steps are specific for the Brazilian Portuguese ABNT2 Layout and may not work for other layouts, but it can help you find a similar solution.

Solution 2:

I had the same problem, but instead of Fn keys my problem was with the Ctrl key. Whenever I pressed Ctrl, gnome-shell CPU usage spiked!

So I figured out that my keyboard layout was set to en-GB, United Kingdom while my keyboard layout is en-US!

While the difference between the two layouts is minimal, it still somehow bugged the whole gnome-shell. So if anyone having the same problem, double check your keyboard layout from Gnome Settings!

Solution 3:

I have reported the bug here: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1895486

I think if more people comment there, the Canonical will help us to fix the problem.

This bug appears on Ubuntu 20.04 too.

I opened a merge request in: https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/112