6

My question mark key in my keyboard isn't working. ("?"). I've tried to use xev and showkey -k to try to identify at least a keycode and manually use xmodmap to map it.

Unfortunately, the keys aren't being detected in neither utilities. I'm using Ubuntu 10.04 in a Virtual Machine (VirtualBox 3.2.4 r62467), and my Kernel is 2.6.32-22-generic. My Host is an Ubuntu 8.04.

When I run xev in my host, I get:

KeyRelease event, serial 30, synthetic
NO, window 0x3600001,
root 0x5d, subw 0x0, time 19346721, (726,722), root:(730,746),
state 0x2010, keycode 211 (keysym 0x2f, slash), same_screen YES,
XKeysymToKeycode returns keycode: 61
XLookupString gives 1 bytes: (2f) "/"
XFilterEvent returns: False

And when I run showkey -v:

0x59 0xd9

xmodmap -pk about this key in guest:

0x002f (slash)  0x003f (question)   0x002f (slash)  0x003f (question)   0x00b0 (degree) 0x00bf (questiondown)

...in host:

 0x002f (slash)  0x003f (question)   0x003b (semicolon)  0x003a (colon)  0xfe60 (dead_belowdot)  0xfe56 (dead_abovedot)

But when I click it on my guest it simply doesn't work.

Some related tickets in Virtualbox: #4957, #599 and #205.

What can this be? It's not a special multimedia key, it's a simple one. I would like to understand what exactly is happening so at least I can try to better debug this issue. If it's detected in my host, why it isn't in my guest?

3 Answers3

8

From archlinux wiki:

Check for scancodes

If a key does not have a keycode you can know if it has a scancode by looking at the kernel log using the dmesg command:

$ dmesg|tail -5

If when you press the key something like that appears:

atkbd.c: Unknown key pressed (translated set 2, code 0xf1 on isa0060/serio0).
atkbd.c: Use 'setkeycodes e071 <keycode>' to make it known.

then your key has a scancode which can be mapped to a keycode. See Map scancodes to keycodes.

If nothing new appears in dmesg then your key does not have a scancode, which means that it is not recognized by the kernel and cannot be used.

Udi
  • 304
3

I give up.

I'm going to buy a new keyboard. $10 for my sanity. I've already learned a bunch of xmodmap concepts and such.

0

I've spend alot of time binding a detectable but unable to get correct keycode. This is the easiest way I found to detect and bind it. Use :

xbindkeys -k

Install xbindkeys if not installed. And then enter above command, then enter the key you want to know the keycode. You'll get keycode and key name with it like this,

m:0x10 + c:169
Mod2 + XF86AudioPlay

Then use xmodmap to bind the key with the keyname(you can search the keyname in the list by using following command xmodmap -pk). In my case I wanted to bind this key with Super key.

xmodmap -e "keycode 169 = Super_L"

Hope this helps!