Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Built in keymapping feature?

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

Post Reply
Jabbro
Poor
Poor
Posts: 5
Joined: Thu Feb 16, 2006 12:00 am

Built in keymapping feature?

Post by Jabbro »

I was thinking that something added to the Options menu when docked, that could allow a player to change mapped keys from inside the game would be nice. This would greatly help players, such as myself that are predisposed to a previous control confguration (such as the C64/Amiga settings). :D
User avatar
Wiggy
Deadly
Deadly
Posts: 222
Joined: Fri Jan 21, 2005 1:12 pm
Location: London, Engerland

Post by Wiggy »

The keyconfig.plist file for key controls is editable, and there is a utility for creating a new plist file that comes with Oolite.
You came in that? You're braver than I thought!
User avatar
Rxke
Retired Assassin
Retired Assassin
Posts: 1757
Joined: Thu Aug 12, 2004 4:54 pm
Location: Belgium

Post by Rxke »

It still would add another layer of polish if you could indeed access that functionality in-game, though... But I guess this one seemingly simple addition could cause some headaches to make it cross-compatible *and* take into account the gazillion existing keyboard-layouts out there...
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Doing it in-game is primarily hampered by the fact that Oolite’s text handling can’t handle non-ASCII text… apart from some esoteric stuff like ? which we added for GrowlTunes. :-) Fixing this has been on my “to look into seriously at some point in the abstract future” list.

The other option is to do it in a standard dialog box. This would only work on Mac OS X. I happen to have written a pretty good library for the non-trivial task of getting suitable text for just about any keypress with any keyboard layout. Unfortunately, making a good control for using it in configuration dialogues in Cocoa has proven difficult due to certain optimisations in Cocoa’s handling of text fields. :-/
User avatar
hwtan
Competent
Competent
Posts: 41
Joined: Tue Mar 21, 2006 2:14 am

Post by hwtan »

My question is only partially related to this topic. While I am using Oolite-PC, I am unable to use the key "," and "." for left and right roll to work after editing the keyconfig file. To my finding, they should be 44 and 46 respectively, but they don't work on my win XP.

Any help out there?
dajt
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 364
Joined: Tue Aug 17, 2004 7:05 am
Location: Orange, NSW, Australia

Post by dajt »

hwtan wrote:
My question is only partially related to this topic. While I am using Oolite-PC, I am unable to use the key "," and "." for left and right roll to work after editing the keyconfig file. To my finding, they should be 44 and 46 respectively, but they don't work on my win XP.

Any help out there?
The Linux and Windows ports only have support for the standard key mappings.

In order for this to change, someone has to go into the SDL version of MyOpenGLView and add all the keys into the keyup and keydown case statements.

It isn't hard, but none of the Linux/Windows coders has wanted to remap their keys badly enough to do it!

This is why the target memory wasn't working to begin with. The case statements were ignoring the +, -, and = keys.
Regards,
David Taylor.
User avatar
winston
Pirate
Pirate
Posts: 731
Joined: Mon Sep 27, 2004 10:21 pm
Location: Port St. Mary, Isle of Man
Contact:

Post by winston »

With some effort (fixes dajt mentioned, plus additions ahruman mentioned, then adding an OOgui screen similar to the Joystick Setup screen) it could be done.

Which reminds me - the OOgui screen for joystick setup could do with a second page for all the new features which might be nice to assign to joystick buttons and axes.
Recluse
Poor
Poor
Posts: 4
Joined: Tue Mar 28, 2006 9:56 pm

Post by Recluse »

Is there a file I could look in to see what keys are recognized? I want to remap the movement keys to the more-familiar wasd. I keep jettisoning cargo unintentionaly...
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Keyconfig.plist. Where it is is platform-dependant. You can probably put a copy in the AddOns folder where OXPs live.
User avatar
Murgh
---- E L I T E ----
---- E L I T E ----
Posts: 454
Joined: Fri Sep 03, 2004 6:19 am
Location: Terra Firma

Post by Murgh »

Ahruman wrote:
Keyconfig.plist. Where it is is platform-dependant. You can probably put a copy in the AddOns folder where OXPs live.
is it so in Linux and PC too, that this then has to be inside a folder named Config?
The man next to you is your lunch
dajt
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 364
Joined: Tue Aug 17, 2004 7:05 am
Location: Orange, NSW, Australia

Post by dajt »

I tried to look at this today, but I cannot find a list of Macintosh key codes anywhere on the net, using google at least!

The way it works is the SDL keycodes are translated to Macintosh keycodes, which is why I need the Mac ones.

So can someone please either post a link to a site with the Mac key codes (e.g. 'a' = 97), or send me a list?

The keys that seem to be missing that people really want at present are , . / [ ]. I was thinking of adding support for pgup, pgdn, end, ins, and del too.

Alternatively, winston can do this change given he has a Mac so can find the Mac codes easily ;)
Regards,
David Taylor.
User avatar
aegidian
Master and Commander
Master and Commander
Posts: 1160
Joined: Thu May 20, 2004 10:46 pm
Location: London UK
Contact:

Post by aegidian »

The standard alphanumerics are all ASCII based.

Then MyOpenGLView does some more translating to get these:

Code: Select all

	gvArrowKeyUp = 255,
	gvArrowKeyDown = 254,
	gvArrowKeyLeft = 253,
	gvArrowKeyRight = 252,
	gvFunctionKey1 = 241,
	gvFunctionKey2 = 242,
	gvFunctionKey3 = 243,
	gvFunctionKey4 = 244,
	gvFunctionKey5 = 245,
	gvFunctionKey6 = 246,
	gvFunctionKey7 = 247,
	gvFunctionKey8 = 248,
	gvFunctionKey9 = 249,
	gvFunctionKey10 = 250,
	gvFunctionKey11 = 251,
	gvMouseLeftButton = 301,
	gvMouseDoubleClick = 303,
	gvHomeKey = 302,
	gvNumberKey0 = 48,
	gvNumberKey1 = 49,
	gvNumberKey2 = 50,
	gvNumberKey3 = 51,
	gvNumberKey4 = 52,
	gvNumberKey5 = 53,
	gvNumberKey6 = 54,
	gvNumberKey7 = 55,
	gvNumberKey8 = 56,
	gvNumberKey9 = 57
I dunno if that helps?
"The planet Rear is scourged by well-intentioned OXZs."

Oolite models and gear? click here!
Post Reply