diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/_summary.md | 9 | ||||
-rw-r--r-- | docs/basic_keycodes.md | 8 | ||||
-rw-r--r-- | docs/custom_quantum_functions.md | 2 | ||||
-rw-r--r-- | docs/features.md (renamed from docs/features/README.md) | 2 | ||||
-rw-r--r-- | docs/modding_your_keyboard.md | 73 | ||||
-rw-r--r-- | docs/porting_your_keyboard_to_qmk.md | 2 | ||||
-rw-r--r-- | docs/quantum_keycodes.md | 4 | ||||
-rw-r--r-- | docs/stenography.md | 108 |
8 files changed, 168 insertions, 40 deletions
diff --git a/docs/_summary.md b/docs/_summary.md index 8a649a3370..723377de98 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -1,4 +1,4 @@ -* [Getting started](README.md) +* [Getting started](README.md) * [QMK Overview](qmk_overview.md) * [Build Environment Setup](build_environment_setup.md) * [Vagrant Guide](vagrant_guide.md) @@ -7,7 +7,7 @@ * [FAQ: Compiling QMK](faq_build.md) * [How to Github](how_to_github.md) -* [Features](features/README.md) +* [Features](features.md) * [Layer switching](key_functions.md) * [Leader Key](leader_key.md) * [Macros](macros.md) @@ -16,6 +16,7 @@ * [Tap Dance](tap_dance.md) * [Mouse keys](mouse_keys.md) * [Unicode](unicode.md) + * [Stenography](stenography.md) * Reference * [Glossary](glossary.md) @@ -27,7 +28,7 @@ * [Customizing Functionality](custom_quantum_functions.md) * [Documentation Best Practices](documentation_best_practices.md) * [Unit Testing](unit_testing.md) - + * For Makers and Modders * [Adding a keyboard to QMK](adding_a_keyboard_to_qmk.md) * [Adding features to QMK](adding_features_to_qmk.md) @@ -39,7 +40,7 @@ * For a Deeper Understanding * [How Keyboards Work](basic_how_keyboards_work.md) * [Understanding QMK](understanding_qmk.md) - + * Other Topics * [General FAQ](faq.md) * [Using Eclipse with QMK](eclipse.md) diff --git a/docs/basic_keycodes.md b/docs/basic_keycodes.md index 2be3ada155..4f84647a2a 100644 --- a/docs/basic_keycodes.md +++ b/docs/basic_keycodes.md @@ -51,9 +51,9 @@ |KC_RSHIFT|KC_RSFT|RightShift| |KC_RALT||RightAlt| |KC_RGUI||Right GUI(Windows/Apple/Meta key)| -|KC_LOCKING_CAPS||Locking Caps Lock| -|KC_LOCKING_NUM||Locking Num Lock| -|KC_LOCKING_SCROLL||Locking Scroll Lock| +|KC_LOCKING_CAPS|KC_LCAP|Locking Caps Lock| +|KC_LOCKING_NUM|KC_LNUM|Locking Num Lock| +|KC_LOCKING_SCROLL|KC_LSCR|Locking Scroll Lock| |KC_INT4|KC_HENK|JIS Henken| |KC_INT5|KC_MHEN|JIS Muhenken| @@ -183,4 +183,4 @@ Windows and Mac use different key codes for next track and previous track. Make |KC_MS_WH_RIGHT|KC_WH_R|Mouse Wheel Right| |KC_MS_ACCEL0|KC_ACL0|Mouse Acceleration 0| |KC_MS_ACCEL1|KC_ACL1|Mouse Acceleration 1| -|KC_MS_ACCEL2|KC_ACL2|Mouse Acceleration 2|
\ No newline at end of file +|KC_MS_ACCEL2|KC_ACL2|Mouse Acceleration 2| diff --git a/docs/custom_quantum_functions.md b/docs/custom_quantum_functions.md index c017c0cdb3..10a718431c 100644 --- a/docs/custom_quantum_functions.md +++ b/docs/custom_quantum_functions.md @@ -36,7 +36,7 @@ enum my_keycodes { ## Programming The Behavior Of Any Keycode -When you want to override the behavior of an existing key, or define the behavior for a new key, you should use the `process_record_kb()' and `process_record_user()` functions. These are called by QMK during key processing before the actual key event is handled. If these functions return `true` QMK will process the keycodes as usual. That can be handy for extending the functionality of a key rather than replacing it. If these functions return `false` QMK will skip the normal key handling, and it will be up you to send any key up or down events that are required. +When you want to override the behavior of an existing key, or define the behavior for a new key, you should use the `process_record_kb()` and `process_record_user()` functions. These are called by QMK during key processing before the actual key event is handled. If these functions return `true` QMK will process the keycodes as usual. That can be handy for extending the functionality of a key rather than replacing it. If these functions return `false` QMK will skip the normal key handling, and it will be up you to send any key up or down events that are required. These function are called every time a key is pressed or released. diff --git a/docs/features/README.md b/docs/features.md index 72187d2d41..0de6622938 100644 --- a/docs/features/README.md +++ b/docs/features.md @@ -102,4 +102,4 @@ case MACRO_RAISED: update_tri_layer(LAYER_LOWER, LAYER_RAISED, LAYER_ADJUST); } break; -```
\ No newline at end of file +``` diff --git a/docs/modding_your_keyboard.md b/docs/modding_your_keyboard.md index 44e6e6e72a..a58fbd52b2 100644 --- a/docs/modding_your_keyboard.md +++ b/docs/modding_your_keyboard.md @@ -1,52 +1,52 @@ ## Audio output from a speaker -Your keyboard can make sounds! If you've got a Planck, Preonic, or basically any keyboard that allows access to the C6 or B5 port (`#define C6_AUDIO` and `#define B5_AUDIO`), you can hook up a simple speaker and make it beep. You can use those beeps to indicate layer transitions, modifiers, special keys, or just to play some funky 8bit tunes. +Your keyboard can make sounds! If you've got a Planck, Preonic, or basically any AVR keyboard that allows access to the C6 or B5 port (`#define C6_AUDIO` and/or `#define B5_AUDIO`), you can hook up a simple speaker and make it beep. You can use those beeps to indicate layer transitions, modifiers, special keys, or just to play some funky 8bit tunes. -The audio code lives in [quantum/audio/audio.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/audio/audio.h) and in the other files in the audio directory. It's enabled by default on the Planck [stock keymap](https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/default/keymap.c). Here are the important bits: +If you add `AUDIO_ENABLE = yes` to your `rules.mk`, there's a couple different sounds that will automatically be enabled without any other configuration: ``` -#include "audio.h" +STARTUP_SONG // plays when the keyboard starts up (audio.c) +GOODBYE_SONG // plays when you press the RESET key (quantum.c) +AG_NORM_SONG // plays when you press AG_NORM (quantum.c) +AG_SWAP_SONG // plays when you press AG_SWAP (quantum.c) +MUSIC_ON_SONG // plays when music mode is activated (process_music.c) +MUSIC_OFF_SONG // plays when music mode is deactivated (process_music.c) +CHROMATIC_SONG // plays when the chromatic music mode is selected (process_music.c) +GUITAR_SONG // plays when the guitar music mode is selected (process_music.c) +VIOLIN_SONG // plays when the violin music mode is selected (process_music.c) +MAJOR_SONG // plays when the major music mode is selected (process_music.c) ``` -Then, lower down the file: +You can override the default songs by doing something like this in your `config.h`: -``` -float tone_startup[][2] = { - ED_NOTE(_E7 ), - E__NOTE(_CS7), - E__NOTE(_E6 ), - E__NOTE(_A6 ), - M__NOTE(_CS7, 20) -}; +```c +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(STARTUP_SOUND) +#endif ``` -This is how you write a song. Each of these lines is a note, so we have a little ditty composed of five notes here. +A full list of sounds can be found in [quantum/audio/song_list.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/audio/song_list.h) - feel free to add your own to this list! All available notes can be seen in [quantum/audio/musical_notes.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/audio/musical_notes.h). -Then, we have this chunk: +To play a custom sound at a particular time, you can define a song like this (near the top of the file): +```c +float my_song[][2] = SONG(QWERTY_SOUND); ``` -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -float tone_plover[][2] = SONG(PLOVER_SOUND); -float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); -float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); -float goodbye[][2] = SONG(GOODBYE_SOUND); -``` +And then play your song like this: -Wherein we bind predefined songs (from [quantum/audio/song_list.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/audio/song_list.h)) into named variables. This is one optimization that helps save on memory: These songs only take up memory when you reference them in your keymap, because they're essentially all preprocessor directives. +```c +PLAY_SONG(my_song); +``` -So now you have something called `tone_plover` for example. How do you make it play the Plover tune, then? If you look further down the keymap, you'll see this: +Alternatively, you can play it in a loop like this: +```c +PLAY_LOOP(my_song); ``` -PLAY_NOTE_ARRAY(tone_plover, false, 0); // Signature is: Song name, repeat, rest style -``` - -This is inside one of the macros. So when that macro executes, your keyboard plays that particular chime. -"Rest style" in the method signature above (the last parameter) specifies if there's a rest (a moment of silence) between the notes. +It's advised that you wrap all audio features in `#ifdef AUDIO_ENABLE` / `#endif` to avoid causing problems when audio isn't built into the keyboard. ## Music mode @@ -59,6 +59,11 @@ Keycodes available: * `MU_ON` - Turn music mode on * `MU_OFF` - Turn music mode off * `MU_TOG` - Toggle music mode +* `MU_MOD` - Cycle through the music modes: + * `CHROMATIC_MODE` - Chromatic scale, row changes the octave + * `GUITAR_MODE` - Chromatic scale, but the row changes the string (+5 st) + * `VIOLIN_MODE` - Chromatic scale, but the row changes the string (+7 st) + * `MAJOR_MODE` - Major scale In music mode, the following keycodes work differently, and don't pass through: @@ -68,6 +73,16 @@ In music mode, the following keycodes work differently, and don't pass through: * `KC_UP` - speed-up playback * `KC_DOWN` - slow-down playback +By default, `MUSIC_MASK` is set to `keycode < 0xFF` which means keycodes less than `0xFF` are turned into notes, and don't output anything. You can change this by defining this in your `config.h` like this: + + #define MUSIC_MASK keycode != KC_NO + +Which will capture all keycodes - be careful, this will get you stuck in music mode until you restart your keyboard! + +The pitch standard (`PITCH_STANDARD_A`) is 440.0f by default - to change this, add something like this to your `config.h`: + + #define PITCH_STANDARD_A 432.0f + ## MIDI functionalty This is still a WIP, but check out `quantum/keymap_midi.c` to see what's happening. Enable from the Makefile. diff --git a/docs/porting_your_keyboard_to_qmk.md b/docs/porting_your_keyboard_to_qmk.md index 05787042fd..5a5025c358 100644 --- a/docs/porting_your_keyboard_to_qmk.md +++ b/docs/porting_your_keyboard_to_qmk.md @@ -20,7 +20,7 @@ For the `DIODE_DIRECTION`, most hand-wiring guides will instruct you to wire the `BACKLIGHT_LEVELS` is how many levels exist for your backlight - max is 15, and they are computed automatically from this number. -## `/keyboards/<keyboard>/Makefile` +## `/keyboards/<keyboard>/rules.mk` The values at the top likely won't need to be changed, since most boards use the `atmega32u4` chip. The `BOOTLOADER_SIZE` will need to be adjusted based on your MCU type. It's defaulted to the Teensy, since that's the most common controller. Below is quoted from the `Makefile`. diff --git a/docs/quantum_keycodes.md b/docs/quantum_keycodes.md index a59d8fbc88..36dbda7a9c 100644 --- a/docs/quantum_keycodes.md +++ b/docs/quantum_keycodes.md @@ -44,6 +44,8 @@ Shortcuts for bootmagic options (these work even when bootmagic is off.) |`MAGIC_UNSWAP_ALT_GUI`/`AG_NORM`|Disable the Alt/GUI switching| |`MAGIC_TOGGLE_NKRO`|Turn NKRO on or off| +<!-- FIXME: this formatting needs work + ## Audio ```c @@ -157,6 +159,8 @@ MI_MODSD, // decrease modulation speed MI_MODSU, // increase modulation speed #endif // MIDI_ADVANCED +--> + ## Backlight These keycodes control the backlight. Most keyboards use this for single color in-switch lighting. diff --git a/docs/stenography.md b/docs/stenography.md new file mode 100644 index 0000000000..fcac512016 --- /dev/null +++ b/docs/stenography.md @@ -0,0 +1,108 @@ +# Stenography in QMK + +[Stenography](https://en.wikipedia.org/wiki/Stenotype) is a method of writing most often used by court reports, closed-captioning, and real-time transcription for the deaf. In stenography words are chorded syllable by syllable with a mixture of spelling, phonetic, and shortcut (briefs) strokes. Professional stenographers can reach 200-300 WPM without any of the strain usually found in standard typing and with far fewer errors (>99.9% accuracy). + +The [Open Steno Project](http://www.openstenoproject.org/) has built an open-source program called Plover that provides real-time translation of steno strokes into words and commands. It has an established dictionary and supports + +## Plover with QWERTY Keyboard + +Plover can work with any standard QWERTY keyboard, although it is more efficient if the keyboard supports NKRO (n-key rollover) to allow Plover to see all the pressed keys at once. An example keymap for Plover can be found in `planck/keymaps/default`. Switching to the `PLOVER` layer adjusts the position of the keyboard to support the number bar. + +To use Plover with QMK just enable NKRO and optionally adjust your layout if you have anything other than a standard layout. You may also want to purchase some steno-friendly keycaps to make it easier to hit multiple keys. + +## Plover with Steno Protocol + +Plover also understands the language of several steno machines. QMK can speak a couple of these languages, TX Bolt and GeminiRP. An example layout can be found in `planck/keymaps/steno`. + +When QMK speaks to Plover over a steno protocol Plover will not use the keyboard as input. This means that you can switch back and forth between a standard keyboard and your steno keyboard, or even switch layers from Plover to standard and back without needing to activate/deactive Plover. + +In this mode Plover expects to speak with a steno machine over a serial port so QMK will present itself to the operating system as a virtual serial port in addition to a keyboard. By default QMK will speak the TX Bolt protocol but can be switched to GeminiRP; the last protocol used is stored in non-volatile memory so QMK will use the same protocol on restart. + +> Note: Due to hardware limitations you may not be able to run both a virtual serial port and mouse emulation at the same time. + +### TX Bolt + +TX Bolt communicates the status of 24 keys over a very simple protocol in variable-sized (1-5 byte) packets. + +### GeminiRP + +GeminiRP encodes 42 keys into a 6-byte packet. While TX Bolt contains everything that is necessary for standard stenography, GeminiRP opens up many more options, including supporting non-English theories. + +## Configuring QMK for Steno + +Firstly, enable steno in your keymap's Makefile. You should also diable mousekeys to prevent conflicts. + +```Makefile +STENO_ENABLE = yes +MOUSEKEY_ENABLE = no +``` + +In your keymap create a new layer for Plover. You will need to include `keymap_steno.h`. See `planck/keymaps/steno/keymap.c` for an example. Remember to create a key to switch to the layer as well as a key for exiting the layer. If you would like to switch modes on the fly you can use the keycodes `QK_STENO_BOLT` and `QK_STENO_GEMINI`. If you only want to use one of the protocols you may set it up in your initialization function: + +```C +void matrix_init_user() { + steno_set_mode(STENO_MODE_GEMINI); // or STENO_MODE_BOLT +} +``` + +Once you have your keyboard flashed launch Plover. Click the 'Configure...' button. In the 'Machine' tab select the Stenotype Machine that corresponds to your desired protocol. Click the 'Configure...' button on this tab and enter the serial port or click 'Scan'. Baud rate is fine at 9600 (although you should be able to set as high as 115200 with no issues). Use the default settings for everything else (Data Bits: 8, Stop Bits: 1, Parity: N, no flow control). + +On the display tab click 'Open stroke display'. With Plover disabled you should be able to hit keys on your keyboard and see them show up in the stroke display window. Use this to make sure you have set up your keymap correctly. You are now ready to steno! + +## Learning Stenography + +* [Learn Plover!](https://sites.google.com/site/ploverdoc/) +* [QWERTY Steno](http://qwertysteno.com/Home/) +* [Steno Jig](https://joshuagrams.github.io/steno-jig/) +* More resources at the Plover [Learning Stenography](https://github.com/openstenoproject/plover/wiki/Learning-Stenography) wiki + +## Keycode Reference + +As defined in `keymap_steno.h`. + +> Note: TX Bolt does not support the full set of keys. The TX Bolt implementation in QMK will map the GeminiRP keys to the nearest TX Bolt key so that one key map will work for both. + +|GeminiRP|TX Bolt|Steno Key| +|--------|-------|-----------| +|`STN_N1`|`STN_NUM`|Number bar #1| +|`STN_N2`|`STN_NUM`|Number bar #2| +|`STN_N3`|`STN_NUM`|Number bar #3| +|`STN_N4`|`STN_NUM`|Number bar #4| +|`STN_N5`|`STN_NUM`|Number bar #5| +|`STN_N6`|`STN_NUM`|Number bar #6| +|`STN_N7`|`STN_NUM`|Number bar #7| +|`STN_N8`|`STN_NUM`|Number bar #8| +|`STN_N9`|`STN_NUM`|Number bar #9| +|`STN_NA`|`STN_NUM`|Number bar #A| +|`STN_NB`|`STN_NUM`|Number bar #B| +|`STN_NC`|`STN_NUM`|Number bar #C| +|`STN_S1`|`STN_SL`| `S-` upper| +|`STN_S2`|`STN_SL`| `S-` lower| +|`STN_TL`|`STN_TL`| `T-`| +|`STN_KL`|`STN_KL`| `K-`| +|`STN_PL`|`STN_PL`| `P-`| +|`STN_WL`|`STN_WL`| `W-`| +|`STN_HL`|`STN_HL`| `H-`| +|`STN_RL`|`STN_RL`| `R-`| +|`STN_A`|`STN_A`| `A` vowel| +|`STN_O`|`STN_O`| `O` vowel| +|`STN_ST1`|`STN_STR`| `*` upper-left | +|`STN_ST2`|`STN_STR`| `*` lower-left| +|`STN_ST3`|`STN_STR`| `*` upper-right| +|`STN_ST4`|`STN_STR`| `*` lower-right| +|`STN_E`|`STN_E`| `E` vowel| +|`STN_U`|`STN_U`| `U` vowel| +|`STN_FR`|`STN_FR`| `-F`| +|`STN_PR`|`STN_PR`| `-P`| +|`STN_RR`|`STN_RR`| `-R`| +|`STN_BR`|`STN_BR`| `-B`| +|`STN_LR`|`STN_LR`| `-L`| +|`STN_GR`|`STN_GR`| `-G`| +|`STN_TR`|`STN_TR`| `-T`| +|`STN_SR`|`STN_SR`| `-S`| +|`STN_DR`|`STN_DR`| `-D`| +|`STN_ZR`|`STN_ZR`| `-Z`| +|`STN_FN`|| (GeminiRP only)| +|`STN_RES1`||(GeminiRP only)| +|`STN_RES2`||(GeminiRP only)| +|`STN_PWR`||(GeminiRP only)| |