Custom keybindings

Trim
Posts: 204
Joined: Mon Dec 03, 2018 3:37 pm

Custom keybindings

Post by Trim » Sat May 18, 2019 10:38 am

Recently, Papa Joe and I had a lengthy discussion on Discord in which I referred to custom key binds that I had added.
I figured I'd share here what I have done. These binds should work for any joystick that has the appropriate type of switches.
It's involves editing a config file but it's pretty simple and you can just paste in what I have below.
The only down side is that you have to redo it after each update. But it's pretty simple, you just have to remember to do it.

The file to edit is:
C:\Program Files\Eagle Dynamics\DCS World OpenBeta\Mods\aircraft\FA-18C\Input\FA-18C\joystick\default.lua

You should be able to open it in any text editor, but I highly recommend Notepad++
You might want to make a backup copy first, just in case, but I've never had a problem before.

At the beginning of the file, just below the line "join(res.keyCommands,{". Paste the following code:

Code: Select all


-- Custom --

{   down = iCommandPlaneGearUp,                     up = iCommandPlaneGearDown,                                                                                                         name = _('Landing Gear Control Handle'),                      category = {_('Custom Special For Joystick')}},
{   down = gear_commands.HookHandle,                up = gear_commands.HookHandle,                 cockpit_device_id = devices.GEAR_INTERFACE,   value_down =  1.0,   value_up = 0.0,   name = _('Arresting Hook Handle'),                            category = {_('Custom Special For Joystick')}},
{   down = hotas_commands.THROTTLE_EXTERIOR_LIGTHS, up = hotas_commands.THROTTLE_EXTERIOR_LIGTHS,  cockpit_device_id = devices.HOTAS,            value_down =  1.0,   value_up = 0.0,   name = _('Exterior Lights Switch'),                           category = {_('Custom Special For Joystick'), _('Throttle Grip'), _('HOTAS')}},
{   down = gear_commands.LaunchBarSw,               up = gear_commands.LaunchBarSw,                cockpit_device_id = devices.GEAR_INTERFACE,   value_down =  0.0,   value_up = 1.0,   name = _('Launch Bar Control Switch'),                        category = {_('Custom Special For Joystick'), _('Left Vertical Panel')}},
{   down = extlights_commands.LdgTaxi,              up = extlights_commands.LdgTaxi,               cockpit_device_id = devices.EXT_LIGHTS,       value_down =  0.0,   value_up = 1.0,   name = _('LDG/TAXI LIGHT Switch'),                            category = {_('Custom Special For Joystick'), _('Left Vertical Panel')}},
{   down = gear_commands.AntiSkidSw,                up = gear_commands.AntiSkidSw,                 cockpit_device_id = devices.GEAR_INTERFACE,   value_down =  0.0,   value_up = 1.0,   name = _('Anti Skid Switch'),                                 category = {_('Custom Special For Joystick'), _('Left Vertical Panel')}},
{   down = cptlights_commands.HookBypass,           up = cptlights_commands.HookBypass,            cockpit_device_id = devices.CPT_LIGTHS,       value_down =  -1.0,  value_up = 1.0,   name = _('Hook Bypass 2-Pos Switch CARRIER/FIELD/CARRIER'),   category = {_('Custom Special For Joystick'), _('Left Vertical Panel')}},
{   down = iCommandViewNightVisionGogglesOn,        up = iCommandViewNightVisionGogglesOn,                                                       value_down =  1.0,   value_up = 0.0,   name = _('NightVision'),                                      category = {_('Custom Special For Joystick'), _('Sensors')}},

-- End Custom --

Then save it. You're done.

Once this is done you will find a new category in the F/A-18 binds called "Custom Special for Joystick". Go ahead and setup the ones you want to use.
After an update, just paste the same code in again. if you do it before loading up the Hornet, all your bindings should still be there. If you forget and load the Hornet before pasting it back in, you may have to go back and rebind them again after pasting it in again.

User avatar
Hedgehog
Site Admin
Posts: 1080
Joined: Mon Nov 05, 2018 7:36 am

Re: Custom keybindings

Post by Hedgehog » Sat May 18, 2019 8:38 pm

OK, but what does this DO for me? What does it add or improve?
Image

Trim
Posts: 204
Joined: Mon Dec 03, 2018 3:37 pm

Re: Custom keybindings

Post by Trim » Sat May 18, 2019 9:45 pm

Ah, forgot that part.

It gives you bindings for some functions so that they work with a toggle switch correctly. Basically what it does is turn a toggled binding into a momentary press binding so it works with a toggle a switch.

The landing gear switch for example. With this binding, the logic says if the switch is in the ON position the gear lever is in the UP position. If it is off the gear lever is on the down position.

Another nice one is the flaps. with this you can use a 3 position switch for the flaps and it will work just like in the game.

If you joystick doesn't have toggle switches, it's less useful. The Warthog throttle has a lot of toggle switches though.

User avatar
Hedgehog
Site Admin
Posts: 1080
Joined: Mon Nov 05, 2018 7:36 am

Re: Custom keybindings

Post by Hedgehog » Sun May 19, 2019 9:06 am

So if you have switches that stay in the 'up' or 'down' position?

The switches on my X55 are all 3-way return-to-center.
Image

Trim
Posts: 204
Joined: Mon Dec 03, 2018 3:37 pm

Re: Custom keybindings

Post by Trim » Sun May 19, 2019 10:42 am

Correct, so yeah, not of much use to you then.

Post Reply