This should not be that difficult, but I'm not seeing the solution. I have a game controller, and in a notebook on my desktop some WL code. The controller sends a "button push" signal to the code just fine, captured by the code in the notebook with a line like this:
Dynamic[ControllerState[2, "B4"]]
However, I would like this to dynamically trigger a function in the code, similar to the way an event handler would work. To simplify things, let's just have it trigger Beep[]
when the button is pushed. I could set a timer to repeatedly check the value of the ControllerState, but that can't be the best way to do it. The code is not part of a Manipulate or 3Dgraphics, but rather part of a custom interface.
Can anyone please point me in the right direction?
Thanks in advance.