Skip to content
Fabrizio Nunnari edited this page Jun 21, 2021 · 2 revisions

Native input for interactive control of a scene flow

VSM has the possibility to read raw input from a device. This is useful to intercept keyboard and mouse events without the need of a user interface (not even an opened window).

To insert this feature, add to your project an instance of KeyRunTimePlugin.

Native input properties

By default, when a key is pressed, its value will be set in a variable called PressedKey. If you want to change this variable name, use the PressedKeySceneflowVar string property.

To wait for key presses, keep a node alive with a loop, and add a conditional edge testing whether PressedKey == <yourkey>. For example, for key a you will test PressedKey == "A". This is a low-level interface, thus no distinction is made between A and a: pressing the shift key will trigger itself an event.

Example project using the native input

Limitations:

  • The variable Pressedkey is not reset when a key is released. If your scene flow loops back to a key pressing test, then Pressedkey="" must be explicitely executed before (tip: use Command Executions).
  • The reference layout is for American keyboards. On German keyboards, for example, y and z will be inverted.
  • Can not manage multiple key presses.

Future work:

  • Manage mouse clicks
Clone this wiki locally