James Mastros wrote:
> Roel Schroeven wrote:
>
>> At the DOS prompt, I noticed that the keys were mapped totally
>> wrong. The letters were correct, but that's about it. SHIFT + the
>> digit keys behaved as would be expected from a QWERTY keyboard,
>> while I use an AZERTY one (Belgian layout). Digit keys without shift
>> produced some digits (a 7 when I pressed 1, for example) and some
>> other symbols. This made it almost impossible to use FDISK... You
>> have to enter digits to make your choices in the menus...
>> After switching my keyboard layout to QWERTY I was able to continue
>> (luckily I'm quite used to typing QWERTY on AZERTY keys).
>
> Um, this is considered correct behavior, if you're describing what I
> think you are. FreeDOS reacted as if you had pressed the phisicly
> corosponding key on a QWERTY keyboard? If so, you need to load the
> correct keyboard map in the guest OS. The same thing /should/ happen
> if you boot the floppy.
I know virtually nothing about the Plex86 internals nor X programming,
and unfortunately I don't have the time to study all the sources.
However, I'm trying to get a picture of keyboard handling. I imagine
this is what happens, correct me if I'm wrong:
- User presses a key, say 'a'. Keyboard sends scancode.
- Kernel + X translate this to the ASCII code for 'a' and pass it to plex86
- Plex86 translates this back to a scancode to send to the guest OS,
using xkeypress() in user/plugins/bochs/gui/x.cc and
bx_keyb_c::gen_scancode() in user/plugins/bochs/iodev/keyboard.cc.
If all this is correct (again, I might be miles off...), plex86 always
assumes a QWERTY keyboard. This would explain why pressing 'a' resulted
in FreeDOS displaying 'a', while it should have displayed a 'q' given it
assumed a QWERTY keyboard layout.
This would also mean there is some work to do to make plex86 and bochs
compatible with non-QWERTY keyboard layouts. Unfortenately, I don't have
the time for this; otherwise I would be pleased to do it myself (after
learning some X programming, that is).
Or, isn't it possible to just get the real scancode and pass that to the
guest OS, without any translation whatsoever?