Ticket #436 (closed defect: fixed)

Opened 10 years ago

Last modified 7 years ago

Keyboard completelly messed up

Reported by: linuxrulez Owned by:
Priority: major Component: other
Version: VirtualBox 1.4.0 Keywords: scancode keycode sunray
Cc: Guest type: other
Host type: other


Keyboard layout is completely messed up (All key mapping is wrong) It seems the problem is the use of scancodes (had the same problem with dosbox. not using scancodes helps)

Specifically this problem occurs only when connected via SunRay terminal (XKB on or off makes no difference) No problem when connected via XDMCP or physically. XEV reports GOOD key symbols and codes (including XKB=on)

HOST: openSuSE 10.2 x86_64 terminal:~ # setxkbmap -print | xkbcomp - $DISPLAY terminal:~ # setxkbmap -print xkb_keymap {

xkb_keycodes { include "sun(type6_usb)" }; xkb_types { include "complete" }; xkb_compat { include "complete" }; xkb_symbols { include "sun/us(type6)" }; xkb_geometry { include "sun(type6)" };

}; Keyboard used: Sun Type7. Keycode / symbol maps edited to make it work under X with XKB=ON

P.S. In preferences HOST key selection works, problem occurs in VM window


keycodes Download (4.3 KB) - added by linuxrulez 10 years ago.
keycode mapping

Change History

comment:1 Changed 10 years ago by michael

Do Wine applications work with your setup? This is basically a scan code problem - most X11 applications work with key symbols, not with scan codes, but for obvious reasons we can't do that in a virtual machine.

comment:2 Changed 10 years ago by linuxrulez

Yes. Tested:

WINE's own WCMD and WineConsole Internet Explorer 6SP1 (from Ies4Linux)


As far as I know, VirtualBox, like DosBox, uses SDL for keyboard capturing. DosBox has ability to turn off scancode using. Is there ANY way to turn it off on VirtualBox ?

comment:3 Changed 10 years ago by michael

And is the keyboard layout similar to a PC keyboard? We work out the scan code mapping based on the keyboard layout (and the main VirtualBox front end does not use SDL for this). Unfortunately we can only use scan codes, as the installed guest operating systems are written to deal with physical (PC) keyboard controllers which do not know anything about the actual layout.

comment:4 Changed 10 years ago by linuxrulez

I have to setup Sun Type 7 (USB) keyboard, witch is in fact the same as type6 (SUN provides broken symbols file, fixed it to make XKB work)

I used US layout (haven't tried national layout yet)

Wouldn't it be easier to just remap scancodes? (fetch symbol with current X symbol map, translate symbol to scancode using some other keycode map. Maybe pc105?) This way, physical keyboard's scancode would make no difference. I've attached xmodmap -pke output

Changed 10 years ago by linuxrulez

keycode mapping

comment:5 Changed 10 years ago by michael

We do something on those lines. We read the symbols attached to each key on the keyboard, and based on that, we try to match the keyboard to a known layout, and from that, to map the scan codes of the keyboard to PC keyboard scan codes for translation purposes. Note that we only do this for remote terminals. If VirtualBox is running on the machine used as an X display, we just assume that it is a PC, and use known scan code translations. We currently look at the $DISPLAY variable to decide whether the display is remote or local. If it starts with ':' (like :0.0'), we assume that it is local. Could that be the problem here?

You might want to have a look at our keyboard handling code, which is in the directory

comment:6 Changed 10 years ago by linuxrulez

Yes, this is the case. When logging in from SynRay, X is local (DISPLAY=:11.0) export DISPLAY="localhost$DISPLAY" solves the problem

comment:7 Changed 10 years ago by sandervl73

  • Priority changed from blocker to major

comment:8 Changed 9 years ago by rm

using a Belgian layout, I'm missing some keys (e.g. the '6' - luckily I can use the numerical keyboard for that) and some keys are mapped wrong.


comment:9 Changed 9 years ago by michael

  • Status changed from new to closed
  • Resolution set to fixed

The last issue is fixed in VirtualBox 1.5.2, due to be released in a few days. See ticket #599 for that, the other issue is fixed in 1.5.0.

Note: See TracTickets for help on using tickets.
ContactPrivacy policyTerms of Use