====== Keyboard ====== Using the ''Key Combo'' or ''Keycode'' Event Types, you can control the applications running on your computer with OSC messages((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)). 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 Combo'' is used to generate key combos, which are the combination of a key and some optional modifiers((modifiers are Command (⌘), Option (⌥), Control (⌃) and Shift (⇧) )). * ''Keycode'' is used to generate the stroke of a single key. Each keycode is mapped to a key of your keyboard, and with the special event, you can generate events for special keys (like Shift or Fn) that could not be created with ''Key Combo'' 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 Window((open the Parameters Window by clicking on the toolbar icon, or by selecting the menu item "Parameters Window" in the View application menu)). 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 ==== {{ :manual:keyhelper.png |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 ==== {{:manual:lemurkey.jpg|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 [[http://www.twelfthroot.com/|Edmund Eagan]]).