Oolite Keymapper

Discussion and announcements regarding the Mac port… er, original version of Oolite.

Moderators: another_commander, winston

User avatar
Posts: 85
Joined: Sun Jul 10, 2011 4:37 am
Location: San Diego, CA

Re: Oolite Keymapper

Post by Oathbreaker »

The Keymapper looks very good for very experience pilots who know exactly what key they want to press for each and every single possible action in the game.

I just started playing and have no clue what key I should choose for "Target Incoming Missile" and the rest, which isn't even listed in http://wiki.alioth.net/index.php/Oolite ... d_Controls

All I'm looking to do is change the yaw left to "Shift + LeftArrow" and yaw right to "Shift + RightArrow" - is there a simple easy way to do that?

Speaking of which there seems to be a discrepancy between the wiki page linked above and the keyconfig.plist that the game uses. Not sure what the deal is here:
Roll Left Left arrow 253 FD
Roll Right Right arrow 252 FC
Pitch Forward Up arrow 255 FF
Pitch Back Down arrow 254 FE
Yaw Left , 44 2C
Yaw Right . 46 2E
key_roll_left = ",";
key_roll_right = ".";
key_pitch_forward = "s";
key_pitch_back = "x";
key_yaw_left = 253; // left arrow
key_yaw_right = 252; // right arrow
The "roll left" and "yaw left" seem to have switched definitions? I'm guessing all I need to do for my purposes is to find the 3-digit (?) code for "Shift + LeftArrow" and write that in place of the 253 in the second quote, but that implies that the game is by default reading "key_yaw_left" when in fact the player is rolling the ship.


Anyone have a solution for me?

EDIT: Seems I may possibly be S.O.L. on this one. I tried two different key code applications to find out the codes for Shift + LeftArrow, and also looked at a partial KeyMapper keyconfig.plist output. All three said the same thing - that pressing LeftArrow gave the exact same code as pressing Shift + LeftArrow. AAAAAAAARRRRRGH.

The real issue is that my stock Apple keyboard has very conveniently located arrow keys ...that are way too far away from the weirdly placed default Oolite yaw controls. With my big hands I'd rather not have to remap all this stuff to the central part of the keyboard, esp. since it's so awesome to have quick access to the NumKeyPad right next to the arrow keys. I suppose I could remap the yaw keys to something closer to my left hand's default hovering around the often-used default keys "AWSRTC", but with the number of little weird things keybound all over the board that'd be a mess. Shift + Arrowkey to yaw instead of roll would be perfect.

Zrg Zkx
Posts: 5
Joined: Thu Nov 24, 2011 10:15 pm
Location: Far out

Re: Oolite Keymapper

Post by Zrg Zkx »

First off, my apologies if this issue has already been resolved in some orderly way. If so, I couldn't find the solution anywhere, so maybe a pointer could be added to the wiki. I was in GrinNoCat's situation and tried to make the keypad work. Not to steal your thunder, Greyman, but this I think is beyond the scope of the keymapper.

Anyways, here's this little hack I've come up with. Disclaimers apply: Don't try this if you don't know what you're doing. If trumbles ruin your cargo and eat you alive, or your Mac crashes and burns and destroys all your precious data, don't say you hadn't been warned.

Well, here goes. Not to be able to use the keypad on the Mac bugged me. Badly. To me, it's the only way to fly. With Apple apparently taking the stance that since there are discrete arrow keys, you don't need NumLock, you won't get it: what do we do? We'll need to remap the keypad. But because Oolite appears to eat the keycodes raw, changing the keyboard layout (e.g., using Ukelele) won't help. Apparently, we'll have to do it the hard way.

Looking at different approaches, I came across KeyRemap4MacBook [http://pqrs.org/macosx/keyremap4macbook/]. A brilliant system extension made by Takayama Fumihiko (tekezo), which allows you to remap any key. (This might help Oathbreaker, too.) Contrary to what the name seems to imply it is not limited to MacBooks. And it already has a NumLock emulation of sorts, albeit without the indicator LED one may be used to. Let me stress it again, this is an unsupported third-party extension Apple support won't want to hear about.

Activating the settings "Use KeyPad as Arrow" under the heading "For PC Users" takes us most of the way.

[attachment=]remap_keypad.png[/attachment] (to be added)

Pitch and roll all you want from your keypad now. Woot! But then, you'll notice that yaw doesn't work yet. In order to make the remapped Num1 (End) and Num3 (PgDn) work as expected, you'll need to modify your keyconfig.plist like so:

Code: Select all

	key_yaw_left	= 304;	// end
	key_yaw_right	= 308;	// pgdn
These I found by trial an error, looking at NSEvent.h and counting. Works for me on a PowerMac running 10.4, YMMV.

But that's it, really. Works a treat for me, and I can play Oolite on the Mac as I do on Linux. If it works for you, great. Say thanks to tekezo, and consider making a donation at [http://www.pledgie.com/campaigns/11108].

Post Reply