Re: [hatari-devel] Keyboard mappings?

[ Thread Index | Date Index | More Archives ]

Am Mon, 31 Oct 2016 22:28:28 +0200
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:

> Hi,
> Host Page up & down keys aren't mapped to Atari
> Help & Undo (0x62 & 0x61) keys with symbolic mapping
> like they're with scancode mapping, and documented
> to be mapped in Hatari manual.
> They're mapped to 0x63 & 0x64 which are keys in
> the Atari numpad.  End key mapping is even more
> confusing.
> See:
> ----------------------------------------------
> $ for i in END PAGE; do grep $i keymap.c; done
> 	 case SDLK_END: code = 0x61; break;
> 	 case SDL_SCANCODE_END: return 0x2b;
> 	 case SDLK_END:      return 0x60;  /* End => "<>" on German
> Atari kbd */
> 	 case SDLK_PAGEUP: code = 0x63; break;
> 	 case SDLK_PAGEDOWN: code = 0x64; break;
> 	 case SDL_SCANCODE_PAGEUP: return 0x62;
> 	 case SDL_SCANCODE_PAGEDOWN: return 0x61;
> 	 case SDLK_PAGEUP:   return 0x62;  /* F11 => Help */
> 	 case SDLK_PAGEDOWN: return 0x61;  /* F12 => Undo */
> ----------------------------------------------
> (matched in symbolic, SDL2 scancode, SDL1 scancode order)
> Is there some specific reason for these differences?

I think there is/was a reason for mapping PAGEUP to 0x63 and PAGEDOWN to
0x64 ... if you have a closer look at the Atari keyboard, there are
four keys that can not be found on a normal PC keyboard: HELP, UNDO,
KP-"(" and KP-")". So on a PC keyboard, they should be mapped to keys
that can not be found on a normal Atari keyboard - SCROLLOCK, PRINT,

The symbolic mapping uses:

 SCROLLOCK <=> UNDO (0x61)
 PRINT     <=> HELP (0x62)
 PAGEUP    <=> KP-"(" (0x63)
 PAGEDOWN  <=> KP-")" (0x64)

==> If you change PAGEUP and PAGEDOWN here, you should change SCROLLOCK
and PRINT, too.

The SDL1 scancode mapping uses:

 PAGEUP     <=> HELP (0x62)
 PAGEDOWN   <=> UNDO (0x61)

Scroll lock and print are mapped via scancode offset here, not sure
whether they end up with a sane Atari key, though...

The SDL2 scancode mapping uses:

 PRINT      <=> HELP (0x62)
 PAGEUP     <=> HELP (0x62)
 PAGEDOWN   <=> UNDO (0x61)

==> So the keypad parentheses can not by typed at all here. We should
likely change SCROLLOCK and PRINT here, too.


Mail converted by MHonArc 2.6.19+