HummerX / BMSAIT

Falcon BMS to Arduino Interface Tool
GNU General Public License v3.0
12 stars 2 forks source link

ButtonMatrix add Pressed and Released commands #7

Open madisdev opened 1 month ago

madisdev commented 1 month ago

Hello,

Thanks for creating this app its really useful. I have been using it to create a F-15 engine control panel, and all seems to be going well so far. I have a 3x3 button matrix and a led for the JFS start light. All works well except I am trying to get the switches to go to the off state.

I see in the Switches demo you can configure the off state of a switch using the "Switch schalter[]" array. There it allows command pressed ID and command released ID. But in the ButtonMatrix.h there is no such trackign of state.

I was wondering do you think it would be possible for that to work with button matrix?

I was going to have a go at it as I am a programmer, but just wanted to see if there is any technical reason why you think that wouldn't work. Thanks.

madisdev commented 1 month ago

I guess I answered my own question, I took some of the code from Switches.h and implemented the same functionality for the ButtonMatrix. Let me know if you would like me to create a PR.

HummerX commented 1 month ago

Hi madisdev, thanks for reporting this issue. The module is supposed to be able to handle both button press and button release commands. This is included in the Demo files. But I found an error in the ButtonMatric module. I corrected this and the module should be able to assign dedicated release commands. In the ButtonMatrix module you will find two tables: The table keyDown contains the commands for pressed buttons. The table keyUp contains the commands to be send to Windows if a button got released.

madisdev commented 1 month ago

Thanks, I got my solution working. But good to know there is an official fix out there. Again thanks for this program, its pretty sweet.

I would like to offer my assistance in helping out with the windows app, in regards to adding English translations and possibly cleaning up the UI. There are some instances where the status messages are still in German. Let me know.