Ticket #2025 (closed defect: fixed)

Opened 15 years ago

Last modified 13 years ago

French keyboard issues -> fixed in SVN/3.0.10

Reported by: laurentlesle Owned by:
Component: other Version: VirtualBox 1.6.4
Keywords: Cc:
Guest type: Linux Host type: other


My Frecnch(France) HP keyboard is not recognised by Virtualbox. See attached the table keyboard.


HP French Keybord not known.log Download (41.9 KB) - added by laurentlesle 15 years ago.

Change History

Changed 15 years ago by laurentlesle

comment:1 Changed 15 years ago by michael

I am rather curious - from the tables you sent, it looks like your keyboard does not have a capslock key. Is this correct? What sort of keyboard is it exactly?

comment:2 Changed 14 years ago by frank

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

No response, closing.

comment:3 Changed 13 years ago by verdy_p

  • Status changed from closed to reopened
  • Resolution fixed deleted

French keyboards don't have Capslock but ShiftLock ! You press it any number of times to activate it, and to disable it you just press Shift once.

Apparently you seem to have made false assumptions about what the CapsLock key does and that it can have two distinct working modes :

  • the CapsLock mode (which is a toggle key)
  • the ShiftLock mode (which is NOT a toggle key, but is disabled by Shift)

Windows even offers the choice about the working mode (the default mode for French is ShiftLock). Depending on the working mode, the key codes generated are different.

This may explain why the bug (about CapsLock that can't be disabled by just striking Shift in the Guest OS) has reappeared, if it was theoretically closed in VBOX 1.5.4.

comment:4 follow-up: ↓ 8 Changed 13 years ago by michael

verdy_p: interesting, I didn't realise that X11 handled them differently (actually my first Linux box had a French keyboard, but that was a long time ago). However, I suspect that your issue may simply be that you didn't set up the keyboard in the guest OS. The guest doesn't know how the host handles the keyboard, so perhaps you have it set to caps lock rather than shift lock?

comment:5 Changed 13 years ago by michael

Ah, I didn't see your comment on ticket #453 in which you give slightly different information. Please note that neither of the tickets are dealing with the issue you are reporting though.

comment:6 Changed 13 years ago by michael

By the way, please confirm that (if) you are using a Linux or Solaris host.

comment:7 Changed 13 years ago by verdy_p

I'm using a Windows Vista host (from your current last release, i.e. using your installer), to run another Windows (XP or Seven). All these Widnows are official French versions (including Seven which is the official release from MS TechNet subscription).

And my host or guest installations of Windows are ALL correctly setup with WHDL certified drivers for the keyboard, all set to French keyboard.

I have tried different combination in the Keybaord Control Panel to use ShiftLock mode (standard for French) or CapsLock mode (usual for US English keyboards), but this does not change anything in the four possible combinations. The CapsLock mode remains active in the guest and the LED on the keyboard remains lighting.

I have NOT given different information, this is exactly the same problem. Visibly VirtualBox fails to translate the virtual keys returned by the keyboard driver from the host into basic virtual keys that can be processed by the guest OS.

(note that when I run a Linux guest on Windows host with VBOX, I also see the same problem).

So this is really a problem of VBOX, in the way that it captures the keyboard events from the host, and translate them before transmitting them to the guest. visibly, it does not work with French keyboards (I have not tried by using US English keyboards on both OS, but I could do that).

comment:8 in reply to: ↑ 4 Changed 13 years ago by verdy_p

Replying to michael:

verdy_p: interesting, I didn't realise that X11 handled them differently (actually my first Linux box had a French keyboard, but that was a long time ago). However, I suspect that your issue may simply be that you didn't set up the keyboard in the guest OS. The guest doesn't know how the host handles the keyboard, so perhaps you have it set to caps lock rather than shift lock?

I have tried all four combinations (ShiftLock or CapsLock mode in both the guest and host). None of these four combinations work, ALL of these four have the same bug that CapsLock remain active and can't be deactivated (can only type capitals, and the keyboard LED remains lighting) from the guest.

I always have to switch back to the host and type something, to set it in non-CapsLock mode (the keyboard LED swtiches off too), before returning to the guest.

I see the same problem on different PCs from different brands (a HP Pavilion notebook, an Acer notebook, a Asus notebook, a standard taiwanese OEM desktop, a IBM desktop): they all have the French keyboard in common and are all running a windows host.

I have no such problem with MS VirtualPC (And I can use either MS VirtualPC or VBOX to run exactly the same installation the same VHD files).

I have even tried to create a new VM using exclusively VBOX, and this does not changes things (so this is not a conflict with a additional driver installed by VirtualPC).

comment:9 Changed 13 years ago by verdy_p

Note that the bug #453 that you have deleted was more appropriate than this one, because this one concerns an "unknown" keyboard. But the logs from VBOX do not expose that my keyboard is unknown, it shows that the PC keyboard is validated and behaves normally in all steps 2 to 6.

comment:10 Changed 13 years ago by michael

This is certainly broken on a Linux host. First of all, I had to change the code to make it recognise shift lock at all. Then it looks like the fix for #453 (caps lock sometimes got out of sync between guest and host) is causing additional problems here - on an X11 host, when shift lock is in use, caps lock is always off, so whenever the guest enables caps lock, VirtualBox "synchronises" them by sending an additional caps lock key press to switch it off again.

I don't know yet whether this is what you are seeing though.

comment:11 Changed 13 years ago by michael

I took a look at the code and at MSDN, and I'm pretty sure it must be a somewhat different problem to what I am seeing with X11 hosts. Are your guests all set to deactivate caps/shift lock when shift is pressed? Could you try changing them (or one of them) to do it when caps lock is pressed a second time to see if that makes a difference? Thanks.

comment:12 Changed 13 years ago by verdy_p

As I said, I have tried ALL the four possible combinations, note of them work. All have the same defect (and the Visual Keyboard accessibility tool in Windows clearly shows that Caps Lock behaves incorrectly in the guest).

But the normal setting for French is to have the CapsLock key working in ShiftLock mode. I am not speaking about X11 at all (because this bug occurs on Windows hosting Windows) and is specific to VBOX (and does not occur in Microsoft VirtualPC)

If you have not changed things in VBOX, may be this is something that has changed in the Windows port of Qt, that you use in VBOX to handle the console and translate the host Windows keyboard events back to the emulated event from the BIOS.

And may be the thing that you have changed for Linux hosts is now causing a problem in Windows hosts (that see two events instead of just one, but anyway, in the ShiftLock mode, pressing the CapsLock key twice should have no different effect than maintaing the CapsLock mode active. And pressing the Shift key should disable the CapsLock mode immediately (even before releasing it).

In the alternate Capslock mode, however, pressing CapsLock twice will disable it, and the Shift key should not change it. As I said, the CapsLock mode in both the guest and host does not work.

Do you have a debugging tool (or runtime option) that I can activate to see the windows virtual key events that are occuring in the host and those that are transmitted to the guest? plus a tool for seeing the virtual keys in the guest?

comment:13 Changed 13 years ago by michael

Since I mainly run Linux host and guest systems, my preferred tool for observing keyboard events is xev. I don't know if there is anything similar for Windows, but you can at least see what is happening on the guest side by running a Linux guest (e.g. a live CD) and running xev on that.

And I'm not sure what you mean by "the thing that I changed for Linux hosts". The changes I was referring to above were introduced - by someone else in the event - for all hosts in VirtualBox 1.5.4 (several years ago).

comment:14 Changed 13 years ago by michael

I think I have found the problem - we were passing CapsLock and NumLock keypresses through to the host when the guest had the focus, but we were not passing through shift, so the host never saw that when it was pressed, and never disabled its CapsLock when "shift cancels CapsLock" was enabled. And since we always (re-)synchronised the guest state to the host, it became impossible to disable it in the guest too. You might want to try out the test build of the stable branch (see this disclaimer) at

to see if it fixes the problem for you. I also changed the code to send a CapsLock keypress followed by a left shift to the guest when we try to disable CapsLock there, in case the guest is also using "shift cancels CapsLock".

comment:15 Changed 13 years ago by verdy_p

I've tried it, this does not change anything: the host is still kept with CapsLock enabled (with the CapsLock LED on the physical keyboard still ON) when I press Shift (when the Guest Windows uses the "Shift cancels CapsLock" mode) or when I press CapsLock (when the Guest Windows does not use the "Shift cancels CapsLock" mode, i.e. with CapsLock supposed to work as a toggle).

So I still need to go to the HOST (Windows too) to cancel CapsLock. I really don't understand why you need to translate or simulate extra Shift or CapsLock keypresses to the HOST, given that the effective mode is only maintained by the physical HOST keyboard driver that finally divers the events to the HOST OS through its API, that is the source of ALL events delivered to VBOX (that it must JUST forward to the GUEST appropriately, just to have the same events received by the Guest).

There is NO situation in which the Guest host can or should deliver any keyboard events (including simulated ones) to the HOST, after any physical key press (at least when the HOST is Windows, but most probably too when the HOST is Linux or some other OS that uses the BIOS events or simulates the BIOS by handling the i8042 hardware serial port directly).

The only case where this could happen is if the Guest simulates hardware events itself (for example when you use the Visual keyboard Tool in the Guest, and click on a button area to simulate a keyboard action that should be reported back to the underlying keyboard driver, which in turn could forward the simulated event to the HOST).

I don't know what you are doing, but if you are not forwarding events from the Guest to the Host, then something is wrong in the Windows events loop of VBOX, that handles some HOST events but then incorrectly state the return status, so that the event chain gets broken (so the HOST drops the events and omits to updates its own status, ad it thinks that your VBOX application has decided to discard the event before it was effectively handled by the higher-level layer of the HOST).

My opinion is that the problem is really on the HOST side only, within the way you are trapping some Windows events : you should not discard any original event, even if you process them specially for your application (here VBOX + its own local GUEST), to decide which one to forward to the GUEST, and how you should forward them to the GUEST.

It looks like that, when you have handled a windows event in the VBOX application received from the HOST, you incorrectly set the return status for modifier keys, and don't allow the HOST to still process the message locally, so the event gets fully captured in VBOX and does not propagate further as it should.

Note: please try yourself by adding and selecting the French keyboard on the Windows Language task bar, on the HOST side. And, same thing on the Guest. Then in the Guest, run the "Visual Keyboard" accessibility tool by pressing Windows+U. Look at how the Guest perceives the keyboard from its underlying HAL.

Note: the French keyboard layout is a bit different from US keyboards, because:

  • it is AZERTY and not QWERTY (AZ and QW are swapped)
  • the M key is on the right of L on the second letters row, instead of the right of N on the third letters row.
  • the digits are shifted on the first row, as the non-shifted positions are used for the most frequent accented letters used in French and punctuation signs.

If you can't find a solution in VBOX, I'll create an alternate French keyboard driver to use on the Guest, so that it will compltely disable the CapsLock mode, by ignoring the CapsLock key.

The CapsLock mode is really not needed in French, and I almost never use it (except by those that want to write using ALLCAPS, something that is highly discouraged in French, as the standard French layout lacks some frequently used but needed accents), it is only there for some convenience and for few users; I want to be able to disable it most of the time, or imemdiately after if I ever press it by accident. (For entering numbers easily, we also have the numeric keypad, without having to use CapsLock).

comment:16 Changed 13 years ago by verdy_p

Well, to see the events that windows receives on the guest, I can compile a small program to log these events.

But because we are apeaking about a defect of the Windows version of VBOX (HOST), you should have the tools on Windows to see the events also on Windows, or VBOX could also contain a debugging flag that, when enabled, should allow to see the events it receives from Windows in its log, before it processes them, and after it has processed them (independantly of the GUEST OS that gets run within its VM). It looks like it effectively receives the events, and may eventually process them correctly for transmitting them to the guest, but it returns the event incorrectly after this local processing (most probably it forgets to call the default Windows event handler, something that is essential to have an outer "TranslateMessage() API to work correctly across all layers).

comment:17 Changed 13 years ago by michael

  • Summary changed from HP French Keyboard unkown to French keyboard issues -> fixed in SVN/3.0.10

Sorry, at the time I did the fix, I didn't have a Windows host handy to test on. A colleague thought that my fix did the trick, but when I did get a Windows system set up, it was clear that it didn't. I committed a new fix (after learning to use windbg in a short time :) ) which solved the problem for me. It will be in the upcoming 3.0.10.

comment:18 Changed 13 years ago by frank

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

comment:19 Changed 13 years ago by verdy_p

Thanks, it works perfectly now (including with alternate/extended keyboard layouts created with MSKLC and keyboard layouts different between the host and guest, and with different ShiftLock/CapsLock modes).

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