75

Since yesterday Alt+F4 is working unexpectedly on my computer. When I press those keys TTY4 is opened. Also, the application which is running on the GUI receives the Alt+F4 message. This is solved by rebooting the system, but after a while it starts doing this again.

As far as I have googled there are other people finding this problem but with no solutions (1, 2).

I am running Ubuntu Gnome 16.10, Kernel version 4.8.0-39-generic and GNOME Shell version 3.20.4.

ig343
  • 1,008

4 Answers4

112

I had this recently on Ubuntu GNOME and on Unity. The answer is this:

sudo kbd_mode -s

Run that in a terminal and then the Alt+F4 keyboard combination returns to normal.

From kbd_mode man page (from kbd project and package):

kbd_mode - report or set the keyboard mode

Without argument, kbd_mode prints the current keyboard mode (RAW, MEDIUMRAW or XLATE).
With argument, it sets the keyboard mode as indicated:

-s: scancode mode (RAW),

Pablo Bianchi
  • 17,371
popey
  • 24,549
1
  1. As root, edit /etc/console-setup/remap.inc.

  2. Add this line at the bottom:

    alt     keycode  62 = VoidSymbol
    
  3. Run sudo dpkg-reconfigure console-setup -phigh

  4. Reboot (reboot).

The problem should be fixed now. At least it worked for me.

Pablo Bianchi
  • 17,371
Nicolas Raoul
  • 11,921
-3

Things to do

1. Alt + f1 

- what will above do? Will it open TTY1?

2. open terminal and just press "j" without quote

what is the output? will it work same as pressing enter key? or just prints "j"?

In the link you posted @Pielco11 says sudo update-grub solves the problem.

Also try sudo apt-get update

Prakash
  • 158
  • 1
  • 1
  • 9
-4

Some ideas to trace down and maybe fix the issue:

  • Booting with a Live-CD in order to check if the problem is physical
  • Use another keyboard
  • Switch the keyboard layout or try to remap the Ctrl
  • Does it only happen on the desktop environment or does it also switch to TTY4 if you are at some other TTY? If it happens also on the TTYs, it might be related to some kernel parameter.

Did you try the tip on the last comment of your second reference (update-grub)?

Julen Larrucea
  • 1,052
  • 11
  • 26