Jump to content

How do I modify keybindings and .lua for keyboard?


Jyge

Recommended Posts

I hope this is the right forum for the question. I am trying to modify some keybindings. For example in Gazelle there are some switches with On/Off keybindings. I would like to modify them to separate On and Off.

 

 

tried following:

{down = device_commands.Button_43,cockpit_device_id = devices.NAVLIGHTS, value_down = 1, name = _('SA342 Panels Lighting On'), category = _('SA342 Main Panel')},

{down = device_commands.Button_43,cockpit_device_id = devices.NAVLIGHTS, value_down = 0, name = _('SA342 Panels Lighting On'), category = _('SA342 Main Panel')},

 

 

I can see the new keys in the game, assign the keys but both keybindings still work as On/Off - for example if I assign a key for Panel Lighting Off pressing the key twice will turn the lights Off and then On again.

 

 

Also, I assume the name of the button has some relevance (device_commands.Button_43) where can one find which button triggers what in the cockpit?

 

 

I would appreciate some first steps as I have some other aircraft as well where I would like to do my changes. It is more important now to get my Warthog more to my liking as I got into VR...

Link to comment
Share on other sites

I had a look and ... for example the Panels lightning has following:

elements["PUPITRE-PLANCHEBORD-PTR"] = default_2_position_tumb(_("SA342 Panels Lighting On/Off"),devices.NAVLIGHTS, device_commands.Button_8,arg_int.inter_pupitre_planchebord) -- 382 arg number

 

 

Well beats me, I do not see the connection here. The default.lua names the switch as Button_43 not as Button_8 so no idea what gives. I am trying to google but I do not hit the relevant link about cockpit switches and so...

 

 

Is it possible at all to achieve what I am trying to do?

Link to comment
Share on other sites

The file "clickabledata.lua" defines the interactive cockpit commands and the "default.lua" defines key commands for HOTAS and keyboard.

For the same function, there can be different button numbers between the two files. But I have often created commands in "default.lua" using the button numbers from "clickabledata.lua". For example to use maintained ON/OFF switches on my button box.

I don't own the SA343 and therefore I cannot help.

Edit:

If you want to help yourself, read the "how-to" document I posted here: https://forums.eagle.ru/showpost.php?p=2862001&postcount=214


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

...tried following:

{down = device_commands.Button_43,cockpit_device_id = devices.NAVLIGHTS, value_down = 1, name = _('SA342 Panels Lighting On'), category = _('SA342 Main Panel')},

{down = device_commands.Button_43,cockpit_device_id = devices.NAVLIGHTS, value_down = 0, name = _('SA342 Panels Lighting On'), category = _('SA342 Main Panel')},

...

As far as I can see the two commands you have created have exactly the same name. That's a fundamental flaw. The names of the commands must be unique within the "default.lua". So if you add two commands, their names must be different, and of course they must also be dfifferent from any names already existing in the file.

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

As far as I can see the two commands you have created have exactly the same name. That's a fundamental flaw. The names of the commands must be unique within the "default.lua". So if you add two commands, their names must be different, and of course they must also be dfifferent from any names already existing in the file.

 

My bad, the second one is of course "Off" - does not work though. Both functions can be assigned a key but still they flip the switch up and down. Did not work when I put down=-1 to the "Off" either.

 

I'll look at the linked tutorial, it is not the only switch I want to change, just an example...

Link to comment
Share on other sites

If the clickable switch in the cockpit is a maintained 2-position switch you can probably use Button_8 instead of Button_43, in the commands you created. If instead, the cockpit has two push buttons, then you will have to use an additional Button_X. And then you can either use two pushbuttons with these two separate commands, or combine the two commands into one and bind it to a maintained ON/OFF switch.

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

For some seriously odd reason this works:

 

 

{down = device_commands.Button_8,cockpit_device_id = devices.NAVLIGHTS, value_down = 1.0, name = _('SA342 Panels Lighting On'), category = _('MODDED')},

{down = device_commands.Button_8,cockpit_device_id = devices.NAVLIGHTS, value_down = 0.0, name = _('SA342 Panels Lighting Off'), category = _('MODDED')},

 

 

 

Button_8 is what I can see in clickabledata.lua I do not know whether it has influence that I moved the whole thing "MODDED" group, where I already have some flare dispenser commands etc. that I copied from somewhere...

Link to comment
Share on other sites

  • Recently Browsing   0 members

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