How do I fix F10, F11 and F12?

What software are related to the Keyboard? or the Keyboard configuration?

Problem

It's local, only at my account. It doesn't help If I try the reassign the keys they still won't work.

Info

My laptop.

If I type xev in a terminal I notice that the key codes are gone. I pressed F12 and got this.

   FocusOut event, serial 33, synthetic NO, window 0x5200001, 
   mode NotifyGrab, detail NotifyAncestor 

   FocusIn event, serial 33, synthetic NO, window 0x5200001, 
   mode NotifyUngrab, detail NotifyAncestor 

   KeymapNotify event, serial 33, synthetic NO, window 0x0, 
   keys: 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

How it happened

I was trying to stream audio via this question/answer. But when I was finished and stopped the program I noticed that F10-F12 had stopped working.

Problem I don't know what the software is called or how it works.

The keycodes For:

F10 is 76

F11 is 95

F12 is 96

Solution

The only solution I found was to reinstall Ubuntu, sad, just hope the problem is a one time thing...


You need to start lower than keycodes. You need to find the scancodes for these keys, and associate keycodes to them. The subsystem that deals with these is udev, and the relevant files are found in /lib/udev/.

Step 1

Check in /var/log/dmesg if the keys F10, F11 and F12 produce any output when you press them. To do so, start the Log File Viewer (gnome-system-log), and notice for any additions to dmesg when you press those keys.

  • If they produce output, then there are no associated keycodes to the scancodes that the keys emit, therefore the problem you are facing is much low level. You need to assign keycodes to these scancodes. Use setkeycodes to assign the correct scancode.

  • If they produce no output, then something is wrong in the X Org configuration and possibly with udev. See next step.

Step 2

Run

/lib/udev/findkeyboards

to find the correct device for your keyboard. Sample output is

USB keyboard: input/event6
AT keyboard: input/event5

In this case, our keyboard is input/event5.

Then, run

sudo /lib/udev/keymap -i input/event5

and press the problematic keys. You can exit this program by pressing Esc.

Sample (correct) output for me is

scan code: 0x44   key code: f10
scan code: 0x57   key code: f11
scan code: 0x58   key code: f12

Step 3

If you notice that the keys work in a new user account, then what went wrong are configuration settings in your current account. There are a few ways where you can re-assign keys. For example, check to see whether you accidentally created new shortcuts for F10, F11 and F12 at

System » Preferences » Keyboard Shortcuts

.