VOGONS


First post, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

I think I ought to know how to do this, but it turns out I don't. I'll be grateful for any help.

For my OS X DOSBox project, I use a keymapper file that maps the Insert key to Command-Down (there is no Ins key on Mac keyboards). I am trying to hard-code all the keymapper assignments in my OS X build, and this is the only one I haven't been able to figure out.

The keymapper line reads:

key_insert "key 277" "key 274 mod3"

Can anyone tell me how to do the equivalent in either sdlmain.cpp or bios_keyboard.cpp or anywhere else?

Many thanks.

Reply 1 of 3, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

you need to look in sdl_mapper.cpp

(for example there are some blocks for the numeric keyboard that are different on linux)

Water flows down the stream
How to ask questions the smart way!

Reply 2 of 3, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Thank you. I see that I have to modify:

#if defined (MACOSX)
/* nothing */

so that it includes something like:

	sdlkey_map[0x68]=SDLK_INSERT;

But I'm still baffled at figuring out what to use in place of 0x68 to indicate MOD3-Down.

A keycode utility in OS X tells me that the key code is 125 / 0x7d, and the modifier (Cmd) is 11534600 /0xb00108.

I'll be very grateful if any OS X expert can tell me what to do next.

Reply 3 of 3, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

I'm not sure I'm getting any closer to an answer but I see that

sdlkey_map[0x7d] is the Down key

sdlkey_map[0x37] is the left Cmd key

and somehow I've got to make these two combine to be

SDLK_INSERT;

But if I simply try something like this, I get an error (which will probably be obvious to everyone here):

sdlkey_map[0x7d]+sdlkey_map[0x37]=SDLK_INSERT;

Is this getting anywhere, or should I just give up trying?