7

I use Alt + Shift to change the language. It is so normal and I have worked with that for a long time. But some days some thing have happen for me. That is Alt + Shift not work all times. For example I can use it on libreOffice to change the language and also on browses. But on some application it does not work. I do not know why.

For example on Taskque software, when I want to add my own task and change the language, Alt+Shift doesn't work.

graham
  • 13,061

2 Answers2

11

This bug made using emacs and IntelliJ Idea a nuisance under Ubuntu 18.04 LTS. I found a simple workaround.

  1. You can verify how Alt and Shift are not being detected simultaneously by running

    $ xkbwatch
    

    Notice how the blinky lights change for ALT and for SHIFT individually but not for both at the same time.

  2. The output of setxkbmap -query:

    rules: evdev
    model: pc105
    layout: us,us,us
    variant: ,intl,
    options: grp:alt_shift_toggle,grp_led:scroll
             ^^^^^^^^^^^^^^^^^^^^
             THIS IS THE PROBLEM
    
  3. We will now unset ALTSHIFT toggle, so that it is not prematurely captured.

    $ setxkbmap -option -option grp_led:scroll
                ^^^^^^^
                DELIBERATELY EMPTY
    

    The first empty -option erases all options, the second one just carries over an option we want to keep. Additional -option clauses can preserve other preexisting options.

    You can still change to next/previous input source with whatever is configured in Ubuntu Settings/Keyboard/Typing. In my case it is Super+Space (Super=Windows key in PCs).

  4. Repeat step number 2 again and notice how ALT and SHIFT now play together simultaneously.

I am now a happy Emacs and IntelliJ user.
This is a single command workaround.

zx485
  • 2,865
4

Perhaps this will help...

Open a terminal and run:

gksu gedit /etc/default/keyboard

(or use some other text editor)

Do following changes in the file:

XKBLAYOUT="de,us"
XKBVARIANT=""
XKBOPTIONS="grp:alt_shift_toggle"

(Replace de,us with your languages)

Restart and try again.

More Info http://www.x.org/releases/X11R7.6/doc/xorg-docs/input/XKB-Config.html#id2521334

TuKsn
  • 4,440