From e7289bb029b28b824eb0ef7be23dba279057d7ac Mon Sep 17 00:00:00 2001 From: Nathan Ross Powell Date: Fri, 16 Jan 2015 00:07:22 -0500 Subject: KC_INSERT should be KC_INS The short name was incorrectly set as `KC_INT` when we want `KC_INS`. --- keyboard/planck/.keymap_nathan.c.swp | Bin 0 -> 20480 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 keyboard/planck/.keymap_nathan.c.swp (limited to 'keyboard/planck') diff --git a/keyboard/planck/.keymap_nathan.c.swp b/keyboard/planck/.keymap_nathan.c.swp new file mode 100644 index 0000000000..d545015c2b Binary files /dev/null and b/keyboard/planck/.keymap_nathan.c.swp differ -- cgit v1.2.3 From ceff93844bdde7b002fb9abc66b583126c2ae907 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 2 Mar 2015 20:37:17 -0500 Subject: simon --- keyboard/planck/keymap_brett.c | 4 ++-- keyboard/planck/keymap_jack.c | 2 +- keyboard/planck/keymap_simon.c | 44 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 keyboard/planck/keymap_simon.c (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymap_brett.c b/keyboard/planck/keymap_brett.c index 16a12837cc..378e78149f 100644 --- a/keyboard/planck/keymap_brett.c +++ b/keyboard/planck/keymap_brett.c @@ -5,7 +5,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, LCTL, A, S, D, F, G, H, J, K, L, SCLN, ENT, LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, - LGUI, TAB, LCTL, LALT, FN2, SPC, FN1, LEFT, DOWN, UP, RGHT), + LGUI, TAB, RSFT, LALT, FN2, SPC, FN1, LEFT, DOWN, UP, RGHT), [1] = KEYMAP( /* RAISE */ GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, DEL, TRNS, F1, F2, F3, F4, F5, F6, 4, 5, 6, TRNS, TRNS, @@ -13,7 +13,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { MPRV, MNXT, TRNS, MUTE, TRNS, TRNS, FN1, TRNS, TRNS, TRNS, PGDN), [2] = KEYMAP( /* LOWER */ FN22, FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, MINS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, EQL, + TRNS, TRNS, TRNS, PAUSE, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, EQL, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MPLY, MSTP, VOLU, VOLD, FN2, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), }; diff --git a/keyboard/planck/keymap_jack.c b/keyboard/planck/keymap_jack.c index 3724bca49f..c74812121f 100644 --- a/keyboard/planck/keymap_jack.c +++ b/keyboard/planck/keymap_jack.c @@ -24,7 +24,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; const uint16_t PROGMEM fn_actions[] = { [1] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay - [2] = ACTION_LAYER_MOMENTARY(3), // to Fn overlay + [2] = ACTION_LAYER_MOMENTARY(3), // to Fn overlay [3] = ACTION_DEFAULT_LAYER_SET(0), [4] = ACTION_DEFAULT_LAYER_SET(1), diff --git a/keyboard/planck/keymap_simon.c b/keyboard/planck/keymap_simon.c new file mode 100644 index 0000000000..37951364be --- /dev/null +++ b/keyboard/planck/keymap_simon.c @@ -0,0 +1,44 @@ +#include "keymap_common.h" + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP( /* Jack */ + ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, + TAB, A, S, D, F, G, H, J, K, L, DOT, ENT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SCLN, DEL, + LCTL, ENT, LALT, CAPS, FN2, SPC, FN1, LEFT, DOWN, UP, RGHT), +[1] = KEYMAP( /* Jack RAISE */ + TRNS, F1, F2, F3, F4, NO, FN11, FN9, FN12, NO, FN14, TRNS, + TRNS, F5, F6, F7, F8, FN16, SLSH, MINS, EQL, LBRC, FN8, TRNS, + TRNS, F9, F10, F11, F12, F15, F16, FN22, SCLN, MINS, QUOT, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +[2] = KEYMAP( /* Jack LOWER */ + FN22, 1, 2, 3, FN13, FN14, FN15, FN16, FN17, FN18, FN19, BSPC, + TRNS, 4, 5, 6, TRNS, TRNS, TRNS, FN20, FN21, FN23, FN24, FN28, + TRNS, 7, 8, 9, 0, FN28, FN15, F7, F8, F9, F10, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay + [2] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay + + [8] = ACTION_MODS_KEY(MOD_LSFT, KC_SLSH), + [9] = ACTION_MODS_KEY(MOD_LSFT, KC_QUOT), + [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), + [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), + + [29] = ACTION_MODS_KEY(MOD_LSFT | MOD_RSFT, KC_PAUSE), +}; -- cgit v1.2.3 From 0fcb3b65f8f980bee606b3be44cad1469c42ea86 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 5 Mar 2015 14:29:33 -0500 Subject: brett --- keyboard/planck/keymap_brett.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymap_brett.c b/keyboard/planck/keymap_brett.c index 378e78149f..97d832b47a 100644 --- a/keyboard/planck/keymap_brett.c +++ b/keyboard/planck/keymap_brett.c @@ -5,15 +5,15 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, LCTL, A, S, D, F, G, H, J, K, L, SCLN, ENT, LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, - LGUI, TAB, RSFT, LALT, FN2, SPC, FN1, LEFT, DOWN, UP, RGHT), + TAB, LGUI, RSFT, LALT, FN2, SPC, FN1, LEFT, DOWN, UP, RGHT), [1] = KEYMAP( /* RAISE */ GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, DEL, - TRNS, F1, F2, F3, F4, F5, F6, 4, 5, 6, TRNS, TRNS, - TRNS, F7, F8, F9, F10, F11, F12, 1, 2, 3, TRNS, PGUP, - MPRV, MNXT, TRNS, MUTE, TRNS, TRNS, FN1, TRNS, TRNS, TRNS, PGDN), + TRNS, F1, F2, F3, F4, F5, F6, 4, 5, 6, QUOT, TRNS, + TRNS, F7, F8, F9, F10, F11, F12, 1, 2, 3, TRNS, PGUP, + MPRV, MNXT, TRNS, MUTE, TRNS, TRNS, FN1, 0, 0, TRNS, PGDN), [2] = KEYMAP( /* LOWER */ - FN22, FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, MINS, - TRNS, TRNS, TRNS, PAUSE, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, EQL, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MINS, + TRNS, TRNS, TRNS, PAUSE, TRNS, TRNS, TRNS, TRNS, LBRC, RBRC, BSLS, EQL, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MPLY, MSTP, VOLU, VOLD, FN2, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), }; -- cgit v1.2.3 From 15b9bce6bab13d85529fe9aaa91b3df9cd773e13 Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Tue, 17 Mar 2015 00:43:37 +1100 Subject: Initial commit for Planck PCB Rev 1. - Backlight on PB7 controlled by Timer1 Fast PWM (no interrupts). - Backlight commands connected temporarily to top left keys. - Backlight init called from matrix.c, since there's no generic keyboard_init() override function. --- keyboard/planck/Makefile | 6 ++-- keyboard/planck/config.h | 4 +++ keyboard/planck/keymap_wilba.c | 56 ++++++++++++++++++++++++++++++++ keyboard/planck/led.c | 22 ++++++++----- keyboard/planck/matrix.c | 74 ++++++++++++++++++++++++++++-------------- 5 files changed, 127 insertions(+), 35 deletions(-) create mode 100644 keyboard/planck/keymap_wilba.c (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index c456cb51b3..001f17f316 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -50,7 +50,8 @@ TARGET_DIR = . # project specific files SRC = keymap_common.c \ matrix.c \ - led.c + led.c \ + backlight.c ifdef KEYMAP SRC := keymap_$(KEYMAP).c $(SRC) @@ -118,9 +119,10 @@ MOUSEKEY_ENABLE = yes # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) 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 - not yet supported in LUFA - +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality # 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 81637f45b2..0b0c152479 100644 --- a/keyboard/planck/config.h +++ b/keyboard/planck/config.h @@ -34,6 +34,10 @@ along with this program. If not, see . /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST +/* number of backlight levels */ +/* NOTE: this is the max value of 0..BACKLIGHT_LEVELS so really 16 levels. */ +#define BACKLIGHT_LEVELS 15 + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboard/planck/keymap_wilba.c b/keyboard/planck/keymap_wilba.c new file mode 100644 index 0000000000..696fda42e3 --- /dev/null +++ b/keyboard/planck/keymap_wilba.c @@ -0,0 +1,56 @@ +#include "keymap_common.h" + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP( /* Wilba */ + FN27, FN28, FN29, E, R, T, Y, U, I, O, P, BSPC, + TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, ENT, + LCTL, LGUI, LALT, RSFT, FN1, SPC, FN2, LEFT, DOWN, UP, RGHT), +[1] = KEYMAP( /* Wilba Alternate */ + ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, + TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, ENT, + LCTL, LGUI, LALT, RSFT, FN1, SPC, FN2, LEFT, DOWN, UP, RGHT), +[2] = KEYMAP( /* Wilba LOWER */ + TRNS, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, TRNS, + TRNS, F11, F12, LBRC, RBRC, FN20, EQL, FN23, FN24, MINS, FN21, TRNS, + TRNS, BSLS, GRV, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, FN1, TRNS, TRNS, MNXT, VOLD, VOLU, MPLY), +[3] = KEYMAP( /* Wilba RAISE */ + TRNS, FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, TRNS, + TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, TRNS, + TRNS, FN25, FN22, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN2, TRNS, TRNS, TRNS, TRNS), +}; +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // LOWER + [2] = ACTION_LAYER_MOMENTARY(3), // RAISE + + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + + [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), // ! + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), // @ + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), // # + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), // $ + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), // % + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), // ^ + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), // & + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), // * + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), // ( + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), // ) + + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), // _ + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), // + + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // ~ + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), // { + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), // } + [25] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), // | + + [26] = ACTION_MODS_KEY(MOD_LSFT | MOD_RSFT, KC_PAUSE), + + [27] = ACTION_BACKLIGHT_TOGGLE(), + [28] = ACTION_BACKLIGHT_INCREASE(), + [29] = ACTION_BACKLIGHT_DECREASE() + +}; diff --git a/keyboard/planck/led.c b/keyboard/planck/led.c index 6cffd5ea7b..448df2ccfb 100644 --- a/keyboard/planck/led.c +++ b/keyboard/planck/led.c @@ -22,13 +22,17 @@ along with this program. If not, see . void led_set(uint8_t usb_led) { - // if (usb_led & (1<. #include "debug.h" #include "util.h" #include "matrix.h" +#include "backlight.h" // TODO fix this dependency #ifndef DEBOUNCE @@ -57,6 +58,13 @@ uint8_t matrix_cols(void) void matrix_init(void) { + // To use PORTF disable JTAG with writing JTD bit twice within four cycles. + MCUCR |= (1< Date: Tue, 17 Mar 2015 00:51:36 +1100 Subject: Added backlight.h, backlight.c --- keyboard/planck/backlight.c | 46 +++++++++++++++++++++++++++++++++++++++++++++ keyboard/planck/backlight.h | 2 ++ 2 files changed, 48 insertions(+) create mode 100644 keyboard/planck/backlight.c create mode 100644 keyboard/planck/backlight.h (limited to 'keyboard/planck') diff --git a/keyboard/planck/backlight.c b/keyboard/planck/backlight.c new file mode 100644 index 0000000000..d12dcf2386 --- /dev/null +++ b/keyboard/planck/backlight.c @@ -0,0 +1,46 @@ + +#include +#include "backlight.h" + + +void backlight_init_ports() +{ + // Setup PB7 as output and output low. + DDRB |= (1<<7); + PORTB &= ~(1<<7); + + // Use full 16-bit resolution. + ICR1 = 0xFFFF; + + // I could write a wall of text here to explain... but TL;DW + // Go read the ATmega32u4 datasheet. + // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on + + // Pin PB7 = OCR1C (Timer 1, Channel C) + // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0 + // (i.e. start high, go low when counter matches.) + // WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0 + // Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1 + + TCCR1A = _BV(COM1C1) | _BV(WGM11); // = 0b00001010; + TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; + + // Default to zero duty cycle. + OCR1C = 0x0000; +} + +void backlight_set(uint8_t level) +{ + if ( level == 0 ) + { + // Turn off PWM control on PB7, revert to output low. + TCCR1A &= ~(_BV(COM1C1)); + } + else + { + // Turn on PWM control of PB7 + TCCR1A |= _BV(COM1C1); + OCR1C = level << 12 | 0x0FFF; + } +} + diff --git a/keyboard/planck/backlight.h b/keyboard/planck/backlight.h new file mode 100644 index 0000000000..0fe1f4a72b --- /dev/null +++ b/keyboard/planck/backlight.h @@ -0,0 +1,2 @@ + +void backlight_init_ports(void); -- cgit v1.2.3 From 65680819df13585a563296f008be1a4b0ee8045a Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Tue, 17 Mar 2015 00:56:41 +1100 Subject: Replaced tabs with spaces to match TMK convention. --- keyboard/planck/backlight.c | 64 +++++++++++++++++++++--------------------- keyboard/planck/keymap_wilba.c | 12 ++++---- keyboard/planck/led.c | 4 +-- keyboard/planck/matrix.c | 6 ++-- 4 files changed, 43 insertions(+), 43 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/backlight.c b/keyboard/planck/backlight.c index d12dcf2386..ee7e31ee9c 100644 --- a/keyboard/planck/backlight.c +++ b/keyboard/planck/backlight.c @@ -5,42 +5,42 @@ void backlight_init_ports() { - // Setup PB7 as output and output low. - DDRB |= (1<<7); - PORTB &= ~(1<<7); - - // Use full 16-bit resolution. - ICR1 = 0xFFFF; + // Setup PB7 as output and output low. + DDRB |= (1<<7); + PORTB &= ~(1<<7); + + // Use full 16-bit resolution. + ICR1 = 0xFFFF; - // I could write a wall of text here to explain... but TL;DW - // Go read the ATmega32u4 datasheet. - // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on - - // Pin PB7 = OCR1C (Timer 1, Channel C) - // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0 - // (i.e. start high, go low when counter matches.) - // WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0 - // Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1 - - TCCR1A = _BV(COM1C1) | _BV(WGM11); // = 0b00001010; - TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; - - // Default to zero duty cycle. - OCR1C = 0x0000; + // I could write a wall of text here to explain... but TL;DW + // Go read the ATmega32u4 datasheet. + // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on + + // Pin PB7 = OCR1C (Timer 1, Channel C) + // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0 + // (i.e. start high, go low when counter matches.) + // WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0 + // Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1 + + TCCR1A = _BV(COM1C1) | _BV(WGM11); // = 0b00001010; + TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; + + // Default to zero duty cycle. + OCR1C = 0x0000; } void backlight_set(uint8_t level) { - if ( level == 0 ) - { - // Turn off PWM control on PB7, revert to output low. - TCCR1A &= ~(_BV(COM1C1)); - } - else - { - // Turn on PWM control of PB7 - TCCR1A |= _BV(COM1C1); - OCR1C = level << 12 | 0x0FFF; - } + if ( level == 0 ) + { + // Turn off PWM control on PB7, revert to output low. + TCCR1A &= ~(_BV(COM1C1)); + } + else + { + // Turn on PWM control of PB7 + TCCR1A |= _BV(COM1C1); + OCR1C = level << 12 | 0x0FFF; + } } diff --git a/keyboard/planck/keymap_wilba.c b/keyboard/planck/keymap_wilba.c index 696fda42e3..9781f8fcd8 100644 --- a/keyboard/planck/keymap_wilba.c +++ b/keyboard/planck/keymap_wilba.c @@ -39,7 +39,7 @@ const uint16_t PROGMEM fn_actions[] = { [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), // * [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), // ( [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), // ) - + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), // _ [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), // + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // ~ @@ -48,9 +48,9 @@ const uint16_t PROGMEM fn_actions[] = { [25] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), // | [26] = ACTION_MODS_KEY(MOD_LSFT | MOD_RSFT, KC_PAUSE), - - [27] = ACTION_BACKLIGHT_TOGGLE(), - [28] = ACTION_BACKLIGHT_INCREASE(), - [29] = ACTION_BACKLIGHT_DECREASE() - + + [27] = ACTION_BACKLIGHT_TOGGLE(), + [28] = ACTION_BACKLIGHT_INCREASE(), + [29] = ACTION_BACKLIGHT_DECREASE() + }; diff --git a/keyboard/planck/led.c b/keyboard/planck/led.c index 448df2ccfb..1f36434883 100644 --- a/keyboard/planck/led.c +++ b/keyboard/planck/led.c @@ -22,8 +22,8 @@ along with this program. If not, see . void led_set(uint8_t usb_led) { - // Using PE6 Caps Lock LED - if (usb_led & (1< Date: Mon, 16 Mar 2015 11:59:21 -0400 Subject: Create handwire-matrix.c --- keyboard/planck/handwire-matrix.c | 193 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100644 keyboard/planck/handwire-matrix.c (limited to 'keyboard/planck') diff --git a/keyboard/planck/handwire-matrix.c b/keyboard/planck/handwire-matrix.c new file mode 100644 index 0000000000..2f2dbdb108 --- /dev/null +++ b/keyboard/planck/handwire-matrix.c @@ -0,0 +1,193 @@ +/* +Copyright 2012 Jun Wako +Generated by planckkeyboard.com (2014 Jack Humbert) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" + + +#ifndef DEBOUNCE +# define DEBOUNCE 10 +#endif +static uint8_t debouncing = DEBOUNCE; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + // initialize row and col + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } +} + +uint8_t matrix_scan(void) +{ + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i] != cols) { + matrix_debouncing[i] = cols; + if (debouncing) { + debug("bounce!: "); debug_hex(debouncing); debug("\n"); + } + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + } + } + + return 1; +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1 Date: Mon, 16 Mar 2015 11:59:49 -0400 Subject: Rename handwire-matrix.c to matrix-handwire.c --- keyboard/planck/handwire-matrix.c | 193 -------------------------------------- keyboard/planck/matrix-handwire.c | 193 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 193 insertions(+), 193 deletions(-) delete mode 100644 keyboard/planck/handwire-matrix.c create mode 100644 keyboard/planck/matrix-handwire.c (limited to 'keyboard/planck') diff --git a/keyboard/planck/handwire-matrix.c b/keyboard/planck/handwire-matrix.c deleted file mode 100644 index 2f2dbdb108..0000000000 --- a/keyboard/planck/handwire-matrix.c +++ /dev/null @@ -1,193 +0,0 @@ -/* -Copyright 2012 Jun Wako -Generated by planckkeyboard.com (2014 Jack Humbert) - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" - - -#ifndef DEBOUNCE -# define DEBOUNCE 10 -#endif -static uint8_t debouncing = DEBOUNCE; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - // initialize row and col - unselect_rows(); - init_cols(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } -} - -uint8_t matrix_scan(void) -{ - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - select_row(i); - _delay_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - if (matrix_debouncing[i] != cols) { - matrix_debouncing[i] = cols; - if (debouncing) { - debug("bounce!: "); debug_hex(debouncing); debug("\n"); - } - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - return 1; -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1. +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" + + +#ifndef DEBOUNCE +# define DEBOUNCE 10 +#endif +static uint8_t debouncing = DEBOUNCE; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + // initialize row and col + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } +} + +uint8_t matrix_scan(void) +{ + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i] != cols) { + matrix_debouncing[i] = cols; + if (debouncing) { + debug("bounce!: "); debug_hex(debouncing); debug("\n"); + } + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + } + } + + return 1; +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1 Date: Wed, 18 Mar 2015 10:19:40 -0400 Subject: Update README.md --- keyboard/planck/README.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'keyboard/planck') diff --git a/keyboard/planck/README.md b/keyboard/planck/README.md index cb009c005d..206d6ad80d 100644 --- a/keyboard/planck/README.md +++ b/keyboard/planck/README.md @@ -9,6 +9,11 @@ DIY/Assembled compact ortholinear keyboard by [Ortholinear Keyboards](http://ort - [Matthew's Fork](https://github.com/pepers/tmk_keyboard/tree/master/keyboard/planck_grid) ## Build + +Follow [this guide](http://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177.html) to setup your development environment before anything else. + +Download the whole firmware [here](https://github.com/jackhumbert/tmk_keyboard/archive/master.zip) and navigate to the keyboard/planck folder. Once your dev env is setup, you'll be able to type "make" to generate your .hex that you can load with the Teensy app onto your Planck (once you've hit reset/shorted GND & RST). + Move to this directory then just run `make` like: $ make -- cgit v1.2.3 From e958baca815fb13e93b79798b1b20a8aea26c8ee Mon Sep 17 00:00:00 2001 From: Nathan Ross Powell Date: Wed, 18 Mar 2015 23:39:01 -0400 Subject: Delete .keymap_nathan.c.swp --- keyboard/planck/.keymap_nathan.c.swp | Bin 20480 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 keyboard/planck/.keymap_nathan.c.swp (limited to 'keyboard/planck') diff --git a/keyboard/planck/.keymap_nathan.c.swp b/keyboard/planck/.keymap_nathan.c.swp deleted file mode 100644 index d545015c2b..0000000000 Binary files a/keyboard/planck/.keymap_nathan.c.swp and /dev/null differ -- cgit v1.2.3 From e9df959c131932f7d149b8c0fa07d7fea845f0fc Mon Sep 17 00:00:00 2001 From: Nathan Ross Powell Date: Wed, 18 Mar 2015 23:58:21 -0400 Subject: Update keymap_nathan.c Remove macro for KEYMAP_GRID that is in keymap_common.h. Add comments with ASCII art for the two layouts in keymap_common.h. --- keyboard/planck/keymap_common.h | 22 ++++++++++++++++++ keyboard/planck/keymap_nathan.c | 49 +++++++++-------------------------------- 2 files changed, 33 insertions(+), 38 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymap_common.h b/keyboard/planck/keymap_common.h index 8a55fd9ee0..c74c7e9a28 100644 --- a/keyboard/planck/keymap_common.h +++ b/keyboard/planck/keymap_common.h @@ -35,6 +35,17 @@ extern const uint16_t fn_actions[]; // MIT Layout +/* + * ,-----------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------' + */ #define KEYMAP( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ @@ -48,6 +59,17 @@ extern const uint16_t fn_actions[]; } // Grid Layout +/* + * ,-----------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------' + */ #define KEYMAP_GRID( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ diff --git a/keyboard/planck/keymap_nathan.c b/keyboard/planck/keymap_nathan.c index 47539188ed..5a0900b66d 100644 --- a/keyboard/planck/keymap_nathan.c +++ b/keyboard/planck/keymap_nathan.c @@ -3,31 +3,6 @@ #include "keymap_common.h" -#ifndef KEYMAP_GRID - /* Planck keymap definition macro for the 'grid' layout - * ,-----------------------------------------------------------------------. - * | | | | | | | | | | | | | - * |-----------------------------------------------------------------------| - * | | | | | | | | | | | | | - * |-----------------------------------------------------------------------| - * | | | | | | | | | | | | | - * |-----------------------------------------------------------------------| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------' - */ -#define KEYMAP_GRID( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ - 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 \ -) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B } \ -} -#endif - const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: main layer * ,-----------------------------------------------------------------------. @@ -50,9 +25,9 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * The top row are Visual Studio combos: * 'Run', 'Breakpoint', 'Step over', 'Step into', 'Set cursor to line' * 2nd row are key combos: - * 'ctrl-alt-delete', 'ctrl-shift-escape' + * 'ctrl-alt-delete', 'ctrl-shift-escape' * 3rd row are macros keys: - * 'P0' - 'P5' execute a script on Windows machines + * 'P0' - 'P5' execute a script on Windows machines * ,-----------------------------------------------------------------------. * | ESC | F5 | F9 | F10 | F11 |S+F11|CSF10|NLock|Num7 |Num8 |Num9 | Del | * |-----------------------------------------------------------------------| @@ -113,7 +88,7 @@ const uint16_t PROGMEM fn_actions[] = { [11] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), // { [12] = ACTION_MODS_KEY(MOD_LSFT, KC_COMMA), // < [13] = ACTION_MODS_KEY(MOD_LSFT, KC_0), // ) - [14] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), // { + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), // } [15] = ACTION_MODS_KEY(MOD_LSFT, KC_DOT), // > // Combo [16] = ACTION_MODS_KEY(MOD_LALT | MOD_LCTL, KC_DEL), // Ctrl+Alt+Delete @@ -127,7 +102,7 @@ const uint16_t PROGMEM fn_actions[] = { [23] = ACTION_MODS_KEY(MOD_LSFT, KC_6), // ^ [24] = ACTION_MODS_KEY(MOD_LSFT, KC_7), // & [25] = ACTION_MODS_KEY(MOD_LSFT, KC_8), // * - [26] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), // + + [26] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), // + [27] = ACTION_MODS_KEY(MOD_LSFT, KC_MINUS), // _ [28] = ACTION_MODS_KEY(MOD_LSFT, KC_QUOTE), // " [29] = ACTION_MODS_KEY(MOD_LSFT, KC_GRAVE), // ~ @@ -142,39 +117,37 @@ const uint16_t PROGMEM fn_actions[] = { // *return* #define RUN_PYTHON_PROGRAM_ON_WIN MACRO( T(ENT), END ) -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { keyevent_t event = record->event; switch (id) { case M_P0: return event.pressed ? - ADD_PYTHON_PROGRAM_ON_WIN( 0 ) : + ADD_PYTHON_PROGRAM_ON_WIN( 0 ) : RUN_PYTHON_PROGRAM_ON_WIN; case M_P1: return event.pressed ? - ADD_PYTHON_PROGRAM_ON_WIN( 1 ) : + ADD_PYTHON_PROGRAM_ON_WIN( 1 ) : RUN_PYTHON_PROGRAM_ON_WIN; case M_P2: return event.pressed ? - ADD_PYTHON_PROGRAM_ON_WIN( 2 ) : + ADD_PYTHON_PROGRAM_ON_WIN( 2 ) : RUN_PYTHON_PROGRAM_ON_WIN; case M_P3: return event.pressed ? - ADD_PYTHON_PROGRAM_ON_WIN( 3 ) : + ADD_PYTHON_PROGRAM_ON_WIN( 3 ) : RUN_PYTHON_PROGRAM_ON_WIN; case M_P4: return event.pressed ? - ADD_PYTHON_PROGRAM_ON_WIN( 4 ) : + ADD_PYTHON_PROGRAM_ON_WIN( 4 ) : RUN_PYTHON_PROGRAM_ON_WIN; case M_P5: return event.pressed ? - ADD_PYTHON_PROGRAM_ON_WIN( 5 ) : + ADD_PYTHON_PROGRAM_ON_WIN( 5 ) : RUN_PYTHON_PROGRAM_ON_WIN; case M_USERNAME: return event.pressed ? MACRO( T(N), T(A), T(T), T(H), T(A), T(N), T(R), T(O), T(S), T(S), T(P), T(O), T(W), T(E), T(L), T(L), END ) : MACRO_NONE; - } return MACRO_NONE; } -- cgit v1.2.3 From 708f95a472327e25355b28899fbd13d89f6925f5 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 20 Mar 2015 13:36:13 -0400 Subject: working extended keymap --- keyboard/planck/Makefile | 20 ++- keyboard/planck/extended_keymap_common.c | 171 ++++++++++++++++++++++++++ keyboard/planck/extended_keymap_common.h | 72 +++++++++++ keyboard/planck/extended_keymap_jack.c | 36 ++++++ keyboard/planck/keymap_tim.c | 44 +++++++ keyboard/planck/matrix-handwire.c | 193 ----------------------------- keyboard/planck/matrix_center.c | 202 +++++++++++++++++++++++++++++++ keyboard/planck/matrix_handwire.c | 193 +++++++++++++++++++++++++++++ 8 files changed, 734 insertions(+), 197 deletions(-) create mode 100644 keyboard/planck/extended_keymap_common.c create mode 100644 keyboard/planck/extended_keymap_common.h create mode 100644 keyboard/planck/extended_keymap_jack.c create mode 100644 keyboard/planck/keymap_tim.c delete mode 100644 keyboard/planck/matrix-handwire.c create mode 100644 keyboard/planck/matrix_center.c create mode 100644 keyboard/planck/matrix_handwire.c (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index 001f17f316..3716f0db92 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -47,16 +47,28 @@ TOP_DIR = ../.. # Directory keyboard dependent files exist TARGET_DIR = . +# # project specific files +# SRC = keymap_common.c \ +# matrix_handwire.c \ +# led.c \ +# backlight.c + +# ifdef KEYMAP +# SRC := keymap_$(KEYMAP).c $(SRC) +# else +# SRC := keymap_jack.c $(SRC) +# endif + # project specific files -SRC = keymap_common.c \ - matrix.c \ +SRC = extended_keymap_common.c \ + matrix_handwire.c \ led.c \ backlight.c ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) + SRC := extended_keymap_$(KEYMAP).c $(SRC) else - SRC := keymap_jack.c $(SRC) + SRC := extended_keymap_jack.c $(SRC) endif CONFIG_H = config.h diff --git a/keyboard/planck/extended_keymap_common.c b/keyboard/planck/extended_keymap_common.c new file mode 100644 index 0000000000..895c7418be --- /dev/null +++ b/keyboard/planck/extended_keymap_common.c @@ -0,0 +1,171 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "extended_keymap_common.h" +#include "report.h" +#include "keycode.h" +#include "action_layer.h" +#include "action.h" +#include "action_macro.h" +#include "debug.h" + + +static action_t keycode_to_action(uint16_t keycode); + + +/* converts key to action */ +action_t action_for_key(uint8_t layer, keypos_t key) +{ + uint16_t keycode = keymap_key_to_keycode(layer, key); + + // Handle mods in keymap + if (keycode > 0x00FF) { + action_t action; + action.code = ACTION_MODS_KEY(keycode >> 8, keycode & 0xFF); + return action; + } + + switch (keycode) { + case KC_FN0 ... KC_FN31: + return keymap_fn_to_action(keycode); +#ifdef BOOTMAGIC_ENABLE + case KC_CAPSLOCK: + case KC_LOCKING_CAPS: + if (keymap_config.swap_control_capslock || keymap_config.capslock_to_control) { + return keycode_to_action(KC_LCTL); + } + return keycode_to_action(keycode); + case KC_LCTL: + if (keymap_config.swap_control_capslock) { + return keycode_to_action(KC_CAPSLOCK); + } + return keycode_to_action(KC_LCTL); + case KC_LALT: + if (keymap_config.swap_lalt_lgui) { + if (keymap_config.no_gui) { + return keycode_to_action(ACTION_NO); + } + return keycode_to_action(KC_LGUI); + } + return keycode_to_action(KC_LALT); + case KC_LGUI: + if (keymap_config.swap_lalt_lgui) { + return keycode_to_action(KC_LALT); + } + if (keymap_config.no_gui) { + return keycode_to_action(ACTION_NO); + } + return keycode_to_action(KC_LGUI); + case KC_RALT: + if (keymap_config.swap_ralt_rgui) { + if (keymap_config.no_gui) { + return keycode_to_action(ACTION_NO); + } + return keycode_to_action(KC_RGUI); + } + return keycode_to_action(KC_RALT); + case KC_RGUI: + if (keymap_config.swap_ralt_rgui) { + return keycode_to_action(KC_RALT); + } + if (keymap_config.no_gui) { + return keycode_to_action(ACTION_NO); + } + return keycode_to_action(KC_RGUI); + case KC_GRAVE: + if (keymap_config.swap_grave_esc) { + return keycode_to_action(KC_ESC); + } + return keycode_to_action(KC_GRAVE); + case KC_ESC: + if (keymap_config.swap_grave_esc) { + return keycode_to_action(KC_GRAVE); + } + return keycode_to_action(KC_ESC); + case KC_BSLASH: + if (keymap_config.swap_backslash_backspace) { + return keycode_to_action(KC_BSPACE); + } + return keycode_to_action(KC_BSLASH); + case KC_BSPACE: + if (keymap_config.swap_backslash_backspace) { + return keycode_to_action(KC_BSLASH); + } + return keycode_to_action(KC_BSPACE); +#endif + default: + return keycode_to_action(keycode); + } +} + + +/* Macro */ +__attribute__ ((weak)) +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + return MACRO_NONE; +} + +/* Function */ +__attribute__ ((weak)) +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) +{ +} + +/* translates keycode to action */ +static action_t keycode_to_action(uint16_t keycode) +{ + action_t action; + switch (keycode) { + case KC_A ... KC_EXSEL: + case KC_LCTRL ... KC_RGUI: + action.code = ACTION_KEY(keycode); + break; + case KC_SYSTEM_POWER ... KC_SYSTEM_WAKE: + action.code = ACTION_USAGE_SYSTEM(KEYCODE2SYSTEM(keycode)); + break; + case KC_AUDIO_MUTE ... KC_WWW_FAVORITES: + action.code = ACTION_USAGE_CONSUMER(KEYCODE2CONSUMER(keycode)); + break; + case KC_MS_UP ... KC_MS_ACCEL2: + action.code = ACTION_MOUSEKEY(keycode); + break; + case KC_TRNS: + action.code = ACTION_TRANSPARENT; + break; + default: + action.code = ACTION_NO; + break; + } + return action; +} + + +/* translates key to keycode */ +uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) +{ + // return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); + // This limits it to a byte + + return pgm_read_word(&keymaps[(layer)][(key.row)][(key.col)]); +} + +/* translates Fn keycode to action */ +action_t keymap_fn_to_action(uint16_t keycode) +{ + return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) }; +} diff --git a/keyboard/planck/extended_keymap_common.h b/keyboard/planck/extended_keymap_common.h new file mode 100644 index 0000000000..773b1c5151 --- /dev/null +++ b/keyboard/planck/extended_keymap_common.h @@ -0,0 +1,72 @@ +/* +Copyright 2012,2013 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef KEYMAP_H +#define KEYMAP_H + +#include +#include +#include "action.h" +#include +#include "keycode.h" +#include "keymap.h" +#include "action_macro.h" +#include "report.h" +#include "host.h" +#include "print.h" +#include "debug.h" + +#ifdef BOOTMAGIC_ENABLE +/* NOTE: Not portable. Bit field order depends on implementation */ +typedef union { + uint16_t raw; + struct { + bool swap_control_capslock:1; + bool capslock_to_control:1; + bool swap_lalt_lgui:1; + bool swap_ralt_rgui:1; + bool no_gui:1; + bool swap_grave_esc:1; + bool swap_backslash_backspace:1; + bool nkro:1; + }; +} keymap_config_t; +keymap_config_t keymap_config; +#endif + +/* translates key to keycode */ +uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key); + +/* translates Fn keycode to action */ +action_t keymap_fn_to_action(uint16_t keycode); + +extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; +extern const uint16_t fn_actions[]; + +// Ability to use mods in layouts +#define LCTL(kc) kc | 0x0100 +#define LSFT(kc) kc | 0x0200 +#define LALT(kc) kc | 0x0400 +#define LGUI(kc) kc | 0x0800 +#define RCTL(kc) kc | 0x1100 +#define RSFT(kc) kc | 0x1200 +#define RALT(kc) kc | 0x1400 +#define RGUI(kc) kc | 0x1800 + +#define S(kc) LSFT(kc) + +#endif diff --git a/keyboard/planck/extended_keymap_jack.c b/keyboard/planck/extended_keymap_jack.c new file mode 100644 index 0000000000..b5fea732b8 --- /dev/null +++ b/keyboard/planck/extended_keymap_jack.c @@ -0,0 +1,36 @@ +#include "extended_keymap_common.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* Jack */ + {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}, + {KC_RSFT, KC_LCTL, KC_LALT, KC_LGUI, KC_FN2, KC_SPC, KC_NO, KC_FN1, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[1] = { /* Jack 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, KC_FN2, KC_SPC, KC_NO, KC_FN1, 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, KC_FN3, KC_FN4, 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_NO, KC_FN1, 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, KC_FN3, KC_FN4, 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, KC_FN2, KC_TRNS, KC_NO, 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), + +}; \ No newline at end of file diff --git a/keyboard/planck/keymap_tim.c b/keyboard/planck/keymap_tim.c new file mode 100644 index 0000000000..7444f3877b --- /dev/null +++ b/keyboard/planck/keymap_tim.c @@ -0,0 +1,44 @@ +#include "keymap_common.h" + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP( + ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, + TAB, A, S, D, F, G, H, J, K, L, SCLN, ENT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, + LCTL, LALT, DEL, LGUI, FN2, SPC, FN1, F2, F5, F9, F12), +[2] = KEYMAP( /* RAISE */ + TRNS, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC, + GRV, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MINS, EQL, LBRC, RBRC, BSLS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, QUOT, FN29, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN1, TRNS, TRNS, TRNS, TRNS), +[3] = KEYMAP( /* LOWER */ + TRNS, FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, BSPC, + FN22, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN20, FN21, FN23, FN24, FN28, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, QUOT, FN29, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, FN2, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; +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), + + [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), + [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), + [29] = ACTION_MODS_KEY(MOD_LSFT, KC_QUOT), +}; diff --git a/keyboard/planck/matrix-handwire.c b/keyboard/planck/matrix-handwire.c deleted file mode 100644 index 2f2dbdb108..0000000000 --- a/keyboard/planck/matrix-handwire.c +++ /dev/null @@ -1,193 +0,0 @@ -/* -Copyright 2012 Jun Wako -Generated by planckkeyboard.com (2014 Jack Humbert) - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" - - -#ifndef DEBOUNCE -# define DEBOUNCE 10 -#endif -static uint8_t debouncing = DEBOUNCE; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - // initialize row and col - unselect_rows(); - init_cols(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } -} - -uint8_t matrix_scan(void) -{ - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - select_row(i); - _delay_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - if (matrix_debouncing[i] != cols) { - matrix_debouncing[i] = cols; - if (debouncing) { - debug("bounce!: "); debug_hex(debouncing); debug("\n"); - } - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - return 1; -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1 + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include "action_layer.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" + + +#ifndef DEBOUNCE +# define DEBOUNCE 10 +#endif +static uint8_t debouncing = DEBOUNCE; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + // initialize row and col + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } +} + +uint8_t matrix_scan(void) +{ + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i] != cols) { + matrix_debouncing[i] = cols; + if (debouncing) { + debug("bounce!: "); debug_hex(debouncing); debug("\n"); + } + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + } + } + + return 1; +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<. +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" + + +#ifndef DEBOUNCE +# define DEBOUNCE 10 +#endif +static uint8_t debouncing = DEBOUNCE; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + // initialize row and col + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } +} + +uint8_t matrix_scan(void) +{ + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i] != cols) { + matrix_debouncing[i] = cols; + if (debouncing) { + debug("bounce!: "); debug_hex(debouncing); debug("\n"); + } + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + } + } + + return 1; +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1 Date: Fri, 20 Mar 2015 22:49:32 -0400 Subject: function stuff too --- keyboard/planck/extended_keymap_common.c | 10 +++++++++- keyboard/planck/extended_keymap_common.h | 6 ++++++ keyboard/planck/extended_keymap_jack.c | 6 +++--- 3 files changed, 18 insertions(+), 4 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/extended_keymap_common.c b/keyboard/planck/extended_keymap_common.c index 895c7418be..387ad43d35 100644 --- a/keyboard/planck/extended_keymap_common.c +++ b/keyboard/planck/extended_keymap_common.c @@ -33,10 +33,12 @@ action_t action_for_key(uint8_t layer, keypos_t key) uint16_t keycode = keymap_key_to_keycode(layer, key); // Handle mods in keymap - if (keycode > 0x00FF) { + if (keycode > 0x00FF && keycode < 0x2000) { action_t action; action.code = ACTION_MODS_KEY(keycode >> 8, keycode & 0xFF); return action; + } else if (keycode > 0x1FFF && keycode < 0x3000) { + return keymap_func_to_action(keycode & 0xFFF); } switch (keycode) { @@ -169,3 +171,9 @@ action_t keymap_fn_to_action(uint16_t keycode) { return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) }; } + +/* translates Fn keycode to action */ +action_t keymap_func_to_action(uint16_t keycode) +{ + return (action_t){ .code = pgm_read_word(&fn_actions[(int)keycode]) }; +} \ No newline at end of file diff --git a/keyboard/planck/extended_keymap_common.h b/keyboard/planck/extended_keymap_common.h index 773b1c5151..fdce9df970 100644 --- a/keyboard/planck/extended_keymap_common.h +++ b/keyboard/planck/extended_keymap_common.h @@ -54,6 +54,9 @@ uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key); /* translates Fn keycode to action */ action_t keymap_fn_to_action(uint16_t keycode); +/* translates Fn keycode to action */ +action_t keymap_func_to_action(uint16_t keycode); + extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; extern const uint16_t fn_actions[]; @@ -67,6 +70,9 @@ extern const uint16_t fn_actions[]; #define RALT(kc) kc | 0x1400 #define RGUI(kc) kc | 0x1800 +#define FUNC(kc) kc | 0x2000 + #define S(kc) LSFT(kc) +#define F(kc) FUNC(kc) #endif diff --git a/keyboard/planck/extended_keymap_jack.c b/keyboard/planck/extended_keymap_jack.c index b5fea732b8..3f620afbb1 100644 --- a/keyboard/planck/extended_keymap_jack.c +++ b/keyboard/planck/extended_keymap_jack.c @@ -5,7 +5,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, - {KC_RSFT, KC_LCTL, KC_LALT, KC_LGUI, KC_FN2, KC_SPC, KC_NO, KC_FN1, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {KC_RSFT, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_NO, KC_FN1, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, [1] = { /* Jack 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}, @@ -21,7 +21,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }, [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, KC_FN3, KC_FN4, 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, FUNC(3), KC_FN4, 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, KC_FN2, KC_TRNS, KC_NO, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} } @@ -33,4 +33,4 @@ const uint16_t PROGMEM fn_actions[] = { [3] = ACTION_DEFAULT_LAYER_SET(0), [4] = ACTION_DEFAULT_LAYER_SET(1), -}; \ No newline at end of file +}; -- cgit v1.2.3 From 3d286a813e6a8ad77cf947978b7898b167ac0024 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sat, 21 Mar 2015 01:01:09 -0400 Subject: colemak shortcuts --- keyboard/planck/extended_keymap_common.c | 10 +++++---- keyboard/planck/extended_keymap_common.h | 37 ++++++++++++++++++++++++++++++++ keyboard/planck/extended_keymap_jack.c | 26 +++++++++++----------- 3 files changed, 57 insertions(+), 16 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/extended_keymap_common.c b/keyboard/planck/extended_keymap_common.c index 387ad43d35..d9f79ac041 100644 --- a/keyboard/planck/extended_keymap_common.c +++ b/keyboard/planck/extended_keymap_common.c @@ -30,14 +30,17 @@ static action_t keycode_to_action(uint16_t keycode); /* converts key to action */ action_t action_for_key(uint8_t layer, keypos_t key) { + // 16bit keycodes - important uint16_t keycode = keymap_key_to_keycode(layer, key); - // Handle mods in keymap if (keycode > 0x00FF && keycode < 0x2000) { + // Has a modifier action_t action; + // Split it up action.code = ACTION_MODS_KEY(keycode >> 8, keycode & 0xFF); return action; } else if (keycode > 0x1FFF && keycode < 0x3000) { + // Is a shortcut for function layer, pull last 12bits return keymap_func_to_action(keycode & 0xFFF); } @@ -160,9 +163,7 @@ static action_t keycode_to_action(uint16_t keycode) /* translates key to keycode */ uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) { - // return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); - // This limits it to a byte - + // Read entire word (16bits) return pgm_read_word(&keymaps[(layer)][(key.row)][(key.col)]); } @@ -175,5 +176,6 @@ action_t keymap_fn_to_action(uint16_t keycode) /* translates Fn keycode to action */ action_t keymap_func_to_action(uint16_t keycode) { + // For FUNC without 8bit limit return (action_t){ .code = pgm_read_word(&fn_actions[(int)keycode]) }; } \ No newline at end of file diff --git a/keyboard/planck/extended_keymap_common.h b/keyboard/planck/extended_keymap_common.h index fdce9df970..24c2cb848e 100644 --- a/keyboard/planck/extended_keymap_common.h +++ b/keyboard/planck/extended_keymap_common.h @@ -70,9 +70,46 @@ extern const uint16_t fn_actions[]; #define RALT(kc) kc | 0x1400 #define RGUI(kc) kc | 0x1800 +// Alias for function layers than expand past FN31 #define FUNC(kc) kc | 0x2000 +// Aliases #define S(kc) LSFT(kc) #define F(kc) FUNC(kc) +// For software implementation of colemak +#define CM_Q KC_Q +#define CM_W KC_W +#define CM_F KC_E +#define CM_P KC_R +#define CM_G KC_T +#define CM_J KC_Y +#define CM_L KC_U +#define CM_U KC_I +#define CM_Y KC_O +#define CM_SCLN KC_P + +#define CM_A KC_A +#define CM_R KC_S +#define CM_S KC_D +#define CM_T KC_F +#define CM_D KC_G +#define CM_H KC_H +#define CM_N KC_J +#define CM_E KC_K +#define CM_I KC_L +#define CM_O KC_SCLN + +#define CM_Z KC_Z +#define CM_X KC_X +#define CM_C KC_C +#define CM_V KC_V +#define CM_B KC_B +#define CM_K KC_N +#define CM_M KC_M +#define CM_COMM KC_COMM +#define CM_DOT KC_DOT +#define CM_SLSH KC_SLSH + + #endif diff --git a/keyboard/planck/extended_keymap_jack.c b/keyboard/planck/extended_keymap_jack.c index 3f620afbb1..ef1eae49f7 100644 --- a/keyboard/planck/extended_keymap_jack.c +++ b/keyboard/planck/extended_keymap_jack.c @@ -1,31 +1,33 @@ #include "extended_keymap_common.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = { /* Jack */ - {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}, - {KC_RSFT, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_NO, KC_FN1, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +[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}, + {KC_RSFT, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_NO, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, -[1] = { /* Jack colemak */ +[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, KC_FN2, KC_SPC, KC_NO, KC_FN1, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {KC_FN3, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_NO, 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, KC_FN3, KC_FN4, KC_PAUSE, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {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_NO, KC_FN1, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, 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), KC_FN4, 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, 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, KC_FN2, KC_TRNS, KC_NO, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_NO, 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 @@ -33,4 +35,4 @@ const uint16_t PROGMEM fn_actions[] = { [3] = ACTION_DEFAULT_LAYER_SET(0), [4] = ACTION_DEFAULT_LAYER_SET(1), -}; +}; \ No newline at end of file -- cgit v1.2.3 From a33ec2f504e790bb253412f09dabd5ffebcfaaa4 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sat, 21 Mar 2015 01:17:22 -0400 Subject: updated readme --- keyboard/planck/README.md | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/README.md b/keyboard/planck/README.md index 206d6ad80d..530fc21212 100644 --- a/keyboard/planck/README.md +++ b/keyboard/planck/README.md @@ -1,29 +1,39 @@ Planck keyboard firmware ====================== -DIY/Assembled compact ortholinear keyboard by [Ortholinear Keyboards](http://ortholinearkeyboards.com). +DIY/Assembled compact ortholinear 40% keyboard by [Ortholinear Keyboards](http://ortholinearkeyboards.com). -## Notable TMK forks (which some of the keymap files are from) -- [Shane's Fork](https://github.com/shanecelis/tmk_keyboard/tree/master/keyboard/planck) -- [Pierre's Fork](https://github.com/pcarrier/tmk_keyboard/blob/pcarrier/planck/keyboard/gh60/keymap_planck.c) -- [Nathan's Fork](https://github.com/nathanrosspowell/tmk_keyboard/tree/planck-jack/keyboard/planck) -- [Matthew's Fork](https://github.com/pepers/tmk_keyboard/tree/master/keyboard/planck_grid) +## Extended Keymap +If you include extended_keymap_common.h instead of keymap_common.h at the top of your file, you'll have access to a bunch of goodies: + +- Use `LSFT()`, `LCTL()`, et. al. (listed in extended_keymap_common.h) as modifiers for keys (daisy-chain-able) +- Use `FUNC(1)` instead of `FN1` (etc.) to access the function layers beyond the 32 function layer limit +- Use `CM_F` instead of `KC_F` to get the ColeMak equivilent for shortcuts (maps backwards) + +### Some notes on usage: + +- The `KEYMAP()` macro is unable to be used due to the bitwise modifications that take place - refer to extended_keymap_jack.c to see how to set things up with the `KC_` prefix +- Keep an eye on the Makefile - this needs to include the correct files to work +- Don't forget to use `const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {` instead of the 8bit equivilent ## Build Follow [this guide](http://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177.html) to setup your development environment before anything else. -Download the whole firmware [here](https://github.com/jackhumbert/tmk_keyboard/archive/master.zip) and navigate to the keyboard/planck folder. Once your dev env is setup, you'll be able to type "make" to generate your .hex that you can load with the Teensy app onto your Planck (once you've hit reset/shorted GND & RST). +Download the whole firmware [here](https://github.com/jackhumbert/tmk_keyboard/archive/master.zip) and navigate to the keyboard/planck folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex that you can load with the Teensy app onto your Planck (once you've hit reset/shorted GND & RST). Move to this directory then just run `make` like: $ make -Use `make -f Makefile.pjrc` if you want to use PJRC stack but I find no reason to do so now. - - ## Keymap -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 `keymap_.c` and see keymap document (you can find in top README.md) and existent keymap files. To build firmware binary hex file with a certain keymap just do `make` with `KEYMAP` option like: $ make KEYMAP=[] + +## Notable TMK forks (which some of the keymap files are from) +- [Shane's Fork](https://github.com/shanecelis/tmk_keyboard/tree/master/keyboard/planck) +- [Pierre's Fork](https://github.com/pcarrier/tmk_keyboard/blob/pcarrier/planck/keyboard/gh60/keymap_planck.c) +- [Nathan's Fork](https://github.com/nathanrosspowell/tmk_keyboard/tree/planck-jack/keyboard/planck) +- [Matthew's Fork](https://github.com/pepers/tmk_keyboard/tree/master/keyboard/planck_grid) \ No newline at end of file -- cgit v1.2.3 From 4454ded0af219362604cda0e3f5eb6001b90dc6d Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 23 Mar 2015 00:33:54 -0400 Subject: macros --- keyboard/planck/extended_keymap_common.c | 11 ++++++---- keyboard/planck/extended_keymap_common.h | 37 ++++++++++++++++++++++++++++++++ keyboard/planck/extended_keymap_jack.c | 15 +++++++++++-- 3 files changed, 57 insertions(+), 6 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/extended_keymap_common.c b/keyboard/planck/extended_keymap_common.c index d9f79ac041..f8fc3209fb 100644 --- a/keyboard/planck/extended_keymap_common.c +++ b/keyboard/planck/extended_keymap_common.c @@ -33,15 +33,19 @@ action_t action_for_key(uint8_t layer, keypos_t key) // 16bit keycodes - important uint16_t keycode = keymap_key_to_keycode(layer, key); - if (keycode > 0x00FF && keycode < 0x2000) { + if (keycode >= 0x0100 && keycode < 0x2000) { // Has a modifier action_t action; // Split it up action.code = ACTION_MODS_KEY(keycode >> 8, keycode & 0xFF); return action; - } else if (keycode > 0x1FFF && keycode < 0x3000) { + } else if (keycode >= 0x2000 && keycode < 0x3000) { // Is a shortcut for function layer, pull last 12bits return keymap_func_to_action(keycode & 0xFFF); + } else if (keycode >= 0x3000 && keycode < 0x4000) { + action_t action; + action.code = ACTION_MACRO(keycode & 0xFF); + return action; } switch (keycode) { @@ -173,9 +177,8 @@ action_t keymap_fn_to_action(uint16_t keycode) return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) }; } -/* translates Fn keycode to action */ action_t keymap_func_to_action(uint16_t keycode) { // For FUNC without 8bit limit return (action_t){ .code = pgm_read_word(&fn_actions[(int)keycode]) }; -} \ No newline at end of file +} diff --git a/keyboard/planck/extended_keymap_common.h b/keyboard/planck/extended_keymap_common.h index 24c2cb848e..66712459c6 100644 --- a/keyboard/planck/extended_keymap_common.h +++ b/keyboard/planck/extended_keymap_common.h @@ -111,5 +111,42 @@ extern const uint16_t fn_actions[]; #define CM_DOT KC_DOT #define CM_SLSH KC_SLSH +// Make it easy to support these in macros +#define KC_CM_Q CM_Q +#define KC_CM_W CM_W +#define KC_CM_F CM_F +#define KC_CM_P CM_P +#define KC_CM_G CM_G +#define KC_CM_J CM_J +#define KC_CM_L CM_L +#define KC_CM_U CM_U +#define KC_CM_Y CM_Y +#define KC_CM_SCLN CM_SCLN + +#define KC_CM_A CM_A +#define KC_CM_R CM_R +#define KC_CM_S CM_S +#define KC_CM_T CM_T +#define KC_CM_D CM_D +#define KC_CM_H CM_H +#define KC_CM_N CM_N +#define KC_CM_E CM_E +#define KC_CM_I CM_I +#define KC_CM_O CM_O + +#define KC_CM_Z CM_Z +#define KC_CM_X CM_X +#define KC_CM_C CM_C +#define KC_CM_V CM_V +#define KC_CM_B CM_B +#define KC_CM_K CM_K +#define KC_CM_M CM_M +#define KC_CM_COMM CM_COMM +#define KC_CM_DOT CM_DOT +#define KC_CM_SLSH CM_SLSH + +#define M(kc) kc | 0x3000 + +#define MACRODOWN(...) (record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE) #endif diff --git a/keyboard/planck/extended_keymap_jack.c b/keyboard/planck/extended_keymap_jack.c index ef1eae49f7..416ae83450 100644 --- a/keyboard/planck/extended_keymap_jack.c +++ b/keyboard/planck/extended_keymap_jack.c @@ -5,7 +5,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {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}, - {KC_RSFT, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_NO, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {M(0), KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_NO, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, [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}, @@ -35,4 +35,15 @@ const uint16_t PROGMEM fn_actions[] = { [3] = ACTION_DEFAULT_LAYER_SET(0), [4] = ACTION_DEFAULT_LAYER_SET(1), -}; \ No newline at end of file +}; + +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; +}; -- cgit v1.2.3 From f1daa266ade67a417cb4dabd38b363442941de79 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 23 Mar 2015 00:35:05 -0400 Subject: macros --- keyboard/planck/README.md | 1 + 1 file changed, 1 insertion(+) (limited to 'keyboard/planck') diff --git a/keyboard/planck/README.md b/keyboard/planck/README.md index 530fc21212..1b76c559a7 100644 --- a/keyboard/planck/README.md +++ b/keyboard/planck/README.md @@ -8,6 +8,7 @@ If you include extended_keymap_common.h instead of keymap_common.h at the top of - Use `LSFT()`, `LCTL()`, et. al. (listed in extended_keymap_common.h) as modifiers for keys (daisy-chain-able) - Use `FUNC(1)` instead of `FN1` (etc.) to access the function layers beyond the 32 function layer limit - Use `CM_F` instead of `KC_F` to get the ColeMak equivilent for shortcuts (maps backwards) +- Use `MACRODOWN()` instead of `MACRO()` to easily make a keydown macro (`CM_*` works here too) ### Some notes on usage: -- cgit v1.2.3 From 4209486b138f3cdbba1aa0c15ca376a6010a72a0 Mon Sep 17 00:00:00 2001 From: Sean Hunter Date: Thu, 2 Apr 2015 09:11:20 +0100 Subject: Latest custom map with lower + raise --- keyboard/planck/keymap_sean.c | 45 +++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymap_sean.c b/keyboard/planck/keymap_sean.c index 9ad572a72c..4fe07f701a 100644 --- a/keyboard/planck/keymap_sean.c +++ b/keyboard/planck/keymap_sean.c @@ -2,34 +2,41 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = KEYMAP( /* Matrix Dvorak */ - QUOT, COMM, DOT, P, Y, SLSH, EQL, F, G, C, R, L, - A, O, E, U, I, ESC, BSPC, D, H, T, N, S, - SCLN, Q, J, K, X, TAB, ENT, B, M, W, V, Z, - LSFT, LCTL, LALT, LGUI, FN1, SPC, FN2, LEFT, DOWN, UP, RGHT), + QUOT, COMM, DOT, P, Y, SLSH, EQL, F, G, C, R, L, + A, O, E, U, I, ESC, BSPC, D, H, T, N, S, + SCLN, Q, J, K, X, TAB, ENT, B, M, W, V, Z, + LSFT, LCTL, LALT, LGUI, FN1, SPC, FN2, LEFT, DOWN, UP, RGHT), [1] = KEYMAP( /* Matrix Qwerty */ - Q, W, E, R, T, SLSH, EQL, Y, U, I, O, P, - A, S, D, F, G, ESC, BSPC, H, J, K, L, SCLN, - Z, X, C, V, B, TAB, ENT, N, M, COMM, DOT, SLSH, - LSFT, LCTL, LALT, LGUI, FN1, SPC, FN2, LEFT, DOWN, UP, RGHT), + Q, W, E, R, T, QUOT, EQL, Y, U, I, O, P, + A, S, D, F, G, ESC, BSPC, H, J, K, L, SCLN, + Z, X, C, V, B, TAB, ENT, N, M, COMM, DOT, SLSH, + LSFT, LCTL, LALT, LGUI, FN1, SPC, FN2, LEFT, DOWN, UP, RGHT), [2] = KEYMAP( /* fn1 lower */ - F1, F2, F3, F4, F5, TRNS, TRNS, F6, F7, F8, F9, F10, - 1, 2, 3, 4, 5, ESC, DEL, 6, 7, 8, 9, 0, - FN3, FN4, TRNS, GRV, MINS, TRNS, TRNS, BSLS, LBRC, RBRC, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, FN1, TRNS, TRNS, HOME, PGDN, PGUP, END), + F1, F2, F3, F4, F5, TRNS, TRNS, F6, F7, F8, F9, F10, + 1, 2, 3, 4, 5, F18, DEL, 6, 7, 8, 9, 0, + FN3, FN4, TRNS, GRV, MINS, TRNS, TRNS, BSLS, LBRC, RBRC, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN5, HOME, PGDN, PGUP, END), [3] = KEYMAP( /* fn2 raise */ - F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, - FN10, FN11, FN12, FN13, FN14, ESC, DEL, FN15, FN16, FN17, FN18, FN19, - FN3, FN4, TRNS, FN22, FN20, TRNS, TRNS, FN28, FN23, FN24, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN2, MNXT, VOLD, VOLU, MPLY), + F1, F2, F3, F4, F5, TRNS, TRNS, F6, F7, F8, F9, F10, + F11, F12, F13, F14, F15, F18, DEL, F16, F17, F18, F19, F20, + FN3, FN4, TRNS, TRNS, TRNS, TRNS, TRNS, EJCT, PWR, LSFT,PAUSE, RSFT, + LEFT, DOWN, UP, RGHT, FN5, TRNS, TRNS, MNXT, VOLD, VOLU, MUTE), + + [4] = KEYMAP( /* lower + raise */ + LEFT, DOWN, UP, RGHT, TRNS, TRNS, TRNS, TRNS, LEFT, DOWN, UP, RGHT, + HOME, PGDN, PGUP, END, TRNS, F18, DEL, TRNS, HOME, PGDN, PGUP, END, + FN3, FN4, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, EJCT, PWR, MPLY, RSFT, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MNXT, VOLD, VOLU, MUTE), }; const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay - [2] = ACTION_LAYER_MOMENTARY(3), // to Fn overlay + [1] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay LOWER + [2] = ACTION_LAYER_MOMENTARY(3), // to Fn overlay RAISE [3] = ACTION_DEFAULT_LAYER_SET(0), [4] = ACTION_DEFAULT_LAYER_SET(1), + [5] = ACTION_LAYER_MOMENTARY(4), // to Fn overlay LOWER + RAISE [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), @@ -47,4 +54,4 @@ const uint16_t PROGMEM fn_actions[] = { [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), -}; \ No newline at end of file +}; -- cgit v1.2.3 From bf1987e23311b6ea19899e4d12eec26b02539379 Mon Sep 17 00:00:00 2001 From: Reed Swiernik Date: Wed, 22 Apr 2015 00:45:03 -0400 Subject: updated makefile --- keyboard/planck/Makefile | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index 3716f0db92..68a4181f9a 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -48,18 +48,22 @@ TOP_DIR = ../.. TARGET_DIR = . # # project specific files -# SRC = keymap_common.c \ -# matrix_handwire.c \ -# led.c \ -# backlight.c +ifdef COMMON +SRC = keymap_common.c \ + matrix_handwire.c \ + led.c \ + backlight.c -# ifdef KEYMAP -# SRC := keymap_$(KEYMAP).c $(SRC) -# else -# SRC := keymap_jack.c $(SRC) -# endif +ifdef KEYMAP + SRC := keymap_$(KEYMAP).c $(SRC) +else + SRC := keymap_jack.c $(SRC) +endif + +else # project specific files + SRC = extended_keymap_common.c \ matrix_handwire.c \ led.c \ @@ -71,6 +75,8 @@ else SRC := extended_keymap_jack.c $(SRC) endif +endif + CONFIG_H = config.h # MCU name -- cgit v1.2.3 From 480b313b1ede34adb2e339ee8885e44b1c8a699f Mon Sep 17 00:00:00 2001 From: Reed Swiernik Date: Wed, 22 Apr 2015 21:39:43 -0400 Subject: Added keymap w/ game mode --- keyboard/planck/keymap_reed.c | 60 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 keyboard/planck/keymap_reed.c (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymap_reed.c b/keyboard/planck/keymap_reed.c new file mode 100644 index 0000000000..601da44b0d --- /dev/null +++ b/keyboard/planck/keymap_reed.c @@ -0,0 +1,60 @@ +#include "keymap_common.h" + +/* + * This layout works off of Jack's layout, making some changes that I + * feel significantly improve the function of the keyboard. + * + */ +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP_GRID( /* Reed */ + ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, + TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, FN5, + LCTL, CAPS, LALT, LGUI, FN2, FN7, SPC, FN1, LEFT, DOWN, UP, RGHT), + +[1] = KEYMAP_GRID( /* Reed EXTREME GAMING */ + ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, + TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, FN5, + LCTL, 1, 2, 3, 4, SPC, FN2, FN1, LEFT, DOWN, UP, RGHT), + +[2] = KEYMAP_GRID( /* Reed RAISE */ + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, DEL, + TRNS, FN3, FN4, PAUSE, TRNS, TRNS, TRNS, MINS, EQL, LBRC, RBRC, BSLS, + TRNS, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN1, MNXT, VOLD, VOLU, MPLY), + +[3] = KEYMAP_GRID( /* Reed LOWER */ + TRNS , FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, BSPC, + TRNS, TRNS, TRNS, PAUSE, TRNS, TRNS, TRNS, FN20, FN21, FN23, FN24, FN28, + TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, TRNS, + TRNS, TRNS, TRNS, TRNS, FN2, TRNS, TRNS, TRNS, MNXT, VOLD, VOLU, MPLY), +}; +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to Fn overlay LOWER + + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + [5] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_ENT), + [7] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPC), + + [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), + [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), + + [29] = ACTION_MODS_KEY(MOD_LSFT | MOD_RSFT, KC_PAUSE), +}; -- cgit v1.2.3 From 0541af4ff9a7f510f3d0f1ef55df86f995023748 Mon Sep 17 00:00:00 2001 From: Reed Swiernik Date: Thu, 23 Apr 2015 04:31:39 -0400 Subject: Updated makefile to properly handle non extended keymaps --- keyboard/planck/Makefile | 11 ++++++----- keyboard/planck/keymap_reed.c | 20 ++++++++++++++------ 2 files changed, 20 insertions(+), 11 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index 68a4181f9a..ef11e3d32b 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -47,9 +47,12 @@ TOP_DIR = ../.. # Directory keyboard dependent files exist TARGET_DIR = . + + # # project specific files -ifdef COMMON -SRC = keymap_common.c \ +ifdef COMMON_KEYMAP + + SRC = keymap_common.c \ matrix_handwire.c \ led.c \ backlight.c @@ -62,9 +65,7 @@ endif else -# project specific files - -SRC = extended_keymap_common.c \ +SRC = extended_keymap_common.c \ matrix_handwire.c \ led.c \ backlight.c diff --git a/keyboard/planck/keymap_reed.c b/keyboard/planck/keymap_reed.c index 601da44b0d..097bf395d8 100644 --- a/keyboard/planck/keymap_reed.c +++ b/keyboard/planck/keymap_reed.c @@ -1,8 +1,15 @@ #include "keymap_common.h" /* + * make KEYMAP=reed COMMON_KEYMAP=true + * + * * This layout works off of Jack's layout, making some changes that I - * feel significantly improve the function of the keyboard. + * feel significantly improve the function of the keyboard. Major changes + * include adding a "gaming mode" that will allow users to still access + * the number keys 1 through 4 easily for games that require it. Also + * included is the ability to use the tap/hold function for easy use of + * right shift and thumb shift with their tapped companions. * */ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -21,22 +28,23 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [2] = KEYMAP_GRID( /* Reed RAISE */ GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, DEL, TRNS, FN3, FN4, PAUSE, TRNS, TRNS, TRNS, MINS, EQL, LBRC, RBRC, BSLS, - TRNS, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, TRNS, + TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN1, MNXT, VOLD, VOLU, MPLY), [3] = KEYMAP_GRID( /* Reed LOWER */ TRNS , FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, BSPC, TRNS, TRNS, TRNS, PAUSE, TRNS, TRNS, TRNS, FN20, FN21, FN23, FN24, FN28, - TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, TRNS, + TRNS, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, TRNS, TRNS, TRNS, TRNS, TRNS, FN2, TRNS, TRNS, TRNS, MNXT, VOLD, VOLU, MPLY), }; const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay RAISE - [2] = ACTION_LAYER_MOMENTARY(3), // to Fn overlay LOWER + [1] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay - RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to Fn overlay - LOWER [3] = ACTION_DEFAULT_LAYER_SET(0), [4] = ACTION_DEFAULT_LAYER_SET(1), - [5] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_ENT), + // Actions for the tap/hold modifiers listed above + [5] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), [7] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPC), [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), -- cgit v1.2.3 From b060714efd5cb809f14264253ea4987732f1def5 Mon Sep 17 00:00:00 2001 From: Reed Swiernik Date: Fri, 24 Apr 2015 00:40:04 -0400 Subject: Changed del key and added docs --- keyboard/planck/keymap_reed.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymap_reed.c b/keyboard/planck/keymap_reed.c index 097bf395d8..f19957ac5c 100644 --- a/keyboard/planck/keymap_reed.c +++ b/keyboard/planck/keymap_reed.c @@ -1,8 +1,14 @@ #include "keymap_common.h" /* - * make KEYMAP=reed COMMON_KEYMAP=true + * BUILD: + * Simply run the command below in the keyboard/planck directory + * to build against this keymap * + * make KEYMAP=reed COMMON_KEYMAP=true + * + * + * DETAILS: * * This layout works off of Jack's layout, making some changes that I * feel significantly improve the function of the keyboard. Major changes @@ -26,13 +32,13 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LCTL, 1, 2, 3, 4, SPC, FN2, FN1, LEFT, DOWN, UP, RGHT), [2] = KEYMAP_GRID( /* Reed RAISE */ - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, DEL, + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC, TRNS, FN3, FN4, PAUSE, TRNS, TRNS, TRNS, MINS, EQL, LBRC, RBRC, BSLS, TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN1, MNXT, VOLD, VOLU, MPLY), [3] = KEYMAP_GRID( /* Reed LOWER */ - TRNS , FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, BSPC, + TRNS , FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, DEL, TRNS, TRNS, TRNS, PAUSE, TRNS, TRNS, TRNS, FN20, FN21, FN23, FN24, FN28, TRNS, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, TRNS, TRNS, TRNS, TRNS, TRNS, FN2, TRNS, TRNS, TRNS, MNXT, VOLD, VOLU, MPLY), -- cgit v1.2.3 From e3ebae521e0113edf09f7f3825435d03525b6920 Mon Sep 17 00:00:00 2001 From: Reed Swiernik Date: Fri, 24 Apr 2015 18:28:03 -0400 Subject: Updated readme with new build info --- keyboard/planck/README.md | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/README.md b/keyboard/planck/README.md index 1b76c559a7..d59956d925 100644 --- a/keyboard/planck/README.md +++ b/keyboard/planck/README.md @@ -18,13 +18,31 @@ If you include extended_keymap_common.h instead of keymap_common.h at the top of ## Build -Follow [this guide](http://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177.html) to setup your development environment before anything else. +Follow [this guide](http://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177.html) to setup your development environment before anything else. Abbreviated instructions are provide at the [bottom of this document](https://github.com/rswiernik/tmk_keyboard/tree/rswiernik_dev/keyboard/planck#environment-setup) -Download the whole firmware [here](https://github.com/jackhumbert/tmk_keyboard/archive/master.zip) and navigate to the keyboard/planck folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex that you can load with the Teensy app onto your Planck (once you've hit reset/shorted GND & RST). +Download the whole firmware [here](https://github.com/jackhumbert/tmk_keyboard/archive/master.zip) and navigate to the keyboard/planck folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex that you can load with the Teensy app onto your Planck (once you've hit reset/shorted GND & RST). -Move to this directory then just run `make` like: +Depending on which keymap you would like to use, you will have to compile slightly differently. - $ make +**Extended Keymaps (default)** +Extended keymaps need to be specified as follows: +``` +$ make KEYMAP=[common|jack|] +``` +Applicable keymaps should follow the format **__extended\_keymap\_name.c__** + +**Common Keymaps** +Common keymaps need to be specified as follows: +``` +$ make KEYMAP=[common|jack|] COMMON=true +``` +Applicable keymaps should follow the format **__keymap\_name.c__** + + +To build the default keymap, simply move to the tmk\_keyboard/keyboard/planck/ and run `make` as follows: +``` +$ make +``` ## Keymap 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. @@ -37,4 +55,7 @@ To build firmware binary hex file with a certain keymap just do `make` with `KEY - [Shane's Fork](https://github.com/shanecelis/tmk_keyboard/tree/master/keyboard/planck) - [Pierre's Fork](https://github.com/pcarrier/tmk_keyboard/blob/pcarrier/planck/keyboard/gh60/keymap_planck.c) - [Nathan's Fork](https://github.com/nathanrosspowell/tmk_keyboard/tree/planck-jack/keyboard/planck) -- [Matthew's Fork](https://github.com/pepers/tmk_keyboard/tree/master/keyboard/planck_grid) \ No newline at end of file +- [Matthew's Fork](https://github.com/pepers/tmk_keyboard/tree/master/keyboard/planck_grid) + +## Environment Setup + -- cgit v1.2.3 From c85f68d9cd2963e0a00dfe05fea75b824d5f4fcc Mon Sep 17 00:00:00 2001 From: Reed Swiernik Date: Fri, 24 Apr 2015 18:29:50 -0400 Subject: Update README.md Changed formatting mistake --- keyboard/planck/README.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'keyboard/planck') diff --git a/keyboard/planck/README.md b/keyboard/planck/README.md index d59956d925..b106fd8c4d 100644 --- a/keyboard/planck/README.md +++ b/keyboard/planck/README.md @@ -25,6 +25,7 @@ Download the whole firmware [here](https://github.com/jackhumbert/tmk_keyboard/a Depending on which keymap you would like to use, you will have to compile slightly differently. **Extended Keymaps (default)** + Extended keymaps need to be specified as follows: ``` $ make KEYMAP=[common|jack|] @@ -32,6 +33,7 @@ $ make KEYMAP=[common|jack|] Applicable keymaps should follow the format **__extended\_keymap\_name.c__** **Common Keymaps** + Common keymaps need to be specified as follows: ``` $ make KEYMAP=[common|jack|] COMMON=true -- cgit v1.2.3 From 835207193a8d5c366d783c8953d4aeaee5ee094a Mon Sep 17 00:00:00 2001 From: Reed Swiernik Date: Fri, 24 Apr 2015 18:35:57 -0400 Subject: Update README.md Updated formatting again... --- keyboard/planck/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/README.md b/keyboard/planck/README.md index b106fd8c4d..84d5000bb4 100644 --- a/keyboard/planck/README.md +++ b/keyboard/planck/README.md @@ -24,7 +24,13 @@ Download the whole firmware [here](https://github.com/jackhumbert/tmk_keyboard/a Depending on which keymap you would like to use, you will have to compile slightly differently. -**Extended Keymaps (default)** +####Default +To build the default keymap, simply move to the tmk\_keyboard/keyboard/planck/ and run `make` as follows: +``` +$ make +``` + +####**Extended Keymaps** Extended keymaps need to be specified as follows: ``` @@ -32,7 +38,7 @@ $ make KEYMAP=[common|jack|] ``` Applicable keymaps should follow the format **__extended\_keymap\_name.c__** -**Common Keymaps** +####**Common Keymaps** Common keymaps need to be specified as follows: ``` @@ -40,12 +46,6 @@ $ make KEYMAP=[common|jack|] COMMON=true ``` Applicable keymaps should follow the format **__keymap\_name.c__** - -To build the default keymap, simply move to the tmk\_keyboard/keyboard/planck/ and run `make` as follows: -``` -$ make -``` - ## Keymap 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. -- cgit v1.2.3 From d0391d9ed7d74e0a6cbf82db1700e7eaa456d386 Mon Sep 17 00:00:00 2001 From: Reed Swiernik Date: Fri, 24 Apr 2015 18:36:57 -0400 Subject: Update README.md This stupid readme... --- keyboard/planck/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/README.md b/keyboard/planck/README.md index 84d5000bb4..0e573652e4 100644 --- a/keyboard/planck/README.md +++ b/keyboard/planck/README.md @@ -36,7 +36,7 @@ Extended keymaps need to be specified as follows: ``` $ make KEYMAP=[common|jack|] ``` -Applicable keymaps should follow the format **__extended\_keymap\_name.c__** +Applicable keymaps should follow the format **__extended\_keymap\_.c__** ####**Common Keymaps** @@ -44,7 +44,7 @@ Common keymaps need to be specified as follows: ``` $ make KEYMAP=[common|jack|] COMMON=true ``` -Applicable keymaps should follow the format **__keymap\_name.c__** +Applicable keymaps should follow the format **__keymap\_.c__** ## Keymap 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. -- cgit v1.2.3 From 79f70b20d993f92c676112986b1d137109b35ce7 Mon Sep 17 00:00:00 2001 From: Reed Swiernik Date: Fri, 24 Apr 2015 18:49:49 -0400 Subject: Update README.md Switched around more readme stuff --- keyboard/planck/README.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/README.md b/keyboard/planck/README.md index 0e573652e4..8931b5fccf 100644 --- a/keyboard/planck/README.md +++ b/keyboard/planck/README.md @@ -25,33 +25,29 @@ Download the whole firmware [here](https://github.com/jackhumbert/tmk_keyboard/a Depending on which keymap you would like to use, you will have to compile slightly differently. ####Default -To build the default keymap, simply move to the tmk\_keyboard/keyboard/planck/ and run `make` as follows: +To build with the default keymap, simply move to the tmk\_keyboard/keyboard/planck/ and run `make` as follows: ``` $ make ``` +## Keymap +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. + ####**Extended Keymaps** -Extended keymaps need to be specified as follows: +To build the firmware binary hex file with an extended keymap just do `make` with `KEYMAP` option like: ``` $ make KEYMAP=[common|jack|] ``` -Applicable keymaps should follow the format **__extended\_keymap\_.c__** +_The only applicable keymaps will work with this option._ Extended keymaps follow the format **__extended\_keymap\_\.c__** ####**Common Keymaps** -Common keymaps need to be specified as follows: +Building with a common keymap is as simple as adding the COMMON option. Note that only ``` $ make KEYMAP=[common|jack|] COMMON=true ``` -Applicable keymaps should follow the format **__keymap\_.c__** - -## Keymap -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. - -To build firmware binary hex file with a certain keymap just do `make` with `KEYMAP` option like: - - $ make KEYMAP=[] +_The only applicable keymaps will work with this option._ Common keymaps follow the format **__keymap\_\.c__** ## Notable TMK forks (which some of the keymap files are from) - [Shane's Fork](https://github.com/shanecelis/tmk_keyboard/tree/master/keyboard/planck) -- cgit v1.2.3 From eadb08b113e26468a7915d1ea60a3f166527c3b0 Mon Sep 17 00:00:00 2001 From: Reed Swiernik Date: Fri, 24 Apr 2015 18:54:03 -0400 Subject: Update README.md --- keyboard/planck/README.md | 3 --- 1 file changed, 3 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/README.md b/keyboard/planck/README.md index 8931b5fccf..ee824d26e0 100644 --- a/keyboard/planck/README.md +++ b/keyboard/planck/README.md @@ -54,6 +54,3 @@ _The only applicable keymaps will work with this option._ Common keymaps follow - [Pierre's Fork](https://github.com/pcarrier/tmk_keyboard/blob/pcarrier/planck/keyboard/gh60/keymap_planck.c) - [Nathan's Fork](https://github.com/nathanrosspowell/tmk_keyboard/tree/planck-jack/keyboard/planck) - [Matthew's Fork](https://github.com/pepers/tmk_keyboard/tree/master/keyboard/planck_grid) - -## Environment Setup - -- cgit v1.2.3 From 85f8506caa00b06f525fc8e62a9fac2093ab8310 Mon Sep 17 00:00:00 2001 From: Reed Swiernik Date: Wed, 29 Apr 2015 02:47:56 -0400 Subject: Moved keymap file location and fixed bugs in keymap_reed.c --- keyboard/planck/Makefile | 8 +- keyboard/planck/common_keymaps/keymap_brett.c | 42 ++++++ keyboard/planck/common_keymaps/keymap_dotcom.c | 34 +++++ keyboard/planck/common_keymaps/keymap_jack.c | 50 +++++++ keyboard/planck/common_keymaps/keymap_joe.c | 107 ++++++++++++++ keyboard/planck/common_keymaps/keymap_matthew.c | 70 ++++++++++ keyboard/planck/common_keymaps/keymap_nathan.c | 153 +++++++++++++++++++++ keyboard/planck/common_keymaps/keymap_peasant.c | 51 +++++++ keyboard/planck/common_keymaps/keymap_reed.c | 74 ++++++++++ keyboard/planck/common_keymaps/keymap_sean.c | 57 ++++++++ keyboard/planck/common_keymaps/keymap_shane.c | 100 ++++++++++++++ keyboard/planck/common_keymaps/keymap_simon.c | 44 ++++++ keyboard/planck/common_keymaps/keymap_tim.c | 44 ++++++ keyboard/planck/common_keymaps/keymap_wilba.c | 56 ++++++++ keyboard/planck/extended_keymap_jack.c | 49 ------- .../planck/extended_keymaps/extended_keymap_jack.c | 49 +++++++ keyboard/planck/keymap_brett.c | 42 ------ keyboard/planck/keymap_dotcom.c | 34 ----- keyboard/planck/keymap_jack.c | 50 ------- keyboard/planck/keymap_joe.c | 107 -------------- keyboard/planck/keymap_matthew.c | 70 ---------- keyboard/planck/keymap_nathan.c | 153 --------------------- keyboard/planck/keymap_peasant.c | 51 ------- keyboard/planck/keymap_reed.c | 74 ---------- keyboard/planck/keymap_sean.c | 57 -------- keyboard/planck/keymap_shane.c | 100 -------------- keyboard/planck/keymap_simon.c | 44 ------ keyboard/planck/keymap_tim.c | 44 ------ keyboard/planck/keymap_wilba.c | 56 -------- 29 files changed, 935 insertions(+), 935 deletions(-) create mode 100644 keyboard/planck/common_keymaps/keymap_brett.c create mode 100644 keyboard/planck/common_keymaps/keymap_dotcom.c create mode 100644 keyboard/planck/common_keymaps/keymap_jack.c create mode 100644 keyboard/planck/common_keymaps/keymap_joe.c create mode 100644 keyboard/planck/common_keymaps/keymap_matthew.c create mode 100644 keyboard/planck/common_keymaps/keymap_nathan.c create mode 100644 keyboard/planck/common_keymaps/keymap_peasant.c create mode 100644 keyboard/planck/common_keymaps/keymap_reed.c create mode 100644 keyboard/planck/common_keymaps/keymap_sean.c create mode 100644 keyboard/planck/common_keymaps/keymap_shane.c create mode 100644 keyboard/planck/common_keymaps/keymap_simon.c create mode 100644 keyboard/planck/common_keymaps/keymap_tim.c create mode 100644 keyboard/planck/common_keymaps/keymap_wilba.c delete mode 100644 keyboard/planck/extended_keymap_jack.c create mode 100644 keyboard/planck/extended_keymaps/extended_keymap_jack.c delete mode 100644 keyboard/planck/keymap_brett.c delete mode 100644 keyboard/planck/keymap_dotcom.c delete mode 100644 keyboard/planck/keymap_jack.c delete mode 100644 keyboard/planck/keymap_joe.c delete mode 100644 keyboard/planck/keymap_matthew.c delete mode 100644 keyboard/planck/keymap_nathan.c delete mode 100644 keyboard/planck/keymap_peasant.c delete mode 100644 keyboard/planck/keymap_reed.c delete mode 100644 keyboard/planck/keymap_sean.c delete mode 100644 keyboard/planck/keymap_shane.c delete mode 100644 keyboard/planck/keymap_simon.c delete mode 100644 keyboard/planck/keymap_tim.c delete mode 100644 keyboard/planck/keymap_wilba.c (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index ef11e3d32b..e32e4f97e8 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -58,9 +58,9 @@ ifdef COMMON_KEYMAP backlight.c ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) + SRC := common_keymaps/keymap_$(KEYMAP).c $(SRC) else - SRC := keymap_jack.c $(SRC) + SRC := common_keymaps/keymap_jack.c $(SRC) endif else @@ -71,9 +71,9 @@ SRC = extended_keymap_common.c \ backlight.c ifdef KEYMAP - SRC := extended_keymap_$(KEYMAP).c $(SRC) + SRC := extended_keymaps/extended_keymap_$(KEYMAP).c $(SRC) else - SRC := extended_keymap_jack.c $(SRC) + SRC := extended_keymaps/extended_keymap_jack.c $(SRC) endif endif diff --git a/keyboard/planck/common_keymaps/keymap_brett.c b/keyboard/planck/common_keymaps/keymap_brett.c new file mode 100644 index 0000000000..97d832b47a --- /dev/null +++ b/keyboard/planck/common_keymaps/keymap_brett.c @@ -0,0 +1,42 @@ +#include "keymap_common.h" + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP( + ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, + LCTL, A, S, D, F, G, H, J, K, L, SCLN, ENT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, + TAB, LGUI, RSFT, LALT, FN2, SPC, FN1, LEFT, DOWN, UP, RGHT), +[1] = KEYMAP( /* RAISE */ + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, DEL, + TRNS, F1, F2, F3, F4, F5, F6, 4, 5, 6, QUOT, TRNS, + TRNS, F7, F8, F9, F10, F11, F12, 1, 2, 3, TRNS, PGUP, + MPRV, MNXT, TRNS, MUTE, TRNS, TRNS, FN1, 0, 0, TRNS, PGDN), +[2] = KEYMAP( /* LOWER */ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MINS, + TRNS, TRNS, TRNS, PAUSE, TRNS, TRNS, TRNS, TRNS, LBRC, RBRC, BSLS, EQL, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + MPLY, MSTP, VOLU, VOLD, FN2, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay + [2] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay + + [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), + [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), + + [29] = ACTION_MODS_KEY(MOD_LSFT | MOD_RSFT, KC_PAUSE), +}; diff --git a/keyboard/planck/common_keymaps/keymap_dotcom.c b/keyboard/planck/common_keymaps/keymap_dotcom.c new file mode 100644 index 0000000000..347f6dea91 --- /dev/null +++ b/keyboard/planck/common_keymaps/keymap_dotcom.c @@ -0,0 +1,34 @@ +#include "keymap_common.h" + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP( + ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, + FN1, A, S, D, F, G, H, J, K, L, SCLN, ENT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, LBRC, + LCTL, BSLS, QUOT, LALT, FN22, SPC, LEFT, UP, DOWN, RGHT, RBRC), +[1] = KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, DEL, + TRNS, FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, TRNS, TRNS, TRNS, + TRNS, FN18, FN19, FN22, EQL, MINS, FN20, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN1, TRNS, VOLD, VOLU, TRNS), +}; +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay + + [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), + [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), +}; diff --git a/keyboard/planck/common_keymaps/keymap_jack.c b/keyboard/planck/common_keymaps/keymap_jack.c new file mode 100644 index 0000000000..c74812121f --- /dev/null +++ b/keyboard/planck/common_keymaps/keymap_jack.c @@ -0,0 +1,50 @@ +#include "keymap_common.h" + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP( /* Jack */ + TAB, Q, W, E, R, T, Y, U, I, O, P, BSPC, + ESC, A, S, D, F, G, H, J, K, L, SCLN, QUOT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, ENT, + RSFT, LCTL, LALT, LGUI, FN2, SPC, FN1, LEFT, DOWN, UP, RGHT), +[1] = KEYMAP( /* Jack colemak */ + TAB, Q, W, F, P, G, J, L, U, Y, SCLN, BSPC, + ESC, A, R, S, T, D, H, N, E, I, O, QUOT, + LSFT, Z, X, C, V, B, K, M, COMM, DOT, SLSH, ENT, + FN3, LCTL, LALT, LGUI, FN2, SPC, FN1, LEFT, DOWN, UP, RGHT), +[2] = KEYMAP( /* Jack RAISE */ + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC, + TRNS, FN3, FN4, PAUSE, TRNS, TRNS, TRNS, MINS, EQL, LBRC, RBRC, BSLS, + TRNS, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN1, MNXT, VOLD, VOLU, MPLY), +[3] = KEYMAP( /* Jack LOWER */ + FN22, FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, BSPC, + TRNS, FN3, FN4, PAUSE, TRNS, TRNS, TRNS, FN20, FN21, FN23, FN24, FN28, + TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, TRNS, + TRNS, TRNS, TRNS, TRNS, FN2, TRNS, TRNS, MNXT, VOLD, VOLU, 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), + + [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), + [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), + + [29] = ACTION_MODS_KEY(MOD_LSFT | MOD_RSFT, KC_PAUSE), +}; diff --git a/keyboard/planck/common_keymaps/keymap_joe.c b/keyboard/planck/common_keymaps/keymap_joe.c new file mode 100644 index 0000000000..07122b702c --- /dev/null +++ b/keyboard/planck/common_keymaps/keymap_joe.c @@ -0,0 +1,107 @@ +#include "keymap_common.h" + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP( /* Joe colemak */ + ESC, Q, W, F, P, G, J, L, U, Y, SCLN, MINS, + BSPC, A, R, S, T, D, H, N, E, I, O, ENT, + TAB, Z, X, C, V, B, K, M, COMM, DOT, SLSH, QUOT, + LCTL, LGUI, LALT, LSFT, FN1, SPC, FN0, LEFT, DOWN, UP, RGHT), +[1] = KEYMAP( /* Joe qwerty */ + ESC, Q, W, E, R, T, Y, U, I, O, P, MINS, + BSPC, A, S, D, F, G, H, J, K, L, SCLN, ENT, + TAB, Z, X, C, V, B, N, M, COMM, DOT, SLSH, QUOT, + LCTL, LGUI, LALT, LSFT, FN1, SPC, FN0, LEFT, DOWN, UP, RGHT), +[2] = KEYMAP( /* Joe RAISE */ + F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, + DEL, FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, TRNS, + BSLS, FN5, FN6, TRNS, TRNS, MENU, CAPS, INS, PSCR, LBRC, RBRC, FN21, + TRNS, TRNS, TRNS, TRNS, FN2, TRNS, FN0, FN26, FN27, FN28, FN29), +[3] = KEYMAP( /* Joe LOWER */ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN7, FN8, FN9, FN30, FN31, + DEL, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, TRNS, + FN25, FN3, FN4, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN23, FN24, EQL, + TRNS, TRNS, TRNS, TRNS, FN1, TRNS, FN2, HOME, PGDN, PGUP, END), +[4] = KEYMAP( /* Joe LOWER + RAISE */ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MNXT, VOLD, VOLU, MPLY), +}; + +enum macro_id { + M_Q0, + M_Q1, + M_Q2, + M_Q3, + M_Q4 +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay + [1] = ACTION_LAYER_MOMENTARY(3), // to Fn overlay + [2] = ACTION_LAYER_MOMENTARY(4), // to Fn overlay + + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + + [5] = ACTION_MODS_KEY(MOD_LCTL, KC_PGDN), + [6] = ACTION_MODS_KEY(MOD_LCTL, KC_PGUP), + + [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), + [25] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), + + [7] = ACTION_MACRO(M_Q0), + [8] = ACTION_MACRO(M_Q1), + [9] = ACTION_MACRO(M_Q2), + [30] = ACTION_MACRO(M_Q3), + [31] = ACTION_MACRO(M_Q4), + + [26] = ACTION_MODS_KEY(MOD_LCTL | MOD_LALT, KC_LEFT), + [27] = ACTION_MODS_KEY(MOD_LCTL | MOD_LALT, KC_DOWN), + [28] = ACTION_MODS_KEY(MOD_LCTL | MOD_LALT, KC_UP), + [29] = ACTION_MODS_KEY(MOD_LCTL | MOD_LALT, KC_RGHT), + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + keyevent_t event = record->event; + switch (id) { + case M_Q0: + return event.pressed ? + MACRO( D(LSFT), T(SCLN), U(LSFT), T(SLSH), END ) : + MACRO_NONE; + case M_Q1: + return event.pressed ? + MACRO( D(LSFT), T(SCLN), T(9), U(LSFT), END ) : + MACRO_NONE; + case M_Q2: + return event.pressed ? + MACRO( D(LSFT), T(0), T(SCLN), U(LSFT), END ) : + MACRO_NONE; + case M_Q3: + return event.pressed ? + MACRO( D(LSFT), T(9), T(SCLN), U(LSFT), END ) : + MACRO_NONE; + case M_Q4: + return event.pressed ? + MACRO( D(LSFT), T(SCLN), T(0), U(LSFT), END ) : + MACRO_NONE; + + } + return MACRO_NONE; +} \ No newline at end of file diff --git a/keyboard/planck/common_keymaps/keymap_matthew.c b/keyboard/planck/common_keymaps/keymap_matthew.c new file mode 100644 index 0000000000..56e7003a97 --- /dev/null +++ b/keyboard/planck/common_keymaps/keymap_matthew.c @@ -0,0 +1,70 @@ +// by Matthew Pepers - https://github.com/pepers + +/* grid planck layout - modified programmer dvorak +,-----------------------------------------------------------------------------------------------. +| pause | @ | | | ^ | | | | | * | # | $ | del | +| esc | ; : | , < | . > | P | Y | F | G | G | C | R | bkspc | +| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | +|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| +| & | / | { | ( | [ | = | ! | ] | ) | } | \ | + | +| ` ~ | A | O | E | U | I | D | H | T | N | S | - _ | +| % | 7 | 5 | 3 | 1 | 9 | 0 | 2 | 4 | 6 | 8 | ? | +|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| +| | | | | | | | | | | | prtsc | +| tab | ' " | Q | J | K | X | B | M | W | V | Z | retrn | +| | | | | | | | | | | | insrt | +|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| +| | | | | | | | | | | | | +| lctrl | lgui | lalt | ralt | lower | shift | space | raise | left | down | up | right | +| | | | | | | | | home | pgdn | pgup | end | +`-----------------------------------------------------------------------------------------------' +*/ + +#include "keymap_common.h" + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: dvorak */ + [0] = KEYMAP_GRID( ESC, SCLN, COMM, DOT, P, Y, F, G, C, R, L, BSPC, \ + GRV, A, O, E, U, I, D, H, T, N, S, MINS, \ + TAB, QUOT, Q, J, K, X, B, M, W, V, Z, ENT, \ + LCTL, LGUI, LALT, RALT, FN1, LSFT, SPC, FN2, LEFT, DOWN, UP, RGHT), + + /* 1: lower (FN1) */ + [1] = KEYMAP_GRID( F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, \ + FN17, 7, 5, 3, 1, 9, 0, 2, 4, 6, 8, FN18, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, INS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, HOME, PGDN, PGUP, END), + + /* 2: raise (FN2) */ + [2] = KEYMAP_GRID(PAUS, FN19, FN20, FN21, TRNS, TRNS, TRNS, TRNS, FN22, FN23, FN24, DEL, \ + FN10, SLSH, FN11, FN12, LBRC, EQL, FN13, RBRC, FN14, FN15, BSLS, FN16, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PSCR, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), + +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(1), // lower Fn layer + [2] = ACTION_LAYER_MOMENTARY(2), // raise Fn layer + + // lower row1 + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_5), // % + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_SLASH), // ? + + // raise row0 + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_2), // @ + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLASH), // | + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_6), // ^ + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_8), // * + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_3), // # + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_4), // $ + + // raise row1 + [10] = ACTION_MODS_KEY(MOD_LSFT, KC_7), // & + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRACKET), // { + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_9), // ( + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_1), // ! + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_0), // ) + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRACKET), // } + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_EQUAL), // + +}; diff --git a/keyboard/planck/common_keymaps/keymap_nathan.c b/keyboard/planck/common_keymaps/keymap_nathan.c new file mode 100644 index 0000000000..5a0900b66d --- /dev/null +++ b/keyboard/planck/common_keymaps/keymap_nathan.c @@ -0,0 +1,153 @@ +// Author: Nathan Ross Powell +// https://github.com/nathanrosspowell/tmk_keyboard/blob/planck-jack/keyboard/planck/keymap_nathan.c + +#include "keymap_common.h" + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: main layer + * ,-----------------------------------------------------------------------. + * |Tab | q | w | e | r | t | y | u | i | o | p | BS | + * |-----------------------------------------------------------------------| + * |Ctrl | a | s | d | f | g | h | j | k | l | ; | Ret | + * |-----------------------------------------------------------------------| + * |Shift| z | x | c | v | b | n | m | [ | ( | { | < | + * |-----------------------------------------------------------------------| + * |Meta | \ | / | Alt |Lower|Space|Space|Upper|Left |Down | Up |Right| + * `-----------------------------------------------------------------------' + */ + [0] = KEYMAP_GRID( + TAB, Q, W, E, R, T, Y, U, I, O, P, BSPC, + LCTL, A, S, D, F, G, H, J, K, L, SCLN, ENT, + RSFT, Z, X, C, V, B, N, M, LBRC, FN10, FN11, FN12, + LGUI, BSLS, SLSH, LALT, FN0, SPC, SPC, FN1, LEFT, DOWN, UP, RGHT), + + /* 1: fn left/lower layer + * The top row are Visual Studio combos: + * 'Run', 'Breakpoint', 'Step over', 'Step into', 'Set cursor to line' + * 2nd row are key combos: + * 'ctrl-alt-delete', 'ctrl-shift-escape' + * 3rd row are macros keys: + * 'P0' - 'P5' execute a script on Windows machines + * ,-----------------------------------------------------------------------. + * | ESC | F5 | F9 | F10 | F11 |S+F11|CSF10|NLock|Num7 |Num8 |Num9 | Del | + * |-----------------------------------------------------------------------| + * | |C/A/D|C/S/E| Ins |Print|Pause|SLock|Num0 |Num4 |Num5 |Num6 |Num= | + * |-----------------------------------------------------------------------| + * | | P0 | P1 | P2 | P3 | P4 | P5 |Num. |Num1 |Num2 |Num3 |Num/ | + * |-----------------------------------------------------------------------| + * | |User | | | | | | |Home |PgDn |PgUp | End | + * `-----------------------------------------------------------------------' + */ + [1] = KEYMAP_GRID( + ESC, F5, F9, F10, F11, FN30, FN31, NLCK, P7, P8, P9, DEL, + TRNS, FN16, FN17, INS, PSCR, PAUS, SLCK, P0, P4, P5, P6, PEQL, + TRNS, FN2, FN3, FN4, FN5, FN6, FN7, PDOT, P1, P2, P3, PSLS, + TRNS, FN8, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, HOME, PGDN, PGUP, END ), + + /* 2: fn right/raise layer + * ,-----------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 |F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |-----------------------------------------------------------------------| + * | | ! | @ | # | $ | % | ^ | & | * | - | + | = | + * |-----------------------------------------------------------------------| + * | | _ | ' | " | ` | ~ | , | . | ] | ) | } | > | + * |-----------------------------------------------------------------------| + * | |NextT|PrevT| | | | Esc | |Mute |Vol- |Vol+ | P/P | + * `-----------------------------------------------------------------------' + */ + [2] = KEYMAP_GRID( + F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, + TRNS, FN18, FN19, FN20, FN21, FN22, FN23, FN24, FN25, MINS, FN26, PAST, + TRNS, FN27, QUOT, FN28, GRV, FN29, COMM, DOT, RBRC, FN13, FN14, FN15, + TRNS, MNXT, MPRV, TRNS, TRNS, TRNS, ESC, TRNS, MUTE, VOLD, VOLU, MPLY ), +}; + +enum macro_id { + M_P0, + M_P1, + M_P2, + M_P3, + M_P4, + M_P5, + M_USERNAME +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), // left/lower layer + [1] = ACTION_LAYER_MOMENTARY(2), // right/raise layer + // Program macros + [2] = ACTION_MACRO(M_P0), + [3] = ACTION_MACRO(M_P1), + [4] = ACTION_MACRO(M_P2), + [5] = ACTION_MACRO(M_P3), + [6] = ACTION_MACRO(M_P4), + [7] = ACTION_MACRO(M_P5), + [8] = ACTION_MACRO(M_USERNAME), + // Braces + [10] = ACTION_MODS_KEY(MOD_LSFT, KC_9), // ( + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), // { + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_COMMA), // < + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_0), // ) + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), // } + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_DOT), // > + // Combo + [16] = ACTION_MODS_KEY(MOD_LALT | MOD_LCTL, KC_DEL), // Ctrl+Alt+Delete + [17] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL, KC_ESC), // Ctrl+Shft+Escape + // Symbols + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_1), // ! + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_2), // @ + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_3), // # + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_4), // $ + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_5), // % + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_6), // ^ + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_7), // & + [25] = ACTION_MODS_KEY(MOD_LSFT, KC_8), // * + [26] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), // + + [27] = ACTION_MODS_KEY(MOD_LSFT, KC_MINUS), // _ + [28] = ACTION_MODS_KEY(MOD_LSFT, KC_QUOTE), // " + [29] = ACTION_MODS_KEY(MOD_LSFT, KC_GRAVE), // ~ + // Debugging + [30] = ACTION_MODS_KEY(MOD_LSFT, KC_F11), // Step into + [31] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL, KC_F10), // Set cursor to line + }; + +// Run a script and pass a key number to it. This is Windows specific and the script needs to be on your path. +// *open run dialog* keypress.py [PRG_NUM] +#define ADD_PYTHON_PROGRAM_ON_WIN( PRG_NUM ) MACRO( D(LGUI), T(R), U(LGUI), W(100), T(K), T(E), T(Y), T(P), T(R), T(E), T(S), T(S), T(DOT), T(P), T(Y), T(SPC), T(PRG_NUM), END ) +// *return* +#define RUN_PYTHON_PROGRAM_ON_WIN MACRO( T(ENT), END ) + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + keyevent_t event = record->event; + switch (id) { + case M_P0: + return event.pressed ? + ADD_PYTHON_PROGRAM_ON_WIN( 0 ) : + RUN_PYTHON_PROGRAM_ON_WIN; + case M_P1: + return event.pressed ? + ADD_PYTHON_PROGRAM_ON_WIN( 1 ) : + RUN_PYTHON_PROGRAM_ON_WIN; + case M_P2: + return event.pressed ? + ADD_PYTHON_PROGRAM_ON_WIN( 2 ) : + RUN_PYTHON_PROGRAM_ON_WIN; + case M_P3: + return event.pressed ? + ADD_PYTHON_PROGRAM_ON_WIN( 3 ) : + RUN_PYTHON_PROGRAM_ON_WIN; + case M_P4: + return event.pressed ? + ADD_PYTHON_PROGRAM_ON_WIN( 4 ) : + RUN_PYTHON_PROGRAM_ON_WIN; + case M_P5: + return event.pressed ? + ADD_PYTHON_PROGRAM_ON_WIN( 5 ) : + RUN_PYTHON_PROGRAM_ON_WIN; + case M_USERNAME: + return event.pressed ? + MACRO( T(N), T(A), T(T), T(H), T(A), T(N), T(R), T(O), T(S), T(S), T(P), T(O), T(W), T(E), T(L), T(L), END ) : + MACRO_NONE; + } + return MACRO_NONE; +} diff --git a/keyboard/planck/common_keymaps/keymap_peasant.c b/keyboard/planck/common_keymaps/keymap_peasant.c new file mode 100644 index 0000000000..ddacb614e6 --- /dev/null +++ b/keyboard/planck/common_keymaps/keymap_peasant.c @@ -0,0 +1,51 @@ +#include "keymap_common.h" + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = KEYMAP( /* Native */ + ESC, Q, W, E, R, T, Y, U, I, O, P, FN2, + BSPC, A, S, D, F, G, H, J, K, L, SCLN, QUOT, + TAB, Z, X, C, V, B, N, M, COMM, DOT, SLSH, ENT, + DEL, LCTL, NO, LSFT, LALT, SPC, NO, LEFT, DOWN, UP, RGHT), + [1] = KEYMAP( /* QWERTY->PHOTOSHOP */ + DELETE, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, FN1, + O, G, S, U, T, FN27, F21, F10, F11, F7, F8, F9, + TAB, FN4, FN5, FN6, F1, FN7, F18, F19, F23, F20, F22, FN9, + COMM, DOT, FN10, FN11, FN3, SPC, FN12, F2, FN8, F3, F14), + [2] = KEYMAP( /* 2: FN3 PHOTOSHOP */ + ESC, FN25, FN26, NO, NO, NO, NO, NO, NO, NO, NO, NO, + NO, NO, NO, NO, NO, NO, NO, NO, NO, FN19, FN20, FN21, + C, NO, FN22, FN5, NO, FN23, NO, NO, NO, NO, FN13, NO, + FN14, FN15, FN16, FN17, FN3, SPC, FN18, NO, NO, F24, 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_ON_OFF(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_LALT, KC_LBRC), // prev layer + [15] = ACTION_MODS_KEY(MOD_LALT, KC_RBRC), // next layer + [16] = ACTION_MODS_KEY(MOD_LCTL, KC_EQL), // zoom in + [17] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL, KC_H), // HSV sliders + [18] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL | MOD_LALT, KC_F11), // save as PNG + [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_LALT, KC_N), // 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/common_keymaps/keymap_reed.c b/keyboard/planck/common_keymaps/keymap_reed.c new file mode 100644 index 0000000000..1aa24e10de --- /dev/null +++ b/keyboard/planck/common_keymaps/keymap_reed.c @@ -0,0 +1,74 @@ +#include "keymap_common.h" + +/* + * BUILD: + * Simply run the command below in the keyboard/planck directory + * to build against this keymap + * + * make KEYMAP=reed COMMON_KEYMAP=true + * + * + * DETAILS: + * + * This layout works off of Jack's layout, making some changes that I + * feel significantly improve the function of the keyboard. Major changes + * include adding a "gaming mode" that will allow users to still access + * the number keys 1 through 4 easily for games that require it. Also + * included is the ability to use the tap/hold function for easy use of + * right shift and thumb shift with their tapped companions. + * + */ +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP_GRID( /* Reed */ + ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, + TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, FN5, + LCTL, CAPS, LALT, LGUI, FN2, FN7, SPC, FN1, LEFT, DOWN, UP, RGHT), + +[1] = KEYMAP_GRID( /* Reed EXTREME GAMING */ + ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, + TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, FN5, + LCTL, 1, 2, 3, 4, SPC, FN2, FN1, LEFT, DOWN, UP, RGHT), + +[2] = KEYMAP_GRID( /* Reed RAISE */ + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC, + TRNS, FN3, FN4, PAUSE, TRNS, TRNS, TRNS, MINS, EQL, LBRC, RBRC, BSLS, + TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN1, MNXT, VOLD, VOLU, MPLY), + +[3] = KEYMAP_GRID( /* Reed LOWER */ + TRNS, FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, DEL, + TRNS, TRNS, INS, HOME, PGUP, TRNS, TRNS, FN20, FN21, FN23, FN24, FN28, + TRNS, TRNS, DEL, END, PGDN, F11, F12, F13, TRNS, VOLD, VOLU, TRNS, + TRNS, TRNS, TRNS, TRNS, FN2, TRNS, TRNS, TRNS, MPRV, MUTE, MPLY, MNXT), +}; +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay - RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to Fn overlay - LOWER + + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + // Actions for the tap/hold modifiers listed above + [5] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), + [7] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPC), + + [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), + [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), + + [29] = ACTION_MODS_KEY(MOD_LSFT | MOD_RSFT, KC_PAUSE), +}; diff --git a/keyboard/planck/common_keymaps/keymap_sean.c b/keyboard/planck/common_keymaps/keymap_sean.c new file mode 100644 index 0000000000..4fe07f701a --- /dev/null +++ b/keyboard/planck/common_keymaps/keymap_sean.c @@ -0,0 +1,57 @@ +#include "keymap_common.h" + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = KEYMAP( /* Matrix Dvorak */ + QUOT, COMM, DOT, P, Y, SLSH, EQL, F, G, C, R, L, + A, O, E, U, I, ESC, BSPC, D, H, T, N, S, + SCLN, Q, J, K, X, TAB, ENT, B, M, W, V, Z, + LSFT, LCTL, LALT, LGUI, FN1, SPC, FN2, LEFT, DOWN, UP, RGHT), + + [1] = KEYMAP( /* Matrix Qwerty */ + Q, W, E, R, T, QUOT, EQL, Y, U, I, O, P, + A, S, D, F, G, ESC, BSPC, H, J, K, L, SCLN, + Z, X, C, V, B, TAB, ENT, N, M, COMM, DOT, SLSH, + LSFT, LCTL, LALT, LGUI, FN1, SPC, FN2, LEFT, DOWN, UP, RGHT), + + [2] = KEYMAP( /* fn1 lower */ + F1, F2, F3, F4, F5, TRNS, TRNS, F6, F7, F8, F9, F10, + 1, 2, 3, 4, 5, F18, DEL, 6, 7, 8, 9, 0, + FN3, FN4, TRNS, GRV, MINS, TRNS, TRNS, BSLS, LBRC, RBRC, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN5, HOME, PGDN, PGUP, END), + + [3] = KEYMAP( /* fn2 raise */ + F1, F2, F3, F4, F5, TRNS, TRNS, F6, F7, F8, F9, F10, + F11, F12, F13, F14, F15, F18, DEL, F16, F17, F18, F19, F20, + FN3, FN4, TRNS, TRNS, TRNS, TRNS, TRNS, EJCT, PWR, LSFT,PAUSE, RSFT, + LEFT, DOWN, UP, RGHT, FN5, TRNS, TRNS, MNXT, VOLD, VOLU, MUTE), + + [4] = KEYMAP( /* lower + raise */ + LEFT, DOWN, UP, RGHT, TRNS, TRNS, TRNS, TRNS, LEFT, DOWN, UP, RGHT, + HOME, PGDN, PGUP, END, TRNS, F18, DEL, TRNS, HOME, PGDN, PGUP, END, + FN3, FN4, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, EJCT, PWR, MPLY, RSFT, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MNXT, VOLD, VOLU, MUTE), +}; +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay LOWER + [2] = ACTION_LAYER_MOMENTARY(3), // to Fn overlay RAISE + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + [5] = ACTION_LAYER_MOMENTARY(4), // to Fn overlay LOWER + RAISE + + [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), + [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), +}; diff --git a/keyboard/planck/common_keymaps/keymap_shane.c b/keyboard/planck/common_keymaps/keymap_shane.c new file mode 100644 index 0000000000..d4e40fe63a --- /dev/null +++ b/keyboard/planck/common_keymaps/keymap_shane.c @@ -0,0 +1,100 @@ +// https://github.com/shanecelis/tmk_keyboard/blob/master/keyboard/planck/keymap_shane.c + +#include "keymap_common.h" +#include "action_layer.h" +#include "action.h" +#include "action_util.h" + +/* + Shane's Planck Layout + http://www.keyboard-layout-editor.com/#/layouts/015d9011102619d7695c86ffe57cf441 +*/ +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = KEYMAP_AND_SWAP( /* Base */ + TAB, Q, W, E, R, T, Y, U, I, O, P, MINS, + LCTL, A, S, D, F, G, H, J, K, L, SCLN, BSPC, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, FN5, + /*ALPHA*/FN3, /*HYPER*/ /*SUPER*/LGUI, /*META*/LALT, LCTL, FN2, FN6, FN1, LEFT, DOWN, UP, RGHT), + [2] = KEYMAP_AND_SWAP( /* More modifiers */ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RCTL, RALT, RGUI, TRNS), + [4] = KEYMAP_AND_SWAP( /* WASD */ + TRNS, TRNS, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, LEFT, DOWN, RIGHT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), + [6] = KEYMAP_AND_SWAP( /* Raise/FN1 */ + FN23, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, EQL, + TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, ENT, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, BSLS, TRNS, + PAUS, TRNS, TRNS, TRNS, TRNS, BSPC, TRNS, MUTE, PGUP, PGDN, MNXT), + [8] = KEYMAP_AND_SWAP( /* Lower/FN2 */ + ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN19, FN20, TRNS, + TRNS, TRNS, TRNS, TRNS, CAPS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, QUOT, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN24, FN25, LBRC, RBRC, TRNS, TRNS, + FN4, TRNS, TRNS, TRNS, TRNS, ENT, TRNS, MPLY, VOLD, VOLU, MPRV), +}; + +enum function_id { + SPACE_FN, +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch (id) { + case SPACE_FN: + if (record->event.pressed) { + // Change the keyboard maps. + // Whatever even layer's are on, turn on the odd one's too. + for (uint8_t i = 0; i < 9; i += 2) { + if (layer_state & (1UL << i)) + layer_on(i + 1); + } + layer_on(1); + } else { + // turn off all the even layers. + for (uint8_t i = 0; i < 9; i += 2) + layer_off(i + 1); + + if (record->tap.count != 0) { + // Space was tapped rather than used like a modifier. + // So send a space up and down event. + add_key(KC_SPC); + send_keyboard_report(); + del_key(KC_SPC); + send_keyboard_report(); + } + } + break; + } +} + + + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(6), // to fist Fn overlay + [2] = ACTION_LAYER_MOMENTARY(8), // to second Fn overlay + [3] = ACTION_LAYER_TOGGLE(2), // toggle more modifiers + [4] = ACTION_LAYER_TOGGLE(4), // toggle wasd + [5] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), + [6] = ACTION_FUNCTION_TAP(SPACE_FN), + + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_1), + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_2), + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_3), + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_4), + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_5), + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_6), + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_7), + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_8), + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_9), + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_0), + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), + [25] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), + [26] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), +}; diff --git a/keyboard/planck/common_keymaps/keymap_simon.c b/keyboard/planck/common_keymaps/keymap_simon.c new file mode 100644 index 0000000000..37951364be --- /dev/null +++ b/keyboard/planck/common_keymaps/keymap_simon.c @@ -0,0 +1,44 @@ +#include "keymap_common.h" + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP( /* Jack */ + ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, + TAB, A, S, D, F, G, H, J, K, L, DOT, ENT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SCLN, DEL, + LCTL, ENT, LALT, CAPS, FN2, SPC, FN1, LEFT, DOWN, UP, RGHT), +[1] = KEYMAP( /* Jack RAISE */ + TRNS, F1, F2, F3, F4, NO, FN11, FN9, FN12, NO, FN14, TRNS, + TRNS, F5, F6, F7, F8, FN16, SLSH, MINS, EQL, LBRC, FN8, TRNS, + TRNS, F9, F10, F11, F12, F15, F16, FN22, SCLN, MINS, QUOT, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +[2] = KEYMAP( /* Jack LOWER */ + FN22, 1, 2, 3, FN13, FN14, FN15, FN16, FN17, FN18, FN19, BSPC, + TRNS, 4, 5, 6, TRNS, TRNS, TRNS, FN20, FN21, FN23, FN24, FN28, + TRNS, 7, 8, 9, 0, FN28, FN15, F7, F8, F9, F10, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay + [2] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay + + [8] = ACTION_MODS_KEY(MOD_LSFT, KC_SLSH), + [9] = ACTION_MODS_KEY(MOD_LSFT, KC_QUOT), + [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), + [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), + + [29] = ACTION_MODS_KEY(MOD_LSFT | MOD_RSFT, KC_PAUSE), +}; diff --git a/keyboard/planck/common_keymaps/keymap_tim.c b/keyboard/planck/common_keymaps/keymap_tim.c new file mode 100644 index 0000000000..7444f3877b --- /dev/null +++ b/keyboard/planck/common_keymaps/keymap_tim.c @@ -0,0 +1,44 @@ +#include "keymap_common.h" + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP( + ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, + TAB, A, S, D, F, G, H, J, K, L, SCLN, ENT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, + LCTL, LALT, DEL, LGUI, FN2, SPC, FN1, F2, F5, F9, F12), +[2] = KEYMAP( /* RAISE */ + TRNS, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC, + GRV, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MINS, EQL, LBRC, RBRC, BSLS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, QUOT, FN29, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN1, TRNS, TRNS, TRNS, TRNS), +[3] = KEYMAP( /* LOWER */ + TRNS, FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, BSPC, + FN22, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN20, FN21, FN23, FN24, FN28, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, QUOT, FN29, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, FN2, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; +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), + + [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), + [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), + [29] = ACTION_MODS_KEY(MOD_LSFT, KC_QUOT), +}; diff --git a/keyboard/planck/common_keymaps/keymap_wilba.c b/keyboard/planck/common_keymaps/keymap_wilba.c new file mode 100644 index 0000000000..9781f8fcd8 --- /dev/null +++ b/keyboard/planck/common_keymaps/keymap_wilba.c @@ -0,0 +1,56 @@ +#include "keymap_common.h" + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP( /* Wilba */ + FN27, FN28, FN29, E, R, T, Y, U, I, O, P, BSPC, + TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, ENT, + LCTL, LGUI, LALT, RSFT, FN1, SPC, FN2, LEFT, DOWN, UP, RGHT), +[1] = KEYMAP( /* Wilba Alternate */ + ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, + TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, ENT, + LCTL, LGUI, LALT, RSFT, FN1, SPC, FN2, LEFT, DOWN, UP, RGHT), +[2] = KEYMAP( /* Wilba LOWER */ + TRNS, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, TRNS, + TRNS, F11, F12, LBRC, RBRC, FN20, EQL, FN23, FN24, MINS, FN21, TRNS, + TRNS, BSLS, GRV, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, FN1, TRNS, TRNS, MNXT, VOLD, VOLU, MPLY), +[3] = KEYMAP( /* Wilba RAISE */ + TRNS, FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, TRNS, + TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, TRNS, + TRNS, FN25, FN22, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN2, TRNS, TRNS, TRNS, TRNS), +}; +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // LOWER + [2] = ACTION_LAYER_MOMENTARY(3), // RAISE + + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + + [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), // ! + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), // @ + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), // # + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), // $ + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), // % + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), // ^ + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), // & + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), // * + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), // ( + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), // ) + + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), // _ + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), // + + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // ~ + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), // { + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), // } + [25] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), // | + + [26] = ACTION_MODS_KEY(MOD_LSFT | MOD_RSFT, KC_PAUSE), + + [27] = ACTION_BACKLIGHT_TOGGLE(), + [28] = ACTION_BACKLIGHT_INCREASE(), + [29] = ACTION_BACKLIGHT_DECREASE() + +}; diff --git a/keyboard/planck/extended_keymap_jack.c b/keyboard/planck/extended_keymap_jack.c deleted file mode 100644 index 416ae83450..0000000000 --- a/keyboard/planck/extended_keymap_jack.c +++ /dev/null @@ -1,49 +0,0 @@ -#include "extended_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}, - {M(0), KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_NO, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[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_NO, 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_NO, 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_NO, 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/extended_keymaps/extended_keymap_jack.c b/keyboard/planck/extended_keymaps/extended_keymap_jack.c new file mode 100644 index 0000000000..416ae83450 --- /dev/null +++ b/keyboard/planck/extended_keymaps/extended_keymap_jack.c @@ -0,0 +1,49 @@ +#include "extended_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}, + {M(0), KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_NO, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[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_NO, 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_NO, 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_NO, 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/keymap_brett.c b/keyboard/planck/keymap_brett.c deleted file mode 100644 index 97d832b47a..0000000000 --- a/keyboard/planck/keymap_brett.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "keymap_common.h" - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP( - ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, - LCTL, A, S, D, F, G, H, J, K, L, SCLN, ENT, - LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, - TAB, LGUI, RSFT, LALT, FN2, SPC, FN1, LEFT, DOWN, UP, RGHT), -[1] = KEYMAP( /* RAISE */ - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, DEL, - TRNS, F1, F2, F3, F4, F5, F6, 4, 5, 6, QUOT, TRNS, - TRNS, F7, F8, F9, F10, F11, F12, 1, 2, 3, TRNS, PGUP, - MPRV, MNXT, TRNS, MUTE, TRNS, TRNS, FN1, 0, 0, TRNS, PGDN), -[2] = KEYMAP( /* LOWER */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MINS, - TRNS, TRNS, TRNS, PAUSE, TRNS, TRNS, TRNS, TRNS, LBRC, RBRC, BSLS, EQL, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - MPLY, MSTP, VOLU, VOLD, FN2, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), -}; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay - [2] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay - - [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), - [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), - [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), - [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), - [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), - [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), - [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), - [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), - [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), - [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), - [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), - [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), - [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), - [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), - [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), - [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), - - [29] = ACTION_MODS_KEY(MOD_LSFT | MOD_RSFT, KC_PAUSE), -}; diff --git a/keyboard/planck/keymap_dotcom.c b/keyboard/planck/keymap_dotcom.c deleted file mode 100644 index 347f6dea91..0000000000 --- a/keyboard/planck/keymap_dotcom.c +++ /dev/null @@ -1,34 +0,0 @@ -#include "keymap_common.h" - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP( - ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, - FN1, A, S, D, F, G, H, J, K, L, SCLN, ENT, - LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, LBRC, - LCTL, BSLS, QUOT, LALT, FN22, SPC, LEFT, UP, DOWN, RGHT, RBRC), -[1] = KEYMAP( - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, DEL, - TRNS, FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, TRNS, TRNS, TRNS, - TRNS, FN18, FN19, FN22, EQL, MINS, FN20, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN1, TRNS, VOLD, VOLU, TRNS), -}; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay - - [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), - [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), - [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), - [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), - [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), - [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), - [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), - [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), - [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), - [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), - [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), - [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), - [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), - [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), - [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), - [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), -}; diff --git a/keyboard/planck/keymap_jack.c b/keyboard/planck/keymap_jack.c deleted file mode 100644 index c74812121f..0000000000 --- a/keyboard/planck/keymap_jack.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "keymap_common.h" - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP( /* Jack */ - TAB, Q, W, E, R, T, Y, U, I, O, P, BSPC, - ESC, A, S, D, F, G, H, J, K, L, SCLN, QUOT, - LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, ENT, - RSFT, LCTL, LALT, LGUI, FN2, SPC, FN1, LEFT, DOWN, UP, RGHT), -[1] = KEYMAP( /* Jack colemak */ - TAB, Q, W, F, P, G, J, L, U, Y, SCLN, BSPC, - ESC, A, R, S, T, D, H, N, E, I, O, QUOT, - LSFT, Z, X, C, V, B, K, M, COMM, DOT, SLSH, ENT, - FN3, LCTL, LALT, LGUI, FN2, SPC, FN1, LEFT, DOWN, UP, RGHT), -[2] = KEYMAP( /* Jack RAISE */ - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC, - TRNS, FN3, FN4, PAUSE, TRNS, TRNS, TRNS, MINS, EQL, LBRC, RBRC, BSLS, - TRNS, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN1, MNXT, VOLD, VOLU, MPLY), -[3] = KEYMAP( /* Jack LOWER */ - FN22, FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, BSPC, - TRNS, FN3, FN4, PAUSE, TRNS, TRNS, TRNS, FN20, FN21, FN23, FN24, FN28, - TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, TRNS, - TRNS, TRNS, TRNS, TRNS, FN2, TRNS, TRNS, MNXT, VOLD, VOLU, 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), - - [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), - [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), - [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), - [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), - [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), - [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), - [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), - [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), - [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), - [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), - [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), - [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), - [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), - [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), - [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), - [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), - - [29] = ACTION_MODS_KEY(MOD_LSFT | MOD_RSFT, KC_PAUSE), -}; diff --git a/keyboard/planck/keymap_joe.c b/keyboard/planck/keymap_joe.c deleted file mode 100644 index 07122b702c..0000000000 --- a/keyboard/planck/keymap_joe.c +++ /dev/null @@ -1,107 +0,0 @@ -#include "keymap_common.h" - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP( /* Joe colemak */ - ESC, Q, W, F, P, G, J, L, U, Y, SCLN, MINS, - BSPC, A, R, S, T, D, H, N, E, I, O, ENT, - TAB, Z, X, C, V, B, K, M, COMM, DOT, SLSH, QUOT, - LCTL, LGUI, LALT, LSFT, FN1, SPC, FN0, LEFT, DOWN, UP, RGHT), -[1] = KEYMAP( /* Joe qwerty */ - ESC, Q, W, E, R, T, Y, U, I, O, P, MINS, - BSPC, A, S, D, F, G, H, J, K, L, SCLN, ENT, - TAB, Z, X, C, V, B, N, M, COMM, DOT, SLSH, QUOT, - LCTL, LGUI, LALT, LSFT, FN1, SPC, FN0, LEFT, DOWN, UP, RGHT), -[2] = KEYMAP( /* Joe RAISE */ - F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, - DEL, FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, TRNS, - BSLS, FN5, FN6, TRNS, TRNS, MENU, CAPS, INS, PSCR, LBRC, RBRC, FN21, - TRNS, TRNS, TRNS, TRNS, FN2, TRNS, FN0, FN26, FN27, FN28, FN29), -[3] = KEYMAP( /* Joe LOWER */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN7, FN8, FN9, FN30, FN31, - DEL, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, TRNS, - FN25, FN3, FN4, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN23, FN24, EQL, - TRNS, TRNS, TRNS, TRNS, FN1, TRNS, FN2, HOME, PGDN, PGUP, END), -[4] = KEYMAP( /* Joe LOWER + RAISE */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MNXT, VOLD, VOLU, MPLY), -}; - -enum macro_id { - M_Q0, - M_Q1, - M_Q2, - M_Q3, - M_Q4 -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay - [1] = ACTION_LAYER_MOMENTARY(3), // to Fn overlay - [2] = ACTION_LAYER_MOMENTARY(4), // to Fn overlay - - [3] = ACTION_DEFAULT_LAYER_SET(0), - [4] = ACTION_DEFAULT_LAYER_SET(1), - - [5] = ACTION_MODS_KEY(MOD_LCTL, KC_PGDN), - [6] = ACTION_MODS_KEY(MOD_LCTL, KC_PGUP), - - [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), - [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), - [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), - [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), - [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), - [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), - [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), - [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), - [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), - [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), - [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), - [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), - [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), - [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), - [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), - [25] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), - - [7] = ACTION_MACRO(M_Q0), - [8] = ACTION_MACRO(M_Q1), - [9] = ACTION_MACRO(M_Q2), - [30] = ACTION_MACRO(M_Q3), - [31] = ACTION_MACRO(M_Q4), - - [26] = ACTION_MODS_KEY(MOD_LCTL | MOD_LALT, KC_LEFT), - [27] = ACTION_MODS_KEY(MOD_LCTL | MOD_LALT, KC_DOWN), - [28] = ACTION_MODS_KEY(MOD_LCTL | MOD_LALT, KC_UP), - [29] = ACTION_MODS_KEY(MOD_LCTL | MOD_LALT, KC_RGHT), - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - keyevent_t event = record->event; - switch (id) { - case M_Q0: - return event.pressed ? - MACRO( D(LSFT), T(SCLN), U(LSFT), T(SLSH), END ) : - MACRO_NONE; - case M_Q1: - return event.pressed ? - MACRO( D(LSFT), T(SCLN), T(9), U(LSFT), END ) : - MACRO_NONE; - case M_Q2: - return event.pressed ? - MACRO( D(LSFT), T(0), T(SCLN), U(LSFT), END ) : - MACRO_NONE; - case M_Q3: - return event.pressed ? - MACRO( D(LSFT), T(9), T(SCLN), U(LSFT), END ) : - MACRO_NONE; - case M_Q4: - return event.pressed ? - MACRO( D(LSFT), T(SCLN), T(0), U(LSFT), END ) : - MACRO_NONE; - - } - return MACRO_NONE; -} \ No newline at end of file diff --git a/keyboard/planck/keymap_matthew.c b/keyboard/planck/keymap_matthew.c deleted file mode 100644 index 56e7003a97..0000000000 --- a/keyboard/planck/keymap_matthew.c +++ /dev/null @@ -1,70 +0,0 @@ -// by Matthew Pepers - https://github.com/pepers - -/* grid planck layout - modified programmer dvorak -,-----------------------------------------------------------------------------------------------. -| pause | @ | | | ^ | | | | | * | # | $ | del | -| esc | ; : | , < | . > | P | Y | F | G | G | C | R | bkspc | -| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | -|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| -| & | / | { | ( | [ | = | ! | ] | ) | } | \ | + | -| ` ~ | A | O | E | U | I | D | H | T | N | S | - _ | -| % | 7 | 5 | 3 | 1 | 9 | 0 | 2 | 4 | 6 | 8 | ? | -|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| -| | | | | | | | | | | | prtsc | -| tab | ' " | Q | J | K | X | B | M | W | V | Z | retrn | -| | | | | | | | | | | | insrt | -|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| -| | | | | | | | | | | | | -| lctrl | lgui | lalt | ralt | lower | shift | space | raise | left | down | up | right | -| | | | | | | | | home | pgdn | pgup | end | -`-----------------------------------------------------------------------------------------------' -*/ - -#include "keymap_common.h" - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: dvorak */ - [0] = KEYMAP_GRID( ESC, SCLN, COMM, DOT, P, Y, F, G, C, R, L, BSPC, \ - GRV, A, O, E, U, I, D, H, T, N, S, MINS, \ - TAB, QUOT, Q, J, K, X, B, M, W, V, Z, ENT, \ - LCTL, LGUI, LALT, RALT, FN1, LSFT, SPC, FN2, LEFT, DOWN, UP, RGHT), - - /* 1: lower (FN1) */ - [1] = KEYMAP_GRID( F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, \ - FN17, 7, 5, 3, 1, 9, 0, 2, 4, 6, 8, FN18, \ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, INS, \ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, HOME, PGDN, PGUP, END), - - /* 2: raise (FN2) */ - [2] = KEYMAP_GRID(PAUS, FN19, FN20, FN21, TRNS, TRNS, TRNS, TRNS, FN22, FN23, FN24, DEL, \ - FN10, SLSH, FN11, FN12, LBRC, EQL, FN13, RBRC, FN14, FN15, BSLS, FN16, \ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PSCR, \ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), - -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(1), // lower Fn layer - [2] = ACTION_LAYER_MOMENTARY(2), // raise Fn layer - - // lower row1 - [17] = ACTION_MODS_KEY(MOD_LSFT, KC_5), // % - [18] = ACTION_MODS_KEY(MOD_LSFT, KC_SLASH), // ? - - // raise row0 - [19] = ACTION_MODS_KEY(MOD_LSFT, KC_2), // @ - [20] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLASH), // | - [21] = ACTION_MODS_KEY(MOD_LSFT, KC_6), // ^ - [22] = ACTION_MODS_KEY(MOD_LSFT, KC_8), // * - [23] = ACTION_MODS_KEY(MOD_LSFT, KC_3), // # - [24] = ACTION_MODS_KEY(MOD_LSFT, KC_4), // $ - - // raise row1 - [10] = ACTION_MODS_KEY(MOD_LSFT, KC_7), // & - [11] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRACKET), // { - [12] = ACTION_MODS_KEY(MOD_LSFT, KC_9), // ( - [13] = ACTION_MODS_KEY(MOD_LSFT, KC_1), // ! - [14] = ACTION_MODS_KEY(MOD_LSFT, KC_0), // ) - [15] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRACKET), // } - [16] = ACTION_MODS_KEY(MOD_LSFT, KC_EQUAL), // + -}; diff --git a/keyboard/planck/keymap_nathan.c b/keyboard/planck/keymap_nathan.c deleted file mode 100644 index 5a0900b66d..0000000000 --- a/keyboard/planck/keymap_nathan.c +++ /dev/null @@ -1,153 +0,0 @@ -// Author: Nathan Ross Powell -// https://github.com/nathanrosspowell/tmk_keyboard/blob/planck-jack/keyboard/planck/keymap_nathan.c - -#include "keymap_common.h" - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: main layer - * ,-----------------------------------------------------------------------. - * |Tab | q | w | e | r | t | y | u | i | o | p | BS | - * |-----------------------------------------------------------------------| - * |Ctrl | a | s | d | f | g | h | j | k | l | ; | Ret | - * |-----------------------------------------------------------------------| - * |Shift| z | x | c | v | b | n | m | [ | ( | { | < | - * |-----------------------------------------------------------------------| - * |Meta | \ | / | Alt |Lower|Space|Space|Upper|Left |Down | Up |Right| - * `-----------------------------------------------------------------------' - */ - [0] = KEYMAP_GRID( - TAB, Q, W, E, R, T, Y, U, I, O, P, BSPC, - LCTL, A, S, D, F, G, H, J, K, L, SCLN, ENT, - RSFT, Z, X, C, V, B, N, M, LBRC, FN10, FN11, FN12, - LGUI, BSLS, SLSH, LALT, FN0, SPC, SPC, FN1, LEFT, DOWN, UP, RGHT), - - /* 1: fn left/lower layer - * The top row are Visual Studio combos: - * 'Run', 'Breakpoint', 'Step over', 'Step into', 'Set cursor to line' - * 2nd row are key combos: - * 'ctrl-alt-delete', 'ctrl-shift-escape' - * 3rd row are macros keys: - * 'P0' - 'P5' execute a script on Windows machines - * ,-----------------------------------------------------------------------. - * | ESC | F5 | F9 | F10 | F11 |S+F11|CSF10|NLock|Num7 |Num8 |Num9 | Del | - * |-----------------------------------------------------------------------| - * | |C/A/D|C/S/E| Ins |Print|Pause|SLock|Num0 |Num4 |Num5 |Num6 |Num= | - * |-----------------------------------------------------------------------| - * | | P0 | P1 | P2 | P3 | P4 | P5 |Num. |Num1 |Num2 |Num3 |Num/ | - * |-----------------------------------------------------------------------| - * | |User | | | | | | |Home |PgDn |PgUp | End | - * `-----------------------------------------------------------------------' - */ - [1] = KEYMAP_GRID( - ESC, F5, F9, F10, F11, FN30, FN31, NLCK, P7, P8, P9, DEL, - TRNS, FN16, FN17, INS, PSCR, PAUS, SLCK, P0, P4, P5, P6, PEQL, - TRNS, FN2, FN3, FN4, FN5, FN6, FN7, PDOT, P1, P2, P3, PSLS, - TRNS, FN8, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, HOME, PGDN, PGUP, END ), - - /* 2: fn right/raise layer - * ,-----------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 |F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |-----------------------------------------------------------------------| - * | | ! | @ | # | $ | % | ^ | & | * | - | + | = | - * |-----------------------------------------------------------------------| - * | | _ | ' | " | ` | ~ | , | . | ] | ) | } | > | - * |-----------------------------------------------------------------------| - * | |NextT|PrevT| | | | Esc | |Mute |Vol- |Vol+ | P/P | - * `-----------------------------------------------------------------------' - */ - [2] = KEYMAP_GRID( - F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, - TRNS, FN18, FN19, FN20, FN21, FN22, FN23, FN24, FN25, MINS, FN26, PAST, - TRNS, FN27, QUOT, FN28, GRV, FN29, COMM, DOT, RBRC, FN13, FN14, FN15, - TRNS, MNXT, MPRV, TRNS, TRNS, TRNS, ESC, TRNS, MUTE, VOLD, VOLU, MPLY ), -}; - -enum macro_id { - M_P0, - M_P1, - M_P2, - M_P3, - M_P4, - M_P5, - M_USERNAME -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // left/lower layer - [1] = ACTION_LAYER_MOMENTARY(2), // right/raise layer - // Program macros - [2] = ACTION_MACRO(M_P0), - [3] = ACTION_MACRO(M_P1), - [4] = ACTION_MACRO(M_P2), - [5] = ACTION_MACRO(M_P3), - [6] = ACTION_MACRO(M_P4), - [7] = ACTION_MACRO(M_P5), - [8] = ACTION_MACRO(M_USERNAME), - // Braces - [10] = ACTION_MODS_KEY(MOD_LSFT, KC_9), // ( - [11] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), // { - [12] = ACTION_MODS_KEY(MOD_LSFT, KC_COMMA), // < - [13] = ACTION_MODS_KEY(MOD_LSFT, KC_0), // ) - [14] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), // } - [15] = ACTION_MODS_KEY(MOD_LSFT, KC_DOT), // > - // Combo - [16] = ACTION_MODS_KEY(MOD_LALT | MOD_LCTL, KC_DEL), // Ctrl+Alt+Delete - [17] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL, KC_ESC), // Ctrl+Shft+Escape - // Symbols - [18] = ACTION_MODS_KEY(MOD_LSFT, KC_1), // ! - [19] = ACTION_MODS_KEY(MOD_LSFT, KC_2), // @ - [20] = ACTION_MODS_KEY(MOD_LSFT, KC_3), // # - [21] = ACTION_MODS_KEY(MOD_LSFT, KC_4), // $ - [22] = ACTION_MODS_KEY(MOD_LSFT, KC_5), // % - [23] = ACTION_MODS_KEY(MOD_LSFT, KC_6), // ^ - [24] = ACTION_MODS_KEY(MOD_LSFT, KC_7), // & - [25] = ACTION_MODS_KEY(MOD_LSFT, KC_8), // * - [26] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), // + - [27] = ACTION_MODS_KEY(MOD_LSFT, KC_MINUS), // _ - [28] = ACTION_MODS_KEY(MOD_LSFT, KC_QUOTE), // " - [29] = ACTION_MODS_KEY(MOD_LSFT, KC_GRAVE), // ~ - // Debugging - [30] = ACTION_MODS_KEY(MOD_LSFT, KC_F11), // Step into - [31] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL, KC_F10), // Set cursor to line - }; - -// Run a script and pass a key number to it. This is Windows specific and the script needs to be on your path. -// *open run dialog* keypress.py [PRG_NUM] -#define ADD_PYTHON_PROGRAM_ON_WIN( PRG_NUM ) MACRO( D(LGUI), T(R), U(LGUI), W(100), T(K), T(E), T(Y), T(P), T(R), T(E), T(S), T(S), T(DOT), T(P), T(Y), T(SPC), T(PRG_NUM), END ) -// *return* -#define RUN_PYTHON_PROGRAM_ON_WIN MACRO( T(ENT), END ) - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - keyevent_t event = record->event; - switch (id) { - case M_P0: - return event.pressed ? - ADD_PYTHON_PROGRAM_ON_WIN( 0 ) : - RUN_PYTHON_PROGRAM_ON_WIN; - case M_P1: - return event.pressed ? - ADD_PYTHON_PROGRAM_ON_WIN( 1 ) : - RUN_PYTHON_PROGRAM_ON_WIN; - case M_P2: - return event.pressed ? - ADD_PYTHON_PROGRAM_ON_WIN( 2 ) : - RUN_PYTHON_PROGRAM_ON_WIN; - case M_P3: - return event.pressed ? - ADD_PYTHON_PROGRAM_ON_WIN( 3 ) : - RUN_PYTHON_PROGRAM_ON_WIN; - case M_P4: - return event.pressed ? - ADD_PYTHON_PROGRAM_ON_WIN( 4 ) : - RUN_PYTHON_PROGRAM_ON_WIN; - case M_P5: - return event.pressed ? - ADD_PYTHON_PROGRAM_ON_WIN( 5 ) : - RUN_PYTHON_PROGRAM_ON_WIN; - case M_USERNAME: - return event.pressed ? - MACRO( T(N), T(A), T(T), T(H), T(A), T(N), T(R), T(O), T(S), T(S), T(P), T(O), T(W), T(E), T(L), T(L), END ) : - MACRO_NONE; - } - return MACRO_NONE; -} diff --git a/keyboard/planck/keymap_peasant.c b/keyboard/planck/keymap_peasant.c deleted file mode 100644 index ddacb614e6..0000000000 --- a/keyboard/planck/keymap_peasant.c +++ /dev/null @@ -1,51 +0,0 @@ -#include "keymap_common.h" - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = KEYMAP( /* Native */ - ESC, Q, W, E, R, T, Y, U, I, O, P, FN2, - BSPC, A, S, D, F, G, H, J, K, L, SCLN, QUOT, - TAB, Z, X, C, V, B, N, M, COMM, DOT, SLSH, ENT, - DEL, LCTL, NO, LSFT, LALT, SPC, NO, LEFT, DOWN, UP, RGHT), - [1] = KEYMAP( /* QWERTY->PHOTOSHOP */ - DELETE, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, FN1, - O, G, S, U, T, FN27, F21, F10, F11, F7, F8, F9, - TAB, FN4, FN5, FN6, F1, FN7, F18, F19, F23, F20, F22, FN9, - COMM, DOT, FN10, FN11, FN3, SPC, FN12, F2, FN8, F3, F14), - [2] = KEYMAP( /* 2: FN3 PHOTOSHOP */ - ESC, FN25, FN26, NO, NO, NO, NO, NO, NO, NO, NO, NO, - NO, NO, NO, NO, NO, NO, NO, NO, NO, FN19, FN20, FN21, - C, NO, FN22, FN5, NO, FN23, NO, NO, NO, NO, FN13, NO, - FN14, FN15, FN16, FN17, FN3, SPC, FN18, NO, NO, F24, 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_ON_OFF(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_LALT, KC_LBRC), // prev layer - [15] = ACTION_MODS_KEY(MOD_LALT, KC_RBRC), // next layer - [16] = ACTION_MODS_KEY(MOD_LCTL, KC_EQL), // zoom in - [17] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL, KC_H), // HSV sliders - [18] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL | MOD_LALT, KC_F11), // save as PNG - [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_LALT, KC_N), // 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/keymap_reed.c b/keyboard/planck/keymap_reed.c deleted file mode 100644 index f19957ac5c..0000000000 --- a/keyboard/planck/keymap_reed.c +++ /dev/null @@ -1,74 +0,0 @@ -#include "keymap_common.h" - -/* - * BUILD: - * Simply run the command below in the keyboard/planck directory - * to build against this keymap - * - * make KEYMAP=reed COMMON_KEYMAP=true - * - * - * DETAILS: - * - * This layout works off of Jack's layout, making some changes that I - * feel significantly improve the function of the keyboard. Major changes - * include adding a "gaming mode" that will allow users to still access - * the number keys 1 through 4 easily for games that require it. Also - * included is the ability to use the tap/hold function for easy use of - * right shift and thumb shift with their tapped companions. - * - */ -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP_GRID( /* Reed */ - ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, - TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, - LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, FN5, - LCTL, CAPS, LALT, LGUI, FN2, FN7, SPC, FN1, LEFT, DOWN, UP, RGHT), - -[1] = KEYMAP_GRID( /* Reed EXTREME GAMING */ - ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, - TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, - LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, FN5, - LCTL, 1, 2, 3, 4, SPC, FN2, FN1, LEFT, DOWN, UP, RGHT), - -[2] = KEYMAP_GRID( /* Reed RAISE */ - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC, - TRNS, FN3, FN4, PAUSE, TRNS, TRNS, TRNS, MINS, EQL, LBRC, RBRC, BSLS, - TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN1, MNXT, VOLD, VOLU, MPLY), - -[3] = KEYMAP_GRID( /* Reed LOWER */ - TRNS , FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, DEL, - TRNS, TRNS, TRNS, PAUSE, TRNS, TRNS, TRNS, FN20, FN21, FN23, FN24, FN28, - TRNS, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, TRNS, - TRNS, TRNS, TRNS, TRNS, FN2, TRNS, TRNS, TRNS, MNXT, VOLD, VOLU, MPLY), -}; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay - RAISE - [2] = ACTION_LAYER_MOMENTARY(3), // to Fn overlay - LOWER - - [3] = ACTION_DEFAULT_LAYER_SET(0), - [4] = ACTION_DEFAULT_LAYER_SET(1), - // Actions for the tap/hold modifiers listed above - [5] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), - [7] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPC), - - [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), - [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), - [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), - [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), - [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), - [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), - [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), - [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), - [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), - [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), - [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), - [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), - [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), - [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), - [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), - [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), - - [29] = ACTION_MODS_KEY(MOD_LSFT | MOD_RSFT, KC_PAUSE), -}; diff --git a/keyboard/planck/keymap_sean.c b/keyboard/planck/keymap_sean.c deleted file mode 100644 index 4fe07f701a..0000000000 --- a/keyboard/planck/keymap_sean.c +++ /dev/null @@ -1,57 +0,0 @@ -#include "keymap_common.h" - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = KEYMAP( /* Matrix Dvorak */ - QUOT, COMM, DOT, P, Y, SLSH, EQL, F, G, C, R, L, - A, O, E, U, I, ESC, BSPC, D, H, T, N, S, - SCLN, Q, J, K, X, TAB, ENT, B, M, W, V, Z, - LSFT, LCTL, LALT, LGUI, FN1, SPC, FN2, LEFT, DOWN, UP, RGHT), - - [1] = KEYMAP( /* Matrix Qwerty */ - Q, W, E, R, T, QUOT, EQL, Y, U, I, O, P, - A, S, D, F, G, ESC, BSPC, H, J, K, L, SCLN, - Z, X, C, V, B, TAB, ENT, N, M, COMM, DOT, SLSH, - LSFT, LCTL, LALT, LGUI, FN1, SPC, FN2, LEFT, DOWN, UP, RGHT), - - [2] = KEYMAP( /* fn1 lower */ - F1, F2, F3, F4, F5, TRNS, TRNS, F6, F7, F8, F9, F10, - 1, 2, 3, 4, 5, F18, DEL, 6, 7, 8, 9, 0, - FN3, FN4, TRNS, GRV, MINS, TRNS, TRNS, BSLS, LBRC, RBRC, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN5, HOME, PGDN, PGUP, END), - - [3] = KEYMAP( /* fn2 raise */ - F1, F2, F3, F4, F5, TRNS, TRNS, F6, F7, F8, F9, F10, - F11, F12, F13, F14, F15, F18, DEL, F16, F17, F18, F19, F20, - FN3, FN4, TRNS, TRNS, TRNS, TRNS, TRNS, EJCT, PWR, LSFT,PAUSE, RSFT, - LEFT, DOWN, UP, RGHT, FN5, TRNS, TRNS, MNXT, VOLD, VOLU, MUTE), - - [4] = KEYMAP( /* lower + raise */ - LEFT, DOWN, UP, RGHT, TRNS, TRNS, TRNS, TRNS, LEFT, DOWN, UP, RGHT, - HOME, PGDN, PGUP, END, TRNS, F18, DEL, TRNS, HOME, PGDN, PGUP, END, - FN3, FN4, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, EJCT, PWR, MPLY, RSFT, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MNXT, VOLD, VOLU, MUTE), -}; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay LOWER - [2] = ACTION_LAYER_MOMENTARY(3), // to Fn overlay RAISE - [3] = ACTION_DEFAULT_LAYER_SET(0), - [4] = ACTION_DEFAULT_LAYER_SET(1), - [5] = ACTION_LAYER_MOMENTARY(4), // to Fn overlay LOWER + RAISE - - [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), - [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), - [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), - [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), - [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), - [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), - [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), - [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), - [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), - [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), - [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), - [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), - [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), - [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), - [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), - [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), -}; diff --git a/keyboard/planck/keymap_shane.c b/keyboard/planck/keymap_shane.c deleted file mode 100644 index d4e40fe63a..0000000000 --- a/keyboard/planck/keymap_shane.c +++ /dev/null @@ -1,100 +0,0 @@ -// https://github.com/shanecelis/tmk_keyboard/blob/master/keyboard/planck/keymap_shane.c - -#include "keymap_common.h" -#include "action_layer.h" -#include "action.h" -#include "action_util.h" - -/* - Shane's Planck Layout - http://www.keyboard-layout-editor.com/#/layouts/015d9011102619d7695c86ffe57cf441 -*/ -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = KEYMAP_AND_SWAP( /* Base */ - TAB, Q, W, E, R, T, Y, U, I, O, P, MINS, - LCTL, A, S, D, F, G, H, J, K, L, SCLN, BSPC, - LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, FN5, - /*ALPHA*/FN3, /*HYPER*/ /*SUPER*/LGUI, /*META*/LALT, LCTL, FN2, FN6, FN1, LEFT, DOWN, UP, RGHT), - [2] = KEYMAP_AND_SWAP( /* More modifiers */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RCTL, RALT, RGUI, TRNS), - [4] = KEYMAP_AND_SWAP( /* WASD */ - TRNS, TRNS, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, LEFT, DOWN, RIGHT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), - [6] = KEYMAP_AND_SWAP( /* Raise/FN1 */ - FN23, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, EQL, - TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, ENT, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, BSLS, TRNS, - PAUS, TRNS, TRNS, TRNS, TRNS, BSPC, TRNS, MUTE, PGUP, PGDN, MNXT), - [8] = KEYMAP_AND_SWAP( /* Lower/FN2 */ - ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN19, FN20, TRNS, - TRNS, TRNS, TRNS, TRNS, CAPS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, QUOT, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN24, FN25, LBRC, RBRC, TRNS, TRNS, - FN4, TRNS, TRNS, TRNS, TRNS, ENT, TRNS, MPLY, VOLD, VOLU, MPRV), -}; - -enum function_id { - SPACE_FN, -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch (id) { - case SPACE_FN: - if (record->event.pressed) { - // Change the keyboard maps. - // Whatever even layer's are on, turn on the odd one's too. - for (uint8_t i = 0; i < 9; i += 2) { - if (layer_state & (1UL << i)) - layer_on(i + 1); - } - layer_on(1); - } else { - // turn off all the even layers. - for (uint8_t i = 0; i < 9; i += 2) - layer_off(i + 1); - - if (record->tap.count != 0) { - // Space was tapped rather than used like a modifier. - // So send a space up and down event. - add_key(KC_SPC); - send_keyboard_report(); - del_key(KC_SPC); - send_keyboard_report(); - } - } - break; - } -} - - - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(6), // to fist Fn overlay - [2] = ACTION_LAYER_MOMENTARY(8), // to second Fn overlay - [3] = ACTION_LAYER_TOGGLE(2), // toggle more modifiers - [4] = ACTION_LAYER_TOGGLE(4), // toggle wasd - [5] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), - [6] = ACTION_FUNCTION_TAP(SPACE_FN), - - [11] = ACTION_MODS_KEY(MOD_LSFT, KC_1), - [12] = ACTION_MODS_KEY(MOD_LSFT, KC_2), - [13] = ACTION_MODS_KEY(MOD_LSFT, KC_3), - [14] = ACTION_MODS_KEY(MOD_LSFT, KC_4), - [15] = ACTION_MODS_KEY(MOD_LSFT, KC_5), - [16] = ACTION_MODS_KEY(MOD_LSFT, KC_6), - [17] = ACTION_MODS_KEY(MOD_LSFT, KC_7), - [18] = ACTION_MODS_KEY(MOD_LSFT, KC_8), - [19] = ACTION_MODS_KEY(MOD_LSFT, KC_9), - [20] = ACTION_MODS_KEY(MOD_LSFT, KC_0), - [21] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), - [22] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), - [23] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), - [24] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), - [25] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), - [26] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), -}; diff --git a/keyboard/planck/keymap_simon.c b/keyboard/planck/keymap_simon.c deleted file mode 100644 index 37951364be..0000000000 --- a/keyboard/planck/keymap_simon.c +++ /dev/null @@ -1,44 +0,0 @@ -#include "keymap_common.h" - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP( /* Jack */ - ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, - TAB, A, S, D, F, G, H, J, K, L, DOT, ENT, - LSFT, Z, X, C, V, B, N, M, COMM, DOT, SCLN, DEL, - LCTL, ENT, LALT, CAPS, FN2, SPC, FN1, LEFT, DOWN, UP, RGHT), -[1] = KEYMAP( /* Jack RAISE */ - TRNS, F1, F2, F3, F4, NO, FN11, FN9, FN12, NO, FN14, TRNS, - TRNS, F5, F6, F7, F8, FN16, SLSH, MINS, EQL, LBRC, FN8, TRNS, - TRNS, F9, F10, F11, F12, F15, F16, FN22, SCLN, MINS, QUOT, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), -[2] = KEYMAP( /* Jack LOWER */ - FN22, 1, 2, 3, FN13, FN14, FN15, FN16, FN17, FN18, FN19, BSPC, - TRNS, 4, 5, 6, TRNS, TRNS, TRNS, FN20, FN21, FN23, FN24, FN28, - TRNS, 7, 8, 9, 0, FN28, FN15, F7, F8, F9, F10, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), -}; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay - [2] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay - - [8] = ACTION_MODS_KEY(MOD_LSFT, KC_SLSH), - [9] = ACTION_MODS_KEY(MOD_LSFT, KC_QUOT), - [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), - [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), - [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), - [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), - [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), - [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), - [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), - [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), - [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), - [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), - [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), - [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), - [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), - [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), - [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), - [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), - - [29] = ACTION_MODS_KEY(MOD_LSFT | MOD_RSFT, KC_PAUSE), -}; diff --git a/keyboard/planck/keymap_tim.c b/keyboard/planck/keymap_tim.c deleted file mode 100644 index 7444f3877b..0000000000 --- a/keyboard/planck/keymap_tim.c +++ /dev/null @@ -1,44 +0,0 @@ -#include "keymap_common.h" - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP( - ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, - TAB, A, S, D, F, G, H, J, K, L, SCLN, ENT, - LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, - LCTL, LALT, DEL, LGUI, FN2, SPC, FN1, F2, F5, F9, F12), -[2] = KEYMAP( /* RAISE */ - TRNS, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC, - GRV, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MINS, EQL, LBRC, RBRC, BSLS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, QUOT, FN29, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN1, TRNS, TRNS, TRNS, TRNS), -[3] = KEYMAP( /* LOWER */ - TRNS, FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, BSPC, - FN22, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN20, FN21, FN23, FN24, FN28, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, QUOT, FN29, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, FN2, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), -}; -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), - - [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), - [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), - [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), - [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), - [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), - [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), - [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), - [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), - [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), - [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), - [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), - [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), - [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), - [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), - [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), - [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), - [29] = ACTION_MODS_KEY(MOD_LSFT, KC_QUOT), -}; diff --git a/keyboard/planck/keymap_wilba.c b/keyboard/planck/keymap_wilba.c deleted file mode 100644 index 9781f8fcd8..0000000000 --- a/keyboard/planck/keymap_wilba.c +++ /dev/null @@ -1,56 +0,0 @@ -#include "keymap_common.h" - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP( /* Wilba */ - FN27, FN28, FN29, E, R, T, Y, U, I, O, P, BSPC, - TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, - LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, ENT, - LCTL, LGUI, LALT, RSFT, FN1, SPC, FN2, LEFT, DOWN, UP, RGHT), -[1] = KEYMAP( /* Wilba Alternate */ - ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, - TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, - LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, ENT, - LCTL, LGUI, LALT, RSFT, FN1, SPC, FN2, LEFT, DOWN, UP, RGHT), -[2] = KEYMAP( /* Wilba LOWER */ - TRNS, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, TRNS, - TRNS, F11, F12, LBRC, RBRC, FN20, EQL, FN23, FN24, MINS, FN21, TRNS, - TRNS, BSLS, GRV, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, FN1, TRNS, TRNS, MNXT, VOLD, VOLU, MPLY), -[3] = KEYMAP( /* Wilba RAISE */ - TRNS, FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, TRNS, - TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, TRNS, - TRNS, FN25, FN22, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN2, TRNS, TRNS, TRNS, TRNS), -}; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // LOWER - [2] = ACTION_LAYER_MOMENTARY(3), // RAISE - - [3] = ACTION_DEFAULT_LAYER_SET(0), - [4] = ACTION_DEFAULT_LAYER_SET(1), - - [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), // ! - [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), // @ - [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), // # - [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), // $ - [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), // % - [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), // ^ - [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), // & - [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), // * - [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), // ( - [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), // ) - - [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), // _ - [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), // + - [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // ~ - [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), // { - [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), // } - [25] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), // | - - [26] = ACTION_MODS_KEY(MOD_LSFT | MOD_RSFT, KC_PAUSE), - - [27] = ACTION_BACKLIGHT_TOGGLE(), - [28] = ACTION_BACKLIGHT_INCREASE(), - [29] = ACTION_BACKLIGHT_DECREASE() - -}; -- cgit v1.2.3 From 15110bf7a06badecb80dba351bb52fce6588dabe Mon Sep 17 00:00:00 2001 From: Reed Swiernik Date: Wed, 29 Apr 2015 02:49:58 -0400 Subject: Corrected makefile common var --- keyboard/planck/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index e32e4f97e8..e021e9e90b 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -50,7 +50,7 @@ TARGET_DIR = . # # project specific files -ifdef COMMON_KEYMAP +ifdef COMMON SRC = keymap_common.c \ matrix_handwire.c \ -- cgit v1.2.3 From cb3e499cc7dbff2607bc43cb05fc8c29a2eb9d30 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 7 May 2015 15:34:46 -0400 Subject: backlight stuff --- keyboard/planck/Makefile | 4 ++-- keyboard/planck/backlight.c | 17 ++++++++------ keyboard/planck/backlight.h | 2 -- keyboard/planck/config.h | 4 ++-- keyboard/planck/extended_keymap_common.c | 26 +++++++++++++++++++++- keyboard/planck/extended_keymap_common.h | 25 +++++++++++++++++++++ .../planck/extended_keymaps/extended_keymap_jack.c | 2 +- keyboard/planck/matrix.c | 4 ++-- 8 files changed, 67 insertions(+), 17 deletions(-) delete mode 100644 keyboard/planck/backlight.h (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index e021e9e90b..773783ad1d 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -53,7 +53,7 @@ TARGET_DIR = . ifdef COMMON SRC = keymap_common.c \ - matrix_handwire.c \ + matrix.c \ led.c \ backlight.c @@ -66,7 +66,7 @@ endif else SRC = extended_keymap_common.c \ - matrix_handwire.c \ + matrix.c \ led.c \ backlight.c diff --git a/keyboard/planck/backlight.c b/keyboard/planck/backlight.c index ee7e31ee9c..a560687ec0 100644 --- a/keyboard/planck/backlight.c +++ b/keyboard/planck/backlight.c @@ -2,9 +2,11 @@ #include #include "backlight.h" +#define CHANNEL OCR1C -void backlight_init_ports() +void backlight_init_ports(uint8_t level) { + // Setup PB7 as output and output low. DDRB |= (1<<7); PORTB &= ~(1<<7); @@ -24,9 +26,8 @@ void backlight_init_ports() TCCR1A = _BV(COM1C1) | _BV(WGM11); // = 0b00001010; TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; - - // Default to zero duty cycle. - OCR1C = 0x0000; + + backlight_init(); } void backlight_set(uint8_t level) @@ -35,12 +36,14 @@ void backlight_set(uint8_t level) { // Turn off PWM control on PB7, revert to output low. TCCR1A &= ~(_BV(COM1C1)); + // CHANNEL = level << OFFSET | 0x0FFF; + CHANNEL = ((1 << level) - 1); } else { // Turn on PWM control of PB7 TCCR1A |= _BV(COM1C1); - OCR1C = level << 12 | 0x0FFF; + // CHANNEL = level << OFFSET | 0x0FFF; + CHANNEL = ((1 << level) - 1); } -} - +} \ No newline at end of file diff --git a/keyboard/planck/backlight.h b/keyboard/planck/backlight.h deleted file mode 100644 index 0fe1f4a72b..0000000000 --- a/keyboard/planck/backlight.h +++ /dev/null @@ -1,2 +0,0 @@ - -void backlight_init_ports(void); diff --git a/keyboard/planck/config.h b/keyboard/planck/config.h index 0b0c152479..4e49a2b897 100644 --- a/keyboard/planck/config.h +++ b/keyboard/planck/config.h @@ -23,9 +23,9 @@ along with this program. If not, see . #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x6060 #define DEVICE_VER 0x0001 -#define MANUFACTURER jackhumbert +#define MANUFACTURER Ortholinear Keyboards #define PRODUCT Planck -#define DESCRIPTION t.m.k. keyboard firmware for the Planck +#define DESCRIPTION A compact ortholinear keyboard /* key matrix size */ #define MATRIX_ROWS 4 diff --git a/keyboard/planck/extended_keymap_common.c b/keyboard/planck/extended_keymap_common.c index f8fc3209fb..841b249431 100644 --- a/keyboard/planck/extended_keymap_common.c +++ b/keyboard/planck/extended_keymap_common.c @@ -22,6 +22,7 @@ along with this program. If not, see . #include "action.h" #include "action_macro.h" #include "debug.h" +#include "backlight.h" static action_t keycode_to_action(uint16_t keycode); @@ -46,7 +47,30 @@ action_t action_for_key(uint8_t layer, keypos_t key) action_t action; action.code = ACTION_MACRO(keycode & 0xFF); return action; - } + } else if (keycode >= BL_0 & keycode <= BL_15) { + action_t action; + action.code = ACTION_BACKLIGHT_LEVEL(keycode & 0x000F); + return action; + } else if (keycode == BL_DEC) { + action_t action; + action.code = ACTION_BACKLIGHT_DECREASE(); + return action; + } else if (keycode == BL_INC) { + action_t action; + action.code = ACTION_BACKLIGHT_INCREASE(); + return action; + } else if (keycode == BL_TOGG) { + action_t action; + action.code = ACTION_BACKLIGHT_TOGGLE(); + return action; + } else if (keycode == BL_STEP) { + action_t action; + action.code = ACTION_BACKLIGHT_STEP(); + return action; + } else if (keycode == RESET) { + bootloader_jump(); + return; + } switch (keycode) { case KC_FN0 ... KC_FN31: diff --git a/keyboard/planck/extended_keymap_common.h b/keyboard/planck/extended_keymap_common.h index 66712459c6..21d8978b7b 100644 --- a/keyboard/planck/extended_keymap_common.h +++ b/keyboard/planck/extended_keymap_common.h @@ -149,4 +149,29 @@ extern const uint16_t fn_actions[]; #define MACRODOWN(...) (record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE) +#define BL_ON 0x4009 +#define BL_OFF 0x4000 +#define BL_0 0x4000 +#define BL_1 0x4001 +#define BL_2 0x4002 +#define BL_3 0x4003 +#define BL_4 0x4004 +#define BL_5 0x4005 +#define BL_6 0x4006 +#define BL_7 0x4007 +#define BL_8 0x4008 +#define BL_9 0x4009 +#define BL_10 0x400A +#define BL_11 0x400B +#define BL_12 0x400C +#define BL_13 0x400D +#define BL_14 0x400E +#define BL_15 0x400F +#define BL_DEC 0x4010 +#define BL_INC 0x4011 +#define BL_TOGG 0x4012 +#define BL_STEP 0x4013 + +#define RESET 0x5000 + #endif diff --git a/keyboard/planck/extended_keymaps/extended_keymap_jack.c b/keyboard/planck/extended_keymaps/extended_keymap_jack.c index 416ae83450..de966ca9df 100644 --- a/keyboard/planck/extended_keymaps/extended_keymap_jack.c +++ b/keyboard/planck/extended_keymaps/extended_keymap_jack.c @@ -5,7 +5,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {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}, - {M(0), KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_NO, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {BL_STEP, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_NO, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, [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}, diff --git a/keyboard/planck/matrix.c b/keyboard/planck/matrix.c index e3926caece..156e081d14 100644 --- a/keyboard/planck/matrix.c +++ b/keyboard/planck/matrix.c @@ -62,8 +62,8 @@ void matrix_init(void) MCUCR |= (1< Date: Fri, 15 May 2015 21:57:29 -0400 Subject: quark --- keyboard/planck/Makefile | 4 +- keyboard/planck/backlight.c | 2 +- .../planck/extended_keymaps/extended_keymap_jack.c | 9 +- keyboard/planck/keymap_common.h | 4 +- keyboard/planck/led.c | 26 +-- keyboard/planck/matrix.c | 76 +++----- keyboard/planck/matrix_handwire.c | 193 --------------------- 7 files changed, 48 insertions(+), 266 deletions(-) delete mode 100644 keyboard/planck/matrix_handwire.c (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index 773783ad1d..2f5517b1b1 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -53,7 +53,7 @@ TARGET_DIR = . ifdef COMMON SRC = keymap_common.c \ - matrix.c \ + matrix_pcb.c \ led.c \ backlight.c @@ -66,7 +66,7 @@ endif else SRC = extended_keymap_common.c \ - matrix.c \ + matrix_pcb.c \ led.c \ backlight.c diff --git a/keyboard/planck/backlight.c b/keyboard/planck/backlight.c index a560687ec0..06f103b4ac 100644 --- a/keyboard/planck/backlight.c +++ b/keyboard/planck/backlight.c @@ -4,7 +4,7 @@ #define CHANNEL OCR1C -void backlight_init_ports(uint8_t level) +void backlight_init_ports() { // Setup PB7 as output and output low. diff --git a/keyboard/planck/extended_keymaps/extended_keymap_jack.c b/keyboard/planck/extended_keymaps/extended_keymap_jack.c index de966ca9df..d39dc5b84c 100644 --- a/keyboard/planck/extended_keymaps/extended_keymap_jack.c +++ b/keyboard/planck/extended_keymaps/extended_keymap_jack.c @@ -5,25 +5,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {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_NO, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {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_NO, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {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_NO, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} + {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_NO, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} } }; diff --git a/keyboard/planck/keymap_common.h b/keyboard/planck/keymap_common.h index c74c7e9a28..d888d81733 100644 --- a/keyboard/planck/keymap_common.h +++ b/keyboard/planck/keymap_common.h @@ -50,12 +50,12 @@ extern const uint16_t fn_actions[]; K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ 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, K37, K38, K39, K3A, K3B \ + K30, K31, K32, K33, K34, K35, K37, K38, K39, K3A, K3B \ ) { \ { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B }, \ { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B }, \ { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_NO, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B } \ + { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K35, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B } \ } // Grid Layout diff --git a/keyboard/planck/led.c b/keyboard/planck/led.c index 1f36434883..2c05746607 100644 --- a/keyboard/planck/led.c +++ b/keyboard/planck/led.c @@ -22,17 +22,17 @@ along with this program. If not, see . void led_set(uint8_t usb_led) { - // Using PE6 Caps Lock LED - if (usb_led & (1<. #include "debug.h" #include "util.h" #include "matrix.h" -#include "backlight.h" // TODO fix this dependency #ifndef DEBOUNCE @@ -58,13 +57,6 @@ uint8_t matrix_cols(void) void matrix_init(void) { - // To use PORTF disable JTAG with writing JTD bit twice within four cycles. - MCUCR |= (1<. -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" - - -#ifndef DEBOUNCE -# define DEBOUNCE 10 -#endif -static uint8_t debouncing = DEBOUNCE; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - // initialize row and col - unselect_rows(); - init_cols(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } -} - -uint8_t matrix_scan(void) -{ - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - select_row(i); - _delay_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - if (matrix_debouncing[i] != cols) { - matrix_debouncing[i] = cols; - if (debouncing) { - debug("bounce!: "); debug_hex(debouncing); debug("\n"); - } - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - return 1; -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1 Date: Mon, 18 May 2015 21:14:21 -0400 Subject: files --- keyboard/planck/__avr_gdbinit | 6 + .../extended_keymaps/extended_keymap_charlie.c | 54 +++++ keyboard/planck/matrix_pcb.c | 222 +++++++++++++++++++++ 3 files changed, 282 insertions(+) create mode 100644 keyboard/planck/__avr_gdbinit create mode 100644 keyboard/planck/extended_keymaps/extended_keymap_charlie.c create mode 100644 keyboard/planck/matrix_pcb.c (limited to 'keyboard/planck') diff --git a/keyboard/planck/__avr_gdbinit b/keyboard/planck/__avr_gdbinit new file mode 100644 index 0000000000..afc51e6d19 --- /dev/null +++ b/keyboard/planck/__avr_gdbinit @@ -0,0 +1,6 @@ +define reset +SIGNAL SIGHUP +end +file planck_lufa.elf +target remote localhost:4242 +break main diff --git a/keyboard/planck/extended_keymaps/extended_keymap_charlie.c b/keyboard/planck/extended_keymaps/extended_keymap_charlie.c new file mode 100644 index 0000000000..18657c8e41 --- /dev/null +++ b/keyboard/planck/extended_keymaps/extended_keymap_charlie.c @@ -0,0 +1,54 @@ +#include "extended_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/matrix_pcb.c b/keyboard/planck/matrix_pcb.c new file mode 100644 index 0000000000..7d46baf3de --- /dev/null +++ b/keyboard/planck/matrix_pcb.c @@ -0,0 +1,222 @@ +/* +Copyright 2012 Jun Wako +Generated by planckkeyboard.com (2014 Jack Humbert) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "backlight.h" // TODO fix this dependency + + +#ifndef DEBOUNCE +# define DEBOUNCE 10 +#endif +static uint8_t debouncing = DEBOUNCE; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + // To use PORTF disable JTAG with writing JTD bit twice within four cycles. + MCUCR |= (1< Date: Tue, 19 May 2015 01:03:54 -0400 Subject: default w/qwerty --- .../extended_keymaps/extended_keymap_default.c | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 keyboard/planck/extended_keymaps/extended_keymap_default.c (limited to 'keyboard/planck') diff --git a/keyboard/planck/extended_keymaps/extended_keymap_default.c b/keyboard/planck/extended_keymaps/extended_keymap_default.c new file mode 100644 index 0000000000..c35b283675 --- /dev/null +++ b/keyboard/planck/extended_keymaps/extended_keymap_default.c @@ -0,0 +1,50 @@ +#include "extended_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_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), 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; +}; -- cgit v1.2.3 From d61d1f5ca3a7dcccc495ac6688e0632c601c0623 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 21 May 2015 19:59:39 -0400 Subject: layouts, default --- keyboard/planck/Makefile | 2 +- .../extended_keymaps/extended_keymap_austin.c | 50 ++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 keyboard/planck/extended_keymaps/extended_keymap_austin.c (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index 2f5517b1b1..964e6832ea 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -73,7 +73,7 @@ SRC = extended_keymap_common.c \ ifdef KEYMAP SRC := extended_keymaps/extended_keymap_$(KEYMAP).c $(SRC) else - SRC := extended_keymaps/extended_keymap_jack.c $(SRC) + SRC := extended_keymaps/extended_keymap_default.c $(SRC) endif endif diff --git a/keyboard/planck/extended_keymaps/extended_keymap_austin.c b/keyboard/planck/extended_keymaps/extended_keymap_austin.c new file mode 100644 index 0000000000..35330be747 --- /dev/null +++ b/keyboard/planck/extended_keymaps/extended_keymap_austin.c @@ -0,0 +1,50 @@ +#include "extended_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; +}; -- cgit v1.2.3