Jump to content

Suggestion: Can we have more options to assign Keys / Buttons?


Recommended Posts

Posted

I tried to create a Profile for the Huey and my TM Warthog. There are several 3-way switches in the Huey cockpit which I would like to map on my TM Warthog, like I did it for the P-51D for example.

 

One example is the Armament Off/Safe/Armed switch.

In the Key assignment in DCS I can only find 2 options for this. Up and Down. And it does exactly that, so it´s not possible to assign 3-button switches for this options.

In the P-51D for such 3-way switches, additional to the "Up" and "Down" function, we got also fixed functions for the swich settings.

 

In this example this would be 3 more options like:

* Armament Off

* Armament Safe

* Armament Armed

 

If these exist, we could either configure 3-way switches in the GUI or at least in the LUA files. This would make it also possible for pit builders to have real 3-way switches and not just toggles which fire an up and down event.

Posted

Hey,

 

first of:

+1

 

second: you can take the long and hard road into the template-hell to produce your own keypresses. Check this file out: C:\Program Files\Eagle Dynamics\DCS World\Mods\aircrafts\Uh-1H\Input\UH-1H\keyboard\default.lua .

Per Mod and per controller category (joystick, keyboard, etc...) there is at least one default.lua and possibly several hardware-specific .luas to be found.

These files are used to control which options per action is present in the controller configuration menu in game.

Using notepad++, and searching for "Armament Off/Safe/Armed" i found these lines:

 

{combos = {{key = ']', reformers = {'RShift'}}}, down = device_commands.Button_20, cockpit_device_id = devices.WEAPON_SYS, value_down = 1.0, name = 'Armament Off/Safe/Armed Up', category = 'Armament System'},
{combos = {{key = '[', reformers = {'RShift'}}}, down = device_commands.Button_20, cockpit_device_id = devices.WEAPON_SYS, value_down = -1.0, name = 'Armament Off/Safe/Armed Down', category = 'Armament System'},

 

These code segments contain several elements:

combos = {{key = ']', reformers = {'RShift'}}}

Determines which keys are pre-bound with the default keyboard layout to this function

 

This bit determine what happens when the key combo is pressed down (hence the down = part, other options seem to be up = or pressed = for a held button).

down = device_commands.Button_20, cockpit_device_id = devices.WEAPON_SYS, value_down = 1.0,

The value_down part is what i think is the cockpit postion of the switch. I think this is just simple math, evertime you press the armament switch up key combo 1.0 is added, everytime you press the armament switch down, 1 is substracted.

 

There is also a value_up for when the key combo is released. Seen a few lines down with this:

{combos = {{key = 'J'}}, down = device_commands.Button_23, up = device_commands.Button_23, cockpit_device_id = devices.WEAPON_SYS, value_down = 1.0, value_up = 0.0, name = 'Jettison', category = 'Armament System'},

 

Whats programmed in the default layout of the Warthog throttle is for example this:

{combos = {{key = 'JOY_BTN31'}}    , down = iCommandPlane_L_ENG_OPER_Ign         , up = iCommandPlane_L_ENG_OPER_Norm_from_Ign    , name = 'Left Engine Oper Ign / Norm'            , category = 'Engine Control Panel'};

So basically one key press, DirectX button 31, one action for down, one action for up.

I do not quite get how to combine serveral infos onto one down = statement like they did for the UH-1 with the default.lua, but i guess with a little trail and error it should be possible to produce something like seperate key presses for threeway switch up = armament up, threeway switch middle = armament middle, and so forth.

 

Good luck :)

  • Like 1
Posted

Or you can use Target.

ASUS ROG Maximus VIII Hero, i7-6700K, Noctua NH-D14 Cooler, Crucial 32GB DDR4 2133, Samsung 950 Pro NVMe 256GB, Samsung EVO 250GB & 500GB SSD, 2TB Caviar Black, Zotac GTX 1080 AMP! Extreme 8GB, Corsair HX1000i, Phillips BDM4065UC 40" 4k monitor, VX2258 TouchScreen, TIR 5 w/ProClip, TM Warthog, VKB Gladiator Pro, Saitek X56, et. al., MFG Crosswind Pedals #1199, VolairSim Pit, Rift CV1 :thumbup:

Posted

Wow Madog! Thank you very much for your thorough reply. Rep inbound :thumbup:

This looks like a job for next weekend for me. I did alter Input settings .lua files previously (for my P-51 Setup for example to make 3-way switches working), but never thought about the possiblity that you can possibly make your own definitions even deeper in the games input config files. I think I never looked into the default.lua files. :)

Posted (edited)

I've been working on this for quite some time too now (without luck).

 

TARGET doesn't enable you to toggle definitive switch positions, as you would wish for with something like the Warthog throttle.

Yet with the example for the master arm it works to just program the up and down commands (guess that's what you meant, cichlidfan).

 

The problem is, that at least I didn't figure out yet, how to edit the .lua-files to make the main fuel switch for example work with 2 separate commands.

Off command to switch it off, nothing else, no matter how often you press the off button, and same for the on state.

 

I've managed to edit all the (for me) needed commands for the Shark, apart from the fuel cut-off, those just don't work.

But the Huey seems to work totally different here, and I've tried a lot of switches and ways to edit the .lua-files already.

 

+1000 for (a lot) more stateful button commands, pleeeeaaaaaaas BST !!!

Or explain how to edit the .lua-files correctly !!!

Here another thread on that topic btw.

Greetings

MadCat

Edited by -=MadCat=-
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...