Mapping keys/buttons to OXP equipment

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

User avatar
hiran
Theorethicist
Posts: 2410
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Mapping keys/buttons to OXP equipment

Post by hiran »

another_commander wrote: Sun Aug 06, 2023 7:04 pm
Do you have the Advanced Nav Array?
Not in a completely fresh game. Should I go and get it?
Sunshine - Moonlight - Good Times - Oolite
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6696
Joined: Wed Feb 28, 2007 7:54 am

Re: Mapping keys/buttons to OXP equipment

Post by another_commander »

Yes, not having it is the reason you cannot plot a course.
User avatar
Cholmondely
Archivist
Archivist
Posts: 5381
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Mapping keys/buttons to OXP equipment

Post by Cholmondely »

shift-6 cycles between 3 possible versions of the 6/F6 screen

1) General chart which merely shows jumpable systems (but only when chosen) - this does not need ANA
2) Yellow route showing fewest jumps to destination system (but takes longer) - needs ANA
3) Blue route showing fastest route to destination system (but more wear and tear on your ship which might need a costly and prolonged maintenance session). - needs ANA
Image
Image
Image

Note that Alnivel's Route Planner OXP allows you to choose much more complex routes while you are docked and requires no extra equipment. - needs ANA

Image

And note that you can cycle through the descriptions of every system on your route on the 7/F7 screen by using your arrow keys.
Last edited by Cholmondely on Sun Aug 06, 2023 11:34 pm, edited 1 time in total.
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
hiran
Theorethicist
Posts: 2410
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Mapping keys/buttons to OXP equipment

Post by hiran »

another_commander wrote: Sun Aug 06, 2023 7:10 pm
Yes, not having it is the reason you cannot plot a course.
Understood. That route plotting is only available with ANA (as Cholmondely named it).
But two things I still don't understand:
- The normal lines between stars (no route) are also dependent on ANA?
- How come by loading a savegame (using my set of expansions) in 1.90 gives me all the route plotting, while loading the same savegame in 1.91 (with the same expansions) does not? ANA should be available either in both cases or in none.
Sunshine - Moonlight - Good Times - Oolite
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Mapping keys/buttons to OXP equipment

Post by phkb »

I'd check to make sure the ANA is installed.
Do a

Code: Select all

PS.equipmentStatus("EQ_ADVANCED_NAVIGATIONAL_ARRAY")
from the console and see what the result is in your 1.90 game, and then again in the 1.91 game.
User avatar
hiran
Theorethicist
Posts: 2410
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Mapping keys/buttons to OXP equipment

Post by hiran »

phkb wrote: Sun Aug 06, 2023 11:21 pm
I'd check to make sure the ANA is installed.
Do a

Code: Select all

PS.equipmentStatus("EQ_ADVANCED_NAVIGATIONAL_ARRAY")
from the console and see what the result is in your 1.90 game, and then again in the 1.91 game.
I started my Nexus, which can act as interplayer communication module as well as Oolite debug console with Oolite 1.90.

Code: Select all

PS.equipmentStatus("EQ_ADVANCED_NAVIGATIONAL_ARRAY")
EQUIPMENT_OK
When I switched to the navigation screen the lines between the stars were not visible, but I could turn them on by pressing Shift-6.

Image




Then I started my Nexus, which can act as interplayer communication module as well as Oolite debug console with Oolite 1.91.

Code: Select all

PS.equipmentStatus("EQ_ADVANCED_NAVIGATIONAL_ARRAY")
EQUIPMENT_OK
When I switched to the navigation screen the lines between the stars were not visible, but I pressing Shift-6 did not show any reaction.

Image




I cannot tell what turned off that feature in first place - I used to have it on and even forgot about the ANA or that you need to activate it.
So all in all it seems I need to activate it but cannot, at least with the given keyboard settings. Searching, I found this in ~/GNUstep/Defaults/oolite.plist (and I am just not sure if it matters):

Code: Select all

...
    <key>KeyConfigOverrides</key>
    <dict>
	<key>key_advanced_nav_array_next</key>
	<array>
	    <dict>
		<key>key</key>
		<integer>48</integer>
		<key>mod1</key>
		<false/>
		<key>mod2</key>
		<false/>
		<key>shift</key>
		<string>true</string>
	    </dict>
	</array>
	<key>key_next_compass_mode</key>
	<array>
	    <dict>
		<key>key</key>
		<integer>57</integer>
		<key>mod1</key>
		<false/>
		<key>mod2</key>
		<false/>
		<key>shift</key>
		<false/>
	    </dict>
	</array>
	<key>key_prev_compass_mode</key>
	<array>
	    <dict>
		<key>key</key>
		<integer>41</integer>
		<key>mod1</key>
		<false/>
		<key>mod2</key>
		<false/>
		<key>shift</key>
		<true/>
	    </dict>
	</array>
    </dict>
...
But all this should work from within the game I guess. So I went again to the keyboard settings and somehow believe it is this screen:

Image

So back into the game in 1.91, on the chart screen I am pressing shift + (alphanumeric) zero but nothing happens.
Last edited by hiran on Mon Aug 07, 2023 9:43 pm, edited 1 time in total.
Sunshine - Moonlight - Good Times - Oolite
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Mapping keys/buttons to OXP equipment

Post by phkb »

Ah. Ok I think the problem is that, when using shift, you need to put in the character that is produced by the shift+key combination, not the keyboard key you are shifting. So, on my US keyboard, shift+0 produces the “)” symbol. Change the “0” to “)” (or whatever your keyboard has above the 0 key) and see if that helps.
User avatar
hiran
Theorethicist
Posts: 2410
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Mapping keys/buttons to OXP equipment

Post by hiran »

phkb wrote: Mon Aug 07, 2023 9:03 pm
Ah. Ok I think the problem is that, when using shift, you need to put in the character that is produced by the shift+key combination, not the keyboard key you are shifting. So, on my US keyboard, shift+0 produces the “)” symbol. Change the “0” to “)” (or whatever your keyboard has above the 0 key) and see if that helps.
Congratulations, you nailed it! With these new settings I was able to get the lines back.
But to be honest, I find the setting a bit confusing. If I were to enter '=', which requires pressing shift anyway, why would I have to declare pressing shift again? Is it possible that Oolite is working on a mix of the entered character and the modifiers while I expected it to record the make/break codes?

Image

Image
Sunshine - Moonlight - Good Times - Oolite
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Mapping keys/buttons to OXP equipment

Post by phkb »

hiran wrote: Mon Aug 07, 2023 9:42 pm
I find the setting a bit confusing.
I can see how it can be a bit confusing. Is it "A"? Or "Shift+a"? Or "Shift+A"? No matter which way we jump, someone will find the choice confusing. Our job is to limit the amount of confusion as much as possible.

I think the best option at this point (other that completely re-writing the system to work in a completely different way), is to add some helper text to the config screen when you're entering the desired key, saying something like "When using shift with a key that produces a character, enter the character that would be generated by the shifted key." Open to suggestions on the best wording here.
User avatar
hiran
Theorethicist
Posts: 2410
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Mapping keys/buttons to OXP equipment

Post by hiran »

Having some explanation might help users to know what to look for. Maybe there is yet one more step we could do:

During gameplay Oolite recognizes a keypress together with the modifiers, and if that matches one of the configured keys it will invoke the action.
During configuration, the keypress and the modifiers have to be configured in separate steps, creating a question mark of Shift + a == A == Shift + A.

What if during configuration the user selects to reconfigure a key and Oolite goes into 'recording mode'. The next key that the user presses is not just analyzed for the key but at the same time all modifiers. Thus as a user I would see 'Shift + A' but maybe bother less than if I had to configure it on my own. The rest of the implementation remains the same.

Could that work?
Sunshine - Moonlight - Good Times - Oolite
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Mapping keys/buttons to OXP equipment

Post by phkb »

That is already in there. At least, I certainly coded it to do that. If you held shift to create the character, the shift flag will automatically be set.

I mean, it might not be working, but the intent was there.
User avatar
hiran
Theorethicist
Posts: 2410
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Mapping keys/buttons to OXP equipment

Post by hiran »

phkb wrote: Tue Aug 08, 2023 7:53 pm
That is already in there. At least, I certainly coded it to do that. If you held shift to create the character, the shift flag will automatically be set.

I mean, it might not be working, but the intent was there.
Sounds good. At least we have the same target.

Now I went back to Oolite v1.91 and tried to reconfigure the 'Next route mode' to fire when I press 'q'. Small letter, directly accessible so no modifier involved. As you can see from above screenshots, it already was configured to 'Shift+=', which means the Shift key needs to be pressed to trigger the action.

So I select 'Next route mode' and press enter.
The 'Key' is selected automatically, so I press enter again.
I need to enter the new key. No, hang on: the prompt below still shows the old key, which I need to remove by pressing backspace.
So I press backspace, then 'q' and enter.
On the previous screen, I can now see

Code: Select all

   Key   q
   Shift  yes
   Control No
   Alt No

  Alternate key (not set)
Selecting 'Save' I get back to the previous screen, which shows the 'Next route mode' to be configured for 'Shift+q'. I will never be able to achieve this, since as soon as I press Shift+q I will actually enter 'Q'....

This beast did not automatically detect from one keypress whether I need shift. It also made me remove the old setting manually.
Sunshine - Moonlight - Good Times - Oolite
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Mapping keys/buttons to OXP equipment

Post by phkb »

Yep, the logic I put in was one way only - checking for the shift key being pressed, but not the other way, checking if the shift key was *not* pressed. I'll get a patch in shortly to address this.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Mapping keys/buttons to OXP equipment

Post by phkb »

OK, PR has been created. Seems to work a lot better now, checking for both shifted and unshifted characters.
User avatar
hiran
Theorethicist
Posts: 2410
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Mapping keys/buttons to OXP equipment

Post by hiran »

phkb wrote: Tue Aug 08, 2023 10:41 pm
OK, PR has been created. Seems to work a lot better now, checking for both shifted and unshifted characters.
I'll test as soon as I see a pre-release lying around. :-)
Sunshine - Moonlight - Good Times - Oolite
Post Reply