electricaltill Posted February 23, 2020 Posted February 23, 2020 (edited) I'm making a button box for the F-14. There are several rotary elements that have 'nudge' CW/CCW key bindings. Some don't have these bindings, I would like to add them and I can't quite grasp from the LUAs how they work. For instance, the azimuth center knob in the RIO cockpit (which DOES have these bindings). In clickabledata.lua: elements["PNT_82"] = default_axis(_("Radar azimuth center"),devices.RADAR, device_commands.RADAR_azimuth_center_knob, cockpit_args.RADAR_azimuth_center_knob, 0.0) Fine. But in default.lua for the keyboard commands we have: { combos = {{key = 'D', reformers = {'LAlt'}}}, up = device_commands.RADAR_azimuth_leftright, down = device_commands.RADAR_azimuth_leftright, cockpit_device_id=devices.RADAR, value_down = 1, value_up = 0, name = _('Radar azimuth right'), category = _('Radar Control Panel')}, { combos = {{key = 'A', reformers = {'LAlt'}}}, up = device_commands.RADAR_azimuth_leftright, down = device_commands.RADAR_azimuth_leftright, cockpit_device_id=devices.RADAR, value_down = -1, value_up = 0, name = _('Radar azimuth left'), category = _('Radar Control Panel')} In default.lua for the joystick commands we have: { up = device_commands.RADAR_azimuth_leftright, down = device_commands.RADAR_azimuth_leftright, cockpit_device_id=devices.RADAR, value_down = 1, value_up = 0, name = _('Radar azimuth right'), category = _('Radar Control Panel')}, { up = device_commands.RADAR_azimuth_leftright, down = device_commands.RADAR_azimuth_leftright, cockpit_device_id=devices.RADAR, value_down = -1, value_up = 0, name = _('Radar azimuth left'), category = _('Radar Control Panel')}So there's extra 'leftright' commands which seem to make this work. I can see in command_defs.lua that there are two lines for this control: RADAR_azimuth_scan_knob = counter(), RADAR_azimuth_leftright = counter() I have tried to add 'leftright' bindings for the DDD erase control by editing all of the files above. The bindings appear in DCS, but don't actually do anything when mapped. In clickabledata.lua both of these controls ("Erase" and "Radar azimuth center") are default_axis commands, so no changes needed there. What am I missing? Edited February 23, 2020 by electricaltill
JG14_Smil Posted February 23, 2020 Posted February 23, 2020 You have to give each renamed command a unique name. They cannot have the default name.
electricaltill Posted February 24, 2020 Author Posted February 24, 2020 You have to give each renamed command a unique name. They cannot have the default name.I'm not renaming anything, I am adding bindings using the same format as other controls of the same type. Those added bindings have unique names. What file are you referring to?
JG14_Smil Posted February 24, 2020 Posted February 24, 2020 Keyboard default lua only works with keyboard. Joystick defaultlua is only loaded with a joystick. Your code examples do not have unique names, they have the default names, so your list is not updated with your new commands. 'example left" would be changed to 'example left nudge' or whatever. I find that editing a button press command works with a hard-wired button, but a virtual button produced by code (encoder sending a virtual button pulse for example) will not be affected. Good luck, I'm done here.
electricaltill Posted February 24, 2020 Author Posted February 24, 2020 Keyboard default lua only works with keyboard. Joystick defaultlua is only loaded with a joystick. Your code examples do not have unique names, they have the default names, so your list is not updated with your new commands. 'example left" would be changed to 'example left nudge' or whatever. The examples are not my code, they are existing, working bindings. I am asking if there is anything else needed to make bindings like this work. Mainly I don't understand what gives significance to the 'leftright' commands in command_defs.lua.
Recommended Posts