aboutsummaryrefslogtreecommitdiff
path: root/readme.md
diff options
context:
space:
mode:
Diffstat (limited to 'readme.md')
-rw-r--r--readme.md75
1 files changed, 66 insertions, 9 deletions
diff --git a/readme.md b/readme.md
index 8e005155b..ed3da43bd 100644
--- a/readme.md
+++ b/readme.md
@@ -35,7 +35,7 @@ This is not a tiny project. While this is the main readme, there are many other
35* The list of possible keycodes you can use in your keymap is actually spread out in a few different places: 35* The list of possible keycodes you can use in your keymap is actually spread out in a few different places:
36 * [doc/keycode.txt](doc/keycode.txt) - an explanation of those same keycodes. 36 * [doc/keycode.txt](doc/keycode.txt) - an explanation of those same keycodes.
37 * [quantum/keymap.h](quantum/keymap.h) - this is where the QMK-specific aliases are all set up. Things like the Hyper and Meh key, the Leader key, and all of the other QMK innovations. These are also explained and documented below, but `keymap.h` is where they're actually defined. 37 * [quantum/keymap.h](quantum/keymap.h) - this is where the QMK-specific aliases are all set up. Things like the Hyper and Meh key, the Leader key, and all of the other QMK innovations. These are also explained and documented below, but `keymap.h` is where they're actually defined.
38* The [TMK documentation](doc/TMK_readme.md). QMK is based on TMK, and this explains how it works internally. 38* The [TMK documentation](doc/TMK_README.md). QMK is based on TMK, and this explains how it works internally.
39 39
40# Getting started 40# Getting started
41 41
@@ -75,8 +75,23 @@ Debian/Ubuntu example:
75 sudo apt-get update 75 sudo apt-get update
76 sudo apt-get install gcc-avr avr-libc dfu-programmer 76 sudo apt-get install gcc-avr avr-libc dfu-programmer
77 77
78### Docker
79
80If this is a bit complex for you, Docker might be the turn-key solution you need. After installing [Docker](https://www.docker.com/products/docker), run the following command at the root of the QMK folder to build a keyboard/keymap:
81
82```bash
83# You'll run this every time you want to build a keymap
84# modify the keymap and keyboard assigment to compile what you want
85# defaults are ergodox_ez/default
86
87docker run -e keymap=gwen -e keyboard=ergodox_ez --rm -v $('pwd'):/qmk:rw edasque/qmk_firmware
88
89```
90
91This will compile the targetted keyboard/keymap and leave it in your QMK directory for you to flash.
92
78### Vagrant 93### Vagrant
79If you have any problems building the firmware, you can try using a tool called Vagrant. It will set up a virtual computer with a known configuration that's ready-to-go for firmware building. OLKB does NOT host the files for this virtual computer. Details on how to set up Vagrant are in the [VAGRANT_GUIDE file](VAGRANT_GUIDE.md). 94If you have any problems building the firmware, you can try using a tool called Vagrant. It will set up a virtual computer with a known configuration that's ready-to-go for firmware building. OLKB does NOT host the files for this virtual computer. Details on how to set up Vagrant are in the [VAGRANT_GUIDE file](doc/VAGRANT_GUIDE.md).
80 95
81## Verify Your Installation 96## Verify Your Installation
821. If you haven't already, obtain this repository ([https://github.com/jackhumbert/qmk_firmware](https://github.com/jackhumbert/qmk_firmware)). You can either download it as a zip file and extract it, or clone it using the command line tool git or the Github Desktop application. 971. If you haven't already, obtain this repository ([https://github.com/jackhumbert/qmk_firmware](https://github.com/jackhumbert/qmk_firmware)). You can either download it as a zip file and extract it, or clone it using the command line tool git or the Github Desktop application.
@@ -97,7 +112,7 @@ In every keymap folder, the following files are recommended:
97 112
98The `make` command is how you compile the firmware into a .hex file, which can be loaded by a dfu programmer (like dfu-progammer via `make dfu`) or the [Teensy loader](https://www.pjrc.com/teensy/loader.html) (only used with Teensys). You can run `make` from the root (`/`), your keyboard folder (`/keyboards/<keyboard>/`), or your keymap folder (`/keyboards/<keyboard>/keymaps/<keymap>/`) if you have a `Makefile` there (see the example [here](/doc/keymap_makefile_example.mk)). 113The `make` command is how you compile the firmware into a .hex file, which can be loaded by a dfu programmer (like dfu-progammer via `make dfu`) or the [Teensy loader](https://www.pjrc.com/teensy/loader.html) (only used with Teensys). You can run `make` from the root (`/`), your keyboard folder (`/keyboards/<keyboard>/`), or your keymap folder (`/keyboards/<keyboard>/keymaps/<keymap>/`) if you have a `Makefile` there (see the example [here](/doc/keymap_makefile_example.mk)).
99 114
100By default, this will generate a `<keyboard>_<keymap>.hex` file in whichever folder you run `make` from. These files are ignored by git, so don't worry about deleting them when committing/creating pull requests. Your .hex file will also be available on qmk.fm/keyboards/<keyboard>/keymaps/<keymap>/. 115By default, this will generate a `<keyboard>_<keymap>.hex` file in whichever folder you run `make` from. These files are ignored by git, so don't worry about deleting them when committing/creating pull requests.
101 116
102Below are some definitions that will be useful: 117Below are some definitions that will be useful:
103 118
@@ -372,10 +387,11 @@ But lets start with how to use it, first!
372 387
373First, you will need `TAP_DANCE_ENABLE=yes` in your `Makefile`, because the feature is disabled by default. This adds a little less than 1k to the firmware size. Next, you will want to define some tap-dance keys, which is easiest to do with the `TD()` macro, that - similar to `F()`, takes a number, which will later be used as an index into the `tap_dance_actions` array. 388First, you will need `TAP_DANCE_ENABLE=yes` in your `Makefile`, because the feature is disabled by default. This adds a little less than 1k to the firmware size. Next, you will want to define some tap-dance keys, which is easiest to do with the `TD()` macro, that - similar to `F()`, takes a number, which will later be used as an index into the `tap_dance_actions` array.
374 389
375This array specifies what actions shall be taken when a tap-dance key is in action. Currently, there are two possible options: 390This array specifies what actions shall be taken when a tap-dance key is in action. Currently, there are three possible options:
376 391
377* `ACTION_TAP_DANCE_DOUBLE(kc1, kc2)`: Sends the `kc1` keycode when tapped once, `kc2` otherwise. 392* `ACTION_TAP_DANCE_DOUBLE(kc1, kc2)`: Sends the `kc1` keycode when tapped once, `kc2` otherwise.
378* `ACTION_TAP_DANCE_FN(fn)`: Calls the specified function - defined in the user keymap - with the current state of the tap-dance action. 393* `ACTION_TAP_DANCE_FN(fn)`: Calls the specified function - defined in the user keymap - with the final tap count of the tap dance action.
394* `ACTION_TAP_DANCE_FN_ADVANCED(on_each_tap_fn, on_dance_finished_fn, on_reset_fn)`: Calls the first specified function - defined in the user keymap - on every tap, the second function on when the dance action finishes (like the previous option), and the last function when the tap dance action resets.
379 395
380The first option is enough for a lot of cases, that just want dual roles. For example, `ACTION_TAP_DANCE(KC_SPC, KC_ENT)` will result in `Space` being sent on single-tap, `Enter` otherwise. 396The first option is enough for a lot of cases, that just want dual roles. For example, `ACTION_TAP_DANCE(KC_SPC, KC_ENT)` will result in `Space` being sent on single-tap, `Enter` otherwise.
381 397
@@ -399,7 +415,8 @@ In the end, let's see a full example!
399enum { 415enum {
400 CT_SE = 0, 416 CT_SE = 0,
401 CT_CLN, 417 CT_CLN,
402 CT_EGG 418 CT_EGG,
419 CT_FLSH,
403}; 420};
404 421
405/* Have the above three on the keymap, TD(CT_SE), etc... */ 422/* Have the above three on the keymap, TD(CT_SE), etc... */
@@ -424,10 +441,50 @@ void dance_egg (qk_tap_dance_state_t *state) {
424 } 441 }
425} 442}
426 443
444// on each tap, light up one led, from right to left
445// on the forth tap, turn them off from right to left
446void dance_flsh_each(qk_tap_dance_state_t *state) {
447 switch (state->count) {
448 case 1:
449 ergodox_right_led_3_on();
450 break;
451 case 2:
452 ergodox_right_led_2_on();
453 break;
454 case 3:
455 ergodox_right_led_1_on();
456 break;
457 case 4:
458 ergodox_right_led_3_off();
459 _delay_ms(50);
460 ergodox_right_led_2_off();
461 _delay_ms(50);
462 ergodox_right_led_1_off();
463 }
464}
465
466// on the fourth tap, set the keyboard on flash state
467void dance_flsh_finished(qk_tap_dance_state_t *state) {
468 if (state->count >= 4) {
469 reset_keyboard();
470 reset_tap_dance(state);
471 }
472}
473
474// if the flash state didnt happen, then turn off leds, left to right
475void dance_flsh_reset(qk_tap_dance_state_t *state) {
476 ergodox_right_led_1_off();
477 _delay_ms(50);
478 ergodox_right_led_2_off();
479 _delay_ms(50);
480 ergodox_right_led_3_off();
481}
482
427const qk_tap_dance_action_t tap_dance_actions[] = { 483const qk_tap_dance_action_t tap_dance_actions[] = {
428 [CT_SE] = ACTION_TAP_DANCE_DOUBLE (KC_SPC, KC_ENT) 484 [CT_SE] = ACTION_TAP_DANCE_DOUBLE (KC_SPC, KC_ENT)
429 ,[CT_CLN] = ACTION_TAP_DANCE_FN (dance_cln) 485 ,[CT_CLN] = ACTION_TAP_DANCE_FN (dance_cln)
430 ,[CT_EGG] = ACTION_TAP_DANCE_FN (dance_egg) 486 ,[CT_EGG] = ACTION_TAP_DANCE_FN (dance_egg)
487 ,[CT_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED (dance_flsh_each, dance_flsh_finished, dance_flsh_reset)
431}; 488};
432``` 489```
433 490
@@ -732,7 +789,7 @@ float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
732float goodbye[][2] = SONG(GOODBYE_SOUND); 789float goodbye[][2] = SONG(GOODBYE_SOUND);
733``` 790```
734 791
735Wherein we bind predefined songs (from [audio/song_list.h](/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. 792Wherein we bind predefined songs (from [quantum/audio/song_list.h](/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.
736 793
737So 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: 794So 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:
738 795
@@ -774,7 +831,7 @@ AutoHotkey inserts the Text right of `Send, ` when this combination is pressed.
774 831
775## RGB Under Glow Mod 832## RGB Under Glow Mod
776 833
777![Planck with RGB Underglow](https://raw.githubusercontent.com/yangliu/qmk_firmware/planck-rgb/keyboards/planck/keymaps/yang/planck-with-rgb-underglow.jpg) 834![Planck with RGB Underglow](https://raw.githubusercontent.com/jackhumbert/qmk_firmware/master/keyboards/planck/keymaps/yang/planck-with-rgb-underglow.jpg)
778 835
779Here is a quick demo on Youtube (with NPKC KC60) (https://www.youtube.com/watch?v=VKrpPAHlisY). 836Here is a quick demo on Youtube (with NPKC KC60) (https://www.youtube.com/watch?v=VKrpPAHlisY).
780 837
@@ -799,7 +856,7 @@ The firmware supports 5 different light effects, and the color (hue, saturation,
799 856
800### WS2812 Wiring 857### WS2812 Wiring
801 858
802![WS2812 Wiring](https://raw.githubusercontent.com/yangliu/qmk_firmware/planck-rgb/keyboards/planck/keymaps/yang/WS2812-wiring.jpg) 859![WS2812 Wiring](https://raw.githubusercontent.com/jackhumbert/qmk_firmware/master/keyboards/planck/keymaps/yang/WS2812-wiring.jpg)
803 860
804Please note the USB port can only supply a limited amount of power to the keyboard (500mA by standard, however, modern computer and most usb hubs can provide 700+mA.). According to the data of NeoPixel from Adafruit, 30 WS2812 LEDs require a 5V 1A power supply, LEDs used in this mod should not more than 20. 861Please note the USB port can only supply a limited amount of power to the keyboard (500mA by standard, however, modern computer and most usb hubs can provide 700+mA.). According to the data of NeoPixel from Adafruit, 30 WS2812 LEDs require a 5V 1A power supply, LEDs used in this mod should not more than 20.
805 862