1
votes

I've upgraded my Ubuntu laptop (Dell XPS-13) from the factory installed version 16 all the way to 19.04. I've dealt with a few issues, but currently my only problem seems to be a few keyboard shortcuts going nuts.

For example, I can no longer comment out code on my IDEs, both IntelliJ and VSCode.

The shortcut is normally Ctrl+/, but now when I enter this, IntelliJ folds the code around where the cursor is, VSCode zooms out (everthing gets small).

Another shortcode that's broken is Ctrl+], which is supposed to navigate forward in IntelliJ, but now doesn't seem to do anything at all, even though Ctrl+[ still works and is the "opposite" shortcut, i.e. it navigates back instead of forward. However, both shortcuts actually seem to work on Firefox!

So, there's some evidence that the problem is not Java-specific, as VSCode, which is Electron based, is also suffering from at least one broken shortcut... but one of the broken shortcuts in IntelliJ seems to work fine on FireFox, which is very confusing.

In any case, I found a small keyboard logger Java app here and this is what it shows when I enter Ctrl+/:

KEY PRESSED: 
key code = 17 (Ctrl)
extended modifiers = 128 (Ctrl)
action key? NO
key location: left
KEY PRESSED: 
key code = 45 (Minus)
extended modifiers = 128 (Ctrl)
action key? NO
key location: standard
KEY TYPED: 
key character = '/'
extended modifiers = 128 (Ctrl)
action key? NO
key location: unknown
KEY RELEASED: 
key code = 17 (Ctrl)
extended modifiers = 0 (no extended modifiers)
action key? NO
key location: left 
KEY RELEASED: 
key code = 45 (Minus)
extended modifiers = 0 (no extended modifiers)
action key? NO
key location: standard

Java, at least, seems to see me pressing both - AND / when I only pressed /, but only while Ctrl is pressed!! This explains why VSCode zooms out and IntelliJ folds the code: they both see Ctrl+- rather than my intended Ctrl+/.

When I enter Ctrl+], the key logger shows:

KEY PRESSED: 
key code = 17 (Ctrl)
extended modifiers = 128 (Ctrl)
action key? NO
key location: left
KEY PRESSED: 
key code = 135 (Dead Diaeresis)
extended modifiers = 128 (Ctrl)
action key? NO
key location: standard
KEY TYPED: 
key character = ''
extended modifiers = 128 (Ctrl)
action key? NO
key location: unknown
KEY RELEASED: 
key code = 135 (Dead Diaeresis)
extended modifiers = 128 (Ctrl)
action key? NO
key location: standard
KEY RELEASED: 
key code = 17 (Ctrl)
extended modifiers = 0 (no extended modifiers)
action key? NO
key location: left

This time, it seems to see something entirely different from what I entered. Instead of ] (which I can type here easily enough) it seems to see 135 (Dead Diaeresis) and ``, whatever that is.

My keyboard is set to use English (Australia) layout and I have a few languages installed (Portuguese, Swedish, English) but I only use English while writing code.

Any idea of what I can do to fix this problem would be highly appreciated!

PS. I've already asked this on the Ubuntu community but got nothing there, not even comments... https://askubuntu.com/questions/1192805/ctrl-shortcut-does-not-work-after-ubuntu-upgrade

2
I've looked more carefully, and it seems that even a normal / key hit shows in the key logger as KEY_PRESSED: - -> KEY_TYPED: / -> KEY_RELEASED: -.Renato
It seems the - (minus) is coming from the Swedish keyboard layout, which is located where the / is on the English layout... so the keylogger seems to be seeing different keyboard layouts on KEY_PRESS and KEY_TYPE events.Renato

2 Answers

1
votes

What layout goes first in your system settings?

There's a known issue that the first in order layout is used for shortcuts: https://youtrack.jetbrains.com/issue/JBR-1675

0
votes

To fix my shortcuts in Ubuntu 18.04. which might have the same cause the following worked:

In System Settings > Region & Language > Input Sources simply move the entries around. Then move them back as you need them.

... that's it. This will update your settings and your shortcuts might work again.

I found this solution from the post by @arsenily-nisnevich - which is different, though. My layout order was displayed correctly. But moving them around led to an update of the underlying settings file.

enter image description here