KeyboardIn

KeyboardInListen for key presses on the keyboard

The KeyboardIn widget listens for a key to be pressed a any keyboard connected to the device. By default, the widget outputs the numerical value of the key pressed. The widget responds on Key Down.

If the detectKey parameter is checked, the widget will only respond to a key press (and release) from the key specified in the keyDetectValue parameter. With detectKey enabled, the widget will output 500 if the selected key is pressed, and 0 when the key is released.

You can have multiple KeyboardIn widgets in your project. This is especially useful when using the keyDetect feature where you can use a different KeyboardIn for each key you want to listen for. Each widget will listen independently, allowing keys to be pressed at the same time.

For example, you could use the Makey Makey to generate your keyboard presses, and have four KeyboardIn widgets, one for each arrow key. Set the keyDetectValue for each widget like this: left = 37, up = 38, right = 39, down = 40.

KeyboardInExample

On Screen Features

  • in – The value of the key pressed
  • out – The output of the widget, which is either the pressed key value, or if detectKey is selected in the parameters, 500 when the right key is pressed, and zero when it is released

Parameters

  • invisible – If set to “true” or checked, the widget will disappear when the Flash movie is run – NOTE: you can make all the widgets invisible interactively when the Flash moving is running simply by pressing the backslash key “\”.
  • keyDetect – If set to “false” or unchecked (the default), the widget will output the value of the last key pressed. If set to “true” or checked, the widget will listen only for a key press with the value specified in keyDetectValue. If this key is pressed, 500 will be output, and 0 will be output when the key is released.
  • keyDetectValue – The value of the key to listen for if keyDetect is check/true.
  • remoteHubIP – unused

Last modified July 10th, 2013