Responds to keys pressed on the keyboard

The Keyboard widget listens to the keyboard, and outputs either the key-code for any key pressed, or listens for a specific key and acts like a switch when the key is pressed.

For example, if the space bar is pressed, a 32 will be output. If the lowercase “a” is pressed, 65 will be output. But if the “Trigger” box is checked and the number is set to 32, then normally the widget will output 0, and only when the space bar is pressed, will it output 1023.

This widget works very well with the Makey Makey board, which outputs key presses in response to touching almost anything physical, like a banana.


1 Connect

Connect the Keyboard widget to another widget that accepts numbers.

Listen to any key

Press any key, and that key-code will be output from the widget. The key-code is displayed on the upper left.

2 Listen to a specific key

In the Trigger mode, the Keyboard widget listens for a single key, such as the space bar or the letter “a.” When that key is not pressed, the min value is output. When the key is pressed, the max value is output.

Do the following for Trigger mode:

  • Set the values of the Min and Max as appropriate for widget Keyboard is connected to
  • Check the Trigger box
  • Set the value next to the trigger box to the key-code for the key you want to listen for

To discover the key-code of the key want to listen for, press the key and watch the number in the upper left of the widget.

NETLabTK - Tangible IoT