Table of Contents

Keyboard

Using the Key Combo or Keycode Event Types, you can control the applications running on your computer with OSC messages1).

These events respond to OSC message like triggers, when the received crosses 0.5 upwards, the key is pressed, and when the value falls back to 0, the key is depressed.

There are two kinds of keyboard events:

Key Combos

You first need to create the key combos you want to use before assigning them to an event. To do this, you must use the Parameters Window3).

The Key Combo tab is fully described in the Parameters Window section.

Keycodes

To use the Keycode Event Type, you must choose the right keycode from a list of 128 keycodes. All these keycodes correspond to a single key on your Macintosh keyboard.

The Values list displays the keycodes and the key associated with it, if it can be graphically represented by a glyph (although some special keys can't be displayed).

It is sometimes faster to search the keycode with a helper tool, the Keycode Helper.

Keycode Helper Window

The Keycode Helper window

To find what keycode to which key on the Mac keyboard, open the Keycode Helper (in the menu Window → Keycode Helper, ⌘K), then type the key you want to assign to the routing. Next, select the corresponding keycode in the Keycode list of the routing window.

Remember that keycodes refer to a key location on the real keyboard, not an actual character. This means that if you change the international layout of your keyboard, the same keycode will be used, but the generated character could change. For example, keycode 12 represents character ‘q’ on a US keyboard, whereas it matches the character ‘a’ on a French keyboard.

Example: Lemur Virtual Keyboard

A screenshot of the Lemur Virtual Keyboard preset

In the Sample Patches folder, you will find a Lemur patch that displays a virtual QWERTY keyboard (kindly donated by Edmund Eagan).

1)
because the OSC protocol is running on the network, a fun application of this would be to use another computer on the network to send keyboard events
2)
modifiers are Command (⌘), Option (⌥), Control (⌃) and Shift (⇧)
3)
open the Parameters Window by clicking on the toolbar icon, or by selecting the menu item “Parameters Window” in the View application menu