digarok / gsplus

Modern cross-platform Apple IIgs emulator and tools based on KEGS
http://apple2.gs/plus
GNU General Public License v2.0
151 stars 44 forks source link

Intl. Keyboard Mapping wrong #48

Open digarok opened 6 years ago

digarok commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

digarok commented 6 years ago

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:

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

MarcoVerpelli commented 6 years ago

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.

ksherlock commented 5 years ago

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).