Jump to content

Assign an axis to work like pressing a button


Recommended Posts

Can you assign an input which is listed as axis to function as button press instead? Without the use of external software?

So for example when the axis is over 50 % value it is like a button pressed.

Link to comment
Share on other sites

I do that in the Tomcat, I created an axis command for the landing gear and use a throttle quadrant to do it. I just put it in the default.lua for the F-14 pilot.

{action = device_commands.GEAR_Handle, cockpit_device_id=devices.GEARHOOK, name=_('Gear Handle')},

Sent from my Samsung Chromebook Plus using Tapatalk

F-14B, F-16, F-18C, A-10C, F-5E, F-86, FC3, BF-109, FW-190, P-51, Spitfire, UH-1,AJS-37 Viggen, MIG-15, MIG-19, MIG-21, AV-8B Harrier, P-47D

Persian Gulf, Caucuses, NTTR, Normandy, The Channel, Syria

Combined Arms, WWII Assets,Super Carrier

TM Warthog, Virpil VFX,BuddyFox UFC, Saitek Pro Flight quadrant & Switch Panel, Odyssey+ VR, Jet Pad w/ SSA, Voice Attack w/Viacom Pro

GeForce RTX2080TI OC, Intel Core i7-7700K 4.5Ghz, 64GB DDR4, Dedicated 1TB SSD

Link to comment
Share on other sites

This is the perfect solution I am looking for. Thank you! And I am almost there I hope. I do this to assign my toe brakes on the rudder to the accelerator pedal in combined arms, because it only has a combo axis for accelerate and brake. So I want to assign the keyboard commands to it.

 

I looked in the keyboard default.lua for the command I want to assign to the joystick which looks like:

{combos = {{key = 'W'}}, down = iCommandPlaneUpStart, up = iCommandPlaneUpStop, name = _('Vehicle Accelerate'), category = _('Moving')},

 

Then I put it in in the joystick.lua like that:

{action = iCommandPlaneDownStart, name = _('Vehicle Accelerate'), category = _('Moving')},

 

It shows up, I can assign the stick, but it does not do anything. Unfortunately it does not look exactly like the code in the F14. I dont know how to deal with the up and down commands, which I assume will be for button press and release.

I tried:

{combos = {{key = 'W'}}, down = iCommandPlaneUpStart, up = iCommandPlaneUpStop, name = _('Vehicle Accelerate'), category = _('Moving')},

{down = iCommandPlaneUpStart, name = _('Vehicle Accelerate'), category = _('Moving')},

 

And that breaks it

{name = _('Vehicle Accelerate'), category = _('Moving')},

 

Any Idea?

Link to comment
Share on other sites

Posted (edited)

Your axis command doesn't have a cockpit device id, so it's not sending the value to anything. I don't know what device would be, I usually can find that data from the clickable lua.

you were also missing device commands. I'm not a pro when it comes to this stuff, I just monkey around with it until it works. So someone else might have a more informed thought on it.
 

{action = device_commands.GEAR_Handle, cockpit_device_id=devices.GEARHOOK, name=_('Gear Handle')},

 

Yours should probably look something like this

{action = device_commands.iCommandPlaneDownStart, cockpit_device_id=devices.????????????????, name = _('Vehicle Accelerate'), category = _('Moving')},

 


Edited by LASooner

F-14B, F-16, F-18C, A-10C, F-5E, F-86, FC3, BF-109, FW-190, P-51, Spitfire, UH-1,AJS-37 Viggen, MIG-15, MIG-19, MIG-21, AV-8B Harrier, P-47D

Persian Gulf, Caucuses, NTTR, Normandy, The Channel, Syria

Combined Arms, WWII Assets,Super Carrier

TM Warthog, Virpil VFX,BuddyFox UFC, Saitek Pro Flight quadrant & Switch Panel, Odyssey+ VR, Jet Pad w/ SSA, Voice Attack w/Viacom Pro

GeForce RTX2080TI OC, Intel Core i7-7700K 4.5Ghz, 64GB DDR4, Dedicated 1TB SSD

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...