joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.69k stars 381 forks source link

Keyboard Layout #1263

Open anonyme-x22 opened 5 years ago

anonyme-x22 commented 5 years ago

Describe the bug Cannot set the keyboard layout as the one in xp for fr I tried: Keyboard layout to none, it's like an azerty but the special characters aren't good. Keyboard layout to fr, not even azerty. Keyboard layout to 437, it's like an azerty but the special characters aren't good. Keyboard layout to 850, it's like an azerty but the special characters aren't good.

To Reproduce Steps to reproduce the behavior:

  1. Open dosbox with one of the settings listed above
  2. On the command line try a then , then ?
  3. in some case the a is working, but , and ? are never on the right key

Expected behavior Same layout as the Fr layout

Environment (please complete the following information):

anonyme-x22 commented 4 years ago

Hi,

Also occurs in the DOSBox-X 0.82.22 build.

Rgds,

joncampbell123 commented 4 years ago

I've been thinking about this, and I think it might be helpful if DOSBox-X were to read keyboard layout information from keyboard layout files shipped with the binaries. The layout files would map to an identifier, at least one of Windows LCID, Linux/X11 keyboard locale, etc. and would map out how the keys are supposed to generate scan codes that then map to the KEYB locale files in DOS. A built-in facility in DOSBox-X would allow you to see the scan codes from the keyboard to aid in making your own. There is no way I can possibly buy every language keyboard out there to do this myself. How does that sound?

joncampbell123 commented 4 years ago

Linux/X11 mapping from my experience may have to match keys by both shifted/unshifted state, such as the hack needed for JP keyboards to differentiate two keys that in X11 by default maps to backslash.

jmaneyrol69 commented 4 years ago

Hi there, Anything new about this issue? I too am one of those unlucky French people who use an AZERTY keyboard...

rderooy commented 4 years ago

If using an SDL1 version of DOSBox-X, set the following in your config file:

[sdl]
usescancodes=true
[dos]
keyboardlayout=fr

There is a patch pending, which will hopefully be included with the next DOSBox-X release, which will make usescancodes=auto the new default, which in turn will enable scancodes if your using the SDL1 binary with a non-US keyboard.

If your using the SDL2 version of DOSBox-X, all you should have to do is set the following:

[dos]
keyboardlayout=fr

Instead of setting the keyboardlayout= setting in your config, you can alternatively just run "keyb fr" at the dosbox-x prompt.

jmaneyrol69 commented 4 years ago

Thanks @rderooy ! The first method (SDL1) worked like a charm :slightly_smiling_face: I know a patch is underway, but it would be nice to document it somewhere in the meantime (in the Wiki for example?).

Cheers

rderooy commented 4 years ago

It is mentioned on the main github page of the project, just look all the way at the bottom. There is a section "International keyboard layout".

jmaneyrol69 commented 4 years ago

RTFM for me then :sweat_smile: ! Thanks again :pray: