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

Improvement ideas #4

Closed viboux closed 3 years ago

viboux commented 3 years ago

So glad I found your project. Everything I have hoped for. I was reading some solutions to make the X Touch Mini work with MSFS 2020 and was not satisfied with these solutions with tons of sketchy software (FreePIE + script + vJoy + mapping in MSFS2020). Your solution is the best, backed by a great Python SimConnect project.

I have made a few improvements yesterday to your code to support manual events which requires a specific value set for example the A32NX Managed and Selected modes in the AP (https://github.com/odwdinc/Python-SimConnect/issues/57).

    {
      "index": 4,
      "event_up": "AP_ALT_VAR_INC",
      "event_down": "AP_ALT_VAR_DEC",
      "event_press": {"event": "ALTITUDE_SLOT_INDEX_SET", "type": "manual", "value": 1, "description": "A32NX - set AP Altitude Hold to selected mode"},
      "event_long_press": {"event": "ALTITUDE_SLOT_INDEX_SET", "type": "manual", "value": 2, "description": "A32NX - set AP Altitude Hold to managed mode"}
    },

Or to support multiple events for a single press.

  "buttons": [
    {
      "index": 1,
      "event_press": ["TOGGLE_FLIGHT_DIRECTOR", "AP_MASTER"],
      "simvar_led": "AUTOPILOT_FLIGHT_DIRECTOR_ACTIVE"
    },

Other ideas not yet implemented:

Would love to contribute to the project, let me know if you want me to share the improvements to the code.

maartentamboer commented 3 years ago

Hey, Nice to see that more people are finding my project and liking it 😄. Any contributions are very welcome, so feel free to share your changes through a Pull request.

Conditional events is based on a value is definitely on my list. I hope to expand triggers with more functionality by allowing the user to test for specific values and so on. I'm looking into using jinja 2 https://jinja.palletsprojects.com/en/2.11.x/templates/#tests so the user could potentially add a rule in the json like this

"rule": "{% if simvarname is lt 10 %}"

Will probably work on that this weekend

maartentamboer commented 3 years ago

Good news, in version 1.0.0 there is now support for conditional events and plane specific configurations Therfore i will now close this issue