teensy-chorded-keyboard provides all the necessary code to use a Teensy board as a chorded keyboard via USB. This code project was inspired by the Chordite keyboard, though it is not necessarily specifc to it.
- Install the Arduino IDE, if you have not already.
- Install the Teensyduino add-on.
- Open the included sketch: arduino teensy_chorded_keyboard/teensy_chorded_keyboard.pde
- Then just compile and upload the program to your Teensy board.
For the moment, the keyboard can only be configured by editting the source files directly.
- The constants PINKY_L, PINKY_H, etc. define the pin numbers for the low pinky switch, the high pinky switch, and so on. You will need to adjust these to match your wiring.
- If LEFT_HANDED is set to true, chord definitions will be expected to start with the pinky finger on the left, up to the index finger. If LEFT_HANDED is false, the order is reversed.
- To change the layout itself, find the function setupLayout() in teensy_chorded_keyboard.pde.
Chord strings for each finger are defined as follows:
- Underscore(_) = no switch
- Caret(^) = high switch
- v = low switch
- Percent(%) = both switches
- The available functions are
- layoutAddChar(chord, char) - for an ASCII character
- layoutAddMod(chord, modifier) - for a modifier (MODIFIERKEY_CTRL, MODIFIERKEY_SHIFT, etc)
- layoutAddCharMod(chord, char, modifier) - for an ASCII character with a modifier
- layoutAddKeyCode(chord, keycode) - for use with USB keycodes. See the list in /hardware/teensy/cores/teensy/usb_common.h
- LAYOUT_SIZE will need to be adjusted to be at least equal to the total number of chords in your layout.
If you are using a different design, you may also need to configure the following:
- In chorded_kbd_lib.c, SWITCHES, NUM_SWITCHES, and NUM_STATES configure, respectively, the IDs of the switches on each finger, the number of switches on each finger, and the number of possible states for each finger. For example, a Chordite would have 2 switches for each finger, and 4 states (no switch pressed, switch A, switch B, and both).
- The pins for each switch will also need to be defined at the top of chorded_kbd_lib.h
Maintainer: Rob Rosenbaum