Mapping keys/buttons to OXP equipment

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

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 »

another_commander wrote: Fri Jul 21, 2023 5:26 am
Here, I have uploaded the automatically built binary corresponding to phkb's latest code for anyone interested
Thanks, a_c!
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: Mapping keys/buttons to OXP equipment

Post by another_commander »

I think phkb's PR for this feature is ready to merge, so before doing that here is the latest binary containing his code for those who like to test: https: //drive.google.com/file/d/11B9k0_harn6-Jg2n8E_4shKU9GSnJR1I/view?usp=sharing

I tested it very briefly with just one piece of primable equipment and it worked fine, but only after saving the game, exiting and reloading. I think that's because it has to save the data to .GNUstepDefaults before being able to use it. I wonder if doing a .GNUstepDefaults sync immediately after installing the OXPs containing primable equipment could help with that.
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 »

Hmm. It was supposed to work without a restart. Let me have another look.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: Mapping keys/buttons to OXP equipment

Post by another_commander »

Okay, you don't actually have to restart the app, but you have to save the game with the primable equipment you have and then immediately reload it in order to get access to the key configs for it.
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, I just checked in a change. Can you see if it's any better now? I mean, it seems to work for me now, anyway.
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 »

No, hang on. I broke something...
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, I think that's done it. Ready to try again.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: Mapping keys/buttons to OXP equipment

Post by another_commander »

Looks good, working fine here now. I have deleted the previous binary upload and replaced it with this one, which contains your latest fix for anyone interested in testing: - deleted; feature is merged on github with commit cf96cf5 and a pre-release binary has been automatically posted under https://github.com/OoliteProject/oolite ... tag/latest
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 »

So, has anyone had a chance to try out the build? Found inexpressible joy at mapping every piece of kit to a key or button? Or too busy on the paper run from Tionisla to Xexedi?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: Mapping keys/buttons to OXP equipment

Post by another_commander »

Keyboardwise I think it works. Joystick, don't know, don't have one. Still, I'd say go ahead and merge unless someone discovers a way to get the universe to implode.
User avatar
hiran
Theorethicist
Posts: 2403
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 »

Now that it's merged I tried the Linux download - I even connected my joystick for that.
And while I had been playing with keyboard before, the joystick handling felt a bit clumsy. That is, compared to the flight simulations that I had bought that force beedback joystick for initially.

But then I started to reduce the dead zone, and for some better aiming I reconfigured the profile to 2.0.
With that flying is a lot easier since adjusting several axes at the same time is possible while it was not on the keyboard.

And finding those nice settings was just a matter of minutes. I like it! :-)
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: Wed Aug 02, 2023 10:26 pm
I like it!
Thanks, hiran. That's excellent news!
User avatar
hiran
Theorethicist
Posts: 2403
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 »

While getting more experience with the joystick, I meanwhile reduced the deadzone to zero and the profile to standard/1.5.
And still I have the feeling there is a dead zone. Does this come from my joystick, or Linux, or SDL or Oolite itself? I did not experience dead zones in Flight Simulator or FlightGrear.

There is another thing also: When flying gets tough just because it was keyboard before I tend to center the joystick and still control the ship via keyboard. Works liike a charm for all axis but the throttle. The A and S keys are ineffective, and to control the speed I still need to touch the joystick. Would it be possible to tweak this behaviour?
Sunshine - Moonlight - Good Times - Oolite
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Mapping keys/buttons to OXP equipment

Post by Cody »

hiran wrote: Thu Aug 03, 2023 6:16 pm
And still I have the feeling there is a dead zone. Does this come from my joystick, or Linux, or SDL or Oolite itself?
Have you set-up your stick using splines?
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
hiran
Theorethicist
Posts: 2403
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 »

Cody wrote: Thu Aug 03, 2023 6:31 pm
hiran wrote: Thu Aug 03, 2023 6:16 pm
And still I have the feeling there is a dead zone. Does this come from my joystick, or Linux, or SDL or Oolite itself?
Have you set-up your stick using splines?
I went to standard/1.5.

So now I tried splines. Seems I do not fully understand what I am doing, but worse: How do I ensure to get symmetrical behaviour, and that the same for all three axes?
Sunshine - Moonlight - Good Times - Oolite
Post Reply