10-10-2013 09:09 AM
I have an event structure in a while loop to handle various buttons the user can press. I used this instead of case structures on the buttons because I have some advanced events I want to happen to the controls as well. Code wise it is working fine, but the buttons are not release when you press them. They only change once when pressed. So if they are released and you click them they stay pressed. If you click on them again, they release. This is very ugly. What am I doing wrong? I have tried changing thier type to switched vs latched and it makes no difference. I tried changing the event on them as well and that doesn't seem to matter. Currently I have "mouse released" on the button as the event trigger.
10-10-2013 09:12 AM
Hello Muffin,
If you have the buttons configured for "latch" operation (reset after being read, which sounds like what you want), the button will only reset when it is actually read within the code- are they connected to anything or read somewhere within your application? The simplest way to ensure the buttons are read when the event is triggered is to place them within the mouse-up event.
Regards,
10-10-2013 09:13 AM
Latching is usally the correct mechanical action for buttons. In order for buttons to latch you need to "read" their value from the terminal. So just place the boolean terminal into the corresponding value change event.
10-10-2013 09:29 AM
Thanks, that was the problem. I did not have the button in the event so it was not being read. I moved it into the event and it now works.