Page 1 of 1

Web emulator has incorrect keymapping in Google Chrome

Posted: Wed Mar 22, 2023 8:25 pm
by Java Cake Games
Only tested in Ubuntu MATE and Chrome OS.

Reproduction steps:
  1. Set your operating system's keyboard layout to English (UK).
  2. Certain keys produce unexpected characters (apostrophe -> left arrow, hash -> backtick, etc.)
  3. Execute KEYMAP "EN-GB"
  4. The keys will still be wrong.
Alternative reproduction steps:
  1. Set your operating system's keyboard layout to German.
  2. Certain keys produce unexpected characters (ß -> left square bracket, ü -> semicolon, etc.)
  3. Execute KEYMAP "DE-DE"
  4. Certain keys will be wrong (Y and Z swapped) and some do nothing at all!
I think most layouts are screwed up, which is unfortunate since the web emulator would be pretty good if typing worked correctly.

Re: Web emulator has incorrect keymapping in Google Chrome

Posted: Wed Mar 22, 2023 10:04 pm
by DragWx
It looks like it's a bug with SDL on emscripten, which has since been fixed, so maybe the web emulator just needs to be recompiled with the most recent version of SDL?

Re: Web emulator has incorrect keymapping in Google Chrome

Posted: Wed Mar 29, 2023 9:34 pm
by Cyber
DragWx wrote: Wed Mar 22, 2023 10:04 pm It looks like it's a bug with SDL on emscripten, which has since been fixed, so maybe the web emulator just needs to be recompiled with the most recent version of SDL?
Probably you are right, but we try to stick with known emulator releases.
Currently web emulator is based on this release: https://github.com/X16Community/x16-emu ... es/tag/r42
And probably this release is compiled with older version of SDL.
I think it is fair to wait for the next emulator release which will include newer version of SDL.

Re: Web emulator has incorrect keymapping in Google Chrome

Posted: Sun Apr 09, 2023 7:20 am
by grml
In your webassembly/main.js you have a list of keyboard layouts:

Code: Select all

//define valid layouts (this can be gotten by running the emulator with -keymap)
const layouts = [
    'en-us',
    'en-gb',
    'de',
    'nordic',
    'it',
    'pl',
    'hu',
    'es',
    'fr',
    'de-ch',
    'fr-be',
    'pt-br'
];
This is from an older emulator version. Here's the emulator's current list: https://github.com/X16Community/x16-emu ... main.c#L54

Re: Web emulator has incorrect keymapping in Google Chrome

Posted: Mon Apr 10, 2023 6:33 am
by MooingLemur
This has been updated in the source but unfortunately it was after R42 was released. The this should be fixed on the web once we release R43.