Jump to content

Missing ECM keybinding in new release


Recommended Posts

I find these new lines in the file "clickabledata.lua":

-- ECM
elements["PTR-ECM-TMB-OPR-455"]			= default_3_position_tumb(_("ECM power switch"),						devices.ECM_INTERFACE, ecm_commands.PwrSw, 455, false, anim_speed_default, false)
elements["PTR-ECM-LVR-DIM-456"]			= default_axis_limited_1_side(_("ECM DIM rotary knob"),					devices.ECM_INTERFACE, ecm_commands.DimRotary, 456)
elements["PTR-ECM-TMB-XMIT-457"]		= default_3_position_tumb(_("ECM XMIT switch"),							devices.ECM_INTERFACE, ecm_commands.XmitSw,	457, false, anim_speed_default, false)
elements["PTR-ECM-BTN-RESET-458"]		= default_button(_("ECM reset button"),									devices.ECM_INTERFACE, ecm_commands.ResetBtn, 458)
elements["PTR-ECM-BTN-BIT-459"]			= default_button(_("ECM bit button"),									devices.ECM_INTERFACE, ecm_commands.BitBtn, 459)
elements["PTR-ECM-BTN-1-460"]			= default_2_position_tumb(_("ECM 1 button"),							devices.ECM_INTERFACE, ecm_commands.OneBtn, 460)
elements["PTR-ECM-BTN-2-465"]			= default_2_position_tumb(_("ECM 2 button"),							devices.ECM_INTERFACE, ecm_commands.TwoBtn, 465)
elements["PTR-ECM-BTN-3-470"]			= default_2_position_tumb(_("ECM 3 button"),							devices.ECM_INTERFACE, ecm_commands.ThreeBtn, 470)
elements["PTR-ECM-BTN-4-475"]			= default_2_position_tumb(_("ECM 4 button"),							devices.ECM_INTERFACE, ecm_commands.FourBtn, 475)
elements["PTR-ECM-BTN-5-480"]			= default_2_position_tumb(_("ECM 5 button"),							devices.ECM_INTERFACE, ecm_commands.FiveBtn, 480)
elements["PTR-ECM-BTN-6-485"]			= default_2_position_tumb(_("ECM 6 button"),							devices.ECM_INTERFACE, ecm_commands.SixBtn, 485)
elements["PTR-ECM-BTN-FRM-490"]			= default_2_position_tumb(_("ECM FRM button"),							devices.ECM_INTERFACE, ecm_commands.FrmBtn, 490)
elements["PTR-ECM-BTN-SPL-495"]			= default_2_position_tumb(_("ECM SPL button"),							devices.ECM_INTERFACE, ecm_commands.SplBtn, 495)

But in fact, the corresponding command bindings in "default.lua" have not been created. They need to be created in both "default.lua", under "joystick" and under "keyboard".  That means, for now you can execute thes commands only per mouse click in the cockpit. Not a bug, probably just WIP.

I'm fairly sure I can create these missing lines and post them. But are you willing to edit your "default.lua"?


Edited by LeCuvier

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Link to comment
Share on other sites

Try these:

{down = ecm_commands.ResetBtn, up = ecm_commands.ResetBtn, value_down = 1.0, value_up = 0.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM Reset Button'), category = {_('ECM Pod')}},
{down = ecm_commands.BitBtn, up = ecm_commands.BitBtn, value_down = 1.0, value_up = 0.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM Bit Button'), category = {_('ECM Pod')}},
{down = ecm_commands.OneBtn, up = ecm_commands.OneBtn, value_down = 1.0, value_up = 0.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM 1 Button'), category = {_('ECM Pod')}},
{down = ecm_commands.TwoBtn, up = ecm_commands.TwoBtn, value_down = 1.0, value_up = 0.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM 2 Button'), category = {_('ECM Pod')}},
{down = ecm_commands.ThreeBtn, up = ecm_commands.ThreeBtn, value_down = 1.0, value_up = 0.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM 3 Button'), category = {_('ECM Pod')}},
{down = ecm_commands.FourBtn, up = ecm_commands.FourBtn, value_down = 1.0, value_up = 0.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM 4 Button'), category = {_('ECM Pod')}},
{down = ecm_commands.FiveBtn, up = ecm_commands.FiveBtn, value_down = 1.0, value_up = 0.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM 5 Button'), category = {_('ECM Pod')}},
{down = ecm_commands.SixBtn, up = ecm_commands.SixBtn, value_down = 1.0, value_up = 0.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM 6 Button'), category = {_('ECM Pod')}},
{down = ecm_commands.FrmBtn, up = ecm_commands.FrmBtn, value_down = 1.0, value_up = 0.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM FRM Button'), category = {_('ECM Pod')}},
{down = ecm_commands.SplBtn, up = ecm_commands.SplBtn, value_down = 1.0, value_up = 0.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM SPL Button'), category = {_('ECM Pod')}},

These lines of code need to be added into the file "default.lua" under "...\DCS World OpenBeta\Mods\aircraft\F-16C\Input\F-16C\keyboard".
I recommend you insert them near the top of the file, just below these lines (so they are easy to locate):

local cockpit = folder.."../../../Cockpit/Scripts/"
dofile(cockpit.."devices.lua")
dofile(cockpit.."command_defs.lua")

local res = external_profile("Config/Input/Aircrafts/common_keyboard_binding.lua")

join(res.keyCommands,{

Use Notepad++ (or equivalent) for the editing!

The 3-position switches require 3 bindings each; I have not found a way to create UP/DOWN commands.

I have tested to verify that the buttons and switches move as expected. I'm not familiar with the functionality to expect. Good luck!

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Link to comment
Share on other sites

The commands from my previous post can also be used with HOTAS devices, button boxes etc. To do that, the lines of code must be added into the file "default.lua" under "...\DCS World OpenBeta\Mods\aircraft\F-16C\Input\F-16C\joystick".

On these devices you can also use 3-position switches if you add these lines of code:

{down = ecm_commands.PwrSw, up = ecm_commands.PwrSw, value_down = 1.0, value_up = 0.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM Power 2-Pos Switch OPR/STBY'), category = {_('ECM Pod')}}, -- combine to 3-position ECM Power switch
{down = ecm_commands.PwrSw, up = ecm_commands.PwrSw, value_down = -1.0, value_up = 0.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM Power 2-Pos Switch OFF/STBY'), category = {_('ECM Pod')}}, -- combine to 3-position ECM Power switch
{down = ecm_commands.XmitSw, up = ecm_commands.XmitSw, value_down = 1.0, value_up = 0.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM Xmit 2-Pos Switch Pos 1/2'), category = {_('ECM Pod')}}, -- combine to 3-position ECM Xmit switch
{down = ecm_commands.XmitSw, up = ecm_commands.XmitSw, value_down = -1.0, value_up = 0.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM Xmit 2-Pos Switch Pos 3/2'), category = {_('ECM Pod')}}, -- combine to 3-position ECM Xmit switch

And if you have a spare axis device you can use it for the ECM Dim command if you add this line of code:

{action = ecm_commands.DimRotary, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM Dim Knob Axis'), category = {_('ECM Pod')}}, -- Tune to SLIDER, Invert, Saturation Y = 50

It must be added in the "axis" section near the end of the file. I recommend to insert it just below these lines:

-- joystick axes 
join(res.axisCommands,{

 

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Link to comment
Share on other sites

Thank you!
In the mean time I've been experimenting a bit myself. I created these code lines for 3-way switches.

Quote
Quote

{down = ecm_commands.XmitSw,                         up = ecm_commands.XmitSw,                        cockpit_device_id = devices.ECM_INTERFACE,        value_down = 1.0,    value_up = 0.0,    name = _('ECM XMIT switch - 1'),                category = {_('ECM Pod')}},
{down = ecm_commands.XmitSw,                                                                         cockpit_device_id = devices.ECM_INTERFACE,        value_down = -1.0,                     name = _('ECM XMIT switch - 2'),                category = {_('ECM Pod')}},
{down = ecm_commands.XmitSw,                         up = ecm_commands.XmitSw,                         cockpit_device_id = devices.ECM_INTERFACE,        value_down = -1.0,    value_up = 0.0,    name = _('ECM XMIT switch - 3'),                category = {_('ECM Pod')}},

{down = ecm_commands.PwrSw,                         up = ecm_commands.PwrSw,                        cockpit_device_id = devices.ECM_INTERFACE,        value_down = 1.0,    value_up = 0.0,    name = _('ECM POWER switch - OPR'),                category = {_('ECM Pod')}},
{down = ecm_commands.PwrSw,                                                                         cockpit_device_id = devices.ECM_INTERFACE,        value_down = -1.0,                     name = _('ECM POWER switch - STBY'),            category = {_('ECM Pod')}},
{down = ecm_commands.PwrSw,                         up = ecm_commands.PwrSw,                         cockpit_device_id = devices.ECM_INTERFACE,        value_down = -1.0,    value_up = 0.0,    name = _('ECM POWER switch - OFF'),                category = {_('ECM Pod')}},
 

 

 

But I haven't been able to code something for the ECM # buttons that works with numpads that don't have fixed on and off positions, because they register only momentary inputs.
The first press on the numpad key toggles the ECM # button on, but the second press doesn't toggle it off. I
'v'e used your code and changed the value_up to 1.0, because otherwise it automatically toggles back to off when releasing the numpad key.
 

Quote

{down = ecm_commands.ResetBtn, up = ecm_commands.ResetBtn, value_down = 1.0, value_up = 1.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM Reset Button'), category = {_('ECM Pod')}},
{down = ecm_commands.BitBtn, up = ecm_commands.BitBtn, value_down = 1.0, value_up = 1.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM Bit Button'), category = {_('ECM Pod')}},
{down = ecm_commands.OneBtn, up = ecm_commands.OneBtn, value_down = 1.0, value_up = 1.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM 1 Button'), category = {_('ECM Pod')}},
{down = ecm_commands.TwoBtn, up = ecm_commands.TwoBtn, value_down = 1.0, value_up = 1.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM 2 Button'), category = {_('ECM Pod')}},
{down = ecm_commands.ThreeBtn, up = ecm_commands.ThreeBtn, value_down = 1.0, value_up = 1.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM 3 Button'), category = {_('ECM Pod')}},
{down = ecm_commands.FourBtn, up = ecm_commands.FourBtn, value_down = 1.0, value_up = 1.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM 4 Button'), category = {_('ECM Pod')}},
{down = ecm_commands.FiveBtn, up = ecm_commands.FiveBtn, value_down = 1.0, value_up = 1.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM 5 Button'), category = {_('ECM Pod')}},
{down = ecm_commands.SixBtn, up = ecm_commands.SixBtn, value_down = 1.0, value_up = 1.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM 6 Button'), category = {_('ECM Pod')}},
{down = ecm_commands.FrmBtn, up = ecm_commands.FrmBtn, value_down = 1.0, value_up = 1.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM FRM Button'), category = {_('ECM Pod')}},
{down = ecm_commands.SplBtn, up = ecm_commands.SplBtn, value_down = 1.0, value_up = 1.0, cockpit_device_id = devices.ECM_INTERFACE, name = _('ECM SPL Button'), category = {_('ECM Pod')}},

Probably it's something pretty easy, but I'm a total noob at coding 🙂

Most important thing for me was the 3-way switches, so thanks for putting me in the right direction.

Link to comment
Share on other sites

4 hours ago, Valk said:

...I''ve used your code and changed the value_up to 1.0, because otherwise it automatically toggles back to off when releasing the numpad key.

I presumed that these should work like normal pushbuttons that are spring-loaded to pop back out when you release them. So my first attempt was without the "up" but then the buttons would remain pressed and it was impossible to make them pop out. If they are supposed to latch in until you push them again, I'm not sure I can get that.

Edit: The only solution I see would require two bindings per pushbutton. One with value_down = 1.0 and one with value_down = 0.0


Edited by LeCuvier

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Link to comment
Share on other sites

  • 2 weeks later...
On 12/25/2021 at 11:12 PM, LeCuvier said:

I presumed that these should work like normal pushbuttons that are spring-loaded to pop back out when you release them. So my first attempt was without the "up" but then the buttons would remain pressed and it was impossible to make them pop out. If they are supposed to latch in until you push them again, I'm not sure I can get that.

Edit: The only solution I see would require two bindings per pushbutton. One with value_down = 1.0 and one with value_down = 0.0

 

Hi im also try to bind them to momentary pushbutton with no luck cant get it to toggle it between pressed and released like in rwr power same type "default_2_position_tumb_small"

{	down = rwr_commands.Power_ITER,								cockpit_device_id = devices.RWR,	value_down =  1.0,					name = _('RWR Indicator Control POWER Button - Depressed/Released'),	category = {_('Left Auxiliary Console'), _('THREAT WARNING AUX Panel'), _("RWR")}},

i try to add _ITER but not working strange cus its same type of switches in clickabledata.lua


Edited by tees

303 & Friends discord

 

Hangar :

 

JF-17 Thunder, F-16C Viper, I-16, Christen Eagle II, F-14 Tomcat, Supercarrier, WWII Assets Pack, F/A-18C Hornet, AJS-37 Viggen, Spitfire LF Mk. IX, F-5E Tiger II, M-2000C, MiG-15bis, Bf 109 K-4 Kurfürst, Fw 190 D-9 Dora, F-86F Sabre, Flaming Cliffs 3, P-51D Mustang, A-10C Warthog,SA342 Gazelle, UH-1H Huey, Mi-8MTV2 Magnificent Eight, Black Shark II, Persian Gulf Map, Normandy 1944 Map,

 

 

Link to comment
Share on other sites

On 12/25/2021 at 4:12 PM, LeCuvier said:

I presumed that these should work like normal pushbuttons that are spring-loaded to pop back out when you release them. So my first attempt was without the "up" but then the buttons would remain pressed and it was impossible to make them pop out. If they are supposed to latch in until you push them again, I'm not sure I can get that.

Edit: The only solution I see would require two bindings per pushbutton. One with value_down = 1.0 and one with value_down = 0.0

Yeah, discrete ON and OFF commands looks like the only way right now. We need _ITER versions of the button commands to be able to toggle them like happens when clicking them with the mouse. It would be nice if ED could make it a standard to have absolute and relative commands available and listed in command_defs.lua for each control.

Checked in what I did for the ECM panel into the keybinds project earlier if anybody is interested:
https://github.com/Munkwolf/dcs-community-keybinds/blob/8b4381fddb20286d9e8c194c7b274ca82c846fa2/InputCommands/F-16C/Input/F-16C/joystick/default.lua#L481

Link to comment
Share on other sites

  • Recently Browsing   0 members

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