maartentamboer / X-Touch-Mini-FS2020

Control FS2020 with a Behringer X-Touch Mini
https://dev-tty.nl/X-Touch-Mini-FS2020/
MIT License
57 stars 19 forks source link

Heading button (2) causes heading bug to snap to current heading #46

Closed Eraysor closed 3 years ago

Eraysor commented 3 years ago

Pressing the heading button 2 causes the heading bug to snap to the current heading. It looks like this is the behaviour for pressing in the encoder but should not be happening with just pressing button 2 according to the configuration:

  "index": 2,
  "event_up": "HEADING_BUG_INC",
  "event_down": "HEADING_BUG_DEC",
  "event_press": {
    "type": "condition",
    "event": [ "{% set heading = (data.get_simvar_value('HEADING_INDICATOR') * 180 / 3.14) | round %}",
                 "{{ data.trigger_event('HEADING_BUG_SET', heading) }}"],
    "description": "Set heading bug to current heading"

Compared to this, which shouldn't change the heading bug but does for me: "index": 2, "event_press": "AP_HDG_HOLD", "simvar_led": "AUTOPILOT_HEADING_LOCK"

Pressure the button just shows this in the log: on_note_data BTN: 2 on_note_data BTN: 2

Just wanted to add that I love the tool and thank you for your work!

Eraysor commented 3 years ago

Fixed this myself! I swapped AP_HDG_HOLD to KEY_AP_PANEL_HEADING_HOLD to get the behaviour I wanted.