OSX key mapping - Harari 1.5

A forum about the Hatari ST/STE emulator - the current version is v1.7

Moderators: simonsunnyboy, thothy, Moderator Team

OSX key mapping - Harari 1.5

Postby JonB » Fri Dec 09, 2011 1:31 pm

HI

OSX keymapping in Hatari seems to be a little bit broken. My main issue is with the '{', '}', '[', and ']' keys which are needed for programming in C on the ST.

How do I get them to map properly? I know there is a keyboard mapping file that can be used but I have no idea of what scan codes to put in there. Does anyone have a full mapping file I could modify?

Thanks

JonB
Too many retro computers here: 1040STfm, Mega4, Ultrasatanx2 , Amiga A500, A500+ and A1200, Acorn Atom x2, BBC Micro, Electron, Spectrum 48k x2, +48, +128k, QL, Oric Atmos, ZX81, Memotech MTX512, Amstrad 6128 x2..
JonB
Captain Atari
Captain Atari
 
Posts: 303
Joined: Fri Dec 02, 2011 5:01 pm

Re: OSX key mapping - Harari 1.5

Postby JonB » Mon Dec 19, 2011 12:24 pm

OK, I found this:

Image

It's a list of key codes for the ST keyboard.

And here, possibly a set of codes for the Apple keyboards:

http://lists.apple.com/archives/carbon-dev/2009/Jan/msg00105.html

However, doing this in the keyscan file has no effect:

Code: Select all
30,26
33,27


Can anyone make sense of this?
Too many retro computers here: 1040STfm, Mega4, Ultrasatanx2 , Amiga A500, A500+ and A1200, Acorn Atom x2, BBC Micro, Electron, Spectrum 48k x2, +48, +128k, QL, Oric Atmos, ZX81, Memotech MTX512, Amstrad 6128 x2..
JonB
Captain Atari
Captain Atari
 
Posts: 303
Joined: Fri Dec 02, 2011 5:01 pm

Re: OSX key mapping - Harari 1.5

Postby JonB » Wed Dec 21, 2011 2:46 pm

Seems the problem is discovering what the host keyboard scan codes are.

There's a sneaky way to work it out:

- in Hatari preferences, enable a joystick as keyboard
- assign the unknown keys to the up/down/left/right/fire of the keyboard joystick
- save the preferences file. On the Mac it lives in ~/.hatari/hatari.cfg
- open the preferences file in an editor and look for the joystick section.
- For Joystick 0 it is [Joystick0] and for joystick 1 it is [Joystick1]
- Read off the host scancodes from the lines nKeyCodeUp / NkeyCodeDown / nKeyCodeLeft etc
- Now update the keyboard file. For the square brackets it is as follows:

Code: Select all
91,26
93,27


Reload the keyboard file and voila!

Now, the only problem is the left shift key doesn't work... yet... hmmm...
Too many retro computers here: 1040STfm, Mega4, Ultrasatanx2 , Amiga A500, A500+ and A1200, Acorn Atom x2, BBC Micro, Electron, Spectrum 48k x2, +48, +128k, QL, Oric Atmos, ZX81, Memotech MTX512, Amstrad 6128 x2..
JonB
Captain Atari
Captain Atari
 
Posts: 303
Joined: Fri Dec 02, 2011 5:01 pm

Re: OSX key mapping - Harari 1.5

Postby Hippy Dave » Wed Dec 21, 2011 7:54 pm

JonB wrote:Seems the problem is discovering what the host keyboard scan codes are.

There's a sneaky way to work it out:

- in Hatari preferences, enable a joystick as keyboard
- assign the unknown keys to the up/down/left/right/fire of the keyboard joystick
- save the preferences file. On the Mac it lives in ~/.hatari/hatari.cfg
- open the preferences file in an editor and look for the joystick section.
- For Joystick 0 it is [Joystick0] and for joystick 1 it is [Joystick1]
- Read off the host scancodes from the lines nKeyCodeUp / NkeyCodeDown / nKeyCodeLeft etc
- Now update the keyboard file. For the square brackets it is as follows:

Code: Select all
91,26
93,27


Reload the keyboard file and voila!

Now, the only problem is the left shift key doesn't work... yet... hmmm...

The most exquisite, excellent, classy way to shoot down a vexing problem with a joystick! :D
User avatar
Hippy Dave
Captain Atari
Captain Atari
 
Posts: 463
Joined: Sat Jan 10, 2009 5:40 am

Re: OSX key mapping - Harari 1.5

Postby JonB » Sat Jan 07, 2012 9:47 pm

shame it doesn't work for the left shift key :(
Too many retro computers here: 1040STfm, Mega4, Ultrasatanx2 , Amiga A500, A500+ and A1200, Acorn Atom x2, BBC Micro, Electron, Spectrum 48k x2, +48, +128k, QL, Oric Atmos, ZX81, Memotech MTX512, Amstrad 6128 x2..
JonB
Captain Atari
Captain Atari
 
Posts: 303
Joined: Fri Dec 02, 2011 5:01 pm

Re: OSX key mapping - Harari 1.5

Postby jvernet » Sun Jan 08, 2012 10:20 am

I've only done this job for a french keyboard, sorry... :coffe:
Atari stuff:
520ST, 520 STF, 520STe, 1040ST, 1040STe, MegaST1, MegaST2, MegaST4, MegaSTe 4Mb+DD 250Mb
Falcon: 14Mb Falcon, SpeedRes 030/40 Card-TT/030: 4MbST+20MbFastRAMTT, DD 1Gb, Hydra NetWork Card
Falcon AB40: AfterBurner 040, Nemesis, dead Blowup Hard II, 32Mb.
--
800XL, 130xe,65xe
jvernet
Atari freak
Atari freak
 
Posts: 65
Joined: Wed Sep 12, 2007 8:04 am
Location: France, 77


Return to Hatari

Who is online

Users browsing this forum: CommonCrawl [Bot] and 2 guests