From 29de37d5c0ea9fc6b5539ce4493c7b10a2a7f33f Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 11 Jan 2016 16:53:33 -0500 Subject: pwm audio --- keyboard/planck/Makefile | 4 ++-- keyboard/planck/keymaps/keymap_eric.c | 42 +++++++++++++++++++++++++++++++++++ keyboard/planck/keymaps/keymap_lock.c | 10 ++++----- keyboard/planck/planck.c | 29 ++++++++++++++++++++++++ keyboard/planck/planck.h | 5 ++++- 5 files changed, 82 insertions(+), 8 deletions(-) create mode 100644 keyboard/planck/keymaps/keymap_eric.c (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index 485c5f77f6..fdf8c16400 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -122,8 +122,8 @@ COMMAND_ENABLE = yes # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend # NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -# MIDI_ENABLE = YES # MIDI controls +# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = YES # MIDI controls # UNICODE_ENABLE = YES # Unicode # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboard/planck/keymaps/keymap_eric.c b/keyboard/planck/keymaps/keymap_eric.c new file mode 100644 index 0000000000..ffeec5f805 --- /dev/null +++ b/keyboard/planck/keymaps/keymap_eric.c @@ -0,0 +1,42 @@ +#include "planck.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = { + {KC_BSLS, S(KC_SLSH), KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH}, + {TG(1), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS}, + {KC_LGUI, KC_QUOT, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RGUI}, + {KC_LCBR, KC_LCTL, KC_LALT, LT(1, TG(2)), KC_SPC, KC_TAB, KC_ENT, KC_BSPC, LT(1, TG(3)), KC_RALT, KC_RCTL, KC_RCBR} + }, + + [1] = { + {KC_PIPE, KC_COLN, KC_LBRC, KC_RBRC, S(KC_P), S(KC_Y), S(KC_F), S(KC_G), S(KC_C), S(KC_R), S(KC_L), KC_AMPR}, + {KC_TRNS, S(KC_A), S(KC_O), S(KC_E), S(KC_U), S(KC_I), S(KC_D), S(KC_H), S(KC_T), S(KC_N), S(KC_S), KC_GRV}, + {KC_TRNS, KC_SCLN, S(KC_Q), S(KC_J), S(KC_K), S(KC_X), S(KC_B), S(KC_M), S(KC_W), S(KC_V), S(KC_Z), KC_TRNS}, + {S(KC_COMM), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_DOT)} + }, + + [2] = { + {KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO}, + {KC_NO, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_NO}, + {KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS}, + {KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO} + }, + + [3] = { + {KC_EXLM, KC_7, KC_5, KC_3, KC_1, KC_9, KC_0, KC_2, KC_4, KC_6, KC_8, KC_EQL}, + {TG(4), KC_NO, KC_PGUP, KC_HOME, KC_INSERT, KC_NO, KC_NO, BL_DEC, KC_UP, BL_INC, KC_NO, KC_NO}, + {KC_TRNS, KC_NO, KC_PGDN, KC_END, KC_DELETE, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_TRNS}, + {KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO} + }, + + [4] = { + {KC_TILD, KC_HASH, KC_LPRN, KC_RPRN, S(KC_QUOT), KC_PERC, KC_UNDS, KC_CIRC, KC_DLR, KC_AT, KC_ASTR, KC_PLUS}, + {KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO}, + {KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS}, + {KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO} + } +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; \ No newline at end of file diff --git a/keyboard/planck/keymaps/keymap_lock.c b/keyboard/planck/keymaps/keymap_lock.c index cc9be55f64..c2bf0b7d81 100644 --- a/keyboard/planck/keymaps/keymap_lock.c +++ b/keyboard/planck/keymaps/keymap_lock.c @@ -1,5 +1,5 @@ #include "keymap_common.h" -#include "backlight.h" +// #include "backlight.h" #include "action_layer.h" #include "keymap_midi.h" #include @@ -71,7 +71,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) if (record->event.pressed) { // play_note(440, 20); // register_code(KC_RSFT); - backlight_set(BACKLIGHT_LEVELS); + // backlight_set(BACKLIGHT_LEVELS); default_layer_and(0); default_layer_or((1<<5)); @@ -106,9 +106,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // note(0+12, 20); // note(0+24, 20); } else { - // unregister_code(KC_RSFT); - // stop_note(); - backlight_set(0); + unregister_code(KC_RSFT); + // stop_all_notes(); + // backlight_set(0); default_layer_and(0); default_layer_or(0); // note(0+24, 20); diff --git a/keyboard/planck/planck.c b/keyboard/planck/planck.c index b62862af04..a986bd8812 100644 --- a/keyboard/planck/planck.c +++ b/keyboard/planck/planck.c @@ -19,6 +19,35 @@ void * matrix_init_kb(void) { DDRE |= (1<<6); PORTE |= (1<<6); + init_notes(); + + // play_note(((double)261.6*32)*pow(2.0,(36)/12.0), 0xF); + // _delay_ms(50); + + // play_note(((double)261.6*32)*pow(2.0,(48)/12.0), 0xF); + // _delay_ms(25); + // stop_note(((double)261.6*32)*pow(2.0,(48)/12.0)); + + // play_note(((double)261.6*32)*pow(2.0,(48)/12.0), 0xF); + // _delay_ms(25); + // stop_note(((double)261.6*32)*pow(2.0,(48)/12.0)); + + + // stop_note(((double)261.6*32)*pow(2.0,(36)/12.0)); + + + // play_note(((double)261.6*32)*pow(2.0,(62)/12.0), 0xF); + // _delay_ms(50); + // stop_note(((double)261.6*32)*pow(2.0,(62)/12.0)); + + + // play_note(((double)261.6*32)*pow(2.0,(64)/12.0), 0xF); + // _delay_ms(50); + // stop_note(((double)261.6*32)*pow(2.0,(64)/12.0)); + + + + if (matrix_init_user) { (*matrix_init_user)(); } diff --git a/keyboard/planck/planck.h b/keyboard/planck/planck.h index 4e59aef566..32c08f3b0b 100644 --- a/keyboard/planck/planck.h +++ b/keyboard/planck/planck.h @@ -3,8 +3,11 @@ #include "matrix.h" #include "keymap_common.h" -#include "backlight.h" +// #include "backlight.h" #include +#ifdef MIDI_ENABLE + #include +#endif #define PLANCK_MIT( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ -- cgit v1.2.3 From 263344d42f8b16e1cd80c4c871e15fa86208d086 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 11 Jan 2016 18:00:07 -0500 Subject: beeps on lock keymap --- keyboard/planck/keymaps/keymap_lock.c | 32 +++++++++++++++++++++++++++++++- keyboard/planck/planck.c | 29 ----------------------------- 2 files changed, 31 insertions(+), 30 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymaps/keymap_lock.c b/keyboard/planck/keymaps/keymap_lock.c index c2bf0b7d81..c8e1b8fa86 100644 --- a/keyboard/planck/keymaps/keymap_lock.c +++ b/keyboard/planck/keymaps/keymap_lock.c @@ -107,7 +107,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // note(0+24, 20); } else { unregister_code(KC_RSFT); - // stop_all_notes(); + stop_all_notes(); // backlight_set(0); default_layer_and(0); default_layer_or(0); @@ -119,3 +119,33 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } return MACRO_NONE; }; + + +void * matrix_init_user(void) { + init_notes(); + + play_note(((double)261.6*3)*pow(2.0,(36)/12.0), 0xF); + _delay_ms(50); + + play_note(((double)261.6*3)*pow(2.0,(48)/12.0), 0xF); + _delay_ms(25); + stop_note(((double)261.6*3)*pow(2.0,(48)/12.0)); + + play_note(((double)261.6*3)*pow(2.0,(48)/12.0), 0xF); + _delay_ms(25); + stop_note(((double)261.6*3)*pow(2.0,(48)/12.0)); + + + stop_note(((double)261.6*3)*pow(2.0,(36)/12.0)); + + + play_note(((double)261.6*3)*pow(2.0,(62)/12.0), 0xF); + _delay_ms(50); + stop_note(((double)261.6*3)*pow(2.0,(62)/12.0)); + + + play_note(((double)261.6*3)*pow(2.0,(64)/12.0), 0xF); + _delay_ms(50); + stop_note(((double)261.6*3)*pow(2.0,(64)/12.0)); + +} diff --git a/keyboard/planck/planck.c b/keyboard/planck/planck.c index a986bd8812..b62862af04 100644 --- a/keyboard/planck/planck.c +++ b/keyboard/planck/planck.c @@ -19,35 +19,6 @@ void * matrix_init_kb(void) { DDRE |= (1<<6); PORTE |= (1<<6); - init_notes(); - - // play_note(((double)261.6*32)*pow(2.0,(36)/12.0), 0xF); - // _delay_ms(50); - - // play_note(((double)261.6*32)*pow(2.0,(48)/12.0), 0xF); - // _delay_ms(25); - // stop_note(((double)261.6*32)*pow(2.0,(48)/12.0)); - - // play_note(((double)261.6*32)*pow(2.0,(48)/12.0), 0xF); - // _delay_ms(25); - // stop_note(((double)261.6*32)*pow(2.0,(48)/12.0)); - - - // stop_note(((double)261.6*32)*pow(2.0,(36)/12.0)); - - - // play_note(((double)261.6*32)*pow(2.0,(62)/12.0), 0xF); - // _delay_ms(50); - // stop_note(((double)261.6*32)*pow(2.0,(62)/12.0)); - - - // play_note(((double)261.6*32)*pow(2.0,(64)/12.0), 0xF); - // _delay_ms(50); - // stop_note(((double)261.6*32)*pow(2.0,(64)/12.0)); - - - - if (matrix_init_user) { (*matrix_init_user)(); } -- cgit v1.2.3 From 4c100dbbef5b97290cbe6d4846575a940649c958 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 13 Jan 2016 00:25:31 -0500 Subject: note seq, start-up beeps, function beeps --- keyboard/planck/keymaps/keymap_lock.c | 73 +++++++++++++++++++++++++++-------- 1 file changed, 57 insertions(+), 16 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymaps/keymap_lock.c b/keyboard/planck/keymaps/keymap_lock.c index c8e1b8fa86..5e5390b036 100644 --- a/keyboard/planck/keymaps/keymap_lock.c +++ b/keyboard/planck/keymaps/keymap_lock.c @@ -2,6 +2,7 @@ // #include "backlight.h" #include "action_layer.h" #include "keymap_midi.h" +#include "beeps.h" #include const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -63,12 +64,26 @@ uint16_t hextokeycode(int hex) { } } +float walk_up[][2] = { + {440.0*pow(2.0,(60)/12.0), 400}, + {0, 50}, + {440.0*pow(2.0,(67)/12.0), 400}, +}; + +float walk_dn[][2] = { + {440.0*pow(2.0,(67)/12.0), 400}, + {0, 50}, + {440.0*pow(2.0,(60)/12.0), 400}, +}; + 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: if (record->event.pressed) { + + play_notes(&walk_up, 3, false); // play_note(440, 20); // register_code(KC_RSFT); // backlight_set(BACKLIGHT_LEVELS); @@ -107,7 +122,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // note(0+24, 20); } else { unregister_code(KC_RSFT); - stop_all_notes(); + play_notes(&walk_dn, 3, false); // backlight_set(0); default_layer_and(0); default_layer_or(0); @@ -120,32 +135,58 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) return MACRO_NONE; }; +float start_up[][2] = { + {440.0*pow(2.0,(67)/12.0), 600}, + {0, 50}, + {440.0*pow(2.0,(64)/12.0), 400}, + {0, 50}, + {440.0*pow(2.0,(55)/12.0), 400}, + {0, 50}, + {440.0*pow(2.0,(60)/12.0), 400}, + {0, 50}, + {440.0*pow(2.0,(64)/12.0), 1000}, +}; void * matrix_init_user(void) { init_notes(); - play_note(((double)261.6*3)*pow(2.0,(36)/12.0), 0xF); - _delay_ms(50); + play_notes(&start_up, 9, false); + // play_note(((double)261.6*3)*pow(2.0,(36)/12.0), 0xF); + // _delay_ms(50); - play_note(((double)261.6*3)*pow(2.0,(48)/12.0), 0xF); - _delay_ms(25); - stop_note(((double)261.6*3)*pow(2.0,(48)/12.0)); + // play_note(((double)261.6*3)*pow(2.0,(48)/12.0), 0xF); + // _delay_ms(25); + // stop_note(((double)261.6*3)*pow(2.0,(48)/12.0)); - play_note(((double)261.6*3)*pow(2.0,(48)/12.0), 0xF); - _delay_ms(25); - stop_note(((double)261.6*3)*pow(2.0,(48)/12.0)); + // play_note(((double)261.6*3)*pow(2.0,(48)/12.0), 0xF); + // _delay_ms(25); + // stop_note(((double)261.6*3)*pow(2.0,(48)/12.0)); - stop_note(((double)261.6*3)*pow(2.0,(36)/12.0)); + // stop_note(((double)261.6*3)*pow(2.0,(36)/12.0)); - play_note(((double)261.6*3)*pow(2.0,(62)/12.0), 0xF); - _delay_ms(50); - stop_note(((double)261.6*3)*pow(2.0,(62)/12.0)); + // play_note(((double)261.6*3)*pow(2.0,(62)/12.0), 0xF); + // _delay_ms(50); + // stop_note(((double)261.6*3)*pow(2.0,(62)/12.0)); - play_note(((double)261.6*3)*pow(2.0,(64)/12.0), 0xF); - _delay_ms(50); - stop_note(((double)261.6*3)*pow(2.0,(64)/12.0)); + // play_note(((double)261.6*3)*pow(2.0,(64)/12.0), 0xF); + // _delay_ms(50); + // stop_note(((double)261.6*3)*pow(2.0,(64)/12.0)); } + + +// void * matrix_scan_user(void) { +// if (layer_state & (1<<2)) { +// if (!playing_notes) +// play_notes(&start_up, 9, true); +// } else if (layer_state & (1<<3)) { +// if (!playing_notes) +// play_notes(&start_up, 9, true); +// } else { +// if (playing_notes) +// stop_all_notes(); +// } +// } \ No newline at end of file -- cgit v1.2.3 From 6e3c36360ed291b9ca2bd014571236308a933d0c Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 15 Jan 2016 23:10:30 -0500 Subject: sounds --- keyboard/planck/keymaps/keymap_lock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymaps/keymap_lock.c b/keyboard/planck/keymaps/keymap_lock.c index 5e5390b036..7a99b57c9d 100644 --- a/keyboard/planck/keymaps/keymap_lock.c +++ b/keyboard/planck/keymaps/keymap_lock.c @@ -67,13 +67,13 @@ uint16_t hextokeycode(int hex) { float walk_up[][2] = { {440.0*pow(2.0,(60)/12.0), 400}, {0, 50}, - {440.0*pow(2.0,(67)/12.0), 400}, + {440.0*pow(2.0,(67)/12.0), 600}, }; float walk_dn[][2] = { {440.0*pow(2.0,(67)/12.0), 400}, {0, 50}, - {440.0*pow(2.0,(60)/12.0), 400}, + {440.0*pow(2.0,(60)/12.0), 600}, }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -- cgit v1.2.3 From 4faddd3449ca553e0d8b02ba91f9a34b534eebe7 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sat, 16 Jan 2016 00:06:51 -0500 Subject: working --- keyboard/planck/keymaps/keymap_lock.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymaps/keymap_lock.c b/keyboard/planck/keymaps/keymap_lock.c index cc9be55f64..bc81adcf97 100644 --- a/keyboard/planck/keymaps/keymap_lock.c +++ b/keyboard/planck/keymaps/keymap_lock.c @@ -1,3 +1,5 @@ +// USING_MIDI +// USING_BACKLIGHT #include "keymap_common.h" #include "backlight.h" #include "action_layer.h" -- cgit v1.2.3 From dfe7004bc545ff7247a0dbef4788b9e1952f9c5d Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sat, 16 Jan 2016 00:51:24 -0500 Subject: new keymap folder structure and makefile magic --- keyboard/planck/Makefile | 13 ++- keyboard/planck/README.md | 126 ++++++++++++++++-------- keyboard/planck/keymaps/alexey.c | 51 ++++++++++ keyboard/planck/keymaps/angerthosenear.c | 50 ++++++++++ keyboard/planck/keymaps/austin.c | 50 ++++++++++ keyboard/planck/keymaps/charlie.c | 54 ++++++++++ keyboard/planck/keymaps/daniel.c | 48 +++++++++ keyboard/planck/keymaps/david.c | 76 ++++++++++++++ keyboard/planck/keymaps/default.c | 68 +++++++++++++ keyboard/planck/keymaps/dzobert.c | 49 +++++++++ keyboard/planck/keymaps/gabriel.c | 108 ++++++++++++++++++++ keyboard/planck/keymaps/jack.c | 50 ++++++++++ keyboard/planck/keymaps/joe.c | 88 +++++++++++++++++ keyboard/planck/keymaps/keymap_alexey.c | 51 ---------- keyboard/planck/keymaps/keymap_angerthosenear.c | 50 ---------- keyboard/planck/keymaps/keymap_austin.c | 50 ---------- keyboard/planck/keymaps/keymap_charlie.c | 54 ---------- keyboard/planck/keymaps/keymap_daniel.c | 48 --------- keyboard/planck/keymaps/keymap_david.c | 76 -------------- keyboard/planck/keymaps/keymap_default.c | 68 ------------- keyboard/planck/keymaps/keymap_dzobert.c | 49 --------- keyboard/planck/keymaps/keymap_gabriel.c | 108 -------------------- keyboard/planck/keymaps/keymap_jack.c | 50 ---------- keyboard/planck/keymaps/keymap_joe.c | 88 ----------------- keyboard/planck/keymaps/keymap_kyle.c | 49 --------- keyboard/planck/keymaps/keymap_leo.c | 46 --------- keyboard/planck/keymaps/keymap_lock.c | 123 ----------------------- keyboard/planck/keymaps/keymap_max.c | 49 --------- keyboard/planck/keymaps/keymap_monkey.c | 76 -------------- keyboard/planck/keymaps/keymap_numpad.c | 26 ----- keyboard/planck/keymaps/kyle.c | 49 +++++++++ keyboard/planck/keymaps/leo.c | 46 +++++++++ keyboard/planck/keymaps/lock.c | 123 +++++++++++++++++++++++ keyboard/planck/keymaps/max.c | 49 +++++++++ keyboard/planck/keymaps/monkey.c | 76 ++++++++++++++ keyboard/planck/keymaps/numpad.c | 26 +++++ keyboard/planck/keymaps/test/default.c | 123 +++++++++++++++++++++++ 37 files changed, 1282 insertions(+), 1102 deletions(-) create mode 100644 keyboard/planck/keymaps/alexey.c create mode 100644 keyboard/planck/keymaps/angerthosenear.c create mode 100644 keyboard/planck/keymaps/austin.c create mode 100644 keyboard/planck/keymaps/charlie.c create mode 100644 keyboard/planck/keymaps/daniel.c create mode 100644 keyboard/planck/keymaps/david.c create mode 100644 keyboard/planck/keymaps/default.c create mode 100644 keyboard/planck/keymaps/dzobert.c create mode 100644 keyboard/planck/keymaps/gabriel.c create mode 100644 keyboard/planck/keymaps/jack.c create mode 100644 keyboard/planck/keymaps/joe.c delete mode 100644 keyboard/planck/keymaps/keymap_alexey.c delete mode 100644 keyboard/planck/keymaps/keymap_angerthosenear.c delete mode 100644 keyboard/planck/keymaps/keymap_austin.c delete mode 100644 keyboard/planck/keymaps/keymap_charlie.c delete mode 100644 keyboard/planck/keymaps/keymap_daniel.c delete mode 100644 keyboard/planck/keymaps/keymap_david.c delete mode 100644 keyboard/planck/keymaps/keymap_default.c delete mode 100644 keyboard/planck/keymaps/keymap_dzobert.c delete mode 100644 keyboard/planck/keymaps/keymap_gabriel.c delete mode 100644 keyboard/planck/keymaps/keymap_jack.c delete mode 100644 keyboard/planck/keymaps/keymap_joe.c delete mode 100644 keyboard/planck/keymaps/keymap_kyle.c delete mode 100644 keyboard/planck/keymaps/keymap_leo.c delete mode 100644 keyboard/planck/keymaps/keymap_lock.c delete mode 100644 keyboard/planck/keymaps/keymap_max.c delete mode 100644 keyboard/planck/keymaps/keymap_monkey.c delete mode 100644 keyboard/planck/keymaps/keymap_numpad.c create mode 100644 keyboard/planck/keymaps/kyle.c create mode 100644 keyboard/planck/keymaps/leo.c create mode 100644 keyboard/planck/keymaps/lock.c create mode 100644 keyboard/planck/keymaps/max.c create mode 100644 keyboard/planck/keymaps/monkey.c create mode 100644 keyboard/planck/keymaps/numpad.c create mode 100644 keyboard/planck/keymaps/test/default.c (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index 485c5f77f6..f3537b2c7a 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -54,10 +54,19 @@ SRC = planck.c \ backlight.c ifdef KEYMAP - SRC := keymaps/keymap_$(KEYMAP).c $(SRC) +ifneq ("$(wildcard keymaps/$(KEYMAP).c)","") + KEYMAP_FILE = keymaps/$(KEYMAP).c else - SRC := keymaps/keymap_default.c $(SRC) + KEYMAP_FILE = keymaps/$(KEYMAP)/default.c endif +else +ifneq ("$(wildcard keymaps/default.c)","") + KEYMAP_FILE = keymaps/default.c +else + KEYMAP_FILE = keymaps/default/default.c +endif +endif +SRC := $(KEYMAP_FILE) $(SRC) CONFIG_H = config.h diff --git a/keyboard/planck/README.md b/keyboard/planck/README.md index 0003e765d4..5c3a52498a 100644 --- a/keyboard/planck/README.md +++ b/keyboard/planck/README.md @@ -3,29 +3,42 @@ Planck keyboard firmware DIY/Assembled compact ortholinear 40% keyboard by [Ortholinear Keyboards](http://ortholinearkeyboards.com). ## Quantum MK Firmware + You have access to a bunch of goodies! Check out the Makefile to enable/disable some of the features. Uncomment the `#` to enable them. Setting them to `no` does nothing and will only confuse future you. BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality MIDI_ENABLE = yes # MIDI controls - # UNICODE_ENABLE = yes # Unicode support + # UNICODE_ENABLE = yes # Unicode support - this is commented out, just as an example. You have to use #, not // BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID -### Mod shortcuts +## Quick aliases to common actions + +Your keymap can include shortcuts to common operations (called "function actions" in tmk). + +### Switching and toggling layers + +`MO(layer)` - momentary switch to *layer*. As soon as you let go of the key, the layer is deactivated and you pop back out to the previous layer. When you apply this to a key, that same key must be set as `KC_TRNS` on the destination layer. Otherwise, you won't make it back to the original layer when you release the key (and you'll get a keycode sent). You can only switch to layers *above* your current layer. If you're on layer 0 and you use `MO(1)`, that will switch to layer 1 just fine. But if you include `MO(3)` on layer 5, that won't do anything for you -- because layer 3 is lower than layer 5 on the stack. + +`LT(layer, kc)` - momentary switch to *layer* when held, and *kc* when tapped. Like `MO()`, this only works upwards in the layer stack (`layer` must be higher than the current layer). + +`TG(layer)` - toggles a layer on or off. As with `MO()`, you should set this key as `KC_TRNS` in the destination layer so that tapping it again actually toggles back to the original layer. Only works upwards in the layer stack. -* `LSFT(kc)` - applies left shift to *kc* - `S(kc)` is an alias -* `RSFT(kc)` - applies right shift to *kc* -* `LCTL(kc)` - applies left control to *kc* -* `RCTL(kc)` - applies right control to *kc* -* `LALT(kc)` - applies left alt to *kc* -* `RALT(kc)` - applies right alt to *kc* -* `LGUI(kc)` - applies left gui (command/win) to *kc* -* `RGUI(kc)` - applies right gui (command/win) to *kc* +### Fun with modifier keys -You can also use more than one, like this: +* `LSFT(kc)` - applies left Shift to *kc* (keycode) - `S(kc)` is an alias +* `RSFT(kc)` - applies right Shift to *kc* +* `LCTL(kc)` - applies left Control to *kc* +* `RCTL(kc)` - applies right Control to *kc* +* `LALT(kc)` - applies left Alt to *kc* +* `RALT(kc)` - applies right Alt to *kc* +* `LGUI(kc)` - applies left GUI (command/win) to *kc* +* `RGUI(kc)` - applies right GUI (command/win) to *kc* - LALT(LGUI(KC_ESC)) +You can also chain these, like this: -The following shortcuts automatically add `LSFT()` to keycodes to get commonly used symbols. Their long names (see `quantum/keymap_common.h`) are also availble. + LALT(LCTL(KC_DEL)) -- this makes a key that sends Alt, Control, and Delete in a single keypress. + +The following shortcuts automatically add `LSFT()` to keycodes to get commonly used symbols. Their long names are also available and documented in `/quantum/keymap_common.h`. KC_TILD ~ KC_EXLM ! @@ -45,31 +58,71 @@ The following shortcuts automatically add `LSFT()` to keycodes to get commonly u KC_PIPE | KC_COLN : -### Function shortcuts +`MT(mod, kc)` - is *mod* (modifier key - MOD_LCTL, MOD_LSFT) when held, and *kc* when tapped. In other words, you can have a key that sends Esc (or the letter O or whatever) when you tap it, but works as a Control key or a Shift key when you hold it down. + +These are the values you can use for the `mod` in `MT()` (right-hand modifiers are not available): + + * MOD_LCTL + * MOD_LSFT + * MOD_LALT + * MOD_LGUI -Instead of using `FNx`, you can use `F(x)` - the benefit here is being able to use more than 32 function layers (up to 4096), if you happen to need them. +These can also be combined like `MOD_LCTL | MOD_LSFT` e.g. `MT(MOD_LCTL | MOD_LSFT, KC_ESC)` which would activate Control and Shift when held, and send Escape when tapped. -There are also keycode shortcuts for common actions: +We've added shortcuts to make common modifier/tap (mod-tap) mappings more compact: -* `MO(layer)` - momentary switch to *layer* -* `DF(layer)` - sets default layer to *layer* -* `TG(layer)` - toggle between the current layer and *layer* -* `MT(mod, kc)` - is *mod* when held, and *kc* when tapped * `CTL_T(kc)` - is LCTL when held and *kc* when tapped * `SFT_T(kc)` - is LSFT when held and *kc* when tapped * `ALT_T(kc)` - is LALT when held and *kc* when tapped * `GUI_T(kc)` - is LGUI when held and *kc* when tapped - * `ALL_T(kc)` - is Hyper (all mods) when held and *kc* when tapped -* `LT(layer, kc)` - momentary switch to *layer* when held, and *kc* when tapped + * `ALL_T(kc)` - is Hyper (all mods) when held and *kc* when tapped. To read more about what you can do with a Hyper key, see [this blog post by Brett Terpstra](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/) + +### Temporarily setting the default layer + +`DF(layer)` - sets default layer to *layer*. The default layer is the one at the "bottom" of the layer stack - the ultimate fallback layer. This currently does not persist over power loss. When you plug the keyboard back in, layer 0 will always be the default. It is theoretically possible to work around that, but that's not what `DF` does. + +### Remember: These are just aliases -These functions work the same way that their `ACTION_*` functions do, and will require KC_TRNS on the layer being switched to - check out the default keymap for an example. +These functions work the same way that their `ACTION_*` functions do - they're just quick aliases. To dig into all of the tmk ACTION_* functions, please see the [TMK documentation](https://github.com/jackhumbert/qmk_firmware/blob/master/tmk_core/doc/keymap.md#2-action). -### Additional keycodes for software-implemented layouts (Colemak, Dvorak, etc) +Instead of using `FNx` when defining `ACTION_*` functions, you can use `F(x)` - the benefit here is being able to use more than 32 function actions (up to 4096), if you happen to need them. + +## Macro shortcuts: Send a whole string when pressing just one key + +Instead of using the `ACTION_MACRO` function, you can simply use `M(n)` to access macro *n* - *n* will get passed into the `action_get_macro` as the `id`, and you can use a switch statement to trigger it. This gets called on the keydown and keyup, so you'll need to use an if statement testing `record->event.pressed` (see keymaps/default.c). + +```c +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // this is the function signature -- just copy/paste it into your keymap file as it is. +{ + switch(id) { + case 0: // this would trigger when you hit a key mapped as M(0) + if (record->event.pressed) { + return MACRO( I(255), T(H), T(E), T(L), T(L), W(255), T(O), END ); // this sends the string 'hello' when the macro executes + } + break; + } + return MACRO_NONE; +}; +``` +A macro can include the following commands: + +* I() change interval of stroke in milliseconds. +* D() press key. +* U() release key. +* T() type key(press and release). +* W() wait (milliseconds). +* END end mark. + +So above you can see the stroke interval changed to 255ms between each keystroke, then a bunch of keys being typed, waits a while, then the macro ends. + +Note: Using macros to have your keyboard send passwords for you is a bad idea. + +### Additional keycode aliases for software-implemented layouts (Colemak, Dvorak, etc) Everything is assuming you're in Qwerty (in software) by default, but there is built-in support for using a Colemak or Dvorak layout by including this at the top of your keymap: - #include "keymap_.h" - + #include "keymap_.h" + Where is "colemak" or "dvorak". After including this line, you will get access to: * `CM_*` for all of the Colemak-equivalent characters @@ -79,19 +132,15 @@ These implementations assume you're using Colemak or Dvorak on your OS, not on y To give an example, if you're using software-implemented Colemak, and want to get an `F`, you would use `CM_F` - `KC_F` under these same circumstances would result in `T`. -### Additional language support +## Additional language support -In `quantum/keymap_extras/`, you'll see various language files - these work the same way as the alternative layout ones do. Most are defined by their two letter country/language code followed by an underscore and a 4-letter abbrivation of its name. `FR_UGRV` which will result in a `ù` when using a software-implemented AZERTY layout. It's currently difficult to send such characters in just the firmware (but it's being worked on - see Unicode support). +In `quantum/keymap_extras/`, you'll see various language files - these work the same way as the alternative layout ones do. Most are defined by their two letter country/language code followed by an underscore and a 4-letter abbreviation of its name. `FR_UGRV` which will result in a `ù` when using a software-implemented AZERTY layout. It's currently difficult to send such characters in just the firmware (but it's being worked on - see Unicode support). -### Unicode support +## Unicode support You can currently send 4 hex digits with your OS-specific modifier key (RALT for OSX with the "Unicode Hex Input" layout) - this is currently limited to supporting one OS at a time, and requires a recompile for switching. 8 digit hex codes are being worked on. The keycode function is `UC(n)`, where *n* is a 4 digit hexidecimal. Enable from the Makefile. -### Macro shortcuts - -Instead of using the `ACTION_MACRO` function, you can simply use `M(n)` to access macro *n* - *n* will get passed into the `action_get_macro` as the `id`, and you can use a switch statement to filter them. This gets called on the keydown and keyup, so you'll need to use an if statement testing `record->event.pressed` (see keymap_default.c). - -### Other keyboard shortcut keycodes +## Other firmware shortcut keycodes * `RESET` - puts the MCU in DFU mode for flashing new firmware (with `make dfu`) * `DEBUG` - the firmware into debug mode - you'll need hid_listen to see things @@ -105,12 +154,11 @@ Instead of using the `ACTION_MACRO` function, you can simply use `M(n)` to acces Enable the backlight from the Makefile. - -### MIDI functionalty +## MIDI functionalty This is still a WIP, but check out `quantum/keymap_midi.c` to see what's happening. Enable from the Makefile. -### Bluetooth functionality +## Bluetooth functionality This requires [some hardware changes](https://www.reddit.com/r/MechanicalKeyboards/comments/3psx0q/the_planck_keyboard_with_bluetooth_guide_and/?ref=search_posts), but can be enabled via the Makefile. The firmware will still output characters via USB, so be aware of this when charging via a computer. It would make sense to have a switch on the Bluefruit to turn it off at will. @@ -124,13 +172,13 @@ Depending on which keymap you would like to use, you will have to compile slight To build with the default keymap, simply run `make`. ### Other Keymaps -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `keymap_.c` and see keymap document (you can find in top README.md) and existent keymap files. +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` and see keymap document (you can find in top README.md) and existent keymap files. To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: ``` $ make KEYMAP=[default|jack|] ``` -Keymaps follow the format **__keymap\_\.c__** and are stored in the `keymaps` folder. +Keymaps follow the format **__.c__** and are stored in the `keymaps` folder. ### Notable forks (which some of the keymap files are from) - [Shane's Fork](https://github.com/shanecelis/tmk_keyboard/tree/master/keyboard/planck) diff --git a/keyboard/planck/keymaps/alexey.c b/keyboard/planck/keymaps/alexey.c new file mode 100644 index 0000000000..89af4112c6 --- /dev/null +++ b/keyboard/planck/keymaps/alexey.c @@ -0,0 +1,51 @@ +#include "keymap_common.h" +#include "planck.h" +#include "backlight.h" + +#define _QW 0 +#define _LW 1 +#define _RS 2 + +// This layout tries to imitate the Atreus keyboard + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_QW] = { /* Qwerty */ + {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, MO(_LW)}, + {KC_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_TRNS}, + {M(0), KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_SPC, KC_SPC, MO(_RS), KC_MINS, KC_QUOT, KC_ENT, KC_TRNS} +}, +[_RS] = { /* RAISE */ + {KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_PGUP, KC_7, KC_8, KC_9, KC_ASTR, KC_TRNS}, + {KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_PGDN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS}, + {KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_INS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_EQL, KC_TRNS} +}, +[_LW] = { /* LOWER */ + {KC_TRNS, KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, + {KC_TRNS, KC_DELETE, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_TRNS, KC_F4, KC_F5, KC_F6, KC_F11, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F12, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, KC_TRNS} +} +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +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: + if (record->event.pressed) { + register_code(KC_RSFT); + backlight_step(); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + diff --git a/keyboard/planck/keymaps/angerthosenear.c b/keyboard/planck/keymaps/angerthosenear.c new file mode 100644 index 0000000000..cdf60632e4 --- /dev/null +++ b/keyboard/planck/keymaps/angerthosenear.c @@ -0,0 +1,50 @@ +#include "keymap_common.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* Qwerty */ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT}, + {KC_LCTL, KC_LGUI, KC_LALT, BL_STEP, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + // Space is repeated to accommadate for both spacebar wiring positions +}, +[1] = { /* WASD + NumPad */ + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_PSLS, KC_PMNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PAST, KC_PPLS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PDOT, KC_PENT, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_SPC, KC_P0, FUNC(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} +}, +[2] = { /* RAISE */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS}, + {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {KC_TRNS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[3] = { /* LOWER */ + {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_DEL}, + {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END} +} +}; + + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER + + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + +}; + +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: + return MACRODOWN(T(CM_T), END); + break; + } + return MACRO_NONE; +}; diff --git a/keyboard/planck/keymaps/austin.c b/keyboard/planck/keymaps/austin.c new file mode 100644 index 0000000000..49fc98a587 --- /dev/null +++ b/keyboard/planck/keymaps/austin.c @@ -0,0 +1,50 @@ +#include "keymap_common.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* Qwerty */ + {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}, + {BL_STEP, KC_LGUI, KC_LALT, KC_LCTL, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + // Space is repeated to accommadate for both spacebar wiring positions +}, +[1] = { /* 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}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, + {KC_FN3, KC_LGUI, KC_LALT, KC_LCTL, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[2] = { /* RAISE */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {KC_TRNS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[3] = { /* LOWER */ + {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, + {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +} +}; + + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER + + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + +}; + +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: + return MACRODOWN(T(CM_T), END); + break; + } + return MACRO_NONE; +}; diff --git a/keyboard/planck/keymaps/charlie.c b/keyboard/planck/keymaps/charlie.c new file mode 100644 index 0000000000..88f454d789 --- /dev/null +++ b/keyboard/planck/keymaps/charlie.c @@ -0,0 +1,54 @@ +#include "keymap_common.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = { /* Native */ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, FUNC(2)}, + {KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_TAB, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, + {KC_DEL, KC_LCTL, KC_NO, KC_LSFT, KC_LALT, KC_SPC, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + [1] = { /* QWERTY->PHOTOSHOP */ + {KC_DELETE, KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, FUNC(1)}, + {KC_O, KC_G, KC_S, KC_U, KC_T, FUNC(27), KC_F21, KC_F10, KC_F11, KC_F7, KC_F8, KC_F9}, + {KC_TAB, FUNC(4), FUNC(5), FUNC(6), KC_F1, FUNC(7), KC_F18, KC_F19, KC_F23, KC_F20, KC_F22, FUNC(9)}, + {KC_COMM, KC_DOT, KC_R, FUNC(11), FUNC(3), KC_SPC, FUNC(12), KC_F2, FUNC(8), KC_F3, KC_F14} + }, + [2] = { /* 2: FUNC(3 PHOTOSHOP */ + {KC_ESC, FUNC(25), FUNC(26), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO}, + {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, FUNC(19), FUNC(20), FUNC(21)}, + {KC_C, KC_NO, FUNC(22), FUNC(5), KC_NO, FUNC(23), KC_NO, KC_NO, KC_NO, KC_NO, FUNC(13), KC_NO}, + {FUNC(14), FUNC(15), FUNC(16), FUNC(17), FUNC(3), KC_SPC, FUNC(18), KC_NO, KC_NO, KC_F24, KC_NO} + } +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_DEFAULT_LAYER_SET(0), // set Qwerty layout + [2] = ACTION_DEFAULT_LAYER_SET(1), // set Photoshop presets + [3] = ACTION_LAYER_MOMENTARY(2), // Photoshop function layer + + [4] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL | MOD_LALT, KC_F9), // photo folder AHK + [5] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL, KC_I), // select inverse + [6] = ACTION_MODS_KEY(MOD_LSFT, KC_M), // marquee select + [7] = ACTION_MODS_KEY(MOD_LALT, KC_BSPC), // fill + [8] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL | MOD_LALT, KC_X), // warp + [9] = ACTION_MODS_KEY(MOD_LCTL | MOD_LALT | MOD_LSFT, KC_F12), // merge all new layer + [10] = ACTION_MODS_KEY(MOD_LCTL, KC_MINS), // zoom out + [11] = ACTION_MODS_KEY(MOD_LCTL, KC_H), // RBG sliders + [12] = ACTION_MODS_KEY(MOD_LCTL, KC_S), // save + [13] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL, KC_F5), // layer mask from transparancy + [14] = ACTION_MODS_KEY(MOD_LCTL, KC_F2), // stroke + [15] = ACTION_MODS_KEY(MOD_LCTL | MOD_LSFT, KC_F2), // stroke layer + [16] = ACTION_MODS_KEY(MOD_LCTL, KC_0), // zoom 0 + [17] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL, KC_H), // HSV sliders + [18] = ACTION_MODS_KEY(MOD_LCTL | MOD_LSFT, KC_S), // save as + [19] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL | MOD_LALT, KC_F7), // gaussian blur + [20] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL | MOD_LALT, KC_F8), // motion blur + [21] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL, KC_X), // liquify filter + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), // prev layer blending + [23] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL, KC_BSPC), // KC_NOrmal layer blending + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), // next layer blending + [25] = ACTION_MODS_KEY(MOD_LCTL, KC_Z), // step back + [26] = ACTION_MODS_KEY(MOD_LCTL, KC_Y), // step forward + [27] = ACTION_MODS_KEY(MOD_LCTL, KC_R), // rasterize + +}; diff --git a/keyboard/planck/keymaps/daniel.c b/keyboard/planck/keymaps/daniel.c new file mode 100644 index 0000000000..234e48ff4a --- /dev/null +++ b/keyboard/planck/keymaps/daniel.c @@ -0,0 +1,48 @@ +#include "keymap_common.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* Qwerty */ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_TAB, 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_RSFT}, + {FUNC(3), KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + // Space is repeated to accommadate for both spacebar wiring positions +}, +[1] = { /* RAISE */ + {KC_GRV, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_EQL}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, S(KC_MINS), KC_BSLS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[2] = { /* LOWER */ + {S(KC_GRV), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, S(KC_EQL)}, + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, + {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_ENT}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[3] = { /* Qwerty */ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL}, + {KC_TAB, 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_RSFT}, + {KC_TRNS, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + // Space is repeated to accommadate for both spacebar wiring positions +} +}; + + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(1), // to RAISE + [2] = ACTION_LAYER_MOMENTARY(2), // to LOWER + [3] = ACTION_LAYER_MOMENTARY(3) // to LOWER +}; + +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: + return MACRODOWN(T(CM_T), END); + break; + } + return MACRO_NONE; +}; diff --git a/keyboard/planck/keymaps/david.c b/keyboard/planck/keymaps/david.c new file mode 100644 index 0000000000..f483084801 --- /dev/null +++ b/keyboard/planck/keymaps/david.c @@ -0,0 +1,76 @@ +#include "keymap_common.h" +#include "beeps.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* Qwerty */ + {KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_A, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ESC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, + {M(10), KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + // Space is repeated to accommadate for both spacebar wiring positions +}, +[1] = { /* 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}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, + {KC_FN3, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[2] = { /* RAISE */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TRNS, FUNC(3), FUNC(4), RESET, M(0), M(1), M(2), KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {KC_TRNS, KC_F11, KC_F12, M(0), M(1), M(2), M(3), M(4), M(5), M(6), M(7), KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[3] = { /* LOWER */ + {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, + {KC_TRNS, FUNC(3), FUNC(4), RESET, M(0), M(1), M(2), S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +} +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER + + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + if (record->event.pressed) { + switch(id) { + case 0: + true_note(12, 12, 20); + break; + case 1: + true_note(14, 14, 20); + break; + case 2: + true_note(16, 16, 20); + break; + case 3: + true_note(17, 17, 20); + break; + case 4: + true_note(19, 19, 20); + break; + case 5: + true_note(21, 21, 20); + break; + case 6: + true_note(23, 23, 20); + break; + case 7: + true_note(24, 24, 20); + break; + case 10: + + break; + } + } + return MACRO_NONE; +}; diff --git a/keyboard/planck/keymaps/default.c b/keyboard/planck/keymaps/default.c new file mode 100644 index 0000000000..49670dafd3 --- /dev/null +++ b/keyboard/planck/keymaps/default.c @@ -0,0 +1,68 @@ +// 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 +#define _LW 3 +#define _RS 4 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_QW] = { /* Qwerty */ + {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(_LW), KC_SPC, KC_SPC, MO(_RS), 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}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[_DV] = { /* Dvorak */ + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, + {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, + {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[_RS] = { /* RAISE */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[_LW] = { /* LOWER */ + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +} +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +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: + if (record->event.pressed) { + register_code(KC_RSFT); + backlight_step(); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboard/planck/keymaps/dzobert.c b/keyboard/planck/keymaps/dzobert.c new file mode 100644 index 0000000000..665e9c20b6 --- /dev/null +++ b/keyboard/planck/keymaps/dzobert.c @@ -0,0 +1,49 @@ +#include "keymap_common.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* Qwerty */ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_TAB}, + {KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_BSPC}, + {KC_LALT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, + {KC_FN4, KC_RSFT, KC_LGUI, KC_LSFT, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + // Space is repeated to accommadate for both spacebar wiring positions +}, +[1] = { /* Colemak */ + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_TAB}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_BSPC}, + {KC_LALT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, + {KC_FN3, KC_RSFT, KC_LGUI, KC_LSFT, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[2] = { /* RAISE */ + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, + {KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_DEL}, + {KC_TRNS, KC_GRV, KC_MINS, KC_EQL, KC_QUOT, S(KC_QUOT), S(KC_LBRC), S(KC_RBRC), KC_LBRC, KC_RBRC, KC_BSLS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_HOME, KC_PGUP, KC_PGDN, KC_END} +}, +[3] = { /* LOWER */ + {KC_POWER,KC_PSCR, KC_SLCK, KC_PAUSE, KC_NLCK, KC_EXECUTE, KC_MENU, KC_APP, KC_7, KC_8, KC_9, KC_KP_SLASH}, + {KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_CAPS, KC_CANCEL, KC_UNDO, KC_AGAIN, KC_4, KC_5, KC_6, KC_KP_ASTERISK}, + {KC_TRNS, KC_INSERT,KC_CUT, KC_COPY, KC_PASTE, KC_BSLS, KC_9, KC_0, KC_1, KC_2, KC_3, KC_KP_MINUS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_KP_DOT, KC_KP_ENTER, KC_KP_PLUS} +} +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER + + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + +}; + +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: + return MACRODOWN(T(CM_T), END); + break; + } + return MACRO_NONE; +}; \ No newline at end of file diff --git a/keyboard/planck/keymaps/gabriel.c b/keyboard/planck/keymaps/gabriel.c new file mode 100644 index 0000000000..805484488b --- /dev/null +++ b/keyboard/planck/keymaps/gabriel.c @@ -0,0 +1,108 @@ +#include "planck.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 _LW 1 +#define _RS 2 +#define _FN 3 + +// This a slightly modified 'default' keymap that's closer to the Mac keyboard layout. I like the position +// of 'esc' and 'tab' better this way. I also got rid of the backlighting control key and the dvorak and +// colemak layers. I added an 'fn' layer that makes the 'bspc' a forward delete (like on OSX). +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* MIT Layout (QWERTY layer) + * + * ,-----------------------------------------------------------------------. + * | esc | q | w | e | r | t | y | u | i | o | p | bspc| + * |-----------------------------------------------------------------------| + * | tab | a | s | d | f | g | h | j | k | l | ; | ' | + * |-----------------------------------------------------------------------| + * |shift| z | x | c | v | b | n | m | , | . | / |enter| + * |-----------------------------------------------------------------------| + * | fn | ctl | alt | cmd |lower| spc |raise|left |down | up |right| + * `-----------------------------------------------------------------------' + */ +[_QW] = { /* QWERTY */ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_TAB, 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 }, + {MO(_FN), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +/* MIT Layout (Raised layer) + * + * ,-----------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |-----------------------------------------------------------------------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | - | + | [ | ] | | | + * |-----------------------------------------------------------------------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------' + */ +[_RS] = { /* RAISE */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_PLUS, KC_LBRC, KC_RBRC, KC_PIPE}, + {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} +}, +/* MIT Layout (Lowered layer) + * + * ,-----------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |-----------------------------------------------------------------------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | = | { | } | \ | + * |-----------------------------------------------------------------------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------' + */ +[_LW] = { /* LOWER */ + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_EQL, KC_LCBR, KC_RCBR, KC_BSLS}, + {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} +}, +/* MIT Layout (FN layer) + * + * ,-----------------------------------------------------------------------. + * | | | | | | | | | | | | del | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | |home |pgdn |pgup | end | + * `-----------------------------------------------------------------------' + */ +[_FN] = { /* FUNCTION */ + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DELT}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END} +} +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +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: + if (record->event.pressed) { + register_code(KC_RSFT); + backlight_step(); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboard/planck/keymaps/jack.c b/keyboard/planck/keymaps/jack.c new file mode 100644 index 0000000000..0b93bba33f --- /dev/null +++ b/keyboard/planck/keymaps/jack.c @@ -0,0 +1,50 @@ +#include "keymap_common.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* Jack soft-coded colemak */ + {KC_TAB, CM_Q, CM_W, CM_F, CM_P, CM_G, CM_J, CM_L, CM_U, CM_Y, CM_SCLN, KC_BSPC}, + {KC_ESC, CM_A, CM_R, CM_S, CM_T, CM_D, CM_H, CM_N, CM_E, CM_I, CM_O, KC_QUOT}, + {KC_LSFT, CM_Z, CM_X, CM_C, CM_V, CM_B, CM_K, CM_M, CM_COMM, CM_DOT, CM_SLSH, KC_ENT}, + {BL_STEP, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + // Space is repeated to accommadate for both spacebar wiring positions +}, +[1] = { /* Jack hard-coded 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}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, + {KC_FN3, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[2] = { /* Jack RAISE */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {KC_TRNS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[3] = { /* Jack LOWER */ + {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, + {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +} +}; + + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay + [2] = ACTION_LAYER_MOMENTARY(3), // to Fn overlay + + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + +}; + +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: + return MACRODOWN(T(CM_T), END); + break; + } + return MACRO_NONE; +}; diff --git a/keyboard/planck/keymaps/joe.c b/keyboard/planck/keymaps/joe.c new file mode 100644 index 0000000000..5b7bbe2bbb --- /dev/null +++ b/keyboard/planck/keymaps/joe.c @@ -0,0 +1,88 @@ +#include "keymap_common.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = { /* Joe colemak */ + {F(3), KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS}, + {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT }, + {F(15), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_UP, KC_QUOT}, + {KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, F(1), KC_SPC, KC_SPC, F(2), KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT} + }, + [1] = { /* Joe soft Colemak */ + {F(3), CM_Q, CM_W, CM_F, CM_P, CM_G, CM_J, CM_L, CM_U, CM_Y, CM_SCLN, KC_MINS}, + {KC_BSPC, CM_A, CM_R, CM_S, CM_T, CM_D, CM_H, CM_N, CM_E, CM_I, CM_O, KC_ENT }, + {F(15), CM_Z, CM_X, CM_C, CM_V, CM_B, CM_K, CM_M, KC_COMM, KC_DOT, KC_UP, KC_QUOT}, + {KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, F(1), KC_SPC, KC_SPC, F(2), KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT} + }, + [2] = { /* Joe NUMPAD */ + {F(3), KC_NO, KC_UP, KC_NO, KC_NO, KC_NO, LSFT(KC_9), LSFT(KC_0), KC_PSLS, KC_P7, KC_P8, KC_P9 }, + {KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, LSFT(KC_5), KC_PEQL, KC_PAST, KC_P4, KC_P5, KC_P6 }, + {F(15), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PCMM, KC_PMNS, KC_P1, KC_P2, KC_P3 }, + {KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, F(1), KC_TRNS, KC_TRNS, F(2), KC_PPLS, KC_P0, KC_PDOT, KC_PENT} + }, + [3] = { /* Joe 1337 haxOr5*/ + {F(3), KC_Q, KC_W, KC_F, KC_P, KC_6, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS}, + {KC_BSPC, KC_4, KC_R, KC_5, KC_7, KC_D, KC_H, KC_N, KC_3, KC_1, KC_0, KC_ENT }, + {F(15), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_UP, KC_QUOT}, + {KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, F(1), KC_SPC, KC_SPC, F(2), KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT} + }, + [4] = { /* Joe LOWER fn1 */ + {KC_GRV, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, M(3), M(2), M(1), M(0) }, + {KC_BSPC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS}, + {KC_BSLS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LBRC, KC_RBRC, KC_PGUP, KC_EQL }, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(1), KC_TRNS, KC_TRNS, F(2), KC_NO, KC_HOME, KC_PGDN, KC_END } + }, + [5] = { /* Joe UPPER fn2 */ + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 }, + {KC_DEL, KC_BTN1, KC_MS_U, KC_BTN2, KC_BTN3, KC_WH_U, KC_BTN4, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO }, + {KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_L, KC_WH_D, KC_WH_R, KC_NO, KC_NO, LCTL(KC_PGUP), LCTL(LALT(KC_UP)), LCTL(KC_PGDN) }, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(1), KC_NO, KC_NO, F(2), KC_NO, LCTL(LALT(KC_LEFT)), LCTL(LALT(KC_DOWN)), LCTL(LALT(KC_RGHT))} + }, + [6] = { /* Joe SPECIAL fn3 */ + {KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, + {KC_NO, KC_MPLY, KC_MPRV, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET }, + {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, + {F(6), F(7), F(8), F(9), F(1), KC_TRNS, KC_TRNS, F(2), KC_POWER, KC_WAKE, KC_SLEP, LCTL(LALT(KC_L))} + } +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(4), // fn1 + [2] = ACTION_LAYER_MOMENTARY(5), // fn2 + + /* ESC on tap, fn3 on hold */ + [3] = ACTION_LAYER_TAP_KEY(6, KC_ESC), + + /* toggle layers */ + [6] = ACTION_DEFAULT_LAYER_SET(0), + [7] = ACTION_DEFAULT_LAYER_SET(1), + [8] = ACTION_DEFAULT_LAYER_SET(2), + [9] = ACTION_DEFAULT_LAYER_SET(3), + + /* tab on tap, shift on hold */ + [15] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_TAB), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch (id) { + case 0: + /* :) */ + return MACRODOWN( DOWN(KC_LSFT), TYPE(KC_SCLN), TYPE(KC_0), UP(KC_LSFT), END ); + break; + case 1: + /* :( */ + return MACRODOWN( DOWN(KC_LSFT), TYPE(KC_SCLN), TYPE(KC_9), UP(KC_LSFT), END ); + break; + case 2: + /* (: | :) */ + return MACRODOWN( DOWN(KC_LSFT), TYPE(KC_9), TYPE(KC_SCLN), TYPE(KC_SPC), TYPE(KC_SPC), TYPE(KC_SCLN), TYPE(KC_0), UP(KC_LSFT), TYPE(KC_LEFT), TYPE(KC_LEFT), TYPE(KC_LEFT), END ); + break; + case 3: + /* :( | ): */ + return MACRODOWN( DOWN(KC_LSFT), TYPE(KC_SCLN), TYPE(KC_9), TYPE(KC_SPC), TYPE(KC_SPC), TYPE(KC_0), TYPE(KC_SCLN), UP(KC_LSFT), TYPE(KC_LEFT), TYPE(KC_LEFT), TYPE(KC_LEFT), END ); + break; + default: + break; + } + return MACRO_NONE; +} diff --git a/keyboard/planck/keymaps/keymap_alexey.c b/keyboard/planck/keymaps/keymap_alexey.c deleted file mode 100644 index 89af4112c6..0000000000 --- a/keyboard/planck/keymaps/keymap_alexey.c +++ /dev/null @@ -1,51 +0,0 @@ -#include "keymap_common.h" -#include "planck.h" -#include "backlight.h" - -#define _QW 0 -#define _LW 1 -#define _RS 2 - -// This layout tries to imitate the Atreus keyboard - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QW] = { /* Qwerty */ - {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, MO(_LW)}, - {KC_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_TRNS}, - {M(0), KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_SPC, KC_SPC, MO(_RS), KC_MINS, KC_QUOT, KC_ENT, KC_TRNS} -}, -[_RS] = { /* RAISE */ - {KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_PGUP, KC_7, KC_8, KC_9, KC_ASTR, KC_TRNS}, - {KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_PGDN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS}, - {KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_INS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_EQL, KC_TRNS} -}, -[_LW] = { /* LOWER */ - {KC_TRNS, KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, - {KC_TRNS, KC_DELETE, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_TRNS, KC_F4, KC_F5, KC_F6, KC_F11, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F12, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, KC_TRNS} -} -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -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: - if (record->event.pressed) { - register_code(KC_RSFT); - backlight_step(); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - diff --git a/keyboard/planck/keymaps/keymap_angerthosenear.c b/keyboard/planck/keymaps/keymap_angerthosenear.c deleted file mode 100644 index cdf60632e4..0000000000 --- a/keyboard/planck/keymaps/keymap_angerthosenear.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "keymap_common.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = { /* Qwerty */ - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT}, - {KC_LCTL, KC_LGUI, KC_LALT, BL_STEP, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} - // Space is repeated to accommadate for both spacebar wiring positions -}, -[1] = { /* WASD + NumPad */ - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_PSLS, KC_PMNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PAST, KC_PPLS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PDOT, KC_PENT, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_SPC, KC_P0, FUNC(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} -}, -[2] = { /* RAISE */ - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS}, - {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {KC_TRNS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[3] = { /* LOWER */ - {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_DEL}, - {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, - {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END} -} -}; - - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE - [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER - - [3] = ACTION_DEFAULT_LAYER_SET(0), - [4] = ACTION_DEFAULT_LAYER_SET(1), - -}; - -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: - return MACRODOWN(T(CM_T), END); - break; - } - return MACRO_NONE; -}; diff --git a/keyboard/planck/keymaps/keymap_austin.c b/keyboard/planck/keymaps/keymap_austin.c deleted file mode 100644 index 49fc98a587..0000000000 --- a/keyboard/planck/keymaps/keymap_austin.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "keymap_common.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = { /* Qwerty */ - {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}, - {BL_STEP, KC_LGUI, KC_LALT, KC_LCTL, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} - // Space is repeated to accommadate for both spacebar wiring positions -}, -[1] = { /* 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}, - {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, - {KC_FN3, KC_LGUI, KC_LALT, KC_LCTL, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[2] = { /* RAISE */ - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {KC_TRNS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[3] = { /* LOWER */ - {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, - {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, - {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -} -}; - - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE - [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER - - [3] = ACTION_DEFAULT_LAYER_SET(0), - [4] = ACTION_DEFAULT_LAYER_SET(1), - -}; - -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: - return MACRODOWN(T(CM_T), END); - break; - } - return MACRO_NONE; -}; diff --git a/keyboard/planck/keymaps/keymap_charlie.c b/keyboard/planck/keymaps/keymap_charlie.c deleted file mode 100644 index 88f454d789..0000000000 --- a/keyboard/planck/keymaps/keymap_charlie.c +++ /dev/null @@ -1,54 +0,0 @@ -#include "keymap_common.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = { /* Native */ - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, FUNC(2)}, - {KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {KC_TAB, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, - {KC_DEL, KC_LCTL, KC_NO, KC_LSFT, KC_LALT, KC_SPC, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, - [1] = { /* QWERTY->PHOTOSHOP */ - {KC_DELETE, KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, FUNC(1)}, - {KC_O, KC_G, KC_S, KC_U, KC_T, FUNC(27), KC_F21, KC_F10, KC_F11, KC_F7, KC_F8, KC_F9}, - {KC_TAB, FUNC(4), FUNC(5), FUNC(6), KC_F1, FUNC(7), KC_F18, KC_F19, KC_F23, KC_F20, KC_F22, FUNC(9)}, - {KC_COMM, KC_DOT, KC_R, FUNC(11), FUNC(3), KC_SPC, FUNC(12), KC_F2, FUNC(8), KC_F3, KC_F14} - }, - [2] = { /* 2: FUNC(3 PHOTOSHOP */ - {KC_ESC, FUNC(25), FUNC(26), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO}, - {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, FUNC(19), FUNC(20), FUNC(21)}, - {KC_C, KC_NO, FUNC(22), FUNC(5), KC_NO, FUNC(23), KC_NO, KC_NO, KC_NO, KC_NO, FUNC(13), KC_NO}, - {FUNC(14), FUNC(15), FUNC(16), FUNC(17), FUNC(3), KC_SPC, FUNC(18), KC_NO, KC_NO, KC_F24, KC_NO} - } -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_DEFAULT_LAYER_SET(0), // set Qwerty layout - [2] = ACTION_DEFAULT_LAYER_SET(1), // set Photoshop presets - [3] = ACTION_LAYER_MOMENTARY(2), // Photoshop function layer - - [4] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL | MOD_LALT, KC_F9), // photo folder AHK - [5] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL, KC_I), // select inverse - [6] = ACTION_MODS_KEY(MOD_LSFT, KC_M), // marquee select - [7] = ACTION_MODS_KEY(MOD_LALT, KC_BSPC), // fill - [8] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL | MOD_LALT, KC_X), // warp - [9] = ACTION_MODS_KEY(MOD_LCTL | MOD_LALT | MOD_LSFT, KC_F12), // merge all new layer - [10] = ACTION_MODS_KEY(MOD_LCTL, KC_MINS), // zoom out - [11] = ACTION_MODS_KEY(MOD_LCTL, KC_H), // RBG sliders - [12] = ACTION_MODS_KEY(MOD_LCTL, KC_S), // save - [13] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL, KC_F5), // layer mask from transparancy - [14] = ACTION_MODS_KEY(MOD_LCTL, KC_F2), // stroke - [15] = ACTION_MODS_KEY(MOD_LCTL | MOD_LSFT, KC_F2), // stroke layer - [16] = ACTION_MODS_KEY(MOD_LCTL, KC_0), // zoom 0 - [17] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL, KC_H), // HSV sliders - [18] = ACTION_MODS_KEY(MOD_LCTL | MOD_LSFT, KC_S), // save as - [19] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL | MOD_LALT, KC_F7), // gaussian blur - [20] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL | MOD_LALT, KC_F8), // motion blur - [21] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL, KC_X), // liquify filter - [22] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), // prev layer blending - [23] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL, KC_BSPC), // KC_NOrmal layer blending - [24] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), // next layer blending - [25] = ACTION_MODS_KEY(MOD_LCTL, KC_Z), // step back - [26] = ACTION_MODS_KEY(MOD_LCTL, KC_Y), // step forward - [27] = ACTION_MODS_KEY(MOD_LCTL, KC_R), // rasterize - -}; diff --git a/keyboard/planck/keymaps/keymap_daniel.c b/keyboard/planck/keymaps/keymap_daniel.c deleted file mode 100644 index 234e48ff4a..0000000000 --- a/keyboard/planck/keymaps/keymap_daniel.c +++ /dev/null @@ -1,48 +0,0 @@ -#include "keymap_common.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = { /* Qwerty */ - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_TAB, 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_RSFT}, - {FUNC(3), KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} - // Space is repeated to accommadate for both spacebar wiring positions -}, -[1] = { /* RAISE */ - {KC_GRV, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_EQL}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, S(KC_MINS), KC_BSLS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[2] = { /* LOWER */ - {S(KC_GRV), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, S(KC_EQL)}, - {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, - {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_ENT}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[3] = { /* Qwerty */ - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL}, - {KC_TAB, 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_RSFT}, - {KC_TRNS, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} - // Space is repeated to accommadate for both spacebar wiring positions -} -}; - - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(1), // to RAISE - [2] = ACTION_LAYER_MOMENTARY(2), // to LOWER - [3] = ACTION_LAYER_MOMENTARY(3) // to LOWER -}; - -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: - return MACRODOWN(T(CM_T), END); - break; - } - return MACRO_NONE; -}; diff --git a/keyboard/planck/keymaps/keymap_david.c b/keyboard/planck/keymaps/keymap_david.c deleted file mode 100644 index f483084801..0000000000 --- a/keyboard/planck/keymaps/keymap_david.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "keymap_common.h" -#include "beeps.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = { /* Qwerty */ - {KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_A, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ESC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, - {M(10), KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} - // Space is repeated to accommadate for both spacebar wiring positions -}, -[1] = { /* 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}, - {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, - {KC_FN3, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[2] = { /* RAISE */ - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_TRNS, FUNC(3), FUNC(4), RESET, M(0), M(1), M(2), KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {KC_TRNS, KC_F11, KC_F12, M(0), M(1), M(2), M(3), M(4), M(5), M(6), M(7), KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[3] = { /* LOWER */ - {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, - {KC_TRNS, FUNC(3), FUNC(4), RESET, M(0), M(1), M(2), S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, - {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -} -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE - [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER - - [3] = ACTION_DEFAULT_LAYER_SET(0), - [4] = ACTION_DEFAULT_LAYER_SET(1), - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - if (record->event.pressed) { - switch(id) { - case 0: - true_note(12, 12, 20); - break; - case 1: - true_note(14, 14, 20); - break; - case 2: - true_note(16, 16, 20); - break; - case 3: - true_note(17, 17, 20); - break; - case 4: - true_note(19, 19, 20); - break; - case 5: - true_note(21, 21, 20); - break; - case 6: - true_note(23, 23, 20); - break; - case 7: - true_note(24, 24, 20); - break; - case 10: - - break; - } - } - return MACRO_NONE; -}; diff --git a/keyboard/planck/keymaps/keymap_default.c b/keyboard/planck/keymaps/keymap_default.c deleted file mode 100644 index 49670dafd3..0000000000 --- a/keyboard/planck/keymaps/keymap_default.c +++ /dev/null @@ -1,68 +0,0 @@ -// 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 -#define _LW 3 -#define _RS 4 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QW] = { /* Qwerty */ - {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(_LW), KC_SPC, KC_SPC, MO(_RS), 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}, - {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[_DV] = { /* Dvorak */ - {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, - {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, - {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, - {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[_RS] = { /* RAISE */ - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[_LW] = { /* LOWER */ - {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, - {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, - {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -} -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -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: - if (record->event.pressed) { - register_code(KC_RSFT); - backlight_step(); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboard/planck/keymaps/keymap_dzobert.c b/keyboard/planck/keymaps/keymap_dzobert.c deleted file mode 100644 index 665e9c20b6..0000000000 --- a/keyboard/planck/keymaps/keymap_dzobert.c +++ /dev/null @@ -1,49 +0,0 @@ -#include "keymap_common.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = { /* Qwerty */ - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_TAB}, - {KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_BSPC}, - {KC_LALT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, - {KC_FN4, KC_RSFT, KC_LGUI, KC_LSFT, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} - // Space is repeated to accommadate for both spacebar wiring positions -}, -[1] = { /* Colemak */ - {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_TAB}, - {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_BSPC}, - {KC_LALT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, - {KC_FN3, KC_RSFT, KC_LGUI, KC_LSFT, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[2] = { /* RAISE */ - {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, - {KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_DEL}, - {KC_TRNS, KC_GRV, KC_MINS, KC_EQL, KC_QUOT, S(KC_QUOT), S(KC_LBRC), S(KC_RBRC), KC_LBRC, KC_RBRC, KC_BSLS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_HOME, KC_PGUP, KC_PGDN, KC_END} -}, -[3] = { /* LOWER */ - {KC_POWER,KC_PSCR, KC_SLCK, KC_PAUSE, KC_NLCK, KC_EXECUTE, KC_MENU, KC_APP, KC_7, KC_8, KC_9, KC_KP_SLASH}, - {KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_CAPS, KC_CANCEL, KC_UNDO, KC_AGAIN, KC_4, KC_5, KC_6, KC_KP_ASTERISK}, - {KC_TRNS, KC_INSERT,KC_CUT, KC_COPY, KC_PASTE, KC_BSLS, KC_9, KC_0, KC_1, KC_2, KC_3, KC_KP_MINUS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_KP_DOT, KC_KP_ENTER, KC_KP_PLUS} -} -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE - [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER - - [3] = ACTION_DEFAULT_LAYER_SET(0), - [4] = ACTION_DEFAULT_LAYER_SET(1), - -}; - -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: - return MACRODOWN(T(CM_T), END); - break; - } - return MACRO_NONE; -}; \ No newline at end of file diff --git a/keyboard/planck/keymaps/keymap_gabriel.c b/keyboard/planck/keymaps/keymap_gabriel.c deleted file mode 100644 index 805484488b..0000000000 --- a/keyboard/planck/keymaps/keymap_gabriel.c +++ /dev/null @@ -1,108 +0,0 @@ -#include "planck.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 _LW 1 -#define _RS 2 -#define _FN 3 - -// This a slightly modified 'default' keymap that's closer to the Mac keyboard layout. I like the position -// of 'esc' and 'tab' better this way. I also got rid of the backlighting control key and the dvorak and -// colemak layers. I added an 'fn' layer that makes the 'bspc' a forward delete (like on OSX). -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* MIT Layout (QWERTY layer) - * - * ,-----------------------------------------------------------------------. - * | esc | q | w | e | r | t | y | u | i | o | p | bspc| - * |-----------------------------------------------------------------------| - * | tab | a | s | d | f | g | h | j | k | l | ; | ' | - * |-----------------------------------------------------------------------| - * |shift| z | x | c | v | b | n | m | , | . | / |enter| - * |-----------------------------------------------------------------------| - * | fn | ctl | alt | cmd |lower| spc |raise|left |down | up |right| - * `-----------------------------------------------------------------------' - */ -[_QW] = { /* QWERTY */ - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_TAB, 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 }, - {MO(_FN), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -/* MIT Layout (Raised layer) - * - * ,-----------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | - * |-----------------------------------------------------------------------| - * | | F1 | F2 | F3 | F4 | F5 | F6 | - | + | [ | ] | | | - * |-----------------------------------------------------------------------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | - * |-----------------------------------------------------------------------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------' - */ -[_RS] = { /* RAISE */ - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_PLUS, KC_LBRC, KC_RBRC, KC_PIPE}, - {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} -}, -/* MIT Layout (Lowered layer) - * - * ,-----------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | - * |-----------------------------------------------------------------------| - * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | = | { | } | \ | - * |-----------------------------------------------------------------------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | - * |-----------------------------------------------------------------------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------' - */ -[_LW] = { /* LOWER */ - {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, - {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_EQL, KC_LCBR, KC_RCBR, KC_BSLS}, - {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} -}, -/* MIT Layout (FN layer) - * - * ,-----------------------------------------------------------------------. - * | | | | | | | | | | | | del | - * |-----------------------------------------------------------------------| - * | | | | | | | | | | | | | - * |-----------------------------------------------------------------------| - * | | | | | | | | | | | | | - * |-----------------------------------------------------------------------| - * | | | | | | | |home |pgdn |pgup | end | - * `-----------------------------------------------------------------------' - */ -[_FN] = { /* FUNCTION */ - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DELT}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END} -} -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -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: - if (record->event.pressed) { - register_code(KC_RSFT); - backlight_step(); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboard/planck/keymaps/keymap_jack.c b/keyboard/planck/keymaps/keymap_jack.c deleted file mode 100644 index 0b93bba33f..0000000000 --- a/keyboard/planck/keymaps/keymap_jack.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "keymap_common.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = { /* Jack soft-coded colemak */ - {KC_TAB, CM_Q, CM_W, CM_F, CM_P, CM_G, CM_J, CM_L, CM_U, CM_Y, CM_SCLN, KC_BSPC}, - {KC_ESC, CM_A, CM_R, CM_S, CM_T, CM_D, CM_H, CM_N, CM_E, CM_I, CM_O, KC_QUOT}, - {KC_LSFT, CM_Z, CM_X, CM_C, CM_V, CM_B, CM_K, CM_M, CM_COMM, CM_DOT, CM_SLSH, KC_ENT}, - {BL_STEP, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} - // Space is repeated to accommadate for both spacebar wiring positions -}, -[1] = { /* Jack hard-coded 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}, - {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, - {KC_FN3, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[2] = { /* Jack RAISE */ - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {KC_TRNS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[3] = { /* Jack LOWER */ - {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, - {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, - {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -} -}; - - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay - [2] = ACTION_LAYER_MOMENTARY(3), // to Fn overlay - - [3] = ACTION_DEFAULT_LAYER_SET(0), - [4] = ACTION_DEFAULT_LAYER_SET(1), - -}; - -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: - return MACRODOWN(T(CM_T), END); - break; - } - return MACRO_NONE; -}; diff --git a/keyboard/planck/keymaps/keymap_joe.c b/keyboard/planck/keymaps/keymap_joe.c deleted file mode 100644 index 5b7bbe2bbb..0000000000 --- a/keyboard/planck/keymaps/keymap_joe.c +++ /dev/null @@ -1,88 +0,0 @@ -#include "keymap_common.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = { /* Joe colemak */ - {F(3), KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS}, - {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT }, - {F(15), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_UP, KC_QUOT}, - {KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, F(1), KC_SPC, KC_SPC, F(2), KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT} - }, - [1] = { /* Joe soft Colemak */ - {F(3), CM_Q, CM_W, CM_F, CM_P, CM_G, CM_J, CM_L, CM_U, CM_Y, CM_SCLN, KC_MINS}, - {KC_BSPC, CM_A, CM_R, CM_S, CM_T, CM_D, CM_H, CM_N, CM_E, CM_I, CM_O, KC_ENT }, - {F(15), CM_Z, CM_X, CM_C, CM_V, CM_B, CM_K, CM_M, KC_COMM, KC_DOT, KC_UP, KC_QUOT}, - {KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, F(1), KC_SPC, KC_SPC, F(2), KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT} - }, - [2] = { /* Joe NUMPAD */ - {F(3), KC_NO, KC_UP, KC_NO, KC_NO, KC_NO, LSFT(KC_9), LSFT(KC_0), KC_PSLS, KC_P7, KC_P8, KC_P9 }, - {KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, LSFT(KC_5), KC_PEQL, KC_PAST, KC_P4, KC_P5, KC_P6 }, - {F(15), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PCMM, KC_PMNS, KC_P1, KC_P2, KC_P3 }, - {KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, F(1), KC_TRNS, KC_TRNS, F(2), KC_PPLS, KC_P0, KC_PDOT, KC_PENT} - }, - [3] = { /* Joe 1337 haxOr5*/ - {F(3), KC_Q, KC_W, KC_F, KC_P, KC_6, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS}, - {KC_BSPC, KC_4, KC_R, KC_5, KC_7, KC_D, KC_H, KC_N, KC_3, KC_1, KC_0, KC_ENT }, - {F(15), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_UP, KC_QUOT}, - {KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, F(1), KC_SPC, KC_SPC, F(2), KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT} - }, - [4] = { /* Joe LOWER fn1 */ - {KC_GRV, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, M(3), M(2), M(1), M(0) }, - {KC_BSPC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS}, - {KC_BSLS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LBRC, KC_RBRC, KC_PGUP, KC_EQL }, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(1), KC_TRNS, KC_TRNS, F(2), KC_NO, KC_HOME, KC_PGDN, KC_END } - }, - [5] = { /* Joe UPPER fn2 */ - {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 }, - {KC_DEL, KC_BTN1, KC_MS_U, KC_BTN2, KC_BTN3, KC_WH_U, KC_BTN4, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO }, - {KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_L, KC_WH_D, KC_WH_R, KC_NO, KC_NO, LCTL(KC_PGUP), LCTL(LALT(KC_UP)), LCTL(KC_PGDN) }, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(1), KC_NO, KC_NO, F(2), KC_NO, LCTL(LALT(KC_LEFT)), LCTL(LALT(KC_DOWN)), LCTL(LALT(KC_RGHT))} - }, - [6] = { /* Joe SPECIAL fn3 */ - {KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, - {KC_NO, KC_MPLY, KC_MPRV, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET }, - {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, - {F(6), F(7), F(8), F(9), F(1), KC_TRNS, KC_TRNS, F(2), KC_POWER, KC_WAKE, KC_SLEP, LCTL(LALT(KC_L))} - } -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(4), // fn1 - [2] = ACTION_LAYER_MOMENTARY(5), // fn2 - - /* ESC on tap, fn3 on hold */ - [3] = ACTION_LAYER_TAP_KEY(6, KC_ESC), - - /* toggle layers */ - [6] = ACTION_DEFAULT_LAYER_SET(0), - [7] = ACTION_DEFAULT_LAYER_SET(1), - [8] = ACTION_DEFAULT_LAYER_SET(2), - [9] = ACTION_DEFAULT_LAYER_SET(3), - - /* tab on tap, shift on hold */ - [15] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_TAB), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch (id) { - case 0: - /* :) */ - return MACRODOWN( DOWN(KC_LSFT), TYPE(KC_SCLN), TYPE(KC_0), UP(KC_LSFT), END ); - break; - case 1: - /* :( */ - return MACRODOWN( DOWN(KC_LSFT), TYPE(KC_SCLN), TYPE(KC_9), UP(KC_LSFT), END ); - break; - case 2: - /* (: | :) */ - return MACRODOWN( DOWN(KC_LSFT), TYPE(KC_9), TYPE(KC_SCLN), TYPE(KC_SPC), TYPE(KC_SPC), TYPE(KC_SCLN), TYPE(KC_0), UP(KC_LSFT), TYPE(KC_LEFT), TYPE(KC_LEFT), TYPE(KC_LEFT), END ); - break; - case 3: - /* :( | ): */ - return MACRODOWN( DOWN(KC_LSFT), TYPE(KC_SCLN), TYPE(KC_9), TYPE(KC_SPC), TYPE(KC_SPC), TYPE(KC_0), TYPE(KC_SCLN), UP(KC_LSFT), TYPE(KC_LEFT), TYPE(KC_LEFT), TYPE(KC_LEFT), END ); - break; - default: - break; - } - return MACRO_NONE; -} diff --git a/keyboard/planck/keymaps/keymap_kyle.c b/keyboard/planck/keymaps/keymap_kyle.c deleted file mode 100644 index da32b74f96..0000000000 --- a/keyboard/planck/keymaps/keymap_kyle.c +++ /dev/null @@ -1,49 +0,0 @@ -#include "keymap_common.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = { /* Qwerty */ - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_TAB, 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}, - {KC_RCTL, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} - // Space is repeated to accommadate for both spacebar wiring positions -}, -[1] = { /* Colemak */ - {KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, - {KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, - {KC_FN3, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[2] = { /* RAISE */ - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {KC_TRNS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[3] = { /* LOWER */ - {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, - {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), LSFT(RSFT(KC_D)), KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, - {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, - {BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -} -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE - [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER - - [3] = ACTION_DEFAULT_LAYER_SET(0), - [4] = ACTION_DEFAULT_LAYER_SET(1), - -}; - -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: - return MACRODOWN(T(CM_T), END); - break; - } - return MACRO_NONE; -}; diff --git a/keyboard/planck/keymaps/keymap_leo.c b/keyboard/planck/keymaps/keymap_leo.c deleted file mode 100644 index 6d66441822..0000000000 --- a/keyboard/planck/keymaps/keymap_leo.c +++ /dev/null @@ -1,46 +0,0 @@ -#include "keymap_common.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = { /* BASE */ - {KC_ESC, KC_LBRC, KC_QUOT, KC_SCLN, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, - {KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT}, - {KC_LSFT, KC_DOT, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_COMM}, - {KC_LCTL, KC_LALT, KC_LGUI, FUNC(3), FUNC(2), KC_SPC, KC_SPC, FUNC(1), FUNC(3), KC_RGUI, KC_RALT, KC_RCTL} -}, -[2] = { /* RAISE */ - {RALT(KC_RBRC), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, S(KC_RBRC)}, - {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} -}, -[3] = { /* LOWER */ - {S(KC_EQL),S(KC_1),S(KC_2),S(KC_3),RALT(KC_5),S(KC_5), S(KC_6), S(KC_7),RALT(KC_7),RALT(KC_0),S(KC_0), KC_MINS}, - {KC_TRNS,RALT(KC_2),S(KC_SLSH),KC_NUBS,S(KC_NUBS),RALT(KC_MINS),RALT(KC_NUBS), KC_NUHS, S(KC_8), S(KC_9), S(KC_MINS), KC_SLSH}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RALT(KC_8), RALT(KC_9), KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} -}, -[4] = { /* META */ - {KC_TRNS, KC_HOME, KC_UP, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_UP, KC_END, KC_TRNS, KC_DEL}, - {KC_TRNS, KC_RGHT, KC_DOWN, KC_LEFT, KC_PGUP, KC_TRNS, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_TRNS, KC_PGDN, KC_TRNS, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} -} -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE - [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER - [3] = ACTION_LAYER_MOMENTARY(4), // to META - -}; - -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: - return MACRODOWN(T(CM_T), END); - break; - } - return MACRO_NONE; -}; diff --git a/keyboard/planck/keymaps/keymap_lock.c b/keyboard/planck/keymaps/keymap_lock.c deleted file mode 100644 index bc81adcf97..0000000000 --- a/keyboard/planck/keymaps/keymap_lock.c +++ /dev/null @@ -1,123 +0,0 @@ -// USING_MIDI -// USING_BACKLIGHT -#include "keymap_common.h" -#include "backlight.h" -#include "action_layer.h" -#include "keymap_midi.h" -#include - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = { /* Qwerty */ - {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, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} - // Space is repeated to accommadate for both spacebar wiring positions -}, -[1] = { /* 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}, - {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, - {KC_FN3, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[2] = { /* RAISE */ - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[3] = { /* LOWER */ - {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, - {KC_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, - {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[4] = { /* TENKEY */ - {KC_TAB, N_C5, N_D5, N_E5, N_F5, N_G5, N_A5, KC_KP_7, KC_KP_8, KC_KP_9, KC_P, KC_BSPC}, - {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_KP_4, KC_KP_5, KC_KP_6, KC_SCLN, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_KP_1, KC_KP_2, KC_KP_3, KC_SLSH, KC_ENT}, - {KC_TRNS, KC_LCTL, KC_LALT, KC_LGUI, KC_TRNS, KC_SPC, KC_SPC, KC_KP_0, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[5] = { - { MIDI12 }, - { MIDI12 }, - { MIDI12 }, - {M(0), KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_SPC, KC_SPC, FUNC(1), MIDI, MIDI, MIDI, MIDI} -} -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE - [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER - - [3] = ACTION_DEFAULT_LAYER_SET(0), - [4] = ACTION_DEFAULT_LAYER_SET(1), - -}; - -uint16_t hextokeycode(int hex) { - if (hex == 0x0) { - return KC_0; - } else if (hex < 0xA) { - return KC_1 + (hex - 0x1); - } else { - return KC_A + (hex - 0xA); - } -} - -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: - if (record->event.pressed) { - // play_note(440, 20); - // register_code(KC_RSFT); - backlight_set(BACKLIGHT_LEVELS); - default_layer_and(0); - default_layer_or((1<<5)); - - // uint8_t low = boot_lock_fuse_bits_get(0x0000); - // uint8_t high = boot_lock_fuse_bits_get(0x0003); - // uint8_t ext = boot_lock_fuse_bits_get(0x0002); - // uint8_t lock = boot_lock_fuse_bits_get(0x0001); - - // register_code(hextokeycode((low & 0xF0) >> 4)); - // unregister_code(hextokeycode((low & 0xF0) >> 4)); - // register_code(hextokeycode((low & 0x0F))); - // unregister_code(hextokeycode((low & 0x0F))); - - - // register_code(hextokeycode((high & 0xF0) >> 4)); - // unregister_code(hextokeycode((high & 0xF0) >> 4)); - // register_code(hextokeycode((high & 0x0F))); - // unregister_code(hextokeycode((high & 0x0F))); - - - // register_code(hextokeycode((ext & 0xF0) >> 4)); - // unregister_code(hextokeycode((ext & 0xF0) >> 4)); - // register_code(hextokeycode((ext & 0x0F))); - // unregister_code(hextokeycode((ext & 0x0F))); - - - // register_code(hextokeycode((lock & 0xF0) >> 4)); - // unregister_code(hextokeycode((lock & 0xF0) >> 4)); - // register_code(hextokeycode((lock & 0x0F))); - // unregister_code(hextokeycode((lock & 0x0F))); - - // note(0+12, 20); - // note(0+24, 20); - } else { - // unregister_code(KC_RSFT); - // stop_note(); - backlight_set(0); - default_layer_and(0); - default_layer_or(0); - // note(0+24, 20); - // note(0, 20); - // play_note(4, 20); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboard/planck/keymaps/keymap_max.c b/keyboard/planck/keymaps/keymap_max.c deleted file mode 100644 index 7fb29bc7a4..0000000000 --- a/keyboard/planck/keymaps/keymap_max.c +++ /dev/null @@ -1,49 +0,0 @@ -#include "keymap_common.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = { /* Qwerty */ - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT }, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT}, - {KC_LCTL, BL_STEP, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} - // Space is repeated to accommadate for both spacebar wiring positions -}, -[1] = { /* Colemak */ - {KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, - {KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT }, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT}, - {KC_LCTL, BL_STEP, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[2] = { /* RAISE */ - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_TRNS}, - {KC_TRNS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_BSLS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[3] = { /* LOWER */ - {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, - {KC_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), KC_TRNS}, - {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, S(KC_BSLS)}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -} -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE - [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER - - [3] = ACTION_DEFAULT_LAYER_SET(0), - [4] = ACTION_DEFAULT_LAYER_SET(1), - -}; - -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: - return MACRODOWN(T(CM_T), END); - break; - } - return MACRO_NONE; -}; diff --git a/keyboard/planck/keymaps/keymap_monkey.c b/keyboard/planck/keymaps/keymap_monkey.c deleted file mode 100644 index 21a2c146ab..0000000000 --- a/keyboard/planck/keymaps/keymap_monkey.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "keymap_common.h" -#include "backlight.h" -#include "debug.h" - -#define COLEMAK_LAYER 0 -#define QWERTY_LAYER 1 -#define LOWER_LAYER 2 -#define UPPER_LAYER 3 -#define SPACEFN_LAYER 4 -#define TENKEY_LAYER 5 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[COLEMAK_LAYER] = { /* Colemak */ - {KC_TAB, UNI(0x1961), KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, - {KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, - {FUNC(5), KC_ESC, KC_LGUI, KC_LALT, FUNC(1), FUNC(6), FUNC(6), FUNC(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[QWERTY_LAYER] = { /* Qwerty */ - {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_LCTL, 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}, - {FUNC(5), KC_ESC, KC_LGUI, KC_LALT, FUNC(1), FUNC(6), FUNC(6), FUNC(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[LOWER_LAYER] = { /* LOWER */ - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE}, - {KC_TRNS, FUNC(3), FUNC(4), RESET, DEBUG, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END} -}, -[UPPER_LAYER] = { /* RAISE */ - {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_DELETE}, - {KC_CALC, FUNC(3), FUNC(4), RESET, DEBUG, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, - {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[SPACEFN_LAYER] = { /* SpaceFN */ - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_UP, KC_END, KC_TRNS, KC_TRNS}, - {KC_TRNS, FUNC(3), FUNC(4), KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} -}, -[TENKEY_LAYER] = { /* TENKEY */ - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_7, KC_KP_8, KC_KP_9, KC_PMNS, KC_BSPC}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, KC_NLCK}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_1, KC_KP_2, KC_KP_3, KC_PDOT, KC_ENT}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_SPC, KC_KP_0, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} -} -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_KEY(LOWER_LAYER, KC_BSPC), // Tap for backspace, hold for LOWER - [2] = ACTION_LAYER_TAP_KEY(UPPER_LAYER, KC_ENT), // Tap for enter, hold for RAISE - - [3] = ACTION_DEFAULT_LAYER_SET(COLEMAK_LAYER), - [4] = ACTION_DEFAULT_LAYER_SET(QWERTY_LAYER), - [5] = ACTION_LAYER_TOGGLE(TENKEY_LAYER), - - [6] = ACTION_LAYER_TAP_KEY(SPACEFN_LAYER, KC_SPC), // Tap for space, hold for SpaceFN -}; - -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: - if (record->event.pressed) { - register_code(KC_RSFT); - backlight_step(); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; \ No newline at end of file diff --git a/keyboard/planck/keymaps/keymap_numpad.c b/keyboard/planck/keymaps/keymap_numpad.c deleted file mode 100644 index 7de4372ab0..0000000000 --- a/keyboard/planck/keymaps/keymap_numpad.c +++ /dev/null @@ -1,26 +0,0 @@ -#include "keymap_common.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = { /* Qwerty */ - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_KP_MINUS, KC_KP_PLUS, KC_KP_PLUS, KC_KP_ENTER, KC_KP_ENTER}, - {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_KP_ASTERISK, KC_KP_9, KC_KP_6, KC_KP_3, KC_KP_DOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_KP_SLASH, KC_KP_8, KC_KP_5, KC_KP_2, KC_KP_0}, - {BL_STEP, KC_LCTL, KC_LALT, KC_LGUI, KC_NO, KC_SPC, KC_SPC, KC_NUMLOCK, KC_KP_7, KC_KP_4, KC_KP_1, KC_KP_0} - // Space is repeated to accommadate for both spacebar wiring positions -} -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -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: - return MACRODOWN(T(CM_T), END); - break; - } - return MACRO_NONE; -}; \ No newline at end of file diff --git a/keyboard/planck/keymaps/kyle.c b/keyboard/planck/keymaps/kyle.c new file mode 100644 index 0000000000..da32b74f96 --- /dev/null +++ b/keyboard/planck/keymaps/kyle.c @@ -0,0 +1,49 @@ +#include "keymap_common.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* Qwerty */ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_TAB, 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}, + {KC_RCTL, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + // Space is repeated to accommadate for both spacebar wiring positions +}, +[1] = { /* Colemak */ + {KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, + {KC_FN3, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[2] = { /* RAISE */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {KC_TRNS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[3] = { /* LOWER */ + {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, + {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), LSFT(RSFT(KC_D)), KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, + {BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +} +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER + + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + +}; + +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: + return MACRODOWN(T(CM_T), END); + break; + } + return MACRO_NONE; +}; diff --git a/keyboard/planck/keymaps/leo.c b/keyboard/planck/keymaps/leo.c new file mode 100644 index 0000000000..6d66441822 --- /dev/null +++ b/keyboard/planck/keymaps/leo.c @@ -0,0 +1,46 @@ +#include "keymap_common.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* BASE */ + {KC_ESC, KC_LBRC, KC_QUOT, KC_SCLN, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, + {KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT}, + {KC_LSFT, KC_DOT, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_COMM}, + {KC_LCTL, KC_LALT, KC_LGUI, FUNC(3), FUNC(2), KC_SPC, KC_SPC, FUNC(1), FUNC(3), KC_RGUI, KC_RALT, KC_RCTL} +}, +[2] = { /* RAISE */ + {RALT(KC_RBRC), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, S(KC_RBRC)}, + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} +}, +[3] = { /* LOWER */ + {S(KC_EQL),S(KC_1),S(KC_2),S(KC_3),RALT(KC_5),S(KC_5), S(KC_6), S(KC_7),RALT(KC_7),RALT(KC_0),S(KC_0), KC_MINS}, + {KC_TRNS,RALT(KC_2),S(KC_SLSH),KC_NUBS,S(KC_NUBS),RALT(KC_MINS),RALT(KC_NUBS), KC_NUHS, S(KC_8), S(KC_9), S(KC_MINS), KC_SLSH}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RALT(KC_8), RALT(KC_9), KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} +}, +[4] = { /* META */ + {KC_TRNS, KC_HOME, KC_UP, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_UP, KC_END, KC_TRNS, KC_DEL}, + {KC_TRNS, KC_RGHT, KC_DOWN, KC_LEFT, KC_PGUP, KC_TRNS, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_TRNS, KC_PGDN, KC_TRNS, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} +} +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER + [3] = ACTION_LAYER_MOMENTARY(4), // to META + +}; + +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: + return MACRODOWN(T(CM_T), END); + break; + } + return MACRO_NONE; +}; diff --git a/keyboard/planck/keymaps/lock.c b/keyboard/planck/keymaps/lock.c new file mode 100644 index 0000000000..bc81adcf97 --- /dev/null +++ b/keyboard/planck/keymaps/lock.c @@ -0,0 +1,123 @@ +// USING_MIDI +// USING_BACKLIGHT +#include "keymap_common.h" +#include "backlight.h" +#include "action_layer.h" +#include "keymap_midi.h" +#include + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* Qwerty */ + {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, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + // Space is repeated to accommadate for both spacebar wiring positions +}, +[1] = { /* 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}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, + {KC_FN3, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[2] = { /* RAISE */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[3] = { /* LOWER */ + {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, + {KC_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[4] = { /* TENKEY */ + {KC_TAB, N_C5, N_D5, N_E5, N_F5, N_G5, N_A5, KC_KP_7, KC_KP_8, KC_KP_9, KC_P, KC_BSPC}, + {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_KP_4, KC_KP_5, KC_KP_6, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_KP_1, KC_KP_2, KC_KP_3, KC_SLSH, KC_ENT}, + {KC_TRNS, KC_LCTL, KC_LALT, KC_LGUI, KC_TRNS, KC_SPC, KC_SPC, KC_KP_0, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[5] = { + { MIDI12 }, + { MIDI12 }, + { MIDI12 }, + {M(0), KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_SPC, KC_SPC, FUNC(1), MIDI, MIDI, MIDI, MIDI} +} +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER + + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + +}; + +uint16_t hextokeycode(int hex) { + if (hex == 0x0) { + return KC_0; + } else if (hex < 0xA) { + return KC_1 + (hex - 0x1); + } else { + return KC_A + (hex - 0xA); + } +} + +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: + if (record->event.pressed) { + // play_note(440, 20); + // register_code(KC_RSFT); + backlight_set(BACKLIGHT_LEVELS); + default_layer_and(0); + default_layer_or((1<<5)); + + // uint8_t low = boot_lock_fuse_bits_get(0x0000); + // uint8_t high = boot_lock_fuse_bits_get(0x0003); + // uint8_t ext = boot_lock_fuse_bits_get(0x0002); + // uint8_t lock = boot_lock_fuse_bits_get(0x0001); + + // register_code(hextokeycode((low & 0xF0) >> 4)); + // unregister_code(hextokeycode((low & 0xF0) >> 4)); + // register_code(hextokeycode((low & 0x0F))); + // unregister_code(hextokeycode((low & 0x0F))); + + + // register_code(hextokeycode((high & 0xF0) >> 4)); + // unregister_code(hextokeycode((high & 0xF0) >> 4)); + // register_code(hextokeycode((high & 0x0F))); + // unregister_code(hextokeycode((high & 0x0F))); + + + // register_code(hextokeycode((ext & 0xF0) >> 4)); + // unregister_code(hextokeycode((ext & 0xF0) >> 4)); + // register_code(hextokeycode((ext & 0x0F))); + // unregister_code(hextokeycode((ext & 0x0F))); + + + // register_code(hextokeycode((lock & 0xF0) >> 4)); + // unregister_code(hextokeycode((lock & 0xF0) >> 4)); + // register_code(hextokeycode((lock & 0x0F))); + // unregister_code(hextokeycode((lock & 0x0F))); + + // note(0+12, 20); + // note(0+24, 20); + } else { + // unregister_code(KC_RSFT); + // stop_note(); + backlight_set(0); + default_layer_and(0); + default_layer_or(0); + // note(0+24, 20); + // note(0, 20); + // play_note(4, 20); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboard/planck/keymaps/max.c b/keyboard/planck/keymaps/max.c new file mode 100644 index 0000000000..7fb29bc7a4 --- /dev/null +++ b/keyboard/planck/keymaps/max.c @@ -0,0 +1,49 @@ +#include "keymap_common.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* Qwerty */ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT}, + {KC_LCTL, BL_STEP, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + // Space is repeated to accommadate for both spacebar wiring positions +}, +[1] = { /* Colemak */ + {KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT}, + {KC_LCTL, BL_STEP, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[2] = { /* RAISE */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_TRNS}, + {KC_TRNS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_BSLS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[3] = { /* LOWER */ + {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, + {KC_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), KC_TRNS}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, S(KC_BSLS)}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +} +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER + + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + +}; + +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: + return MACRODOWN(T(CM_T), END); + break; + } + return MACRO_NONE; +}; diff --git a/keyboard/planck/keymaps/monkey.c b/keyboard/planck/keymaps/monkey.c new file mode 100644 index 0000000000..21a2c146ab --- /dev/null +++ b/keyboard/planck/keymaps/monkey.c @@ -0,0 +1,76 @@ +#include "keymap_common.h" +#include "backlight.h" +#include "debug.h" + +#define COLEMAK_LAYER 0 +#define QWERTY_LAYER 1 +#define LOWER_LAYER 2 +#define UPPER_LAYER 3 +#define SPACEFN_LAYER 4 +#define TENKEY_LAYER 5 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[COLEMAK_LAYER] = { /* Colemak */ + {KC_TAB, UNI(0x1961), KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, + {FUNC(5), KC_ESC, KC_LGUI, KC_LALT, FUNC(1), FUNC(6), FUNC(6), FUNC(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[QWERTY_LAYER] = { /* Qwerty */ + {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_LCTL, 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}, + {FUNC(5), KC_ESC, KC_LGUI, KC_LALT, FUNC(1), FUNC(6), FUNC(6), FUNC(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[LOWER_LAYER] = { /* LOWER */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE}, + {KC_TRNS, FUNC(3), FUNC(4), RESET, DEBUG, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END} +}, +[UPPER_LAYER] = { /* RAISE */ + {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_DELETE}, + {KC_CALC, FUNC(3), FUNC(4), RESET, DEBUG, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[SPACEFN_LAYER] = { /* SpaceFN */ + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_UP, KC_END, KC_TRNS, KC_TRNS}, + {KC_TRNS, FUNC(3), FUNC(4), KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} +}, +[TENKEY_LAYER] = { /* TENKEY */ + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_7, KC_KP_8, KC_KP_9, KC_PMNS, KC_BSPC}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, KC_NLCK}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_1, KC_KP_2, KC_KP_3, KC_PDOT, KC_ENT}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_SPC, KC_KP_0, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} +} +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_KEY(LOWER_LAYER, KC_BSPC), // Tap for backspace, hold for LOWER + [2] = ACTION_LAYER_TAP_KEY(UPPER_LAYER, KC_ENT), // Tap for enter, hold for RAISE + + [3] = ACTION_DEFAULT_LAYER_SET(COLEMAK_LAYER), + [4] = ACTION_DEFAULT_LAYER_SET(QWERTY_LAYER), + [5] = ACTION_LAYER_TOGGLE(TENKEY_LAYER), + + [6] = ACTION_LAYER_TAP_KEY(SPACEFN_LAYER, KC_SPC), // Tap for space, hold for SpaceFN +}; + +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: + if (record->event.pressed) { + register_code(KC_RSFT); + backlight_step(); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; \ No newline at end of file diff --git a/keyboard/planck/keymaps/numpad.c b/keyboard/planck/keymaps/numpad.c new file mode 100644 index 0000000000..7de4372ab0 --- /dev/null +++ b/keyboard/planck/keymaps/numpad.c @@ -0,0 +1,26 @@ +#include "keymap_common.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* Qwerty */ + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_KP_MINUS, KC_KP_PLUS, KC_KP_PLUS, KC_KP_ENTER, KC_KP_ENTER}, + {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_KP_ASTERISK, KC_KP_9, KC_KP_6, KC_KP_3, KC_KP_DOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_KP_SLASH, KC_KP_8, KC_KP_5, KC_KP_2, KC_KP_0}, + {BL_STEP, KC_LCTL, KC_LALT, KC_LGUI, KC_NO, KC_SPC, KC_SPC, KC_NUMLOCK, KC_KP_7, KC_KP_4, KC_KP_1, KC_KP_0} + // Space is repeated to accommadate for both spacebar wiring positions +} +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +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: + return MACRODOWN(T(CM_T), END); + break; + } + return MACRO_NONE; +}; \ No newline at end of file diff --git a/keyboard/planck/keymaps/test/default.c b/keyboard/planck/keymaps/test/default.c new file mode 100644 index 0000000000..bc81adcf97 --- /dev/null +++ b/keyboard/planck/keymaps/test/default.c @@ -0,0 +1,123 @@ +// USING_MIDI +// USING_BACKLIGHT +#include "keymap_common.h" +#include "backlight.h" +#include "action_layer.h" +#include "keymap_midi.h" +#include + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* Qwerty */ + {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, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + // Space is repeated to accommadate for both spacebar wiring positions +}, +[1] = { /* 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}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, + {KC_FN3, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[2] = { /* RAISE */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[3] = { /* LOWER */ + {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, + {KC_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[4] = { /* TENKEY */ + {KC_TAB, N_C5, N_D5, N_E5, N_F5, N_G5, N_A5, KC_KP_7, KC_KP_8, KC_KP_9, KC_P, KC_BSPC}, + {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_KP_4, KC_KP_5, KC_KP_6, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_KP_1, KC_KP_2, KC_KP_3, KC_SLSH, KC_ENT}, + {KC_TRNS, KC_LCTL, KC_LALT, KC_LGUI, KC_TRNS, KC_SPC, KC_SPC, KC_KP_0, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[5] = { + { MIDI12 }, + { MIDI12 }, + { MIDI12 }, + {M(0), KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_SPC, KC_SPC, FUNC(1), MIDI, MIDI, MIDI, MIDI} +} +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER + + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + +}; + +uint16_t hextokeycode(int hex) { + if (hex == 0x0) { + return KC_0; + } else if (hex < 0xA) { + return KC_1 + (hex - 0x1); + } else { + return KC_A + (hex - 0xA); + } +} + +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: + if (record->event.pressed) { + // play_note(440, 20); + // register_code(KC_RSFT); + backlight_set(BACKLIGHT_LEVELS); + default_layer_and(0); + default_layer_or((1<<5)); + + // uint8_t low = boot_lock_fuse_bits_get(0x0000); + // uint8_t high = boot_lock_fuse_bits_get(0x0003); + // uint8_t ext = boot_lock_fuse_bits_get(0x0002); + // uint8_t lock = boot_lock_fuse_bits_get(0x0001); + + // register_code(hextokeycode((low & 0xF0) >> 4)); + // unregister_code(hextokeycode((low & 0xF0) >> 4)); + // register_code(hextokeycode((low & 0x0F))); + // unregister_code(hextokeycode((low & 0x0F))); + + + // register_code(hextokeycode((high & 0xF0) >> 4)); + // unregister_code(hextokeycode((high & 0xF0) >> 4)); + // register_code(hextokeycode((high & 0x0F))); + // unregister_code(hextokeycode((high & 0x0F))); + + + // register_code(hextokeycode((ext & 0xF0) >> 4)); + // unregister_code(hextokeycode((ext & 0xF0) >> 4)); + // register_code(hextokeycode((ext & 0x0F))); + // unregister_code(hextokeycode((ext & 0x0F))); + + + // register_code(hextokeycode((lock & 0xF0) >> 4)); + // unregister_code(hextokeycode((lock & 0xF0) >> 4)); + // register_code(hextokeycode((lock & 0x0F))); + // unregister_code(hextokeycode((lock & 0x0F))); + + // note(0+12, 20); + // note(0+24, 20); + } else { + // unregister_code(KC_RSFT); + // stop_note(); + backlight_set(0); + default_layer_and(0); + default_layer_or(0); + // note(0+24, 20); + // note(0, 20); + // play_note(4, 20); + } + break; + } + return MACRO_NONE; +}; -- cgit v1.2.3 From c9a096dc99a2af45d288f9915d70fa339c0e5a6e Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sat, 16 Jan 2016 00:57:35 -0500 Subject: added error for keymap file not existing --- keyboard/planck/Makefile | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index f3537b2c7a..ff68ea0fb3 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -57,7 +57,11 @@ ifdef KEYMAP ifneq ("$(wildcard keymaps/$(KEYMAP).c)","") KEYMAP_FILE = keymaps/$(KEYMAP).c else +ifneq ("$(wildcard keymaps/$(KEYMAP)/default.c)","") KEYMAP_FILE = keymaps/$(KEYMAP)/default.c +else +$(error Keymap file does not exist) +endif endif else ifneq ("$(wildcard keymaps/default.c)","") -- cgit v1.2.3 From f66a251e5d9d741ccd3eda5a87de5a71c14843e9 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sat, 16 Jan 2016 01:01:32 -0500 Subject: I guess I can reference #90 in the commit message --- keyboard/planck/keymaps/test/README.md | 3 +++ keyboard/planck/keymaps/test/default.c | 38 ---------------------------------- 2 files changed, 3 insertions(+), 38 deletions(-) create mode 100644 keyboard/planck/keymaps/test/README.md (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymaps/test/README.md b/keyboard/planck/keymaps/test/README.md new file mode 100644 index 0000000000..c555d2ddc9 --- /dev/null +++ b/keyboard/planck/keymaps/test/README.md @@ -0,0 +1,3 @@ +# Testing out this! + +This folder will probably get deleted before merging. \ No newline at end of file diff --git a/keyboard/planck/keymaps/test/default.c b/keyboard/planck/keymaps/test/default.c index bc81adcf97..71bd6c91e5 100644 --- a/keyboard/planck/keymaps/test/default.c +++ b/keyboard/planck/keymaps/test/default.c @@ -71,51 +71,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) switch(id) { case 0: if (record->event.pressed) { - // play_note(440, 20); - // register_code(KC_RSFT); backlight_set(BACKLIGHT_LEVELS); default_layer_and(0); default_layer_or((1<<5)); - - // uint8_t low = boot_lock_fuse_bits_get(0x0000); - // uint8_t high = boot_lock_fuse_bits_get(0x0003); - // uint8_t ext = boot_lock_fuse_bits_get(0x0002); - // uint8_t lock = boot_lock_fuse_bits_get(0x0001); - - // register_code(hextokeycode((low & 0xF0) >> 4)); - // unregister_code(hextokeycode((low & 0xF0) >> 4)); - // register_code(hextokeycode((low & 0x0F))); - // unregister_code(hextokeycode((low & 0x0F))); - - - // register_code(hextokeycode((high & 0xF0) >> 4)); - // unregister_code(hextokeycode((high & 0xF0) >> 4)); - // register_code(hextokeycode((high & 0x0F))); - // unregister_code(hextokeycode((high & 0x0F))); - - - // register_code(hextokeycode((ext & 0xF0) >> 4)); - // unregister_code(hextokeycode((ext & 0xF0) >> 4)); - // register_code(hextokeycode((ext & 0x0F))); - // unregister_code(hextokeycode((ext & 0x0F))); - - - // register_code(hextokeycode((lock & 0xF0) >> 4)); - // unregister_code(hextokeycode((lock & 0xF0) >> 4)); - // register_code(hextokeycode((lock & 0x0F))); - // unregister_code(hextokeycode((lock & 0x0F))); - - // note(0+12, 20); - // note(0+24, 20); } else { - // unregister_code(KC_RSFT); - // stop_note(); backlight_set(0); default_layer_and(0); default_layer_or(0); - // note(0+24, 20); - // note(0, 20); - // play_note(4, 20); } break; } -- cgit v1.2.3 From eb61700912f1713ba27d34c23d7f07be66ee6513 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 20 Jan 2016 00:06:52 -0500 Subject: better integrations --- keyboard/planck/Makefile | 7 ++-- keyboard/planck/keymaps/keymap_default.c | 8 +++-- keyboard/planck/keymaps/keymap_lock.c | 60 ++++++-------------------------- keyboard/planck/planck.h | 4 ++- 4 files changed, 25 insertions(+), 54 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index fdf8c16400..7b06446d74 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -50,8 +50,7 @@ TMK_DIR = ../../tmk_core TARGET_DIR = . # # project specific files -SRC = planck.c \ - backlight.c +SRC = planck.c ifdef KEYMAP SRC := keymaps/keymap_$(KEYMAP).c $(SRC) @@ -124,9 +123,13 @@ COMMAND_ENABLE = yes # Commands for debug and configuration # NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work # BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality MIDI_ENABLE = YES # MIDI controls +AUDIO_ENABLE = YES # Audio output on port C6 # UNICODE_ENABLE = YES # Unicode # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID +ifdef BACKLIGHT_ENABLE + SRC += backlight.c +endif # Optimize size but this may cause error "relocation truncated to fit" #EXTRALDFLAGS = -Wl,--relax diff --git a/keyboard/planck/keymaps/keymap_default.c b/keyboard/planck/keymaps/keymap_default.c index 49670dafd3..a9c2a06813 100644 --- a/keyboard/planck/keymaps/keymap_default.c +++ b/keyboard/planck/keymaps/keymap_default.c @@ -2,7 +2,9 @@ // this is the style you want to emulate. #include "planck.h" -#include "backlight.h" +#ifdef BACKLIGHT_ENABLE + #include "backlight.h" +#endif // 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. @@ -58,7 +60,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case 0: if (record->event.pressed) { register_code(KC_RSFT); - backlight_step(); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif } else { unregister_code(KC_RSFT); } diff --git a/keyboard/planck/keymaps/keymap_lock.c b/keyboard/planck/keymaps/keymap_lock.c index 7a99b57c9d..0deb212cc7 100644 --- a/keyboard/planck/keymaps/keymap_lock.c +++ b/keyboard/planck/keymaps/keymap_lock.c @@ -1,8 +1,10 @@ #include "keymap_common.h" -// #include "backlight.h" +#ifdef BACKLIGHT_ENABLE + #include "backlight.h" +#endif #include "action_layer.h" #include "keymap_midi.h" -#include "beeps.h" +#include "audio.h" #include const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -86,7 +88,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) play_notes(&walk_up, 3, false); // play_note(440, 20); // register_code(KC_RSFT); - // backlight_set(BACKLIGHT_LEVELS); + #ifdef BACKLIGHT_ENABLE + backlight_set(BACKLIGHT_LEVELS); + #endif default_layer_and(0); default_layer_or((1<<5)); @@ -118,17 +122,14 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // register_code(hextokeycode((lock & 0x0F))); // unregister_code(hextokeycode((lock & 0x0F))); - // note(0+12, 20); - // note(0+24, 20); } else { unregister_code(KC_RSFT); play_notes(&walk_dn, 3, false); - // backlight_set(0); + #ifdef BACKLIGHT_ENABLE + backlight_set(0); + #endif default_layer_and(0); default_layer_or(0); - // note(0+24, 20); - // note(0, 20); - // play_note(4, 20); } break; } @@ -149,44 +150,5 @@ float start_up[][2] = { void * matrix_init_user(void) { init_notes(); - play_notes(&start_up, 9, false); - // play_note(((double)261.6*3)*pow(2.0,(36)/12.0), 0xF); - // _delay_ms(50); - - // play_note(((double)261.6*3)*pow(2.0,(48)/12.0), 0xF); - // _delay_ms(25); - // stop_note(((double)261.6*3)*pow(2.0,(48)/12.0)); - - // play_note(((double)261.6*3)*pow(2.0,(48)/12.0), 0xF); - // _delay_ms(25); - // stop_note(((double)261.6*3)*pow(2.0,(48)/12.0)); - - - // stop_note(((double)261.6*3)*pow(2.0,(36)/12.0)); - - - // play_note(((double)261.6*3)*pow(2.0,(62)/12.0), 0xF); - // _delay_ms(50); - // stop_note(((double)261.6*3)*pow(2.0,(62)/12.0)); - - - // play_note(((double)261.6*3)*pow(2.0,(64)/12.0), 0xF); - // _delay_ms(50); - // stop_note(((double)261.6*3)*pow(2.0,(64)/12.0)); - -} - - -// void * matrix_scan_user(void) { -// if (layer_state & (1<<2)) { -// if (!playing_notes) -// play_notes(&start_up, 9, true); -// } else if (layer_state & (1<<3)) { -// if (!playing_notes) -// play_notes(&start_up, 9, true); -// } else { -// if (playing_notes) -// stop_all_notes(); -// } -// } \ No newline at end of file +} \ No newline at end of file diff --git a/keyboard/planck/planck.h b/keyboard/planck/planck.h index 32c08f3b0b..e775ea7c62 100644 --- a/keyboard/planck/planck.h +++ b/keyboard/planck/planck.h @@ -3,7 +3,9 @@ #include "matrix.h" #include "keymap_common.h" -// #include "backlight.h" +#ifdef BACKLIGHT_ENABLE + #include "backlight.h" +#endif #include #ifdef MIDI_ENABLE #include -- cgit v1.2.3 From a820533ab770e1919f190c102a091c1060f6302e Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 20 Jan 2016 00:15:29 -0500 Subject: keymap.c changes, disable grep stuff --- keyboard/planck/Makefile | 10 ++- keyboard/planck/keymaps/default.c | 68 ----------------- keyboard/planck/keymaps/default/README.md | 34 +++++++++ keyboard/planck/keymaps/default/keymap.c | 68 +++++++++++++++++ keyboard/planck/keymaps/jack.c | 50 ------------ keyboard/planck/keymaps/lock.c | 123 ------------------------------ keyboard/planck/keymaps/lock/README.md | 3 + keyboard/planck/keymaps/lock/keymap.c | 123 ++++++++++++++++++++++++++++++ keyboard/planck/keymaps/test/README.md | 3 - keyboard/planck/keymaps/test/default.c | 85 --------------------- 10 files changed, 235 insertions(+), 332 deletions(-) delete mode 100644 keyboard/planck/keymaps/default.c create mode 100644 keyboard/planck/keymaps/default/README.md create mode 100644 keyboard/planck/keymaps/default/keymap.c delete mode 100644 keyboard/planck/keymaps/jack.c delete mode 100644 keyboard/planck/keymaps/lock.c create mode 100644 keyboard/planck/keymaps/lock/README.md create mode 100644 keyboard/planck/keymaps/lock/keymap.c delete mode 100644 keyboard/planck/keymaps/test/README.md delete mode 100644 keyboard/planck/keymaps/test/default.c (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index ff68ea0fb3..16d462b699 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -53,12 +53,16 @@ TARGET_DIR = . SRC = planck.c \ backlight.c +ifdef keymap + KEYMAP = $(keymap) +endif + ifdef KEYMAP ifneq ("$(wildcard keymaps/$(KEYMAP).c)","") KEYMAP_FILE = keymaps/$(KEYMAP).c else -ifneq ("$(wildcard keymaps/$(KEYMAP)/default.c)","") - KEYMAP_FILE = keymaps/$(KEYMAP)/default.c +ifneq ("$(wildcard keymaps/$(KEYMAP)/keymap.c)","") + KEYMAP_FILE = keymaps/$(KEYMAP)/keymap.c else $(error Keymap file does not exist) endif @@ -67,7 +71,7 @@ else ifneq ("$(wildcard keymaps/default.c)","") KEYMAP_FILE = keymaps/default.c else - KEYMAP_FILE = keymaps/default/default.c + KEYMAP_FILE = keymaps/default/keymap.c endif endif SRC := $(KEYMAP_FILE) $(SRC) diff --git a/keyboard/planck/keymaps/default.c b/keyboard/planck/keymaps/default.c deleted file mode 100644 index 49670dafd3..0000000000 --- a/keyboard/planck/keymaps/default.c +++ /dev/null @@ -1,68 +0,0 @@ -// 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 -#define _LW 3 -#define _RS 4 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QW] = { /* Qwerty */ - {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(_LW), KC_SPC, KC_SPC, MO(_RS), 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}, - {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[_DV] = { /* Dvorak */ - {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, - {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, - {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, - {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[_RS] = { /* RAISE */ - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[_LW] = { /* LOWER */ - {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, - {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, - {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -} -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -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: - if (record->event.pressed) { - register_code(KC_RSFT); - backlight_step(); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboard/planck/keymaps/default/README.md b/keyboard/planck/keymaps/default/README.md new file mode 100644 index 0000000000..d2f43bbdb8 --- /dev/null +++ b/keyboard/planck/keymaps/default/README.md @@ -0,0 +1,34 @@ +# The Default Planck Layout + + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = { /* Qwerty */ + {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(_LW), KC_SPC, KC_SPC, MO(_RS), 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}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + }, + [_DV] = { /* Dvorak */ + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, + {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, + {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + }, + [_RS] = { /* RAISE */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} + }, + [_LW] = { /* LOWER */ + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} + } + }; \ No newline at end of file diff --git a/keyboard/planck/keymaps/default/keymap.c b/keyboard/planck/keymaps/default/keymap.c new file mode 100644 index 0000000000..49670dafd3 --- /dev/null +++ b/keyboard/planck/keymaps/default/keymap.c @@ -0,0 +1,68 @@ +// 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 +#define _LW 3 +#define _RS 4 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_QW] = { /* Qwerty */ + {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(_LW), KC_SPC, KC_SPC, MO(_RS), 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}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[_DV] = { /* Dvorak */ + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, + {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, + {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[_RS] = { /* RAISE */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[_LW] = { /* LOWER */ + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +} +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +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: + if (record->event.pressed) { + register_code(KC_RSFT); + backlight_step(); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboard/planck/keymaps/jack.c b/keyboard/planck/keymaps/jack.c deleted file mode 100644 index 0b93bba33f..0000000000 --- a/keyboard/planck/keymaps/jack.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "keymap_common.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = { /* Jack soft-coded colemak */ - {KC_TAB, CM_Q, CM_W, CM_F, CM_P, CM_G, CM_J, CM_L, CM_U, CM_Y, CM_SCLN, KC_BSPC}, - {KC_ESC, CM_A, CM_R, CM_S, CM_T, CM_D, CM_H, CM_N, CM_E, CM_I, CM_O, KC_QUOT}, - {KC_LSFT, CM_Z, CM_X, CM_C, CM_V, CM_B, CM_K, CM_M, CM_COMM, CM_DOT, CM_SLSH, KC_ENT}, - {BL_STEP, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} - // Space is repeated to accommadate for both spacebar wiring positions -}, -[1] = { /* Jack hard-coded 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}, - {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, - {KC_FN3, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[2] = { /* Jack RAISE */ - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {KC_TRNS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[3] = { /* Jack LOWER */ - {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, - {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, - {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -} -}; - - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay - [2] = ACTION_LAYER_MOMENTARY(3), // to Fn overlay - - [3] = ACTION_DEFAULT_LAYER_SET(0), - [4] = ACTION_DEFAULT_LAYER_SET(1), - -}; - -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: - return MACRODOWN(T(CM_T), END); - break; - } - return MACRO_NONE; -}; diff --git a/keyboard/planck/keymaps/lock.c b/keyboard/planck/keymaps/lock.c deleted file mode 100644 index bc81adcf97..0000000000 --- a/keyboard/planck/keymaps/lock.c +++ /dev/null @@ -1,123 +0,0 @@ -// USING_MIDI -// USING_BACKLIGHT -#include "keymap_common.h" -#include "backlight.h" -#include "action_layer.h" -#include "keymap_midi.h" -#include - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = { /* Qwerty */ - {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, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} - // Space is repeated to accommadate for both spacebar wiring positions -}, -[1] = { /* 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}, - {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, - {KC_FN3, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[2] = { /* RAISE */ - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[3] = { /* LOWER */ - {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, - {KC_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, - {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[4] = { /* TENKEY */ - {KC_TAB, N_C5, N_D5, N_E5, N_F5, N_G5, N_A5, KC_KP_7, KC_KP_8, KC_KP_9, KC_P, KC_BSPC}, - {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_KP_4, KC_KP_5, KC_KP_6, KC_SCLN, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_KP_1, KC_KP_2, KC_KP_3, KC_SLSH, KC_ENT}, - {KC_TRNS, KC_LCTL, KC_LALT, KC_LGUI, KC_TRNS, KC_SPC, KC_SPC, KC_KP_0, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[5] = { - { MIDI12 }, - { MIDI12 }, - { MIDI12 }, - {M(0), KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_SPC, KC_SPC, FUNC(1), MIDI, MIDI, MIDI, MIDI} -} -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE - [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER - - [3] = ACTION_DEFAULT_LAYER_SET(0), - [4] = ACTION_DEFAULT_LAYER_SET(1), - -}; - -uint16_t hextokeycode(int hex) { - if (hex == 0x0) { - return KC_0; - } else if (hex < 0xA) { - return KC_1 + (hex - 0x1); - } else { - return KC_A + (hex - 0xA); - } -} - -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: - if (record->event.pressed) { - // play_note(440, 20); - // register_code(KC_RSFT); - backlight_set(BACKLIGHT_LEVELS); - default_layer_and(0); - default_layer_or((1<<5)); - - // uint8_t low = boot_lock_fuse_bits_get(0x0000); - // uint8_t high = boot_lock_fuse_bits_get(0x0003); - // uint8_t ext = boot_lock_fuse_bits_get(0x0002); - // uint8_t lock = boot_lock_fuse_bits_get(0x0001); - - // register_code(hextokeycode((low & 0xF0) >> 4)); - // unregister_code(hextokeycode((low & 0xF0) >> 4)); - // register_code(hextokeycode((low & 0x0F))); - // unregister_code(hextokeycode((low & 0x0F))); - - - // register_code(hextokeycode((high & 0xF0) >> 4)); - // unregister_code(hextokeycode((high & 0xF0) >> 4)); - // register_code(hextokeycode((high & 0x0F))); - // unregister_code(hextokeycode((high & 0x0F))); - - - // register_code(hextokeycode((ext & 0xF0) >> 4)); - // unregister_code(hextokeycode((ext & 0xF0) >> 4)); - // register_code(hextokeycode((ext & 0x0F))); - // unregister_code(hextokeycode((ext & 0x0F))); - - - // register_code(hextokeycode((lock & 0xF0) >> 4)); - // unregister_code(hextokeycode((lock & 0xF0) >> 4)); - // register_code(hextokeycode((lock & 0x0F))); - // unregister_code(hextokeycode((lock & 0x0F))); - - // note(0+12, 20); - // note(0+24, 20); - } else { - // unregister_code(KC_RSFT); - // stop_note(); - backlight_set(0); - default_layer_and(0); - default_layer_or(0); - // note(0+24, 20); - // note(0, 20); - // play_note(4, 20); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboard/planck/keymaps/lock/README.md b/keyboard/planck/keymaps/lock/README.md new file mode 100644 index 0000000000..d21cb990b0 --- /dev/null +++ b/keyboard/planck/keymaps/lock/README.md @@ -0,0 +1,3 @@ +# Lock layout + +This layout is designed for having a lock switch in the lower-left-hand corner, and for experimenting with MIDI/audio features. It's constantly in development, so don't expect anything to work/be documented correctly! \ No newline at end of file diff --git a/keyboard/planck/keymaps/lock/keymap.c b/keyboard/planck/keymaps/lock/keymap.c new file mode 100644 index 0000000000..bc81adcf97 --- /dev/null +++ b/keyboard/planck/keymaps/lock/keymap.c @@ -0,0 +1,123 @@ +// USING_MIDI +// USING_BACKLIGHT +#include "keymap_common.h" +#include "backlight.h" +#include "action_layer.h" +#include "keymap_midi.h" +#include + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* Qwerty */ + {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, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + // Space is repeated to accommadate for both spacebar wiring positions +}, +[1] = { /* 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}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, + {KC_FN3, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[2] = { /* RAISE */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[3] = { /* LOWER */ + {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, + {KC_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[4] = { /* TENKEY */ + {KC_TAB, N_C5, N_D5, N_E5, N_F5, N_G5, N_A5, KC_KP_7, KC_KP_8, KC_KP_9, KC_P, KC_BSPC}, + {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_KP_4, KC_KP_5, KC_KP_6, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_KP_1, KC_KP_2, KC_KP_3, KC_SLSH, KC_ENT}, + {KC_TRNS, KC_LCTL, KC_LALT, KC_LGUI, KC_TRNS, KC_SPC, KC_SPC, KC_KP_0, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[5] = { + { MIDI12 }, + { MIDI12 }, + { MIDI12 }, + {M(0), KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_SPC, KC_SPC, FUNC(1), MIDI, MIDI, MIDI, MIDI} +} +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER + + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + +}; + +uint16_t hextokeycode(int hex) { + if (hex == 0x0) { + return KC_0; + } else if (hex < 0xA) { + return KC_1 + (hex - 0x1); + } else { + return KC_A + (hex - 0xA); + } +} + +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: + if (record->event.pressed) { + // play_note(440, 20); + // register_code(KC_RSFT); + backlight_set(BACKLIGHT_LEVELS); + default_layer_and(0); + default_layer_or((1<<5)); + + // uint8_t low = boot_lock_fuse_bits_get(0x0000); + // uint8_t high = boot_lock_fuse_bits_get(0x0003); + // uint8_t ext = boot_lock_fuse_bits_get(0x0002); + // uint8_t lock = boot_lock_fuse_bits_get(0x0001); + + // register_code(hextokeycode((low & 0xF0) >> 4)); + // unregister_code(hextokeycode((low & 0xF0) >> 4)); + // register_code(hextokeycode((low & 0x0F))); + // unregister_code(hextokeycode((low & 0x0F))); + + + // register_code(hextokeycode((high & 0xF0) >> 4)); + // unregister_code(hextokeycode((high & 0xF0) >> 4)); + // register_code(hextokeycode((high & 0x0F))); + // unregister_code(hextokeycode((high & 0x0F))); + + + // register_code(hextokeycode((ext & 0xF0) >> 4)); + // unregister_code(hextokeycode((ext & 0xF0) >> 4)); + // register_code(hextokeycode((ext & 0x0F))); + // unregister_code(hextokeycode((ext & 0x0F))); + + + // register_code(hextokeycode((lock & 0xF0) >> 4)); + // unregister_code(hextokeycode((lock & 0xF0) >> 4)); + // register_code(hextokeycode((lock & 0x0F))); + // unregister_code(hextokeycode((lock & 0x0F))); + + // note(0+12, 20); + // note(0+24, 20); + } else { + // unregister_code(KC_RSFT); + // stop_note(); + backlight_set(0); + default_layer_and(0); + default_layer_or(0); + // note(0+24, 20); + // note(0, 20); + // play_note(4, 20); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboard/planck/keymaps/test/README.md b/keyboard/planck/keymaps/test/README.md deleted file mode 100644 index c555d2ddc9..0000000000 --- a/keyboard/planck/keymaps/test/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Testing out this! - -This folder will probably get deleted before merging. \ No newline at end of file diff --git a/keyboard/planck/keymaps/test/default.c b/keyboard/planck/keymaps/test/default.c deleted file mode 100644 index 71bd6c91e5..0000000000 --- a/keyboard/planck/keymaps/test/default.c +++ /dev/null @@ -1,85 +0,0 @@ -// USING_MIDI -// USING_BACKLIGHT -#include "keymap_common.h" -#include "backlight.h" -#include "action_layer.h" -#include "keymap_midi.h" -#include - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = { /* Qwerty */ - {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, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} - // Space is repeated to accommadate for both spacebar wiring positions -}, -[1] = { /* 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}, - {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, - {KC_FN3, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[2] = { /* RAISE */ - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[3] = { /* LOWER */ - {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, - {KC_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, - {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[4] = { /* TENKEY */ - {KC_TAB, N_C5, N_D5, N_E5, N_F5, N_G5, N_A5, KC_KP_7, KC_KP_8, KC_KP_9, KC_P, KC_BSPC}, - {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_KP_4, KC_KP_5, KC_KP_6, KC_SCLN, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_KP_1, KC_KP_2, KC_KP_3, KC_SLSH, KC_ENT}, - {KC_TRNS, KC_LCTL, KC_LALT, KC_LGUI, KC_TRNS, KC_SPC, KC_SPC, KC_KP_0, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[5] = { - { MIDI12 }, - { MIDI12 }, - { MIDI12 }, - {M(0), KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_SPC, KC_SPC, FUNC(1), MIDI, MIDI, MIDI, MIDI} -} -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE - [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER - - [3] = ACTION_DEFAULT_LAYER_SET(0), - [4] = ACTION_DEFAULT_LAYER_SET(1), - -}; - -uint16_t hextokeycode(int hex) { - if (hex == 0x0) { - return KC_0; - } else if (hex < 0xA) { - return KC_1 + (hex - 0x1); - } else { - return KC_A + (hex - 0xA); - } -} - -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: - if (record->event.pressed) { - backlight_set(BACKLIGHT_LEVELS); - default_layer_and(0); - default_layer_or((1<<5)); - } else { - backlight_set(0); - default_layer_and(0); - default_layer_or(0); - } - break; - } - return MACRO_NONE; -}; -- cgit v1.2.3 From ae620fe8562254a5c00a48b863cabd4c87abd613 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sat, 23 Jan 2016 20:35:13 -0500 Subject: rename file --- keyboard/planck/keymaps/keymap_eric.c | 42 ----------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 keyboard/planck/keymaps/keymap_eric.c (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymaps/keymap_eric.c b/keyboard/planck/keymaps/keymap_eric.c deleted file mode 100644 index ffeec5f805..0000000000 --- a/keyboard/planck/keymaps/keymap_eric.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "planck.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = { - {KC_BSLS, S(KC_SLSH), KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH}, - {TG(1), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS}, - {KC_LGUI, KC_QUOT, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RGUI}, - {KC_LCBR, KC_LCTL, KC_LALT, LT(1, TG(2)), KC_SPC, KC_TAB, KC_ENT, KC_BSPC, LT(1, TG(3)), KC_RALT, KC_RCTL, KC_RCBR} - }, - - [1] = { - {KC_PIPE, KC_COLN, KC_LBRC, KC_RBRC, S(KC_P), S(KC_Y), S(KC_F), S(KC_G), S(KC_C), S(KC_R), S(KC_L), KC_AMPR}, - {KC_TRNS, S(KC_A), S(KC_O), S(KC_E), S(KC_U), S(KC_I), S(KC_D), S(KC_H), S(KC_T), S(KC_N), S(KC_S), KC_GRV}, - {KC_TRNS, KC_SCLN, S(KC_Q), S(KC_J), S(KC_K), S(KC_X), S(KC_B), S(KC_M), S(KC_W), S(KC_V), S(KC_Z), KC_TRNS}, - {S(KC_COMM), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_DOT)} - }, - - [2] = { - {KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO}, - {KC_NO, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_NO}, - {KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS}, - {KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO} - }, - - [3] = { - {KC_EXLM, KC_7, KC_5, KC_3, KC_1, KC_9, KC_0, KC_2, KC_4, KC_6, KC_8, KC_EQL}, - {TG(4), KC_NO, KC_PGUP, KC_HOME, KC_INSERT, KC_NO, KC_NO, BL_DEC, KC_UP, BL_INC, KC_NO, KC_NO}, - {KC_TRNS, KC_NO, KC_PGDN, KC_END, KC_DELETE, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_TRNS}, - {KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO} - }, - - [4] = { - {KC_TILD, KC_HASH, KC_LPRN, KC_RPRN, S(KC_QUOT), KC_PERC, KC_UNDS, KC_CIRC, KC_DLR, KC_AT, KC_ASTR, KC_PLUS}, - {KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO}, - {KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS}, - {KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO} - } -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; \ No newline at end of file -- cgit v1.2.3 From fd72a46c139c0450299e6e4ebbf4ffba531c9e2d Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sat, 23 Jan 2016 20:52:01 -0500 Subject: Makefile back to defaults --- keyboard/planck/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index dece6a7f17..8414b2ccc0 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -138,9 +138,9 @@ COMMAND_ENABLE = yes # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend # NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = YES # MIDI controls -AUDIO_ENABLE = YES # Audio output on port C6 +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +# MIDI_ENABLE = YES # MIDI controls +# AUDIO_ENABLE = YES # Audio output on port C6 # UNICODE_ENABLE = YES # Unicode # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID -- cgit v1.2.3 From 0a40654b82520849fcc587e8fb76c823378649a6 Mon Sep 17 00:00:00 2001 From: Yang Liu Date: Sun, 24 Jan 2016 13:14:50 -0800 Subject: Add support for WS2812 LEDs --- keyboard/planck/Makefile | 13 +- keyboard/planck/config.h | 15 + keyboard/planck/keymaps/yang/keymap.c | 146 ++++++++++ keyboard/planck/light_ws2812.c | 181 ++++++++++++ keyboard/planck/light_ws2812.h | 73 +++++ keyboard/planck/planck.c | 7 +- keyboard/planck/planck.h | 9 +- keyboard/planck/rgblight.c | 505 ++++++++++++++++++++++++++++++++++ keyboard/planck/rgblight.h | 87 ++++++ 9 files changed, 1029 insertions(+), 7 deletions(-) create mode 100644 keyboard/planck/keymaps/yang/keymap.c create mode 100755 keyboard/planck/light_ws2812.c create mode 100755 keyboard/planck/light_ws2812.h create mode 100644 keyboard/planck/rgblight.c create mode 100644 keyboard/planck/rgblight.h (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index 8414b2ccc0..d37005260a 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -27,7 +27,7 @@ # make flip-ee = Download the eeprom file to the device, using Atmel FLIP # (must have Atmel FLIP installed). # -# make debug = Start either simulavr or avarice as specified for debugging, +# make debug = Start either simulavr or avarice as specified for debugging, # with avr-gdb or avr-insight as the front end for debugging. # # make filename.s = Just compile filename.c into the assembler code only. @@ -137,17 +137,25 @@ CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -# NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality # MIDI_ENABLE = YES # MIDI controls # AUDIO_ENABLE = YES # Audio output on port C6 # UNICODE_ENABLE = YES # Unicode # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 bottom RGB light ifdef BACKLIGHT_ENABLE SRC += backlight.c endif +ifdef RGBLIGHT_ENABLE + SRC += light_ws2812.c + SRC += rgblight.c + OPT_DEFS += -DRGBLIGHT_ENABLE +endif + + # Optimize size but this may cause error "relocation truncated to fit" #EXTRALDFLAGS = -Wl,--relax @@ -157,4 +165,3 @@ VPATH += $(TOP_DIR) VPATH += $(TMK_DIR) include $(TOP_DIR)/quantum/quantum.mk - diff --git a/keyboard/planck/config.h b/keyboard/planck/config.h index a4c711db82..856de73066 100644 --- a/keyboard/planck/config.h +++ b/keyboard/planck/config.h @@ -58,6 +58,21 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) +/* ws2812 RGB LED */ +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD +#define ws2812_pin PD1 +#define RGBLED_NUM 28 // Number of LEDs +#ifndef RGBLIGHT_HUE_STEP +#define RGBLIGHT_HUE_STEP 10 +#endif +#ifndef RGBLIGHT_SAT_STEP +#define RGBLIGHT_SAT_STEP 17 +#endif +#ifndef RGBLIGHT_VAL_STEP +#define RGBLIGHT_VAL_STEP 17 +#endif + /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboard/planck/keymaps/yang/keymap.c b/keyboard/planck/keymaps/yang/keymap.c new file mode 100644 index 0000000000..541b1a57e4 --- /dev/null +++ b/keyboard/planck/keymaps/yang/keymap.c @@ -0,0 +1,146 @@ +// 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" +#ifdef BACKLIGHT_ENABLE + #include "backlight.h" +#endif + +// 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 +#define _LW 3 +#define _RS 4 +#define _RGB 5 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_QW] = { /* Qwerty */ + {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(_LW), F(0), F(0), MO(_RS), 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}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), F(0), F(0), MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[_DV] = { /* Dvorak */ + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, + {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, + {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), F(0), F(0), MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[_RS] = { /* RAISE */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[_LW] = { /* LOWER */ + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[_RGB] = { /* RGBLIGHT */ + {KC_TRNS, KC_PGUP, KC_UP, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL}, + {KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_END, KC_TRNS}, + {KC_TRNS, F(1), F(2), F(3), F(4), F(5), F(6), F(7), F(8), KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} + +} +}; + +enum function_id { + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_KEY(_RGB, KC_SPC), + [1] = ACTION_FUNCTION(RGBLED_TOGGLE), + [2] = ACTION_FUNCTION(RGBLED_STEP_MODE), + [3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), + [4] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), + [5] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), + [6] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), + [7] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), + [8] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), +}; + +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: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch (id) { + case RGBLED_TOGGLE: + //led operations + if (record->event.pressed) { + rgblight_toggle(); + } + + break; + case RGBLED_INCREASE_HUE: + if (record->event.pressed) { + rgblight_increase_hue(); + } + break; + case RGBLED_DECREASE_HUE: + if (record->event.pressed) { + rgblight_decrease_hue(); + } + break; + case RGBLED_INCREASE_SAT: + if (record->event.pressed) { + rgblight_increase_sat(); + } + break; + case RGBLED_DECREASE_SAT: + if (record->event.pressed) { + rgblight_decrease_sat(); + } + break; + case RGBLED_INCREASE_VAL: + if (record->event.pressed) { + rgblight_increase_val(); + } + break; + case RGBLED_DECREASE_VAL: + if (record->event.pressed) { + rgblight_decrease_val(); + } + break; + case RGBLED_STEP_MODE: + if (record->event.pressed) { + rgblight_step(); + } + break; + } +} diff --git a/keyboard/planck/light_ws2812.c b/keyboard/planck/light_ws2812.c new file mode 100755 index 0000000000..f20043067e --- /dev/null +++ b/keyboard/planck/light_ws2812.c @@ -0,0 +1,181 @@ +/* +* light weight WS2812 lib V2.0b +* +* Controls WS2811/WS2812/WS2812B RGB-LEDs +* Author: Tim (cpldcpu@gmail.com) +* +* Jan 18th, 2014 v2.0b Initial Version +* Nov 29th, 2015 v2.3 Added SK6812RGBW support +* +* License: GNU GPL v2 (see License.txt) +*/ + +#include "light_ws2812.h" +#include +#include +#include +#include "debug.h" + +// Setleds for standard RGB +void inline ws2812_setleds(struct cRGB *ledarray, uint16_t leds) +{ + ws2812_setleds_pin(ledarray,leds, _BV(ws2812_pin)); +} + +void inline ws2812_setleds_pin(struct cRGB *ledarray, uint16_t leds, uint8_t pinmask) +{ + ws2812_DDRREG |= pinmask; // Enable DDR + ws2812_sendarray_mask((uint8_t*)ledarray,leds+leds+leds,pinmask); + _delay_us(50); +} + +// Setleds for SK6812RGBW +void inline ws2812_setleds_rgbw(struct cRGBW *ledarray, uint16_t leds) +{ + ws2812_DDRREG |= _BV(ws2812_pin); // Enable DDR + ws2812_sendarray_mask((uint8_t*)ledarray,leds<<2,_BV(ws2812_pin)); + _delay_us(80); +} + +void ws2812_sendarray(uint8_t *data,uint16_t datlen) +{ + ws2812_sendarray_mask(data,datlen,_BV(ws2812_pin)); +} + +/* + This routine writes an array of bytes with RGB values to the Dataout pin + using the fast 800kHz clockless WS2811/2812 protocol. +*/ + +// Timing in ns +#define w_zeropulse 350 +#define w_onepulse 900 +#define w_totalperiod 1250 + +// Fixed cycles used by the inner loop +#define w_fixedlow 2 +#define w_fixedhigh 4 +#define w_fixedtotal 8 + +// Insert NOPs to match the timing, if possible +#define w_zerocycles (((F_CPU/1000)*w_zeropulse )/1000000) +#define w_onecycles (((F_CPU/1000)*w_onepulse +500000)/1000000) +#define w_totalcycles (((F_CPU/1000)*w_totalperiod +500000)/1000000) + +// w1 - nops between rising edge and falling edge - low +#define w1 (w_zerocycles-w_fixedlow) +// w2 nops between fe low and fe high +#define w2 (w_onecycles-w_fixedhigh-w1) +// w3 nops to complete loop +#define w3 (w_totalcycles-w_fixedtotal-w1-w2) + +#if w1>0 + #define w1_nops w1 +#else + #define w1_nops 0 +#endif + +// The only critical timing parameter is the minimum pulse length of the "0" +// Warn or throw error if this timing can not be met with current F_CPU settings. +#define w_lowtime ((w1_nops+w_fixedlow)*1000000)/(F_CPU/1000) +#if w_lowtime>550 + #error "Light_ws2812: Sorry, the clock speed is too low. Did you set F_CPU correctly?" +#elif w_lowtime>450 + #warning "Light_ws2812: The timing is critical and may only work on WS2812B, not on WS2812(S)." + #warning "Please consider a higher clockspeed, if possible" +#endif + +#if w2>0 +#define w2_nops w2 +#else +#define w2_nops 0 +#endif + +#if w3>0 +#define w3_nops w3 +#else +#define w3_nops 0 +#endif + +#define w_nop1 "nop \n\t" +#define w_nop2 "rjmp .+0 \n\t" +#define w_nop4 w_nop2 w_nop2 +#define w_nop8 w_nop4 w_nop4 +#define w_nop16 w_nop8 w_nop8 + +void inline ws2812_sendarray_mask(uint8_t *data,uint16_t datlen,uint8_t maskhi) +{ + uint8_t curbyte,ctr,masklo; + uint8_t sreg_prev; + + masklo =~maskhi&ws2812_PORTREG; + maskhi |= ws2812_PORTREG; + sreg_prev=SREG; + cli(); + + while (datlen--) { + curbyte=*data++; + + asm volatile( + " ldi %0,8 \n\t" + "loop%=: \n\t" + " out %2,%3 \n\t" // '1' [01] '0' [01] - re +#if (w1_nops&1) +w_nop1 +#endif +#if (w1_nops&2) +w_nop2 +#endif +#if (w1_nops&4) +w_nop4 +#endif +#if (w1_nops&8) +w_nop8 +#endif +#if (w1_nops&16) +w_nop16 +#endif + " sbrs %1,7 \n\t" // '1' [03] '0' [02] + " out %2,%4 \n\t" // '1' [--] '0' [03] - fe-low + " lsl %1 \n\t" // '1' [04] '0' [04] +#if (w2_nops&1) + w_nop1 +#endif +#if (w2_nops&2) + w_nop2 +#endif +#if (w2_nops&4) + w_nop4 +#endif +#if (w2_nops&8) + w_nop8 +#endif +#if (w2_nops&16) + w_nop16 +#endif + " out %2,%4 \n\t" // '1' [+1] '0' [+1] - fe-high +#if (w3_nops&1) +w_nop1 +#endif +#if (w3_nops&2) +w_nop2 +#endif +#if (w3_nops&4) +w_nop4 +#endif +#if (w3_nops&8) +w_nop8 +#endif +#if (w3_nops&16) +w_nop16 +#endif + + " dec %0 \n\t" // '1' [+2] '0' [+2] + " brne loop%=\n\t" // '1' [+3] '0' [+4] + : "=&d" (ctr) + : "r" (curbyte), "I" (_SFR_IO_ADDR(ws2812_PORTREG)), "r" (maskhi), "r" (masklo) + ); + } + + SREG=sreg_prev; +} diff --git a/keyboard/planck/light_ws2812.h b/keyboard/planck/light_ws2812.h new file mode 100755 index 0000000000..54eef22d9e --- /dev/null +++ b/keyboard/planck/light_ws2812.h @@ -0,0 +1,73 @@ +/* + * light weight WS2812 lib include + * + * Version 2.3 - Nev 29th 2015 + * Author: Tim (cpldcpu@gmail.com) + * + * Please do not change this file! All configuration is handled in "ws2812_config.h" + * + * License: GNU GPL v2 (see License.txt) + + + */ + +#ifndef LIGHT_WS2812_H_ +#define LIGHT_WS2812_H_ + +#include +#include +//#include "ws2812_config.h" + +/* + * Structure of the LED array + * + * cRGB: RGB for WS2812S/B/C/D, SK6812, SK6812Mini, SK6812WWA, APA104, APA106 + * cRGBW: RGBW for SK6812RGBW + */ + +struct cRGB { uint8_t g; uint8_t r; uint8_t b; }; +struct cRGBW { uint8_t g; uint8_t r; uint8_t b; uint8_t w;}; + + + +/* User Interface + * + * Input: + * ledarray: An array of GRB data describing the LED colors + * number_of_leds: The number of LEDs to write + * pinmask (optional): Bitmask describing the output bin. e.g. _BV(PB0) + * + * The functions will perform the following actions: + * - Set the data-out pin as output + * - Send out the LED data + * - Wait 50�s to reset the LEDs + */ + +void ws2812_setleds (struct cRGB *ledarray, uint16_t number_of_leds); +void ws2812_setleds_pin (struct cRGB *ledarray, uint16_t number_of_leds,uint8_t pinmask); +void ws2812_setleds_rgbw(struct cRGBW *ledarray, uint16_t number_of_leds); + +/* + * Old interface / Internal functions + * + * The functions take a byte-array and send to the data output as WS2812 bitstream. + * The length is the number of bytes to send - three per LED. + */ + +void ws2812_sendarray (uint8_t *array,uint16_t length); +void ws2812_sendarray_mask(uint8_t *array,uint16_t length, uint8_t pinmask); + + +/* + * Internal defines + */ +#ifndef CONCAT +#define CONCAT(a, b) a ## b +#endif +#ifndef CONCAT_EXP +#define CONCAT_EXP(a, b) CONCAT(a, b) +#endif + +// #define ws2812_PORTREG CONCAT_EXP(PORT,ws2812_port) +// #define ws2812_DDRREG CONCAT_EXP(DDR,ws2812_port) + +#endif /* LIGHT_WS2812_H_ */ diff --git a/keyboard/planck/planck.c b/keyboard/planck/planck.c index b62862af04..63ca54761c 100644 --- a/keyboard/planck/planck.c +++ b/keyboard/planck/planck.c @@ -15,6 +15,11 @@ void * matrix_init_kb(void) { backlight_init_ports(); #endif + #ifdef RGBLIGHT_ENABLE + rgblight_init(); + #endif + + // Turn status LED on DDRE |= (1<<6); PORTE |= (1<<6); @@ -28,4 +33,4 @@ void * matrix_scan_kb(void) { if (matrix_scan_user) { (*matrix_scan_user)(); } -}; \ No newline at end of file +}; diff --git a/keyboard/planck/planck.h b/keyboard/planck/planck.h index e775ea7c62..00b01b54df 100644 --- a/keyboard/planck/planck.h +++ b/keyboard/planck/planck.h @@ -6,6 +6,9 @@ #ifdef BACKLIGHT_ENABLE #include "backlight.h" #endif +#ifdef RGBLIGHT_ENABLE + #include "rgblight.h" +#endif #include #ifdef MIDI_ENABLE #include @@ -22,7 +25,7 @@ { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ { k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b } \ -} +} #define PLANCK_GRID( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ @@ -35,9 +38,9 @@ { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ -} +} void * matrix_init_user(void); void * matrix_scan_user(void); -#endif \ No newline at end of file +#endif diff --git a/keyboard/planck/rgblight.c b/keyboard/planck/rgblight.c new file mode 100644 index 0000000000..552456aae3 --- /dev/null +++ b/keyboard/planck/rgblight.c @@ -0,0 +1,505 @@ +#include +#include +#include +#include "progmem.h" +#include "timer.h" +#include "rgblight.h" +#include "debug.h" + +const uint8_t DIM_CURVE[] PROGMEM = { + 0, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, + 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, + 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, + 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, + 15, 15, 16, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, + 20, 20, 21, 21, 22, 22, 22, 23, 23, 24, 24, 25, 25, 25, 26, 26, + 27, 27, 28, 28, 29, 29, 30, 30, 31, 32, 32, 33, 33, 34, 35, 35, + 36, 36, 37, 38, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 46, 47, + 48, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 68, 69, 70, 71, 73, 74, 75, 76, 78, 79, 81, 82, + 83, 85, 86, 88, 90, 91, 93, 94, 96, 98, 99, 101, 103, 105, 107, 109, + 110, 112, 114, 116, 118, 121, 123, 125, 127, 129, 132, 134, 136, 139, 141, 144, + 146, 149, 151, 154, 157, 159, 162, 165, 168, 171, 174, 177, 180, 183, 186, 190, + 193, 196, 200, 203, 207, 211, 214, 218, 222, 226, 230, 234, 238, 242, 248, 255, +}; +const uint8_t RGBLED_BREATHING_TABLE[] PROGMEM = {0,0,0,0,1,1,1,2,2,3,4,5,5,6,7,9,10,11,12,14,15,17,18,20,21,23,25,27,29,31,33,35,37,40,42,44,47,49,52,54,57,59,62,65,67,70,73,76,79,82,85,88,90,93,97,100,103,106,109,112,115,118,121,124,127,131,134,137,140,143,146,149,152,155,158,162,165,167,170,173,176,179,182,185,188,190,193,196,198,201,203,206,208,211,213,215,218,220,222,224,226,228,230,232,234,235,237,238,240,241,243,244,245,246,248,249,250,250,251,252,253,253,254,254,254,255,255,255,255,255,255,255,254,254,254,253,253,252,251,250,250,249,248,246,245,244,243,241,240,238,237,235,234,232,230,228,226,224,222,220,218,215,213,211,208,206,203,201,198,196,193,190,188,185,182,179,176,173,170,167,165,162,158,155,152,149,146,143,140,137,134,131,128,124,121,118,115,112,109,106,103,100,97,93,90,88,85,82,79,76,73,70,67,65,62,59,57,54,52,49,47,44,42,40,37,35,33,31,29,27,25,23,21,20,18,17,15,14,12,11,10,9,7,6,5,5,4,3,2,2,1,1,1,0,0,0}; +const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {30, 20, 10, 5}; +const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[] PROGMEM = {120, 60, 30}; +const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {100, 50, 20}; +const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 50, 20}; +const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {100, 50, 20}; + +rgblight_config_t rgblight_config; +rgblight_config_t inmem_config; +struct cRGB led[RGBLED_NUM]; +uint8_t rgblight_inited = 0; + + +void sethsv(uint16_t hue, uint8_t sat, uint8_t val, struct cRGB *led1) { + /* convert hue, saturation and brightness ( HSB/HSV ) to RGB + The DIM_CURVE is used only on brightness/value and on saturation (inverted). + This looks the most natural. + */ + uint8_t r, g, b; + + val = pgm_read_byte(&DIM_CURVE[val]); + sat = 255 - pgm_read_byte(&DIM_CURVE[255 - sat]); + + uint8_t base; + + if (sat == 0) { // Acromatic color (gray). Hue doesn't mind. + r = val; + g = val; + b = val; + } else { + base = ((255 - sat) * val) >> 8; + + switch (hue / 60) { + case 0: + r = val; + g = (((val - base)*hue) / 60) + base; + b = base; + break; + + case 1: + r = (((val - base)*(60 - (hue % 60))) / 60) + base; + g = val; + b = base; + break; + + case 2: + r = base; + g = val; + b = (((val - base)*(hue % 60)) / 60) + base; + break; + + case 3: + r = base; + g = (((val - base)*(60 - (hue % 60))) / 60) + base; + b = val; + break; + + case 4: + r = (((val - base)*(hue % 60)) / 60) + base; + g = base; + b = val; + break; + + case 5: + r = val; + g = base; + b = (((val - base)*(60 - (hue % 60))) / 60) + base; + break; + } + } + setrgb(r,g,b, led1); +} + +void setrgb(uint8_t r, uint8_t g, uint8_t b, struct cRGB *led1) { + (*led1).r = r; + (*led1).g = g; + (*led1).b = b; +} + + +uint32_t eeconfig_read_rgblight(void) { + return eeprom_read_dword(EECONFIG_RGBLIGHT); +} +void eeconfig_write_rgblight(uint32_t val) { + eeprom_write_dword(EECONFIG_RGBLIGHT, val); +} +void eeconfig_write_rgblight_default(void) { + dprintf("eeconfig_write_rgblight_default\n"); + rgblight_config.enable = 1; + rgblight_config.mode = 1; + rgblight_config.hue = 200; + rgblight_config.sat = 204; + rgblight_config.val = 204; + eeconfig_write_rgblight(rgblight_config.raw); +} +void eeconfig_debug_rgblight(void) { + dprintf("rgblight_config eprom\n"); + dprintf("rgblight_config.enable = %d\n", rgblight_config.enable); + dprintf("rghlight_config.mode = %d\n", rgblight_config.mode); + dprintf("rgblight_config.hue = %d\n", rgblight_config.hue); + dprintf("rgblight_config.sat = %d\n", rgblight_config.sat); + dprintf("rgblight_config.val = %d\n", rgblight_config.val); +} + +void rgblight_init(void) { + debug_enable = 1; // Debug ON! + dprintf("rgblight_init called.\n"); + rgblight_inited = 1; + dprintf("rgblight_init start!\n"); + if (!eeconfig_is_enabled()) { + dprintf("rgblight_init eeconfig is not enabled.\n"); + eeconfig_init(); + eeconfig_write_rgblight_default(); + } + rgblight_config.raw = eeconfig_read_rgblight(); + if (!rgblight_config.mode) { + dprintf("rgblight_init rgblight_config.mode = 0. Write default values to EEPROM.\n"); + eeconfig_write_rgblight_default(); + rgblight_config.raw = eeconfig_read_rgblight(); + } + eeconfig_debug_rgblight(); // display current eeprom values + + rgblight_timer_init(); // setup the timer + + if (rgblight_config.enable) { + rgblight_mode(rgblight_config.mode); + } +} + +void rgblight_increase(void) { + uint8_t mode; + if (rgblight_config.mode < RGBLIGHT_MODES) { + mode = rgblight_config.mode + 1; + } + rgblight_mode(mode); +} + +void rgblight_decrease(void) { + uint8_t mode; + if (rgblight_config.mode > 1) { //mode will never < 1, if mode is less than 1, eeprom need to be initialized. + mode = rgblight_config.mode-1; + } + rgblight_mode(mode); +} + +void rgblight_step(void) { + uint8_t mode; + mode = rgblight_config.mode + 1; + if (mode > RGBLIGHT_MODES) { + mode = 1; + } + rgblight_mode(mode); +} + +void rgblight_mode(uint8_t mode) { + if (!rgblight_config.enable) { + return; + } + if (mode<1) { + rgblight_config.mode = 1; + } else if (mode > RGBLIGHT_MODES) { + rgblight_config.mode = RGBLIGHT_MODES; + } else { + rgblight_config.mode = mode; + } + eeconfig_write_rgblight(rgblight_config.raw); + dprintf("rgblight mode: %u\n", rgblight_config.mode); + if (rgblight_config.mode == 1) { + rgblight_timer_disable(); + } else if (rgblight_config.mode >=2 && rgblight_config.mode <=23) { + // MODE 2-5, breathing + // MODE 6-8, rainbow mood + // MODE 9-14, rainbow swirl + // MODE 15-20, snake + // MODE 21-23, knight + rgblight_timer_enable(); + } + rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val); +} + +void rgblight_toggle(void) { + rgblight_config.enable ^= 1; + eeconfig_write_rgblight(rgblight_config.raw); + dprintf("rgblight toggle: rgblight_config.enable = %u\n", rgblight_config.enable); + if (rgblight_config.enable) { + rgblight_mode(rgblight_config.mode); + } else { + rgblight_timer_disable(); + _delay_ms(50); + rgblight_set(); + } +} + + +void rgblight_increase_hue(void){ + uint16_t hue; + hue = (rgblight_config.hue+RGBLIGHT_HUE_STEP) % 360; + rgblight_sethsv(hue, rgblight_config.sat, rgblight_config.val); +} +void rgblight_decrease_hue(void){ + uint16_t hue; + if (rgblight_config.hue-RGBLIGHT_HUE_STEP <0 ) { + hue = (rgblight_config.hue+360-RGBLIGHT_HUE_STEP) % 360; + } else { + hue = (rgblight_config.hue-RGBLIGHT_HUE_STEP) % 360; + } + rgblight_sethsv(hue, rgblight_config.sat, rgblight_config.val); +} +void rgblight_increase_sat(void) { + uint8_t sat; + if (rgblight_config.sat + RGBLIGHT_SAT_STEP > 255) { + sat = 255; + } else { + sat = rgblight_config.sat+RGBLIGHT_SAT_STEP; + } + rgblight_sethsv(rgblight_config.hue, sat, rgblight_config.val); +} +void rgblight_decrease_sat(void){ + uint8_t sat; + if (rgblight_config.sat - RGBLIGHT_SAT_STEP < 0) { + sat = 0; + } else { + sat = rgblight_config.sat-RGBLIGHT_SAT_STEP; + } + rgblight_sethsv(rgblight_config.hue, sat, rgblight_config.val); +} +void rgblight_increase_val(void){ + uint8_t val; + if (rgblight_config.val + RGBLIGHT_VAL_STEP > 255) { + val = 255; + } else { + val = rgblight_config.val+RGBLIGHT_VAL_STEP; + } + rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, val); +} +void rgblight_decrease_val(void) { + uint8_t val; + if (rgblight_config.val - RGBLIGHT_VAL_STEP < 0) { + val = 0; + } else { + val = rgblight_config.val-RGBLIGHT_VAL_STEP; + } + rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, val); +} + +void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val){ + inmem_config.raw = rgblight_config.raw; + if (rgblight_config.enable) { + struct cRGB tmp_led; + sethsv(hue, sat, val, &tmp_led); + inmem_config.hue = hue; + inmem_config.sat = sat; + inmem_config.val = val; + // dprintf("rgblight set hue [MEMORY]: %u,%u,%u\n", inmem_config.hue, inmem_config.sat, inmem_config.val); + rgblight_setrgb(tmp_led.r, tmp_led.g, tmp_led.b); + } +} +void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val){ + if (rgblight_config.enable) { + if (rgblight_config.mode == 1) { + // same static color + rgblight_sethsv_noeeprom(hue, sat, val); + } else { + // all LEDs in same color + if (rgblight_config.mode >= 2 && rgblight_config.mode <= 5) { + // breathing mode, ignore the change of val, use in memory value instead + val = rgblight_config.val; + } else if (rgblight_config.mode >= 6 && rgblight_config.mode <= 14) { + // rainbow mood and rainbow swirl, ignore the change of hue + hue = rgblight_config.hue; + } + } + rgblight_config.hue = hue; + rgblight_config.sat = sat; + rgblight_config.val = val; + eeconfig_write_rgblight(rgblight_config.raw); + dprintf("rgblight set hsv [EEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val); + } +} + +void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b){ + // dprintf("rgblight set rgb: %u,%u,%u\n", r,g,b); + for (uint8_t i=0;i>8)&0xff; + OCR3AL = RGBLED_TIMER_TOP&0xff; + SREG = sreg; +} +void rgblight_timer_enable(void) { + TIMSK3 |= _BV(OCIE3A); + dprintf("TIMER3 enabled.\n"); +} +void rgblight_timer_disable(void) { + TIMSK3 &= ~_BV(OCIE3A); + dprintf("TIMER3 disabled.\n"); +} +void rgblight_timer_toggle(void) { + TIMSK3 ^= _BV(OCIE3A); + dprintf("TIMER3 toggled.\n"); +} + +ISR(TIMER3_COMPA_vect) { + // Mode = 1, static light, do nothing here + if (rgblight_config.mode>=2 && rgblight_config.mode<=5) { + // mode = 2 to 5, breathing mode + rgblight_effect_breathing(rgblight_config.mode-2); + + } else if (rgblight_config.mode>=6 && rgblight_config.mode<=8) { + rgblight_effect_rainbow_mood(rgblight_config.mode-6); + } else if (rgblight_config.mode>=9 && rgblight_config.mode<=14) { + rgblight_effect_rainbow_swirl(rgblight_config.mode-9); + } else if (rgblight_config.mode>=15 && rgblight_config.mode<=20) { + rgblight_effect_snake(rgblight_config.mode-15); + } else if (rgblight_config.mode>=21 && rgblight_config.mode<=23) { + rgblight_effect_knight(rgblight_config.mode-21); + } +} + +// effects +void rgblight_effect_breathing(uint8_t interval) { + static uint8_t pos = 0; + static uint16_t last_timer = 0; + + if (timer_elapsed(last_timer)=RGBLED_NUM) k=RGBLED_NUM-1; + if (i==k) { + sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, &preled[i]); + } + } + } + if (RGBLIGHT_EFFECT_KNIGHT_OFFSET) { + for (i=0;iRGBLED_NUM+RGBLIGHT_EFFECT_KNIGHT_LENGTH) { + pos = RGBLED_NUM+RGBLIGHT_EFFECT_KNIGHT_LENGTH-1; + increament = 1; + } else { + pos += 1; + } + } + +} diff --git a/keyboard/planck/rgblight.h b/keyboard/planck/rgblight.h new file mode 100644 index 0000000000..fd39ead09f --- /dev/null +++ b/keyboard/planck/rgblight.h @@ -0,0 +1,87 @@ +#ifndef RGBLIGHT_H +#define RGBLIGHT_H + +#ifndef RGBLIGHT_MODES +#define RGBLIGHT_MODES 23 +#endif + +#ifndef RGBLIGHT_EFFECT_SNAKE_LENGTH +#define RGBLIGHT_EFFECT_SNAKE_LENGTH 7 +#endif + +#ifndef RGBLIGHT_EFFECT_KNIGHT_LENGTH +#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 7 +#endif +#ifndef RGBLIGHT_EFFECT_KNIGHT_OFFSET +#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 11 +#endif + +#ifndef RGBLIGHT_EFFECT_DUALKNIGHT_LENGTH +#define RGBLIGHT_EFFECT_DUALKNIGHT_LENGTH 4 +#endif + +#ifndef RGBLIGHT_HUE_STEP +#define RGBLIGHT_HUE_STEP 10 +#endif +#ifndef RGBLIGHT_SAT_STEP +#define RGBLIGHT_SAT_STEP 17 +#endif +#ifndef RGBLIGHT_VAL_STEP +#define RGBLIGHT_VAL_STEP 17 +#endif + +#define RGBLED_TIMER_TOP F_CPU/(256*64) + +#include +#include +#include "eeconfig.h" +#include "light_ws2812.h" + +typedef union { + uint32_t raw; + struct { + bool enable :1; + uint8_t mode :6; + uint16_t hue :9; + uint8_t sat :8; + uint8_t val :8; + }; +} rgblight_config_t; + +void rgblight_init(void); +void rgblight_increase(void); +void rgblight_decrease(void); +void rgblight_toggle(void); +void rgblight_step(void); +void rgblight_mode(uint8_t mode); +void rgblight_set(void); +void rgblight_increase_hue(void); +void rgblight_decrease_hue(void); +void rgblight_increase_sat(void); +void rgblight_decrease_sat(void); +void rgblight_increase_val(void); +void rgblight_decrease_val(void); +void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val); +void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b); + +#define EECONFIG_RGBLIGHT (uint8_t *)7 +uint32_t eeconfig_read_rgblight(void); +void eeconfig_write_rgblight(uint32_t val); +void eeconfig_write_rgblight_default(void); +void eeconfig_debug_rgblight(void); + +void sethsv(uint16_t hue, uint8_t sat, uint8_t val, struct cRGB *led1); +void setrgb(uint8_t r, uint8_t g, uint8_t b, struct cRGB *led1); +void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val); + +void rgblight_timer_init(void); +void rgblight_timer_enable(void); +void rgblight_timer_disable(void); +void rgblight_timer_toggle(void); +void rgblight_effect_breathing(uint8_t interval); +void rgblight_effect_rainbow_mood(uint8_t interval); +void rgblight_effect_rainbow_swirl(uint8_t interval); +void rgblight_effect_snake(uint8_t interval); +void rgblight_effect_knight(uint8_t interval); + +#endif -- cgit v1.2.3 From ba9ac457b2159097ecfd9848c5171c52e3a68260 Mon Sep 17 00:00:00 2001 From: Yang Liu Date: Sun, 24 Jan 2016 17:05:47 -0800 Subject: Integrate WS2812 code into quantum core --- keyboard/planck/Makefile | 8 +- keyboard/planck/config.h | 6 - keyboard/planck/light_ws2812.c | 181 --------------- keyboard/planck/light_ws2812.h | 73 ------ keyboard/planck/rgblight.c | 505 ----------------------------------------- keyboard/planck/rgblight.h | 87 ------- 6 files changed, 1 insertion(+), 859 deletions(-) delete mode 100755 keyboard/planck/light_ws2812.c delete mode 100755 keyboard/planck/light_ws2812.h delete mode 100644 keyboard/planck/rgblight.c delete mode 100644 keyboard/planck/rgblight.h (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index d37005260a..7619399b98 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -143,18 +143,12 @@ BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality # AUDIO_ENABLE = YES # Audio output on port C6 # UNICODE_ENABLE = YES # Unicode # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 bottom RGB light +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with MIDI at the same time. ifdef BACKLIGHT_ENABLE SRC += backlight.c endif -ifdef RGBLIGHT_ENABLE - SRC += light_ws2812.c - SRC += rgblight.c - OPT_DEFS += -DRGBLIGHT_ENABLE -endif - # Optimize size but this may cause error "relocation truncated to fit" #EXTRALDFLAGS = -Wl,--relax diff --git a/keyboard/planck/config.h b/keyboard/planck/config.h index 856de73066..d3719e0cb1 100644 --- a/keyboard/planck/config.h +++ b/keyboard/planck/config.h @@ -63,15 +63,9 @@ along with this program. If not, see . #define ws2812_DDRREG DDRD #define ws2812_pin PD1 #define RGBLED_NUM 28 // Number of LEDs -#ifndef RGBLIGHT_HUE_STEP #define RGBLIGHT_HUE_STEP 10 -#endif -#ifndef RGBLIGHT_SAT_STEP #define RGBLIGHT_SAT_STEP 17 -#endif -#ifndef RGBLIGHT_VAL_STEP #define RGBLIGHT_VAL_STEP 17 -#endif /* * Feature disable options diff --git a/keyboard/planck/light_ws2812.c b/keyboard/planck/light_ws2812.c deleted file mode 100755 index f20043067e..0000000000 --- a/keyboard/planck/light_ws2812.c +++ /dev/null @@ -1,181 +0,0 @@ -/* -* light weight WS2812 lib V2.0b -* -* Controls WS2811/WS2812/WS2812B RGB-LEDs -* Author: Tim (cpldcpu@gmail.com) -* -* Jan 18th, 2014 v2.0b Initial Version -* Nov 29th, 2015 v2.3 Added SK6812RGBW support -* -* License: GNU GPL v2 (see License.txt) -*/ - -#include "light_ws2812.h" -#include -#include -#include -#include "debug.h" - -// Setleds for standard RGB -void inline ws2812_setleds(struct cRGB *ledarray, uint16_t leds) -{ - ws2812_setleds_pin(ledarray,leds, _BV(ws2812_pin)); -} - -void inline ws2812_setleds_pin(struct cRGB *ledarray, uint16_t leds, uint8_t pinmask) -{ - ws2812_DDRREG |= pinmask; // Enable DDR - ws2812_sendarray_mask((uint8_t*)ledarray,leds+leds+leds,pinmask); - _delay_us(50); -} - -// Setleds for SK6812RGBW -void inline ws2812_setleds_rgbw(struct cRGBW *ledarray, uint16_t leds) -{ - ws2812_DDRREG |= _BV(ws2812_pin); // Enable DDR - ws2812_sendarray_mask((uint8_t*)ledarray,leds<<2,_BV(ws2812_pin)); - _delay_us(80); -} - -void ws2812_sendarray(uint8_t *data,uint16_t datlen) -{ - ws2812_sendarray_mask(data,datlen,_BV(ws2812_pin)); -} - -/* - This routine writes an array of bytes with RGB values to the Dataout pin - using the fast 800kHz clockless WS2811/2812 protocol. -*/ - -// Timing in ns -#define w_zeropulse 350 -#define w_onepulse 900 -#define w_totalperiod 1250 - -// Fixed cycles used by the inner loop -#define w_fixedlow 2 -#define w_fixedhigh 4 -#define w_fixedtotal 8 - -// Insert NOPs to match the timing, if possible -#define w_zerocycles (((F_CPU/1000)*w_zeropulse )/1000000) -#define w_onecycles (((F_CPU/1000)*w_onepulse +500000)/1000000) -#define w_totalcycles (((F_CPU/1000)*w_totalperiod +500000)/1000000) - -// w1 - nops between rising edge and falling edge - low -#define w1 (w_zerocycles-w_fixedlow) -// w2 nops between fe low and fe high -#define w2 (w_onecycles-w_fixedhigh-w1) -// w3 nops to complete loop -#define w3 (w_totalcycles-w_fixedtotal-w1-w2) - -#if w1>0 - #define w1_nops w1 -#else - #define w1_nops 0 -#endif - -// The only critical timing parameter is the minimum pulse length of the "0" -// Warn or throw error if this timing can not be met with current F_CPU settings. -#define w_lowtime ((w1_nops+w_fixedlow)*1000000)/(F_CPU/1000) -#if w_lowtime>550 - #error "Light_ws2812: Sorry, the clock speed is too low. Did you set F_CPU correctly?" -#elif w_lowtime>450 - #warning "Light_ws2812: The timing is critical and may only work on WS2812B, not on WS2812(S)." - #warning "Please consider a higher clockspeed, if possible" -#endif - -#if w2>0 -#define w2_nops w2 -#else -#define w2_nops 0 -#endif - -#if w3>0 -#define w3_nops w3 -#else -#define w3_nops 0 -#endif - -#define w_nop1 "nop \n\t" -#define w_nop2 "rjmp .+0 \n\t" -#define w_nop4 w_nop2 w_nop2 -#define w_nop8 w_nop4 w_nop4 -#define w_nop16 w_nop8 w_nop8 - -void inline ws2812_sendarray_mask(uint8_t *data,uint16_t datlen,uint8_t maskhi) -{ - uint8_t curbyte,ctr,masklo; - uint8_t sreg_prev; - - masklo =~maskhi&ws2812_PORTREG; - maskhi |= ws2812_PORTREG; - sreg_prev=SREG; - cli(); - - while (datlen--) { - curbyte=*data++; - - asm volatile( - " ldi %0,8 \n\t" - "loop%=: \n\t" - " out %2,%3 \n\t" // '1' [01] '0' [01] - re -#if (w1_nops&1) -w_nop1 -#endif -#if (w1_nops&2) -w_nop2 -#endif -#if (w1_nops&4) -w_nop4 -#endif -#if (w1_nops&8) -w_nop8 -#endif -#if (w1_nops&16) -w_nop16 -#endif - " sbrs %1,7 \n\t" // '1' [03] '0' [02] - " out %2,%4 \n\t" // '1' [--] '0' [03] - fe-low - " lsl %1 \n\t" // '1' [04] '0' [04] -#if (w2_nops&1) - w_nop1 -#endif -#if (w2_nops&2) - w_nop2 -#endif -#if (w2_nops&4) - w_nop4 -#endif -#if (w2_nops&8) - w_nop8 -#endif -#if (w2_nops&16) - w_nop16 -#endif - " out %2,%4 \n\t" // '1' [+1] '0' [+1] - fe-high -#if (w3_nops&1) -w_nop1 -#endif -#if (w3_nops&2) -w_nop2 -#endif -#if (w3_nops&4) -w_nop4 -#endif -#if (w3_nops&8) -w_nop8 -#endif -#if (w3_nops&16) -w_nop16 -#endif - - " dec %0 \n\t" // '1' [+2] '0' [+2] - " brne loop%=\n\t" // '1' [+3] '0' [+4] - : "=&d" (ctr) - : "r" (curbyte), "I" (_SFR_IO_ADDR(ws2812_PORTREG)), "r" (maskhi), "r" (masklo) - ); - } - - SREG=sreg_prev; -} diff --git a/keyboard/planck/light_ws2812.h b/keyboard/planck/light_ws2812.h deleted file mode 100755 index 54eef22d9e..0000000000 --- a/keyboard/planck/light_ws2812.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * light weight WS2812 lib include - * - * Version 2.3 - Nev 29th 2015 - * Author: Tim (cpldcpu@gmail.com) - * - * Please do not change this file! All configuration is handled in "ws2812_config.h" - * - * License: GNU GPL v2 (see License.txt) - + - */ - -#ifndef LIGHT_WS2812_H_ -#define LIGHT_WS2812_H_ - -#include -#include -//#include "ws2812_config.h" - -/* - * Structure of the LED array - * - * cRGB: RGB for WS2812S/B/C/D, SK6812, SK6812Mini, SK6812WWA, APA104, APA106 - * cRGBW: RGBW for SK6812RGBW - */ - -struct cRGB { uint8_t g; uint8_t r; uint8_t b; }; -struct cRGBW { uint8_t g; uint8_t r; uint8_t b; uint8_t w;}; - - - -/* User Interface - * - * Input: - * ledarray: An array of GRB data describing the LED colors - * number_of_leds: The number of LEDs to write - * pinmask (optional): Bitmask describing the output bin. e.g. _BV(PB0) - * - * The functions will perform the following actions: - * - Set the data-out pin as output - * - Send out the LED data - * - Wait 50�s to reset the LEDs - */ - -void ws2812_setleds (struct cRGB *ledarray, uint16_t number_of_leds); -void ws2812_setleds_pin (struct cRGB *ledarray, uint16_t number_of_leds,uint8_t pinmask); -void ws2812_setleds_rgbw(struct cRGBW *ledarray, uint16_t number_of_leds); - -/* - * Old interface / Internal functions - * - * The functions take a byte-array and send to the data output as WS2812 bitstream. - * The length is the number of bytes to send - three per LED. - */ - -void ws2812_sendarray (uint8_t *array,uint16_t length); -void ws2812_sendarray_mask(uint8_t *array,uint16_t length, uint8_t pinmask); - - -/* - * Internal defines - */ -#ifndef CONCAT -#define CONCAT(a, b) a ## b -#endif -#ifndef CONCAT_EXP -#define CONCAT_EXP(a, b) CONCAT(a, b) -#endif - -// #define ws2812_PORTREG CONCAT_EXP(PORT,ws2812_port) -// #define ws2812_DDRREG CONCAT_EXP(DDR,ws2812_port) - -#endif /* LIGHT_WS2812_H_ */ diff --git a/keyboard/planck/rgblight.c b/keyboard/planck/rgblight.c deleted file mode 100644 index 552456aae3..0000000000 --- a/keyboard/planck/rgblight.c +++ /dev/null @@ -1,505 +0,0 @@ -#include -#include -#include -#include "progmem.h" -#include "timer.h" -#include "rgblight.h" -#include "debug.h" - -const uint8_t DIM_CURVE[] PROGMEM = { - 0, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, - 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, - 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, - 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, - 15, 15, 16, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, - 20, 20, 21, 21, 22, 22, 22, 23, 23, 24, 24, 25, 25, 25, 26, 26, - 27, 27, 28, 28, 29, 29, 30, 30, 31, 32, 32, 33, 33, 34, 35, 35, - 36, 36, 37, 38, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 46, 47, - 48, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 68, 69, 70, 71, 73, 74, 75, 76, 78, 79, 81, 82, - 83, 85, 86, 88, 90, 91, 93, 94, 96, 98, 99, 101, 103, 105, 107, 109, - 110, 112, 114, 116, 118, 121, 123, 125, 127, 129, 132, 134, 136, 139, 141, 144, - 146, 149, 151, 154, 157, 159, 162, 165, 168, 171, 174, 177, 180, 183, 186, 190, - 193, 196, 200, 203, 207, 211, 214, 218, 222, 226, 230, 234, 238, 242, 248, 255, -}; -const uint8_t RGBLED_BREATHING_TABLE[] PROGMEM = {0,0,0,0,1,1,1,2,2,3,4,5,5,6,7,9,10,11,12,14,15,17,18,20,21,23,25,27,29,31,33,35,37,40,42,44,47,49,52,54,57,59,62,65,67,70,73,76,79,82,85,88,90,93,97,100,103,106,109,112,115,118,121,124,127,131,134,137,140,143,146,149,152,155,158,162,165,167,170,173,176,179,182,185,188,190,193,196,198,201,203,206,208,211,213,215,218,220,222,224,226,228,230,232,234,235,237,238,240,241,243,244,245,246,248,249,250,250,251,252,253,253,254,254,254,255,255,255,255,255,255,255,254,254,254,253,253,252,251,250,250,249,248,246,245,244,243,241,240,238,237,235,234,232,230,228,226,224,222,220,218,215,213,211,208,206,203,201,198,196,193,190,188,185,182,179,176,173,170,167,165,162,158,155,152,149,146,143,140,137,134,131,128,124,121,118,115,112,109,106,103,100,97,93,90,88,85,82,79,76,73,70,67,65,62,59,57,54,52,49,47,44,42,40,37,35,33,31,29,27,25,23,21,20,18,17,15,14,12,11,10,9,7,6,5,5,4,3,2,2,1,1,1,0,0,0}; -const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {30, 20, 10, 5}; -const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[] PROGMEM = {120, 60, 30}; -const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {100, 50, 20}; -const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 50, 20}; -const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {100, 50, 20}; - -rgblight_config_t rgblight_config; -rgblight_config_t inmem_config; -struct cRGB led[RGBLED_NUM]; -uint8_t rgblight_inited = 0; - - -void sethsv(uint16_t hue, uint8_t sat, uint8_t val, struct cRGB *led1) { - /* convert hue, saturation and brightness ( HSB/HSV ) to RGB - The DIM_CURVE is used only on brightness/value and on saturation (inverted). - This looks the most natural. - */ - uint8_t r, g, b; - - val = pgm_read_byte(&DIM_CURVE[val]); - sat = 255 - pgm_read_byte(&DIM_CURVE[255 - sat]); - - uint8_t base; - - if (sat == 0) { // Acromatic color (gray). Hue doesn't mind. - r = val; - g = val; - b = val; - } else { - base = ((255 - sat) * val) >> 8; - - switch (hue / 60) { - case 0: - r = val; - g = (((val - base)*hue) / 60) + base; - b = base; - break; - - case 1: - r = (((val - base)*(60 - (hue % 60))) / 60) + base; - g = val; - b = base; - break; - - case 2: - r = base; - g = val; - b = (((val - base)*(hue % 60)) / 60) + base; - break; - - case 3: - r = base; - g = (((val - base)*(60 - (hue % 60))) / 60) + base; - b = val; - break; - - case 4: - r = (((val - base)*(hue % 60)) / 60) + base; - g = base; - b = val; - break; - - case 5: - r = val; - g = base; - b = (((val - base)*(60 - (hue % 60))) / 60) + base; - break; - } - } - setrgb(r,g,b, led1); -} - -void setrgb(uint8_t r, uint8_t g, uint8_t b, struct cRGB *led1) { - (*led1).r = r; - (*led1).g = g; - (*led1).b = b; -} - - -uint32_t eeconfig_read_rgblight(void) { - return eeprom_read_dword(EECONFIG_RGBLIGHT); -} -void eeconfig_write_rgblight(uint32_t val) { - eeprom_write_dword(EECONFIG_RGBLIGHT, val); -} -void eeconfig_write_rgblight_default(void) { - dprintf("eeconfig_write_rgblight_default\n"); - rgblight_config.enable = 1; - rgblight_config.mode = 1; - rgblight_config.hue = 200; - rgblight_config.sat = 204; - rgblight_config.val = 204; - eeconfig_write_rgblight(rgblight_config.raw); -} -void eeconfig_debug_rgblight(void) { - dprintf("rgblight_config eprom\n"); - dprintf("rgblight_config.enable = %d\n", rgblight_config.enable); - dprintf("rghlight_config.mode = %d\n", rgblight_config.mode); - dprintf("rgblight_config.hue = %d\n", rgblight_config.hue); - dprintf("rgblight_config.sat = %d\n", rgblight_config.sat); - dprintf("rgblight_config.val = %d\n", rgblight_config.val); -} - -void rgblight_init(void) { - debug_enable = 1; // Debug ON! - dprintf("rgblight_init called.\n"); - rgblight_inited = 1; - dprintf("rgblight_init start!\n"); - if (!eeconfig_is_enabled()) { - dprintf("rgblight_init eeconfig is not enabled.\n"); - eeconfig_init(); - eeconfig_write_rgblight_default(); - } - rgblight_config.raw = eeconfig_read_rgblight(); - if (!rgblight_config.mode) { - dprintf("rgblight_init rgblight_config.mode = 0. Write default values to EEPROM.\n"); - eeconfig_write_rgblight_default(); - rgblight_config.raw = eeconfig_read_rgblight(); - } - eeconfig_debug_rgblight(); // display current eeprom values - - rgblight_timer_init(); // setup the timer - - if (rgblight_config.enable) { - rgblight_mode(rgblight_config.mode); - } -} - -void rgblight_increase(void) { - uint8_t mode; - if (rgblight_config.mode < RGBLIGHT_MODES) { - mode = rgblight_config.mode + 1; - } - rgblight_mode(mode); -} - -void rgblight_decrease(void) { - uint8_t mode; - if (rgblight_config.mode > 1) { //mode will never < 1, if mode is less than 1, eeprom need to be initialized. - mode = rgblight_config.mode-1; - } - rgblight_mode(mode); -} - -void rgblight_step(void) { - uint8_t mode; - mode = rgblight_config.mode + 1; - if (mode > RGBLIGHT_MODES) { - mode = 1; - } - rgblight_mode(mode); -} - -void rgblight_mode(uint8_t mode) { - if (!rgblight_config.enable) { - return; - } - if (mode<1) { - rgblight_config.mode = 1; - } else if (mode > RGBLIGHT_MODES) { - rgblight_config.mode = RGBLIGHT_MODES; - } else { - rgblight_config.mode = mode; - } - eeconfig_write_rgblight(rgblight_config.raw); - dprintf("rgblight mode: %u\n", rgblight_config.mode); - if (rgblight_config.mode == 1) { - rgblight_timer_disable(); - } else if (rgblight_config.mode >=2 && rgblight_config.mode <=23) { - // MODE 2-5, breathing - // MODE 6-8, rainbow mood - // MODE 9-14, rainbow swirl - // MODE 15-20, snake - // MODE 21-23, knight - rgblight_timer_enable(); - } - rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val); -} - -void rgblight_toggle(void) { - rgblight_config.enable ^= 1; - eeconfig_write_rgblight(rgblight_config.raw); - dprintf("rgblight toggle: rgblight_config.enable = %u\n", rgblight_config.enable); - if (rgblight_config.enable) { - rgblight_mode(rgblight_config.mode); - } else { - rgblight_timer_disable(); - _delay_ms(50); - rgblight_set(); - } -} - - -void rgblight_increase_hue(void){ - uint16_t hue; - hue = (rgblight_config.hue+RGBLIGHT_HUE_STEP) % 360; - rgblight_sethsv(hue, rgblight_config.sat, rgblight_config.val); -} -void rgblight_decrease_hue(void){ - uint16_t hue; - if (rgblight_config.hue-RGBLIGHT_HUE_STEP <0 ) { - hue = (rgblight_config.hue+360-RGBLIGHT_HUE_STEP) % 360; - } else { - hue = (rgblight_config.hue-RGBLIGHT_HUE_STEP) % 360; - } - rgblight_sethsv(hue, rgblight_config.sat, rgblight_config.val); -} -void rgblight_increase_sat(void) { - uint8_t sat; - if (rgblight_config.sat + RGBLIGHT_SAT_STEP > 255) { - sat = 255; - } else { - sat = rgblight_config.sat+RGBLIGHT_SAT_STEP; - } - rgblight_sethsv(rgblight_config.hue, sat, rgblight_config.val); -} -void rgblight_decrease_sat(void){ - uint8_t sat; - if (rgblight_config.sat - RGBLIGHT_SAT_STEP < 0) { - sat = 0; - } else { - sat = rgblight_config.sat-RGBLIGHT_SAT_STEP; - } - rgblight_sethsv(rgblight_config.hue, sat, rgblight_config.val); -} -void rgblight_increase_val(void){ - uint8_t val; - if (rgblight_config.val + RGBLIGHT_VAL_STEP > 255) { - val = 255; - } else { - val = rgblight_config.val+RGBLIGHT_VAL_STEP; - } - rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, val); -} -void rgblight_decrease_val(void) { - uint8_t val; - if (rgblight_config.val - RGBLIGHT_VAL_STEP < 0) { - val = 0; - } else { - val = rgblight_config.val-RGBLIGHT_VAL_STEP; - } - rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, val); -} - -void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val){ - inmem_config.raw = rgblight_config.raw; - if (rgblight_config.enable) { - struct cRGB tmp_led; - sethsv(hue, sat, val, &tmp_led); - inmem_config.hue = hue; - inmem_config.sat = sat; - inmem_config.val = val; - // dprintf("rgblight set hue [MEMORY]: %u,%u,%u\n", inmem_config.hue, inmem_config.sat, inmem_config.val); - rgblight_setrgb(tmp_led.r, tmp_led.g, tmp_led.b); - } -} -void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val){ - if (rgblight_config.enable) { - if (rgblight_config.mode == 1) { - // same static color - rgblight_sethsv_noeeprom(hue, sat, val); - } else { - // all LEDs in same color - if (rgblight_config.mode >= 2 && rgblight_config.mode <= 5) { - // breathing mode, ignore the change of val, use in memory value instead - val = rgblight_config.val; - } else if (rgblight_config.mode >= 6 && rgblight_config.mode <= 14) { - // rainbow mood and rainbow swirl, ignore the change of hue - hue = rgblight_config.hue; - } - } - rgblight_config.hue = hue; - rgblight_config.sat = sat; - rgblight_config.val = val; - eeconfig_write_rgblight(rgblight_config.raw); - dprintf("rgblight set hsv [EEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val); - } -} - -void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b){ - // dprintf("rgblight set rgb: %u,%u,%u\n", r,g,b); - for (uint8_t i=0;i>8)&0xff; - OCR3AL = RGBLED_TIMER_TOP&0xff; - SREG = sreg; -} -void rgblight_timer_enable(void) { - TIMSK3 |= _BV(OCIE3A); - dprintf("TIMER3 enabled.\n"); -} -void rgblight_timer_disable(void) { - TIMSK3 &= ~_BV(OCIE3A); - dprintf("TIMER3 disabled.\n"); -} -void rgblight_timer_toggle(void) { - TIMSK3 ^= _BV(OCIE3A); - dprintf("TIMER3 toggled.\n"); -} - -ISR(TIMER3_COMPA_vect) { - // Mode = 1, static light, do nothing here - if (rgblight_config.mode>=2 && rgblight_config.mode<=5) { - // mode = 2 to 5, breathing mode - rgblight_effect_breathing(rgblight_config.mode-2); - - } else if (rgblight_config.mode>=6 && rgblight_config.mode<=8) { - rgblight_effect_rainbow_mood(rgblight_config.mode-6); - } else if (rgblight_config.mode>=9 && rgblight_config.mode<=14) { - rgblight_effect_rainbow_swirl(rgblight_config.mode-9); - } else if (rgblight_config.mode>=15 && rgblight_config.mode<=20) { - rgblight_effect_snake(rgblight_config.mode-15); - } else if (rgblight_config.mode>=21 && rgblight_config.mode<=23) { - rgblight_effect_knight(rgblight_config.mode-21); - } -} - -// effects -void rgblight_effect_breathing(uint8_t interval) { - static uint8_t pos = 0; - static uint16_t last_timer = 0; - - if (timer_elapsed(last_timer)=RGBLED_NUM) k=RGBLED_NUM-1; - if (i==k) { - sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, &preled[i]); - } - } - } - if (RGBLIGHT_EFFECT_KNIGHT_OFFSET) { - for (i=0;iRGBLED_NUM+RGBLIGHT_EFFECT_KNIGHT_LENGTH) { - pos = RGBLED_NUM+RGBLIGHT_EFFECT_KNIGHT_LENGTH-1; - increament = 1; - } else { - pos += 1; - } - } - -} diff --git a/keyboard/planck/rgblight.h b/keyboard/planck/rgblight.h deleted file mode 100644 index fd39ead09f..0000000000 --- a/keyboard/planck/rgblight.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef RGBLIGHT_H -#define RGBLIGHT_H - -#ifndef RGBLIGHT_MODES -#define RGBLIGHT_MODES 23 -#endif - -#ifndef RGBLIGHT_EFFECT_SNAKE_LENGTH -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 7 -#endif - -#ifndef RGBLIGHT_EFFECT_KNIGHT_LENGTH -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 7 -#endif -#ifndef RGBLIGHT_EFFECT_KNIGHT_OFFSET -#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 11 -#endif - -#ifndef RGBLIGHT_EFFECT_DUALKNIGHT_LENGTH -#define RGBLIGHT_EFFECT_DUALKNIGHT_LENGTH 4 -#endif - -#ifndef RGBLIGHT_HUE_STEP -#define RGBLIGHT_HUE_STEP 10 -#endif -#ifndef RGBLIGHT_SAT_STEP -#define RGBLIGHT_SAT_STEP 17 -#endif -#ifndef RGBLIGHT_VAL_STEP -#define RGBLIGHT_VAL_STEP 17 -#endif - -#define RGBLED_TIMER_TOP F_CPU/(256*64) - -#include -#include -#include "eeconfig.h" -#include "light_ws2812.h" - -typedef union { - uint32_t raw; - struct { - bool enable :1; - uint8_t mode :6; - uint16_t hue :9; - uint8_t sat :8; - uint8_t val :8; - }; -} rgblight_config_t; - -void rgblight_init(void); -void rgblight_increase(void); -void rgblight_decrease(void); -void rgblight_toggle(void); -void rgblight_step(void); -void rgblight_mode(uint8_t mode); -void rgblight_set(void); -void rgblight_increase_hue(void); -void rgblight_decrease_hue(void); -void rgblight_increase_sat(void); -void rgblight_decrease_sat(void); -void rgblight_increase_val(void); -void rgblight_decrease_val(void); -void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val); -void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b); - -#define EECONFIG_RGBLIGHT (uint8_t *)7 -uint32_t eeconfig_read_rgblight(void); -void eeconfig_write_rgblight(uint32_t val); -void eeconfig_write_rgblight_default(void); -void eeconfig_debug_rgblight(void); - -void sethsv(uint16_t hue, uint8_t sat, uint8_t val, struct cRGB *led1); -void setrgb(uint8_t r, uint8_t g, uint8_t b, struct cRGB *led1); -void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val); - -void rgblight_timer_init(void); -void rgblight_timer_enable(void); -void rgblight_timer_disable(void); -void rgblight_timer_toggle(void); -void rgblight_effect_breathing(uint8_t interval); -void rgblight_effect_rainbow_mood(uint8_t interval); -void rgblight_effect_rainbow_swirl(uint8_t interval); -void rgblight_effect_snake(uint8_t interval); -void rgblight_effect_knight(uint8_t interval); - -#endif -- cgit v1.2.3 From 84657a9e4be2dfa54338b659d8f0a49c2f50e3f4 Mon Sep 17 00:00:00 2001 From: Yang Liu Date: Sun, 24 Jan 2016 17:54:35 -0800 Subject: Add a photo for the demonstration of RGB underflow --- .../planck/keymaps/yang/planck-with-rgb-underglow.jpg | Bin 0 -> 343033 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 keyboard/planck/keymaps/yang/planck-with-rgb-underglow.jpg (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymaps/yang/planck-with-rgb-underglow.jpg b/keyboard/planck/keymaps/yang/planck-with-rgb-underglow.jpg new file mode 100644 index 0000000000..c636b9a83d Binary files /dev/null and b/keyboard/planck/keymaps/yang/planck-with-rgb-underglow.jpg differ -- cgit v1.2.3 From 2d29795de81b6655735ee5b74a57deaaa4c63f1d Mon Sep 17 00:00:00 2001 From: Yang Liu Date: Sun, 24 Jan 2016 17:56:43 -0800 Subject: add one more photo --- keyboard/planck/keymaps/yang/WS2812-wiring.jpg | Bin 0 -> 290495 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 keyboard/planck/keymaps/yang/WS2812-wiring.jpg (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymaps/yang/WS2812-wiring.jpg b/keyboard/planck/keymaps/yang/WS2812-wiring.jpg new file mode 100644 index 0000000000..2c65cd283a Binary files /dev/null and b/keyboard/planck/keymaps/yang/WS2812-wiring.jpg differ -- cgit v1.2.3 From f277079dfa831d44456f00f307e26cf79d36c03d Mon Sep 17 00:00:00 2001 From: Yang Liu Date: Sun, 24 Jan 2016 18:16:40 -0800 Subject: no message --- keyboard/planck/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index 7619399b98..307b0c7f4f 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -137,13 +137,13 @@ CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +# NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality # MIDI_ENABLE = YES # MIDI controls # AUDIO_ENABLE = YES # Audio output on port C6 # UNICODE_ENABLE = YES # Unicode # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with MIDI at the same time. +# RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with MIDI at the same time. ifdef BACKLIGHT_ENABLE SRC += backlight.c -- cgit v1.2.3