16

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

Alvar
  • 17,058
  • 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

4 Answers4

5

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

.

user4124
  • 8,911
  • 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
  • They work in windows and in a live cd. So what now? – Alvar May 17 '11 at 08:05
  • The important thing is that F10, F11, F12 work with the LiveCD. Which means that you should be looking into potential disruptive changes. If you create a new user account on your Ubuntu box, do these keys work now? If they do, then it is a session issue, otherwise it's an installation issue. – user4124 May 17 '11 at 08:13
  • F10-F12 works if I use another account on my laptop! Which means that it's just my sessions that's damaged. So how can I fix it? – Alvar May 17 '11 at 10:04
  • Could I just copy the file that have the lists for the keyboard(codes and links and all that) from another account and just replace the one I currently have? Since it's only my account thats "broken". – Alvar May 17 '11 at 11:49
  • I am not sure which files you consider copying. However, by all means try it out. What you need to remember is to keep notes to return the previous step if something goes wrong. – user4124 May 20 '11 at 09:47
  • true, but I don't know what the file is called that the key codes are stored in? Do you know? – Alvar May 20 '11 at 13:10
0
  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..
Alvar
  • 17,058
george
  • 172
0

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.

minimec
  • 806
  • I was trying to stream audio by using this answer.http://askubuntu.com/questions/28039/how-to-stream-music-over-the-network-to-multiple-computers/30853#30853 – 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
  • I disabled the fn thing and I just use the F buttons. the keycodes is the problem! I have only problems with F10-F12 the rest works just fine. – Alvar May 15 '11 at 11:27
  • if you followed this howto http://biozshock.blogspot.com/2010/01/audio-output-streaming-on-ubuntu-linux.html you installed 'jackd'. This is the major change you did with your system. As jackd is a daemon it will always start on boot, and it is not 'gnome component'. I would try to remove the jackd. This is an empirical bugtracing ;) – minimec May 15 '11 at 12:20
  • It didn't wake the keys after a reboot. should I remove all of the programs I added? – Alvar May 15 '11 at 14:48
  • For 'empirical bugtracing' I would do so. As I said before, I see no connection between pulseaudio and keyboard configuration. I might see a conflict with software you installed and use, that somehow 'overlap' the default gnome settings. In that case jackd seemed to be a candidate as it is a daemon and would always 'overlap' as it is started per default. vlc also has such a shortcut thing in the preferences, but these are all disabled by default here on my desktop. Your problem is definitly strange... – minimec May 15 '11 at 15:01
  • --> maybe also create a new user and verify the bug. Sometimes only some user settings are messed up. – minimec May 15 '11 at 15:09
-2

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

LayerCake
  • 1,046
  • 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