I use gnome tweaks to switch my left CTRL and ALT keys. This has been working fine since 18.4, and I had no issues since upgrading to 20.4 until today...
When I open the settings I can see the checkbox to swap the keys is still ticked. When I untick the checkbox and reapply it the key bindings work - for around 5 minutes. Then for no apparent reason reverts back to default. I've even tried leaving the window open - I can see it remain checked, wait for it to no longer apply, it's still ticked, I untick and re-tick it and it works again
Any help for how I can troubleshoot this is much appreciated.
Seems like this may be the same as https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1899206
If so, it will be fixed in Gnome 3.38.2
In my case, I narrowed it down to plugging in an external keyboard via USB. Even though the external keyboard has the same layout (UK QWERTY) as the laptop, my compose key and CAPS LOCK key settings are reset. It's annoying, but re-selecting the options in Gnome-Tweaks fixes it.
According to this question, this is specific to the version of GNOME currently being used in Ubuntu 20.04. There is a corresponding bug registered for GNOME, which should be fixed in an upcoming release. According to the other discussion, there is a workaround, restarting the gnome session after connecting the keyboard:
This is quite possibly the same bug identified in the existing answer, just registered in different places.