Group Abstract Group Abstract

Message Boards Message Boards

Game controller button to trigger action

Posted 3 years ago

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.

POSTED BY: Mark Greenberg
2 Replies
Posted 3 years ago
POSTED BY: Mark Greenberg
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard