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?

2
  • Does ? work on the console (Ctrl-Alt-1)? What keyboard layout do you have (US, European, etc.)? Does showkey -k show you any keys, but just not ?; more data, please.
    – msw
    Jun 15, 2010 at 15:00
  • Couldn't test console mode in the VM, how do you do it in Virtualbox?. I have a Brazilian Keyboard layout, it's an HP model (KU-0316). showkey -k shows any keys, just not ?. superuser.com/questions/151463/… Jun 16, 2010 at 12:13

3 Answers 3

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.

1
  • My key is being listet by showkey but not in dmesg.
    – Suuuehgi
    Oct 5, 2021 at 6:56
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.

2
  • Did you see the answer above?
    – Udi
    Mar 14, 2013 at 18:13
  • Yep. But I don't even have that Virtual Machine anymore, so it's not worth the hassle and I can't test your solution (although "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.", I only mark as accepted if I can test for sure). But thanks for passing by, your post may me useful for someone! +1 Apr 18, 2013 at 4:02
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!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .