Keyboard stops working after source switch

From time to time keyboard stops working after I switch source (i.e. using ctrl + shift combination). Most often it happens in Chrome yet I've experienced this in PyCharm IDE as well and maybe some other applications. I should probably note, that keyboard stops working only in the application in which this problem triggered - if that happened in Chrome for example, I can't type there and all is fine with other apps.

I'm not perfectly sure that the source switching triggers it, yet it appears so.

What would you recommend me to do? If there's no obvious solution, how should I 'debug' it?

My OS is Ubuntu 14.10 (with Unity).

Thank you.

UPDATE: I must also note that things were the same with alt + shift combination.

UPDATE 2: I followed advice by @ElderGeek and changed the source switching key to f2, for some time things were working well for me, but now the trouble is back. I need to relaunch an application in order to get keyboard working in it.

UPDATE 3: I confirm that keyboard turning off is not related to the source switching.

UPDATE 4: The problem persists after clean installation.


Solution 1:

I've had this problem with Pycharm when I first installed Unity and did some customs, am still not sure if the problem occurred from Unity

Here is what you want to do:

  1. Install DConf Editor & Lunch it.
  2. Go to Desktop Then ibus
  3. General
  4. Now check the box next to use-global-engine and use-system-keyboard-layout

enter image description here

Edit: Make sure to match the keyboard input method:

  1. System Settings > Language Support
  2. At the bottom part find "Keyboard input method system"
  3. Choose iBus, Or you can try all of them. (Required reboot)
  4. After making the change, you need to restart for the settings to take effect.

enter image description here

Solution 2:

There are a number of chrome specific keyboard shortcuts many of which use some combintaion of CTRL Shift. This could easily create some incompatibilites with your "source switching" key combination.

Recommendation: Change your source switching key combo if possible to something not reserved for your commonly used applications.

Source: http://www.shortcutworld.com/en/linux/Chrome.html

Solution 3:

It could very well be caused by a corrupted dconf database.

You can find out by removing or (temporarily?) renaming the directory ~/.config/dconf/, and log out and back in to force the creation of a new database.

If it turns out to be the cause, you can remove the outdated database.

Edit
You mentioned in a comment that it has occurred on several installations already, and also after a clean install. That makes it almost certainly a hardware issue. That would also explain the unpredictable occurrence of the symptoms.