Keyboard Input behavior (detect any key presses)

captaincomic

  • *
  • Posts: 6108
I put a behavior called "Keyboard Input" on StencylForge to detect keyboard events of any key pressed released.

Unlike usual I wasn't lazy with comments and fully commented it as well ;) so I hope it will be easy to use.

In short: Add the behavior to a scene, then write in any scene behavior custom events called "KeyUp" and "KeyDown", and use the custom block "last pressed key" to check which key has been pressed or released. The custom block "last input character" will return the character generated by the last key-up event. It takes into account modifier keys and should work with any keyboard layout.

captaincomic

  • *
  • Posts: 6108
There's a core event to detect keyboard input now (build 7151), so this behavior won't be needed anymore.

Jon

  • *
  • Posts: 17533
Feel free to delete the behavior from SVN (if you haven't done so already).

captaincomic

  • *
  • Posts: 6108
I actually forgot to ever bundle it, it was on StencylForge only.