Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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...

share|improve this question
    
Do you get "unknown keycode" in dmesg if you press these keys? If yes, setkeycodes might help. –  elmicha May 12 '11 at 17:29
    
Can you change the volume using Volume control? Do you even hear sound? –  Lekensteyn May 14 '11 at 11:57
    
I use Alsamixer to change the volume and the sound is normal, it's just that the keycodes are gone to the keys so I can't use them. –  Alvar May 14 '11 at 13:33
add comment

4 Answers

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

.

share|improve this answer
    
scan code: 0x58 key code: f12 scan code: 0x57 key code: f11 scan code: 0x44 key code: f10 –  Alvar May 16 '11 at 15:56
    
In step one, can you clarify what you want me to do? /var/log/dmesg is a huge file, but I can't find anything about my F10-12 keys. (I typed sudo gedit /var/log/dmesg) –  Alvar May 16 '11 at 16:04
    
You can run the Log File Viewer (in System » Administration). When you press F10-11-12 and there is new input to dmesg, you will see it in the Log File Viewer. –  user4124 May 16 '11 at 19:17
    
I don't see a new input in dmesg, but why do I need it? I've got the scan code and the key code so? –  Alvar May 16 '11 at 20:48
    
Since dmesg does not give any relevant output for the keyboard, and the command above produce keycodes for f10, f11 and f12, this means that your hardware is fine. Something else is wrong, and probably it's a configuration issue. Try to boot with a LiveUSB/LiveCD and verify whether those keys work. If they work on the LiveUSB/LiveCD, then some user configuration is messing up your system. –  user4124 May 16 '11 at 23:14
show 6 more comments
  1. Go to keyboard preferences --> layouts and add a new layout (UK or any other you currently don't have).
  2. Remove your current layout and then logout and back in.
  3. Go to keyboard preferences --> layouts and add your old layout again, and remove the one you added earlier.
  4. Log out and back in. Check the functionality now..
share|improve this answer
    
It didn't work... :( –  Alvar May 11 '11 at 17:24
add comment

Imho your problem is not at all related to the keyboard configuration!

  • I would check the gnome-shortcuts (maybe reassign keys), ...

  • ...or check if some software you use has some mediakey-plugin or something in the preferences that might cause problems with the gnome-shortcut system. Probably that software is not gtk+. Could be something like audacious or amarok.

I see no possibility that a pulseaudio crash could (directly) cause your problem.

share|improve this answer
    
I was trying to stream audio by using this answer.askubuntu.com/questions/28039/… –  Alvar May 14 '11 at 15:11
    
the keys work and if I reassign them I can lower/raise the volume. But if I don't get the keycodes back, then I can't use the keys! –  Alvar May 14 '11 at 15:13
    
I was (maybe I still am) a little confused about you talking about volume lower/raise and F10-12 at the same time. So I guessed, that you had a keyboard that gives you alternate keyfunction by pressing a 'FN' key in combination with a F-key. On my Logitech keyboard, the alternate keyfunctions for the F10-12 keys are 'previous, play/pause, next'. These alernate keyfunctions do not give you any keycode in xev, but would give you a similar output, as you showed in your question for the F12 key. But indeed: simply pressing the F12 key should give you 'keycode 96'. –  minimec May 15 '11 at 11:14
    
Now on older Logitech keyboards that 'FN' key had the same behaviour as the CapsLock key: Once pressed the alternate funtctions would be activated until you press it again. That caused problems for me, as I sometimes activated that 'FN' key accidently (--> lost all F-keys) On newer keyboards that 'FN' key behaves like the 'alt' 'super' 'ctrl' keys: You have to use a 'FN'+F1-12 combination to use alternate function. –  minimec May 15 '11 at 11:14
    
I do have to guess that you had working F10-12 keys after initial install of Ubuntu (<--is that correct?). On the other hand I don't see how that keyboard configuration would be changed without you changing something manually. Your keyboard and mouse are configured automatically via the xserver xorg (xinput). If you did not change anything manually (add a xorg.conf), why should that automatic configuration suddenly change? You could now try to add those keys again with xmodmap, but I always begin to wonder, when I have to fix something manually, that worked out of the box bofore. –  minimec May 15 '11 at 11:15
show 5 more comments

Here is a pretty good description intended for multimedia keys but it really helped me a lot. https://help.ubuntu.com/community/MultimediaKeys

share|improve this answer
1  
multimedia keys aren't the point of the question, multimedia keys can be set to any key, it's just an assignment. –  Alvar May 14 '11 at 15:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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