TinyTapeout / tt-commander-app

Web app to control the Tiny Tapeout Demo board
https://commander.tinytapeout.com
Other
0 stars 3 forks source link

Support for momentary (push-button style) ui_in as alternative to toggles #16

Open algofoogle opened 2 weeks ago

algofoogle commented 2 weeks ago

https://github.com/TinyTapeout/tt-commander-app/issues/2 implemented the great keyboard 0-7 inputs to toggle ui_in pins.

Can there also be an alternative (maybe a mode enabled with a checkbox) that is more like real pushbuttons? e.g. only while the keyboard key is held, the pin is asserted (or better: the keyboard key inverts whatever the existing "default" toggle state of the input is).

Example of how this would be used:

  1. Go to INTERACT tab
  2. Tick ui_in to activate, as normal
  3. Mouse-click (or use keyboard keys) to "latch on" (or toggle) the default input states
  4. Tick an extra "Pushbutton mode" option
  5. Pressing keyboard keys 0-7 will then INVERT the state of the respective input (as set in step 3 above) for exactly the duration of that keyboard key being held (i.e. being sensitive to keydown/up instead of keypress).

This allows the user to assert either very brief (tapped) or somewhat long and still precise (held) positive and negative input states.

This would be handy for games (example: Pong, where button-held duration is important) but probably also a more natural way to test things that depend on instantaneous states rather than "switching"/toggling states.

OPTIONAL EXTRA: In addition to (or instead of) point 4 above, this could be how the UI behaves when combined with the Shift key.