gsplus icon indicating copy to clipboard operation
gsplus copied to clipboard

Intl. Keyboard Mapping wrong

Open digarok opened this issue 6 years ago • 5 comments

German user with QWERTZ layout reports:

I can't enter a / within GS+. :slightly_smiling_face: On my German PC keyboard, the / is when I press Shift+7. On older versions, like 0.12, the / character appeared when I pressed #. But now it is gone. The ÖÄÜ keys did something in previous GS+, now nothing.

img_20180831_161649

digarok avatar Aug 31 '18 14:08 digarok

Looking in the code we use a mix of char literals and SDL defines for the key mapping:

{ 0x0c,       'q', 'Q' },
{ 0x0d,       'w', 'W' },
{ 0x0e,       'e', 'E' },

versus

  { 0x35,       SDLK_ESCAPE,0 },
  { 0x7a,       SDLK_F1,        0 },
  { 0x78,       SDLK_F2,        0 },

SDL2 uses keycode for the literal char mapping, and it also has a 'scancode' that is a special SDL2 term. Their scancode is used for trying to do a physical mapping (so WASD is the same layout on another locale even if they are hitting different letters).

This leads me to believe that we should use keycodes everywhere we can, but that will require testing feedback from international users to see if this matches the expected behavior.

digarok avatar Aug 31 '18 14:08 digarok

I believe this is fixed in https://github.com/digarok/gsplus/pull/49

digarok avatar Aug 31 '18 15:08 digarok

User reported back that shift-7 still does not produce "/" but the keypad slash works. This is odd because there is a special keycode for the keypad divider which is not what we are using.

Ultimately this all points back to other needs:

  • Better International keyboard support and testing overall
  • Support for Apple IIgs keyboard layouts (US, FR, DE, etc)
  • Support for Apple IIgs display language

This work is going to be pushed off until after the 0.14 release and probably the 0.15 release.

digarok avatar Sep 01 '18 13:09 digarok

I can confirm that even with the Italian keyboard the keys pressed do not correspond to what you get on the screen (i.e. if I press £ I get #) I think it's an old problem that comes from KEGS, I tried to compile it under Linux and the result was the same.

MarcoVerpelli avatar Sep 12 '18 14:09 MarcoVerpelli

ADB keycodes are based on the physical key position, not the letter that happens to be printed on that key.

See Inside Macintosh Toolbox Essentials figure 2-10 on page 2-43 for an example of French/US keyboards. (n.b. - Macintosh remaps arrow keys and control key codes via a KMAP resource and the codes displayed aren't the raw codes).

ksherlock avatar Feb 21 '19 14:02 ksherlock