Jump to content

Is there way to create keybindings for separate on and off for some cockpit switches?


Jyge

Recommended Posts

I have been modifying default.lua on one aircraft or another, but with Mig-21 I had no real luck so far. I wanted to separate some On/Off switches to separate On and Off keybindings. This is what I tried in default.lua:

 

 

   --Modded
{down = device_commands.Obogrev,cockpit_device_id = devices.WEAPON_CONTROL, value_down = 1.0, name = _('MSL Heat On'), category = _('Modded')},
{down = device_commands.Obogrev,cockpit_device_id = devices.WEAPON_CONTROL, value_down = -1.0, name = _('MSL Heat Off'), category = _('Modded')}, 
{down = device_commands.Pusk,cockpit_device_id = devices.WEAPON_CONTROL, value_down = 1.0, name = _('MSL - RKT Launch On'), category = _('Modded')},
{down = device_commands.Pusk,cockpit_device_id = devices.WEAPON_CONTROL, value_down = -1.0, name = _('MSL - RKT Launch Off'), category = _('Modded')}, 
{down = device_commands.Pitanie12,cockpit_device_id = devices.WEAPON_CONTROL, value_down = 1.0, name = _('1-2 Power On'), category = _('Modded')},
{down = device_commands.Pitanie12,cockpit_device_id = devices.WEAPON_CONTROL, value_down = -1.0, name = _('1-2 Power Off'), category = _('Modded')}, 
{down = device_commands.Pitanie34,cockpit_device_id = devices.WEAPON_CONTROL, value_down = 1.0, name = _('3-4 Power On'), category = _('Modded')},
{down = device_commands.Pitanie34,cockpit_device_id = devices.WEAPON_CONTROL, value_down = -1.0, name = _('3-4 Power Off'), category = _('Modded')}, 
{down = device_commands.GS23,cockpit_device_id = devices.WEAPON_CONTROL, value_down = 1.0, name = _('Gun On'), category = _('Modded')},
{down = device_commands.GS23,cockpit_device_id = devices.WEAPON_CONTROL, value_down = -1.0, name = _('Gun Off'), category = _('Modded')}, 
{down = device_commands.ASPon,cockpit_device_id = devices.ASP, value_down = 1.0, name = _('ASP-17 Sight On'), category = _('Modded')},
{down = device_commands.ASPon,cockpit_device_id = devices.ASP, value_down = -1.0, name = _('ASP-17 Sight Off'), category = _('Modded')}, 
{down = device_commands.ASPpipperOn,cockpit_device_id = devices.ASP, value_down = 1.0, name = _('Pipper On'), category = _('Modded')},
{down = device_commands.ASPpipperOn,cockpit_device_id = devices.ASP, value_down = -1.0, name = _('Pipper Off'), category = _('Modded')}, 
{down = device_commands.ASPnetOn,cockpit_device_id = devices.ASP, value_down = 1.0, name = _('Fix net On'), category = _('Modded')},
{down = device_commands.ASPnetOn,cockpit_device_id = devices.ASP, value_down = -1.0, name = _('Fix net Off'), category = _('Modded')}, 

 

 

 

Well firstly, the On functions would not even appear before I deleted the default bindings. After this the On function in my definition would work as On/Off toggle and Off worked as I wanted.

 

 

Is there a way to accomplish this or one of those things again? I find it pity that they do not harmonize the logic in these keybindings for all aircraft...I think the way Razbam makes this leaves best basis for customization or switches...

Link to comment
Share on other sites

Have you tried RS Mapper https://forums.eagle.ru/showthread.php?t=205492&highlight=rs+mapper?

You can not only add action to a switch but also to the return of the same switch.

Might save you editing lua files.

 

 

I don't think that is the solution. This deals with inputs from the joystick. My problem is the toggle switches, the same keypress switches the stuff on and the next press switches it off again. I want to have a dedicated keypress to switch something on and another different keypress to switch the stuff off, this can be only solved on the simulator side.

Link to comment
Share on other sites

{combos = {{key='JOY_BTN22'}}, cockpit_device_id = devices.WEAPON_CONTROL, down = device_commands.Obogrev, value_down = 1.0, up = device_commands.Obogrev, value_up = 0.0, name = _('MSL Heat On/Off'), category=_('Modded')},

Link to comment
Share on other sites

Hi everyone

I remember that when the MIG-21 came out many commands had the ON-OFF function separat as for example the air brakes. it is possible in the future to have this option again in addition to the already existing one ??.

Thank you.

Intel I5-8600 3,1GHz. NVIDIA RTX2070 8GB DDR6. 32GB RAM DDR4. SSD 500GB. WIN 10.

Saiteck Rino x55, pedals, panels Switch,Radio,AP.Trackir 5,Leo Bodnar,Voice Attack.

Link to comment
Share on other sites

This is a block of lua I add every patch to the joystick\default.lua for custom controls. Most them have no issues, a few have some cosmetic ones like the switch and clickzone get out of sync.

 

{down=device_commands.Airbrakes,up=device_commands.Airbrakes,cockpit_device_id=devices.AIRBRAKE,value_down=1.0,value_up=0.0,name=_('Airbrake (Off)'),category=_('Custom')},
{down=device_commands.RADARfixBeam,up=device_commands.RADARfixBeam,cockpit_device_id=devices.RADAR,value_down=1.0,value_up=0.0,name=_('Fix Beam (Off)'),category=_('Custom')},
{down=device_commands.RADARlowAlt,cockpit_device_id=devices.RADAR,value_down=0.5,name=_('Low Altitude Filter'),category=_('Radar and SPO')},
{down=device_commands.RADARlowAlt,up=device_commands.RADARlowAlt,cockpit_device_id=devices.RADAR,value_down=1,value_up=0.5,name=_('Radar Tilt (Mid)'),category=_('Custom')},
{down=device_commands.RADARlowAlt,up=device_commands.RADARlowAlt,cockpit_device_id=devices.RADAR,value_down=0,value_up=0.5,name=_('Radar No Filter (Mid)'),category=_('Custom')},
{down=device_commands.GearLever,up=device_commands.GearLever,cockpit_device_id=devices.GEARS,value_down=1.0,value_up=0.0,name=_('Gear Up (Neutral)'),category=_('Custom')},
{down=device_commands.GearLever,up=device_commands.GearLever,cockpit_device_id=devices.GEARS,value_down=-1.0,value_up=0.0,name=_('Gear Down (Neutral)'),category=_('Custom')},
{down=device_commands.GearHandleFixator,up=device_commands.GearHandleFixator,cockpit_device_id=devices.GEARS,value_down=1.0,value_up=0.0,name=_('Gear Lock Release (Lock)'),category=_('Custom')},
{down=iCommandPlaneWheelBrakeOff,name=_('Brake Release'),category=_('Custom')},

Link to comment
Share on other sites

you can just set the same function to two different buttons, hitting the same button twice will turn it on and off, but hitting the on button to turn it on, and the off button to turn it off would still work...

My youtube channel Remember: the fun is in the fight, not the kill, so say NO! to the AIM-120.

System specs:ROG Maximus XI Hero, Intel I9 9900K, 32GB 3200MHz ram, EVGA 1080ti FTW3, Samsung 970 EVO 1TB NVME, 27" Samsung SA350 1080p, 27" BenQ GW2765HT 1440p, ASUS ROG PG278Q 1440p G-SYNC

Controls: Saitekt rudder pedals,Virpil MongoosT50 throttle, warBRD base, CM2 stick, TrackIR 5+pro clip, WMR VR headset.

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

I'm looking for a way to get the speed brake on off on separate commands. I tried the code strings you posted, I also changed them, but without success. Does anyone know how to do ? thank you

Intel I5-8600 3,1GHz. NVIDIA RTX2070 8GB DDR6. 32GB RAM DDR4. SSD 500GB. WIN 10.

Saiteck Rino x55, pedals, panels Switch,Radio,AP.Trackir 5,Leo Bodnar,Voice Attack.

Link to comment
Share on other sites

Thanks for the reply Red Yeti. I'll do tests tomorrow because I can't now.

However I don't know if it will work, I'm looking for a way to get an example: Key "C" (Joy Button 1) for "AirBrake ON" and Key "B" (Joy Button 2) for AirBrake OFF. As in the M2000c or in the F-18. Thanks anyway

Intel I5-8600 3,1GHz. NVIDIA RTX2070 8GB DDR6. 32GB RAM DDR4. SSD 500GB. WIN 10.

Saiteck Rino x55, pedals, panels Switch,Radio,AP.Trackir 5,Leo Bodnar,Voice Attack.

Link to comment
Share on other sites

  • 3 weeks later...

I have to jump in here for a +1.

I've just started flying the MiG-21 again, took a break for a few years when the switches changed to a toggle, and this is still bothering me.

 

I hope there is a chance these can be reinstated alongside toggles, please?

Link to comment
Share on other sites

Gizzy’s profile if using thrustmaster

 

I'm not familiar with that profile as I like to write my own using TARGET,

but I'm also not sure how this solves the problem of discrete switch positions being replaced by toggles. ie APUOn and APUOff bindings replaced with a single APUOn/Off

Link to comment
Share on other sites

  • Recently Browsing   0 members

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