68

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.

106

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.

| improve this answer | |
  • 6
    Running sudo kbd_mode before the above command showed me that my keyboard was in “Unicode (UTF-8) mode”. The above command will set your keyboard mode to “raw (scancode) mode”, as man kbd_mode can verify. – Rory O'Kane Jul 31 '18 at 22:26
  • 3
    Just for future reference for others, this works in 18.04 as well (it uses GNOME by default). – jhpratt Sep 6 '18 at 1:16
  • 2
    And sudo kbd_mode -u to switch back to unicode mode – WitchCraft Sep 8 '18 at 5:35
  • 5
    It is really annoying to have to do this for every boot, apparently a permanent solution is to edit /etc/console-setup/remap.inc as described by askubuntu.com/a/1059609/104605 . – Compholio Oct 4 '18 at 14:26
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
5) The problem should be fixed now. At least it worked for me.

| improve this answer | |
-2

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

| improve this answer | |
  • When this happens, Alt+F1 opens TTY1. I haven't tried pressing J on a terminal specifically but I know that other commands using Ctrl work fine. – ig343 Mar 26 '17 at 16:52
  • can you confirm what will happen if you just press "j" in terminal? Open terminal with ctrl + Atl +T – Err0rr Mar 27 '17 at 5:19
  • I tried what you asked and it just prints "j". – ig343 Apr 5 '17 at 15:51
-3

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)?

| improve this answer | |
  • It is definitely not physical. Yes, I have updated grub. – ig343 Mar 26 '17 at 16:50
  • Have you tried booting from a live CD? I happen to have a similar problem right now and I am comparing settings between a good and a bad machine. If a live CD session works properly, you could try to compare the outputs of, for example: env, locale, localectl or locale charmap. – Julen Larrucea Mar 27 '17 at 16:51
  • The thing is my computer works normally most of times. This just happens from time to time, so it is hard to compare. – ig343 Mar 28 '17 at 5:31
  • It sounds like a tricky problem. Maybe you could make a script that outputs all the related information and save it into a file (including all commands above). Then run it again when the problem reappears and make a diff or something with both files. – Julen Larrucea Mar 28 '17 at 7:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.