Jump to content

Recommended Posts

Posted (edited)

I use the TM Warthog HOTAS and want to take advantage of the many switches on my throttle, but not use two switches for a single ON/OFF control. In most cases you can set the switch to toggle ON/OFF/ON... but I don't like that because the switch position does not tell me what the current state is.

So I tried to create a combo line in the ...\default.lua file, based on a solution Racoon had given me for 3-state flap control on the Dora. The first target was Pitot/Windshield heating. I copy the two original lines plus the added one:

{ down = device_commands.Button_12, cockpit_device_id = devices.FUSEBOX, value_down = 1.0, name = _('Pitot / Windscreen Heating ON'), category = _('Right Switch Panel')},

{ down = device_commands.Button_12, cockpit_device_id = devices.FUSEBOX, value_down = 0.0, name = _('Pitot / Windscreen Heating OFF'), category = _('Right Switch Panel')},

{ down = device_commands.Button_13, cockpit_device_id = devices.FUSEBOX, value_down = 1.0, name = _('Pitot / Windscreen Heating (toggle)'), category = _('Right Switch Panel')},

-- Following line added by Hans-Werner Fassbender to achieve defined 2-state control with one switch. JOY_BTN16 is Engine Fuel Flow Left on TM HOTAS Throttle

{combos = {{key = 'JOY_BTN16'}}, cockpit_device_id = devices.FUSEBOX, down = device_commands.Button_12, value_down = 1.0, up = device_commands.Button_12, value_down = 0.0, name = _('Pitot / Windshield Heating ON/OFF'), category = _('Right Switch Panel')},

 

This didn't work.

Today I reviewed the code again and changed the "up" part of the "combos" line to "..., up = device_commands.Button_12, value_up = 0.0,....."

This works and the "Dashboard UV Light ON/OFF" also works with the following line added to the block "-- C 101 Pit Lights CB":

{combos = {{key = 'JOY_BTN17'}}, cockpit_device_id = devices.FUSEBOX, down = device_commands.Button_9, value_down = 1.0, up = device_commands.Button_9, value_up = 0.0, name = _('Dashboard/UV Lights ON/OFF'), category = _('Right Switch Panel')},

I replace the attached file "default.lua" with the corrected one.

default.lua

Edited by LeCuvier
Correction of the .lua code

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

  • Recently Browsing   0 members

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