Re: [hatari-devel] Apple keyboard + SDL2

[ Thread Index | Date Index | More Archives ]

My file "Keyboard mapping" for my Macbook Pro is below. I moved my work from keymap.C to this file.
It seems to me that keyboards Apple have no all the same mapping (?). If somebody can test the file it would be useful for me.
 Good night

Description: Zip archive

Le 30 avr. 2017 à 16:46, Troed Sångberg <troed@xxxxxxxxxxx> a écrit :

I'll happily help it with something more generalized/localized. Scancode is now working pretty well, except I can type * on my Swedish MBPr keyboard. Slightly cumbersome when Devpac-coding ;)


On Sun, Apr 30, 2017 at 4:02 PM, Cocoa Pod <cocoa.pod@xxxxxxx> wrote:
I agree, a keymap file " azerty-fr.txt " would be better. I am again going to try to make this file, but until now the results were less well than those of my solution and I dont understand why !! I use french TOS and keyboard on french macbook pro.

> Thomas,
> I see using keyboard scan codes on OS X works now with the exception of the pipe/backslash key. That key did not respond in scancode mode. I did not think to try scan codes again with SDL 2. Unfortunately, the Mac keyboard does not have every key that exists on a PC keyboard. Therefore, I cannot access the PrtScr, Scroll Lock, Page Up, or Page Down keys on a standard Mac keyboard. As I recall, these are used for Help, Undo, and the keypad parenthesis keys. I wish there was a way to use scan codes in combination with the key mapping. In addition, the standard Mac keyboard you will find on a notebook will not include a numeric keypad. You can buy a keyboard with a keypad, but it is not standard.
> Miguel,
> Thomas is correct. It would be much better to simply create key mapping files to access the different ST keys using the Mac keyboard. A separate file could be created for each major keyboard (French, German, US, Spanish). People using any other keyboard could use these files as a model. With SDL 2, it has become easier to create the keymap files. I created one in order to access the Help and Undo keys on OS X.
> Unlike you, I am able to use Alt modifier keys when using a US TOS with my US Mac keyboard. In WordWriter ST, I can hit Option (Alt) Q in order to exit the program. I admit I do not use Alt modifier keys often in Hatari, but they do appear to work.
> Here is my sample keymap.txt file in order to access the Help and Undo keys:
> #98 = ST Help key
> F11,98
> #97 = ST Undo key
> F12,97
> Bob C
>> On Apr 29, 2017, at 8:01 AM, Thomas Huth <th.huth@xxxxxx> wrote:
>> Am Tue, 25 Apr 2017 23:11:15 +0200
>> schrieb Cocoa Pod <cocoa.pod@xxxxxxx>:
>>> HI,
>>> Questions:   on windows or Linux
>>> Is it possible to reach all the visible characters on a keyboard
>>> Atari?
>> If the keyboard has enough keys (i.e. also a numberpad), yes, I think
>> it is possible to get a match for all keys. It might also depends also
>> on the language, of course, but that's why why have the possibility to
>> load keymapping from files.
>>> Modifier Alt has effect ?  and  Shift+Alt  ?
>> Yes, should work.
>>> Because I use Apple machine, I modified "Symbolic" in keymap.c. So,
>>> compiling hatari with Xcode, keymap.c becomes automatically correct
>>> for Macbook Pro keyboard with or without numerical keyboard. I added
>>> a macro which permits to experiment conversion character->scan-code.
>>> Compiled with Xcode, keyboard is AZERTY-fr. You can add other layout.
>>> Compiled under linux or windows, nothing has changed.  Test of that:
>>> MegaSTE + Tos2.06 and I use SDL2 .
>> First, with SDL2, I think it is better to use the scancode mapping
>> instead of the symbolic mapping, since the scancodes are now
>> standardized (with SDL1, they were not, so scancode mapping did not
>> work at all on Mac OS X if I remember clearly). You've got to use a
>> matching TOS language for that, too (i.e. French TOS for French
>> keyboard).
>> Second, if you still want to use symbolic mapping instead, I think it
>> would be better to provide loadable keyboard mapping files instead.
>> There are so many different language and keyboard layouts out there, so
>> that I think it is not feasible to add such hacks to the source code
>> (e.g. your changes likely only work with the French version of the
>> Mac keyboards, I guess ... so including these would likely break the
>> other languages). Have a look at doc/fr/clavier-exemple.txt for an
>> example keyboard mapping file for French keyboards (however, it might
>> still be the SDL1 mapping, not sure if somebody ever updated that one
>> for SDL2...).
>>> None character having  Alt modifier in its key combination can  be
>>> obtained. Grrrrrrrrrrrrrrrr !!!!!!
>> Is maybe OS X "stealing" the Alt key from the application? ... it works
>> on Linux, as far as I can tell.
>> Thomas

Mail converted by MHonArc 2.6.19+