summaryrefslogtreecommitdiff
path: root/keyboard/planck/keymaps/keymap_default.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboard/planck/keymaps/keymap_default.c')
-rw-r--r--keyboard/planck/keymaps/keymap_default.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/keyboard/planck/keymaps/keymap_default.c b/keyboard/planck/keymaps/keymap_default.c
index 4468247b9a..06db767516 100644
--- a/keyboard/planck/keymaps/keymap_default.c
+++ b/keyboard/planck/keymaps/keymap_default.c
@@ -1,6 +1,13 @@
+// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
+// this is the style you want to emulate.
+
#include "planck.h"
#include "backlight.h"
+// Each layer gets a name for readability, which is then used in the keymap matrix below.
+// The underscores don't mean anything - you can have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same length, obviously, and you can also skip them
+// entirely and just use numbers.
#define _QW 0
#define _CM 1
#define _DV 2
@@ -12,7 +19,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
{KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
- {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(2), KC_SPC, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
+ {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_RS), KC_SPC, KC_SPC, MO(_LW), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
[_CM] = { /* Colemak */
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC},
@@ -50,11 +57,11 @@ const uint16_t PROGMEM fn_actions[] = {
};
-const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
switch(id) {
- case 0:
+ case 0:
if (record->event.pressed) {
register_code(KC_RSFT);
backlight_step();
@@ -62,6 +69,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
unregister_code(KC_RSFT);
}
break;
- }
+ }
return MACRO_NONE;
};