Support for keymap file?

36 views
Skip to first unread message

Philipp Donzé

unread,
Aug 5, 2023, 7:10:40 AM8/5/23
to ARAnyM
Hi again

I’ve been working on a „change keymapping“ feature for MacAranym (see my work-in-progress PR https://github.com/pd95/aranym/pull/7).

Why?
Because, at least on macOS, users are often struggling with keyboard input. Either keys do map to unexpected places or they do not do anything at all. Further some Atari specific keys (like Help, Undo and Insert) are unmapped.

I think the problem is mostly SDL2 related on which the current MacAranym builds are relying on. Otherwise Windows or Linux users would also struggle…

What?
Currently I’ve implemented a small loader (based on the existing ARANYMKEYMAP constant in the source) which allows defining numerically the mappings from SDL2 to the Atari scancodes. Those mappings are applied before the „Aranym default scancode mapping“, so it is possible to override already existing keys.


Open Points? 
1. I have no idea if this a feature which would be beneficial for the other Aranym platforms, so I’m just writing this e-mail to get some feedback here. Perhaps others have also had some ideas how this should be done properly?

2. It’s currently difficult to find the numeric values needed for the mapping. Currently there is only output to the Terminal/console for keys which are „unmapped“… It would be good for a user to have some visual feedback when he taps on a key which won’t be sent to the Atari.

3. A UI to configure the whole mapping would be great. Something showing the available Atari keyboards similar to http://tho-otto.de/keyboards/ and allowing to define for each key the corresponding host SDL key, by simply typing it on the keyboard.

What do you think? Is it worth investing more time? In the current state it is usable for me and for some users I know… But if there was interest  to bring this into the master source, there would still be some effort to make it usable for everybody.

Best regards
Philipp

Miro Kropáček

unread,
Aug 6, 2023, 4:16:15 AM8/6/23
to ARAnyM
On Sat, 5 Aug 2023 at 13:10, Philipp Donzé <philip...@gmx.ch> wrote:
What do you think? Is it worth investing more time? In the current state it is usable for me and for some users I know… But if there was interest  to bring this into the master source, there would still be some effort to make it usable for everybody.
There's nothing wrong with your idea so I'd say go ahead. Personally I don't use Aranym's / FreeMiNT's keyboard for anything else than plain ASCII so I'm not the best person to comment on this.

Maybe try to ask some real users on AF and similar, whether they struggle with keyboard input and why (this mailing list is rarely the main source of news for users).

--

Francois LE COAT

unread,
Aug 27, 2023, 9:40:05 AM8/27/23
to ARAnyM
Hi,

Is there a place where I can find a keymap file adapted to my keyboard?

Thanks,

Philipp Donzé writes:
> Hi again
>
> I’ve been working on a „change keymapping“ feature for MacAranym (see my
> work-in-progress PR https://github.com/pd95/aranym/pull/7).
>
> *Why?*
> Because, at least on macOS, users are often struggling with keyboard
> input. Either keys do map to unexpected places or they do not do
> anything at all. Further some Atari specific keys (like Help, Undo and
> Insert) are unmapped.
>
> I think the problem is mostly SDL2 related on which the current
> MacAranym builds are relying on. Otherwise Windows or Linux users would
> also struggle…
>
> *What?*
> Currently I’ve implemented a small loader (based on the existing
> ARANYMKEYMAP constant in the source) which allows defining numerically
> the mappings from SDL2 to the Atari scancodes. Those mappings are
> applied before the „Aranym default scancode mapping“, so it is possible
> to override already existing keys.
>
>
> *Open Points? *
> 1. I have no idea if this a feature which would be beneficial for the
> other Aranym platforms, so I’m just writing this e-mail to get some
> feedback here. Perhaps others have also had some ideas how this should
> be done properly?
>
> 2. It’s currently difficult to find the numeric values needed for the
> mapping. Currently there is only output to the Terminal/console for keys
> which are „unmapped“… It would be good for a user to have some visual
> feedback when he taps on a key which won’t be sent to the Atari.
>
> 3. A UI to configure the whole mapping would be great. Something showing
> the available Atari keyboards similar to
> http://tho-otto.de/keyboards/ and allowing to define for each key the
> corresponding host SDL key, by simply typing it on the keyboard.
>
> What do you think? Is it worth investing more time? In the current state
> it is usable for me and for some users I know… But if there was interest
>  to bring this into the master source, there would still be some effort
> to make it usable for everybody.
>
> Best regards
> Philipp

Best regards,

--
François LE COAT
Author of Eureka 2.12 (2D Graph Describer, 3D Modeller)
http://eureka.atari.org/

Philipp Donzé

unread,
Aug 28, 2023, 5:52:41 AM8/28/23
to ARAnyM
Hi François

No, there are no files available to download, especially as I don’t know what your keyboard is and Apple has a lot of different keyboards to choose from.

On my website I’ve added a section explaining more "in depth" how to use the keymap feature:

  • keymap file contains mappings from SDL2 scancodes to Atari scancodes. 
  • It can be used to map missing keys like HelpUndoand Insert to keys which are available on your system (like F13F14 or F15). 
  • The keymap file must be placed beside the config file in your Aranym_files directory.

And here is an example file mapping the mentioned SDL keys:

# <SDL scancode>,<Atari scancode>
# Values can be decimal or hexadecimal (with '0x' prefix)
# Everything behind a hash # or a semi-colon ; is treated as a comment and ignored

0x46,0x52 ; Printscreen / F13 to Insert
0x47,0x62 ; Scroll lock / F14 to Help
0x48,0x61 ; Pause / F15 to Undo
107,0x62 ; F16 to Help

If you don’t know the first value (SDL scan code, which is normally printed to the console for unmapped/dead keys), the https://github.com/libsdl-org/sdlwiki/blob/main/SDL2/SDLScancodeLookup.mediawiki might be useful.
If you don’t know the Atari scan code to map to, https://freemint.github.io/tos.hyp/en/scancode.html might be of use and I’ve written a small TOS application which shows the key code received on the Atari side (https://github.com/pd95/aranym/files/12069326/key_test.zip).

I hope this gets you started.

Just out of curiosity: what’s your intended use of the feature? What are keys you want to change/map or which cause problems?

Philipp

--
You received this message because you are subscribed to the Google Groups "ARAnyM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aranym+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aranym/ff92495c-4689-687b-c0e8-c903daa840df%40gmail.com.

Francois LE COAT

unread,
Oct 1, 2023, 4:30:46 PM10/1/23
to ARAnyM
Hi,

Is it possible to distribute your build of ARAnyM for macOS that is here MacAranym 1.1.0+git-change-keymapping (17/07/2023) without supplying a "keymap" configuration file ?

Thanks,

Philipp Donzé writes:
No, there are no files available to download, especially as I don’t know what your keyboard is and Apple has a lot of different keyboards to choose from.

On my website I’ve added a section explaining more "in depth" how to use the keymap feature:
  • keymap file contains mappings from SDL2 scancodes to Atari scancodes. 
  • It can be used to map missing keys like HelpUndoand Insert to keys which are available on your system (like F13F14 or F15). 
  • The keymap file must be placed beside the config file in your Aranym_files directory.
And here is an example file mapping the mentioned SDL keys:

# <SDL scancode>,<Atari scancode>
# Values can be decimal or hexadecimal (with '0x' prefix)
# Everything behind a hash # or a semi-colon ; is treated as a comment and ignored

0x46,0x52 ; Printscreen / F13 to Insert
0x47,0x62 ; Scroll lock / F14 to Help
0x48,0x61 ; Pause / F15 to Undo
107,0x62 ; F16 to Help

If you don’t know the first value (SDL scan code, which is normally printed to the console for unmapped/dead keys), the https://github.com/libsdl-org/sdlwiki/blob/main/SDL2/SDLScancodeLookup.mediawiki might be useful.
If you don’t know the Atari scan code to map to, https://freemint.github.io/tos.hyp/en/scancode.html might be of use and I’ve written a small TOS application which shows the key code received on the Atari side (https://github.com/pd95/aranym/files/12069326/key_test.zip).

I hope this gets you started.

Just out of curiosity: what’s your intended use of the feature? What are keys you want to change/map or which cause problems?

Philipp

Francois LE COAT wrote :

Hi,

Is there a place where I can find a keymap file adapted to my keyboard?

Thanks,

Philipp Donzé writes:
Hi again
I’ve been working on a „change keymapping“ feature for MacAranym (see my work-in-progress PR https://github.com/pd95/aranym/pull/7).
*Why?*
Because, at least on macOS, users are often struggling with keyboard input. Either keys do map to unexpected places or they do not do anything at all. Further some Atari specific keys (like Help, Undo and Insert) are unmapped.
I think the problem is mostly SDL2 related on which the current MacAranym builds are relying on. Otherwise Windows or Linux users would also struggle…
*What?*
Currently I’ve implemented a small loader (based on the existing ARANYMKEYMAP constant in the source) which allows defining numerically the mappings from SDL2 to the Atari scancodes. Those mappings are applied before the „Aranym default scancode mapping“, so it is possible to override already existing keys.
*Open Points? *
1. I have no idea if this a feature which would be beneficial for the other Aranym platforms, so I’m just writing this e-mail to get some feedback here. Perhaps others have also had some ideas how this should be done properly?
2. It’s currently difficult to find the numeric values needed for the mapping. Currently there is only output to the Terminal/console for keys which are „unmapped“… It would be good for a user to have some visual feedback when he taps on a key which won’t be sent to the Atari.
3. A UI to configure the whole mapping would be great. Something showing the available Atari keyboards similar to http://tho-otto.de/keyboards/ and allowing to define for each key the corresponding host SDL key, by simply typing it on the keyboard.
What do you think? Is it worth investing more time? In the current state it is usable for me and for some users I know… But if there was interest   to bring this into the master source, there would still be some effort to make it usable for everybody.
Best regards
Philipp
Best regards,

--
François LE COAT
Author of Eureka 2.12 (2D Graph Describer, 3D Modeller)
Reply all
Reply to author
Forward
0 new messages