diff --git a/keyboards/planck/config.h b/keyboards/planck/config.h new file mode 100644 index 000000000000..84c2fd11dcbb --- /dev/null +++ b/keyboards/planck/config.h @@ -0,0 +1,42 @@ +/* +Copyright 2012 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 . +*/ + +#pragma once + +#define AUDIO_VOICES +#define AUDIO_PIN C6 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT diff --git a/keyboards/planck/ez/base/info.json b/keyboards/planck/ez/base/info.json new file mode 100644 index 000000000000..07167a8c2a30 --- /dev/null +++ b/keyboards/planck/ez/base/info.json @@ -0,0 +1,6 @@ +{ + "keyboard_name": "Planck EZ", + "usb": { + "pid": "0xC6CE" + } +} diff --git a/keyboards/planck/ez/base/rules.mk b/keyboards/planck/ez/base/rules.mk new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/keyboards/planck/ez/config.h b/keyboards/planck/ez/config.h new file mode 100644 index 000000000000..3b10a2b753b1 --- /dev/null +++ b/keyboards/planck/ez/config.h @@ -0,0 +1,123 @@ +/* Copyright 2018 Jack Humbert + * Copyright 2015 ZSA Technology Labs Inc (@zsa) + * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * 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 . + */ + +#pragma once + +#define MUSIC_MAP +#undef AUDIO_VOICES +#undef AUDIO_PIN +#define AUDIO_PIN A5 +#define AUDIO_PIN_ALT A4 +#define AUDIO_PIN_ALT_AS_NEGATIVE + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT + +// #define WS2812_LED_N 2 +// #define RGBLED_NUM WS2812_LED_N +// #define WS2812_TIM_N 2 +// #define WS2812_TIM_CH 2 +// #define PORT_WS2812 GPIOA +// #define PIN_WS2812 1 +// #define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection) +//#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP +//#define WS2812_EXTERNAL_PULLUP + +#define DRIVER_ADDR_1 0b1010000 + +#define DRIVER_COUNT 1 +#define RGB_MATRIX_LED_COUNT 47 + +#define RGB_MATRIX_KEYPRESSES +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS +#define RGB_DISABLE_WHEN_USB_SUSPENDED + +#define RGB_MATRIX_LED_PROCESS_LIMIT 5 +#define RGB_MATRIX_LED_FLUSH_LIMIT 26 +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +#define ENABLE_RGB_MATRIX_ALPHAS_MODS +#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_BREATHING +#define ENABLE_RGB_MATRIX_BAND_SAT +#define ENABLE_RGB_MATRIX_BAND_VAL +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#define ENABLE_RGB_MATRIX_CYCLE_ALL +#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +#define ENABLE_RGB_MATRIX_DUAL_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#define ENABLE_RGB_MATRIX_RAINDROPS +#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#define ENABLE_RGB_MATRIX_HUE_BREATHING +#define ENABLE_RGB_MATRIX_HUE_PENDULUM +#define ENABLE_RGB_MATRIX_HUE_WAVE +#define ENABLE_RGB_MATRIX_PIXEL_RAIN +#define ENABLE_RGB_MATRIX_PIXEL_FLOW +#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +#define ENABLE_RGB_MATRIX_TYPING_HEATMAP +#define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#define ENABLE_RGB_MATRIX_SPLASH +#define ENABLE_RGB_MATRIX_MULTISPLASH +#define ENABLE_RGB_MATRIX_SOLID_SPLASH +#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + +#define TAPPING_TOGGLE 1 + +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 400 +#define MOUSEKEY_WHEEL_INTERVAL MOUSEKEY_INTERVAL +#define MOUSEKEY_WHEEL_MAX_SPEED MOUSEKEY_MAX_SPEED +#define MOUSEKEY_WHEEL_TIME_TO_MAX MOUSEKEY_TIME_TO_MAX diff --git a/keyboards/planck/ez/ez.c b/keyboards/planck/ez/ez.c new file mode 100644 index 000000000000..e6bd217520e5 --- /dev/null +++ b/keyboards/planck/ez/ez.c @@ -0,0 +1,369 @@ +/* Copyright 2018 Jack Humbert + * Copyright 2015 ZSA Technology Labs Inc (@zsa) + * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * 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 "ez.h" +#include +#include + +keyboard_config_t keyboard_config; +#ifdef RGB_MATRIX_ENABLE +const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, B_12, A_12, C_12}, + {0, B_11, A_11, C_11}, + {0, B_10, A_10, C_10}, + {0, B_9, A_9, C_9}, + {0, B_8, A_8, C_8}, + {0, B_7, A_7, C_7}, + + {0, H_12, G_12, I_12}, + {0, H_11, G_11, I_11}, + {0, H_10, G_10, I_10}, + {0, H_9, G_9, I_9}, + {0, H_8, G_8, I_8}, + {0, H_7, G_7, I_7}, + + {0, B_6, A_6, C_6}, + {0, B_5, A_5, C_5}, + {0, B_4, A_4, C_4}, + {0, B_3, A_3, C_3}, + {0, B_2, A_2, C_2}, + {0, B_1, A_1, C_1}, + + {0, H_6, G_6, I_6}, + {0, H_5, G_5, I_5}, + {0, H_4, G_4, I_4}, + {0, H_3, G_3, I_3}, + {0, H_2, G_2, I_2}, + {0, H_1, G_1, I_1}, + + {0, E_12, D_12, F_12}, + {0, E_11, D_11, F_11}, + {0, E_10, D_10, F_10}, + {0, E_9, D_9, F_9}, + {0, E_8, D_8, F_8}, + {0, E_7, D_7, F_7}, + + {0, K_12, J_12, L_12}, + {0, K_11, J_11, L_11}, + {0, K_10, J_10, L_10}, + {0, K_9, J_9, L_9}, + {0, K_8, J_8, L_8}, + {0, K_7, J_7, L_7}, + + {0, E_6, D_6, F_6}, + {0, E_5, D_5, F_5}, + {0, E_4, D_4, F_4}, + {0, E_3, D_3, F_3}, + {0, E_2, D_2, F_2}, + {0, E_1, D_1, F_1}, + + {0, K_6, J_6, L_6}, + {0, K_5, J_5, L_5}, + {0, K_4, J_4, L_4}, + {0, K_3, J_3, L_3}, + {0, K_2, J_2, L_2}, + +}; + +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5 }, + { 12, 13, 14, 15, 16, 17 }, + { 24, 25, 26, 27, 28, 29 }, + { 36, 37, 38, 45, 46, NO_LED }, + { 6, 7, 8, 9, 10, 11 }, + { 18, 19, 20, 21, 22, 23 }, + { 30, 31, 32, 33, 34, 35 }, + { 42, 43, 44, 39, 40, 41 } +}, { + { 0, 0 }, { 20, 0 }, { 40, 0 }, { 61, 0 }, { 81, 0 }, { 101, 0 }, { 122, 0 }, { 142, 0 }, { 162, 0 }, { 183, 0 }, { 203, 0 }, { 223, 0 }, + { 0, 21 }, { 20, 21 }, { 40, 21 }, { 61, 21 }, { 81, 21 }, { 101, 21 }, { 122, 21 }, { 142, 21 }, { 162, 21 }, { 183, 21 }, { 203, 21 }, { 223, 21 }, + { 0, 42 }, { 20, 42 }, { 40, 42 }, { 61, 42 }, { 81, 42 }, { 101, 42 }, { 122, 42 }, { 142, 42 }, { 162, 42 }, { 183, 42 }, { 203, 42 }, { 223, 42 }, + { 0, 63 }, { 20, 63 }, { 40, 63 }, { 61, 63 }, { 81, 63 }, { 111, 63 }, { 142, 63 }, { 162, 63 }, { 183, 63 }, { 203, 63 }, { 223, 63 } +}, { + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1 +} }; + +#endif + +/* Left B9 Right B8 */ + +// See http://jared.geek.nz/2013/feb/linear-led-pwm +static uint16_t cie_lightness(uint16_t v) { + if (v <= 5243) // if below 8% of max + return v / 9; // same as dividing by 900% + else { + uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare + // to get a useful result with integer division, we shift left in the expression above + // and revert what we've done again after squaring. + y = y * y * y >> 8; + if (y > 0xFFFFUL) // prevent overflow + return 0xFFFFU; + else + return (uint16_t) y; + } +} + +static PWMConfig pwmCFG = { + 0xFFFF,/* PWM clock frequency */ + 256,/* initial PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */ + NULL, + { + {PWM_OUTPUT_DISABLED, NULL}, /* channel 0 -> TIM1-CH1 = PA8 */ + {PWM_OUTPUT_DISABLED, NULL}, /* channel 1 -> TIM1-CH2 = PA9 */ + {PWM_OUTPUT_ACTIVE_HIGH, NULL}, + {PWM_OUTPUT_ACTIVE_HIGH, NULL} + }, + 0, /* HW dependent part.*/ + 0 +}; + +static uint32_t planck_ez_right_led_duty; +static uint32_t planck_ez_left_led_duty; + +void planck_ez_right_led_level(uint8_t level) { + planck_ez_right_led_duty = (uint32_t)(cie_lightness(0xFFFF * (uint32_t) level / 255)); + if (level == 0) { + // Turn backlight off + pwmDisableChannel(&PWMD4, 2); + } else { + // Turn backlight on + pwmEnableChannel(&PWMD4, 2, PWM_FRACTION_TO_WIDTH(&PWMD4,0xFFFF,planck_ez_right_led_duty)); + } +} + + +void planck_ez_right_led_on(void){ + pwmEnableChannel(&PWMD4, 2, PWM_FRACTION_TO_WIDTH(&PWMD4,0xFFFF,planck_ez_right_led_duty)); +} + +void planck_ez_right_led_off(void){ + pwmDisableChannel(&PWMD4, 2); +} + +void planck_ez_left_led_level(uint8_t level) { + planck_ez_left_led_duty = (uint32_t)(cie_lightness(0xFFFF * (uint32_t) level / 255)); + if (level == 0) { + // Turn backlight off + pwmDisableChannel(&PWMD4, 3); + } else { + // Turn backlight on + pwmEnableChannel(&PWMD4, 3, PWM_FRACTION_TO_WIDTH(&PWMD4,0xFFFF,planck_ez_left_led_duty)); + } +} + +void planck_ez_left_led_on(void){ + pwmEnableChannel(&PWMD4, 3, PWM_FRACTION_TO_WIDTH(&PWMD4,0xFFFF,planck_ez_left_led_duty)); +} + +void planck_ez_left_led_off(void){ + pwmDisableChannel(&PWMD4, 3); +} + + +void led_initialize_hardware(void) { + pwmStart(&PWMD4, &pwmCFG); + + // set up defaults + planck_ez_right_led_level((uint8_t)keyboard_config.led_level * 255 / 4 ); + palSetPadMode(GPIOB, 8, PAL_MODE_ALTERNATE(2)); + planck_ez_left_led_level((uint8_t)keyboard_config.led_level * 255 / 4 ); + palSetPadMode(GPIOB, 9, PAL_MODE_ALTERNATE(2)); + + + // turn LEDs off by default + planck_ez_left_led_off(); + planck_ez_right_led_off(); +} + +void keyboard_pre_init_kb(void) { + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + // read kb settings from eeprom + keyboard_config.raw = eeconfig_read_kb(); +#if defined(RGB_MATRIX_ENABLE) && defined(ORYX_CONFIGURATOR) + if (keyboard_config.rgb_matrix_enable) { + rgb_matrix_set_flags(LED_FLAG_ALL); + } else { + rgb_matrix_set_flags(LED_FLAG_NONE); + } +#endif + led_initialize_hardware(); + keyboard_pre_init_user(); +} + +#if defined(RGB_MATRIX_ENABLE) && defined(ORYX_CONFIGURATOR) +void keyboard_post_init_kb(void) { + rgb_matrix_enable_noeeprom(); + keyboard_post_init_user(); +} +#endif + +void eeconfig_init_kb(void) { // EEPROM is getting reset! + keyboard_config.raw = 0; + keyboard_config.rgb_matrix_enable = true; + keyboard_config.led_level = 4; + eeconfig_update_kb(keyboard_config.raw); + eeconfig_init_user(); +} + + +#ifdef ORYX_CONFIGURATOR + +#ifndef PLANCK_EZ_USER_LEDS + +#ifndef PLANCK_EZ_LED_LOWER +# define PLANCK_EZ_LED_LOWER 3 +#endif +#ifndef PLANCK_EZ_LED_RAISE +# define PLANCK_EZ_LED_RAISE 4 +#endif +#ifndef PLANCK_EZ_LED_ADJUST +# define PLANCK_EZ_LED_ADJUST 6 +#endif + +layer_state_t layer_state_set_kb(layer_state_t state) { + planck_ez_left_led_off(); + planck_ez_right_led_off(); + state = layer_state_set_user(state); + uint8_t layer = get_highest_layer(state); + switch (layer) { + case PLANCK_EZ_LED_LOWER: + planck_ez_left_led_on(); + break; + case PLANCK_EZ_LED_RAISE: + planck_ez_right_led_on(); + break; + case PLANCK_EZ_LED_ADJUST: + planck_ez_right_led_on(); + planck_ez_left_led_on(); + break; + default: + break; + } + return state; +} +#endif + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LED_LEVEL: + if (record->event.pressed) { + keyboard_config.led_level++; + if (keyboard_config.led_level > 4) { + keyboard_config.led_level = 0; + } + planck_ez_right_led_level((uint8_t)keyboard_config.led_level * 255 / 4 ); + planck_ez_left_led_level((uint8_t)keyboard_config.led_level * 255 / 4 ); + eeconfig_update_kb(keyboard_config.raw); + layer_state_set_kb(layer_state); + } + break; +#ifdef RGB_MATRIX_ENABLE + case TOGGLE_LAYER_COLOR: + if (record->event.pressed) { + keyboard_config.disable_layer_led ^= 1; + if (keyboard_config.disable_layer_led) + rgb_matrix_set_color_all(0, 0, 0); + eeconfig_update_kb(keyboard_config.raw); + } + break; + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_NONE); + keyboard_config.rgb_matrix_enable = false; + rgb_matrix_set_color_all(0, 0, 0); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + keyboard_config.rgb_matrix_enable = true; + } + break; + } + eeconfig_update_kb(keyboard_config.raw); + } + return false; +#endif + } + return process_record_user(keycode, record); +} +#endif + +#ifdef AUDIO_ENABLE +bool music_mask_kb(uint16_t keycode) { + switch (keycode) { + case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: + case QK_TO ... QK_TO_MAX: + case QK_MOMENTARY ... QK_MOMENTARY_MAX: + case QK_DEF_LAYER ... QK_DEF_LAYER_MAX: + case QK_TOGGLE_LAYER ... QK_TOGGLE_LAYER_MAX: + case QK_ONE_SHOT_LAYER ... QK_ONE_SHOT_LAYER_MAX: + case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX: + case QK_LAYER_MOD ... QK_LAYER_MOD_MAX: + case QK_ONE_SHOT_MOD ... QK_ONE_SHOT_MOD_MAX: + case QK_MOD_TAP ... QK_MOD_TAP_MAX: + case AU_ON ... AU_PREV: + case QK_BOOT: + case QK_CLEAR_EEPROM: + return false; + default: + return music_mask_user(keycode); + } +} +#endif + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}}, + {{5, 5}, {4, 5}, {3, 5}, {2, 5}, {1, 5}, {0, 5}}, + {{5, 6}, {4, 6}, {3, 6}, {2, 6}, {1, 6}, {0, 6}}, + {{5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, + + {{5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, + {{5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, + {{5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, + {{5, 7}, {4, 7}, {3, 7}, {2, 7}, {1, 7}, {0, 7}}, +}; + +# ifdef ENCODER_MAP_ENABLE +const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0}; +# endif +#endif + +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = { + {36, 37, 38, 39, 40, 41}, + {24, 25, 26, 27, 28, 29}, + {12, 13, 14, 15, 16, 17}, + { 0, 1, 2, 10, 11, 6}, + {42, 43, 44, 45, 46, 47}, + {30, 31, 32, 33, 34, 35}, + {18, 19, 20, 21, 22, 23}, + { 7, 8, 9, 3, 4, 5} +}; diff --git a/keyboards/planck/ez/ez.h b/keyboards/planck/ez/ez.h new file mode 100644 index 000000000000..695b14d9ad00 --- /dev/null +++ b/keyboards/planck/ez/ez.h @@ -0,0 +1,47 @@ +/* Copyright 2018 Jack Humbert + * Copyright 2015 ZSA Technology Labs Inc (@zsa) + * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * 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 . + */ +#pragma once + +#include "quantum.h" + +void planck_ez_right_led_on(void); +void planck_ez_right_led_off(void); +void planck_ez_right_led_level(uint8_t level); +void planck_ez_left_led_on(void); +void planck_ez_left_led_off(void); +void planck_ez_left_led_level(uint8_t level); + +enum planck_ez_keycodes { + LED_LEVEL = QK_KB_0, + TOGGLE_LAYER_COLOR, +}; + +#ifndef WEBUSB_ENABLE +# define WEBUSB_PAIR KC_NO +#endif + +typedef union { + uint32_t raw; + struct { + uint8_t led_level :3; + bool disable_layer_led :1; + bool rgb_matrix_enable :1; + }; +} keyboard_config_t; + +extern keyboard_config_t keyboard_config; diff --git a/keyboards/planck/ez/glow/info.json b/keyboards/planck/ez/glow/info.json new file mode 100644 index 000000000000..48522585709d --- /dev/null +++ b/keyboards/planck/ez/glow/info.json @@ -0,0 +1,6 @@ +{ + "keyboard_name": "Planck EZ Glow", + "usb": { + "pid": "0xC6CF" + } +} diff --git a/keyboards/planck/ez/glow/rules.mk b/keyboards/planck/ez/glow/rules.mk new file mode 100644 index 000000000000..aad92997d0fa --- /dev/null +++ b/keyboards/planck/ez/glow/rules.mk @@ -0,0 +1 @@ +RGB_MATRIX_ENABLE = yes diff --git a/keyboards/planck/ez/halconf.h b/keyboards/planck/ez/halconf.h new file mode 100644 index 000000000000..f1044867f76c --- /dev/null +++ b/keyboards/planck/ez/halconf.h @@ -0,0 +1,23 @@ +/* Copyright 2021 QMK + * + * 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 3 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 . + */ +#pragma once + +#define HAL_USE_I2C TRUE +#define HAL_USE_GPT TRUE +#define HAL_USE_DAC TRUE +#define HAL_USE_PWM TRUE + +#include_next diff --git a/keyboards/planck/ez/info.json b/keyboards/planck/ez/info.json new file mode 100644 index 000000000000..370a19357f04 --- /dev/null +++ b/keyboards/planck/ez/info.json @@ -0,0 +1,140 @@ +{ + "manufacturer": "ZSA Technology Labs", + "url": "https://ergodox-ez.com/pages/planck", + "maintainer": "jackhumbert", + "usb": { + "vid": "0x3297", + "device_version": "0.0.1" + }, + "rgb_matrix": { + "driver": "IS31FL3737" + }, + "matrix_pins": { + "cols": ["B11", "B10", "B2", "B1", "A7", "B0"], + "rows": ["A10", "A9", "A8", "B15", "C13", "C14", "C15", "A2"] + }, + "diode_direction": "COL2ROW", + "encoder": { + "rotary": [ + {"pin_a": "B12", "pin_b": "B13"} + ] + }, + "processor": "STM32F303", + "bootloader": "stm32-dfu", + "community_layouts": ["ortho_4x12", "planck_mit"], + "layout_aliases": { + "LAYOUT_planck_grid": "LAYOUT_ortho_4x12", + "LAYOUT_planck_mit": "LAYOUT_planck_1x2uC" + }, + "layouts": { + "LAYOUT_planck_1x2uC": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [4, 0], "x": 6, "y": 0}, + {"matrix": [4, 1], "x": 7, "y": 0}, + {"matrix": [4, 2], "x": 8, "y": 0}, + {"matrix": [4, 3], "x": 9, "y": 0}, + {"matrix": [4, 4], "x": 10, "y": 0}, + {"matrix": [4, 5], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [5, 0], "x": 6, "y": 1}, + {"matrix": [5, 1], "x": 7, "y": 1}, + {"matrix": [5, 2], "x": 8, "y": 1}, + {"matrix": [5, 3], "x": 9, "y": 1}, + {"matrix": [5, 4], "x": 10, "y": 1}, + {"matrix": [5, 5], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [6, 0], "x": 6, "y": 2}, + {"matrix": [6, 1], "x": 7, "y": 2}, + {"matrix": [6, 2], "x": 8, "y": 2}, + {"matrix": [6, 3], "x": 9, "y": 2}, + {"matrix": [6, 4], "x": 10, "y": 2}, + {"matrix": [6, 5], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [7, 3], "x": 3, "y": 3}, + {"matrix": [7, 4], "x": 4, "y": 3}, + {"matrix": [7, 5], "x": 5, "y": 3, "w": 2}, + {"matrix": [7, 0], "x": 7, "y": 3}, + {"matrix": [7, 1], "x": 8, "y": 3}, + {"matrix": [7, 2], "x": 9, "y": 3}, + {"matrix": [3, 3], "x": 10, "y": 3}, + {"matrix": [3, 4], "x": 11, "y": 3} + ] + }, + "LAYOUT_ortho_4x12": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [4, 0], "x": 6, "y": 0}, + {"matrix": [4, 1], "x": 7, "y": 0}, + {"matrix": [4, 2], "x": 8, "y": 0}, + {"matrix": [4, 3], "x": 9, "y": 0}, + {"matrix": [4, 4], "x": 10, "y": 0}, + {"matrix": [4, 5], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [5, 0], "x": 6, "y": 1}, + {"matrix": [5, 1], "x": 7, "y": 1}, + {"matrix": [5, 2], "x": 8, "y": 1}, + {"matrix": [5, 3], "x": 9, "y": 1}, + {"matrix": [5, 4], "x": 10, "y": 1}, + {"matrix": [5, 5], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [6, 0], "x": 6, "y": 2}, + {"matrix": [6, 1], "x": 7, "y": 2}, + {"matrix": [6, 2], "x": 8, "y": 2}, + {"matrix": [6, 3], "x": 9, "y": 2}, + {"matrix": [6, 4], "x": 10, "y": 2}, + {"matrix": [6, 5], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [7, 3], "x": 3, "y": 3}, + {"matrix": [7, 4], "x": 4, "y": 3}, + {"matrix": [7, 5], "x": 5, "y": 3}, + {"matrix": [3, 5], "x": 6, "y": 3}, + {"matrix": [7, 0], "x": 7, "y": 3}, + {"matrix": [7, 1], "x": 8, "y": 3}, + {"matrix": [7, 2], "x": 9, "y": 3}, + {"matrix": [3, 3], "x": 10, "y": 3}, + {"matrix": [3, 4], "x": 11, "y": 3} + ] + } + } +} diff --git a/keyboards/planck/ez/mcuconf.h b/keyboards/planck/ez/mcuconf.h new file mode 100644 index 000000000000..7475b0990c69 --- /dev/null +++ b/keyboards/planck/ez/mcuconf.h @@ -0,0 +1,41 @@ +/* Copyright 2021 QMK + * + * 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 3 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 . + */ + +#pragma once + +#include_next + +// for i2c expander, and ISSI +#undef STM32_I2C_USE_I2C1 +#define STM32_I2C_USE_I2C1 TRUE + +// for indicator LEDs +#undef STM32_PWM_USE_TIM3 +#define STM32_PWM_USE_TIM3 TRUE +#undef STM32_PWM_USE_TIM4 +#define STM32_PWM_USE_TIM4 TRUE + +// for audio +#undef STM32_DAC_USE_DAC1_CH1 +#define STM32_DAC_USE_DAC1_CH1 TRUE +#undef STM32_DAC_USE_DAC1_CH2 +#define STM32_DAC_USE_DAC1_CH2 TRUE +#undef STM32_GPT_USE_TIM6 +#define STM32_GPT_USE_TIM6 TRUE +#undef STM32_GPT_USE_TIM7 +#define STM32_GPT_USE_TIM7 TRUE +#undef STM32_GPT_USE_TIM8 +#define STM32_GPT_USE_TIM8 TRUE diff --git a/keyboards/planck/ez/readme.md b/keyboards/planck/ez/readme.md new file mode 100644 index 000000000000..f85ab5969369 --- /dev/null +++ b/keyboards/planck/ez/readme.md @@ -0,0 +1,64 @@ +# Planck EZ + +![Planck EZ](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/planck/ez/neat-planck-banner.png) + +A variant of the Planck featuring a 2u spacebar and per-key RGB backlighting. + +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert), [Drashna Jael're](https://github.com/drashna) +Hardware Supported: Planck EZ +Hardware Availability: [ZSA](https://www.zsa.io/planck/) + +Make example for this keyboard (after setting up your build environment): + + make planck/ez:oryx + +For the per key RGB version of this keyboard, you want to use the "glow" subdirectory. For example: + + make planck/ez/glow:oryx + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Planck EZ Configuration (from Oryx) + +To enable the features from Oryx (ZSA's Configurator), either compile the the `oryx` keymap, or add `#define ORYX_CONFIGURATOR` to your `config.h` file. + +This enables the front Indicator LEDs, and the `TOGGLE_LAYER_COLOR`, and `LED_LEVEL` keycodes. The `TOGGLE_LAYER_COLOR` keycode toggles the customized LED map configured on Oryx. The `LED_LEVEL` cycles through the brightness levels for the front "teeth" LEDs. + +### Indicator LEDs + +The two front "teeth" LED indicators are PWM controlled. If you have `ORYX_CONFIGURATOR` defined in your keymap's `config.h`, you can use the `LED_LEVEL` to cycle through preset vales (0, 25%, 50%, 75%, 100%), and will be saved to EEPROM (persistent storage) + +Alternatively, you can set the brightness by calling the following functions: + +```c +void planck_ez_right_led_level(uint8_t level); +void planck_ez_left_led_level(uint8_t level); +``` + +These settings are not persistent, so you'd need to reset it every time the board starts. + +These are on a 0-255 scale + +#### Layer indication + +By default, the indicator lights are used for layer indication, expecting the specific layers used in the default keymap. However, this may not work for you. And if that is the case, you can add `#define PLANCK_EZ_USER_LEDS` to your `config.h` file. + +This will remove the default behavior for changing the LEDs based on layer, and allow you to control them manually. + +Alternatively, you can use the following defines in your keymap's `config.h` to control which layers are used, as long as you have `ORYX_CONFIGURATOR` defined in your keymap's `config.h` file, as well. + +```c +#define PLANCK_EZ_LED_LOWER 3 +#define PLANCK_EZ_LED_RAISE 4 +#define PLANCK_EZ_LED_ADJUST 6 +``` + +This will allow you to change the layers that are used, without having to add anything code to your `keymap.c` + +### RGB Matrix Features + +If you're using the Smart LED (layer indication) feature from the Oryx Configurator, you want to make sure that you enable these options by adding `#define ORYX_CONFIGURATOR` to your keymap's `config.h`. + +This changes the `RGB_TOG` keycode so that it will toggle the lights on and off, in a way that will allow the Smart LEDs to continue to work, even with the rest of the LEDs turned off. + +Additionally, a new keycode has been added to toggle the Smart LEDs. Use `TOGGLE_LAYER_COLOR`, if you aren't already. diff --git a/keyboards/planck/ez/rules.mk b/keyboards/planck/ez/rules.mk new file mode 100644 index 000000000000..a19a4fceaa86 --- /dev/null +++ b/keyboards/planck/ez/rules.mk @@ -0,0 +1,25 @@ +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = yes # Audio output +AUDIO_DRIVER = dac_additive +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +ENCODER_ENABLE = yes + +LAYOUTS_HAS_RGB = no + +RGB_MATRIX_SUPPORTED = yes +RGBLIGHT_SUPPORTED = no +BAKCLIGHT_SUPPORTED = no + +MOUSE_SHARED_EP = no + +DEFAULT_FOLDER = planck/ez/base diff --git a/keyboards/planck/info.json b/keyboards/planck/info.json new file mode 100644 index 000000000000..3f92fa168d4f --- /dev/null +++ b/keyboards/planck/info.json @@ -0,0 +1,4 @@ +{ + "url": "https://olkb.com/planck", + "maintainer": "jackhumbert" +} diff --git a/keyboards/planck/keymaps/abhixec/config.h b/keyboards/planck/keymaps/abhixec/config.h new file mode 100644 index 000000000000..b3d107bcfa82 --- /dev/null +++ b/keyboards/planck/keymaps/abhixec/config.h @@ -0,0 +1,48 @@ +/* Copyright 2015-2017 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 . + */ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/abhixec/keymap.c b/keyboards/planck/keymaps/abhixec/keymap.c new file mode 100644 index 000000000000..f8f5731ce21f --- /dev/null +++ b/keyboards/planck/keymaps/abhixec/keymap.c @@ -0,0 +1,261 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + + +enum planck_layers { + _QWERTY, + _COLEMAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define SHENT MT(MOD_RSFT, KC_ENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |shent | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + QK_GESC, 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, SHENT , + _______,KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + QK_GESC, 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, SHENT , + _______,KC_LCTL, KC_LALT,KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Adjust (Lower + Raise) + * v------------------------RGB CONTROL--------------------v + * ,-----------------------------------------------------------------------------------. + * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | |MUSmod|Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_song); } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_gb_song); } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } + return true; +} + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/abhixec/readme.md b/keyboards/planck/keymaps/abhixec/readme.md new file mode 100644 index 000000000000..b7bccc52bb6a --- /dev/null +++ b/keyboards/planck/keymaps/abhixec/readme.md @@ -0,0 +1,2 @@ +# Abhixec's Layout + diff --git a/keyboards/planck/keymaps/abhixec/rules.mk b/keyboards/planck/keymaps/abhixec/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/abhixec/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/abishalom/config.h b/keyboards/planck/keymaps/abishalom/config.h new file mode 100644 index 000000000000..fbdc426d04aa --- /dev/null +++ b/keyboards/planck/keymaps/abishalom/config.h @@ -0,0 +1,32 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 diff --git a/keyboards/planck/keymaps/abishalom/keymap.c b/keyboards/planck/keymaps/abishalom/keymap.c new file mode 100644 index 000000000000..87af1d75e33d --- /dev/null +++ b/keyboards/planck/keymaps/abishalom/keymap.c @@ -0,0 +1,318 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _NAV, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl| CAPS | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT(_NAV, 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_LCTL, KC_CAPS, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End |Pl/Ps | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Prev | Vol- | Vol+ | Next | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, KC_MPLY, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn |Pl/Ps | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Prev | Vol- | Vol+ | Next | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, KC_MPLY, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT +), + +/* Nav + * ,----------------------------------l-------------------------------------------------. + * | | | | | | | | Pg Dn| Up | Pg Up| | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Mute | Vol-| Vol+ | Pl/Ps| | | Left | Down | Right| | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_NAV] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_UP, KC_PGUP, _______ , _______, + _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT +), + + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * v------------------------RGB CONTROL--------------------v + * ,-----------------------------------------------------------------------------------. + * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | |MUSmod|Aud on|Audoff|AGnorm|AGswap|Qwerty| | |Plover| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + writePinLow(E6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + writePinHigh(E6); + #endif + } + return false; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_song); } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_gb_song); } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } + return true; +} + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/abishalom/readme.md b/keyboards/planck/keymaps/abishalom/readme.md new file mode 100644 index 000000000000..9978df19bec2 --- /dev/null +++ b/keyboards/planck/keymaps/abishalom/readme.md @@ -0,0 +1,7 @@ +# Abishalom Planck Layout + +Mostly the same as default. Changes: +- Get rid of COLEMAK and DVORAK layers +- Add new layer (NAV) which is accessed by holding the ESC key. This brings up arrow keys in ijkl spots, along with handy media funcions in wasd. +- Move left control to the corner, put caps lock between LCTRL and LGUI +- Adjustments to media keys in bottom right corner \ No newline at end of file diff --git a/keyboards/planck/keymaps/abishalom/rules.mk b/keyboards/planck/keymaps/abishalom/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/abishalom/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/adamtabrams/config.h b/keyboards/planck/keymaps/adamtabrams/config.h new file mode 100644 index 000000000000..d47e552434ab --- /dev/null +++ b/keyboards/planck/keymaps/adamtabrams/config.h @@ -0,0 +1,39 @@ +/* Copyright (C) 2021 Adam Abrams + * + * 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 3 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 . + */ + +#pragma once + +// General Configs +#define NO_ACTION_ONESHOT +#define FORCE_NKRO +#define TAPPING_TOGGLE 3 + +// Mouse Configs +#define MK_3_SPEED +#define MK_MOMENTARY_ACCEL +#define MK_C_OFFSET_1 6 +#define MK_C_OFFSET_UNMOD 16 +#define MK_C_OFFSET_2 26 +// for MK_W lower is faster +#define MK_W_INTERVAL_UNMOD 80 + +// Tap-Hold Configs +#define TAPPING_TERM 180 +#define PERMISSIVE_HOLD +#define HOLD_ON_OTHER_KEY_PRESS +#define HOLD_ON_OTHER_KEY_PRESS_PER_KEY +#define QUICK_TAP_TERM 0 +#define QUICK_TAP_TERM_PER_KEY diff --git a/keyboards/planck/keymaps/adamtabrams/keymap.c b/keyboards/planck/keymaps/adamtabrams/keymap.c new file mode 100644 index 000000000000..ce1acd437b5b --- /dev/null +++ b/keyboards/planck/keymaps/adamtabrams/keymap.c @@ -0,0 +1,279 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + + +enum planck_layers { + _QWERTY, + _COLEMAK, + _SIMPLE, + _NUMBER, + _ARROWS, + _CURSOR, + _SYSTEM, + _KBOARD, + _FMWARE +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + SIMPLE, + NORMAL +}; + +#define ARROWS TT(_ARROWS) +#define CURSOR TT(_CURSOR) +#define SYSTEM TT(_SYSTEM) +#define KBOARD MO(_KBOARD) +#define FMWARE MO(_FMWARE) + +#define NUMSPAC LT(_NUMBER, KC_SPC) +#define SHFTESC LSFT_T(KC_ESC) +#define SFTENTR SFT_T(KC_ENT) + +#define ALT__A ALT_T(KC_A) +#define ALTSCLN ALT_T(KC_SCLN) +#define ALT__O ALT_T(KC_O) +#define GUI__S GUI_T(KC_S) +#define GUI__L GUI_T(KC_L) +#define GUI__R GUI_T(KC_R) +#define GUI__I GUI_T(KC_I) +#define SFT__D SFT_T(KC_D) +#define SFT__K SFT_T(KC_K) +#define SFT__S SFT_T(KC_S) +#define SFT__E SFT_T(KC_E) +#define CTL__F CTL_T(KC_F) +#define CTL__J CTL_T(KC_J) +#define CTL__T CTL_T(KC_T) +#define CTL__N CTL_T(KC_N) + +#define ALTRGHT A(KC_RGHT) +#define ALTLEFT A(KC_LEFT) +#define CTLRGHT C(KC_RGHT) +#define CTLLEFT C(KC_LEFT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* ## Qwerty + +| Tab | Q | W | E | R | T | Y | U | I | O | P | -_ | +| Bsp | A(A) | G(S) | S(D) | C(F) | G | H | C(J) | S(K) | G(L) | A(;) | '" | +| ! | Z | X | C | V | B | N | M | , | . | / | Enter| +| CTRL | GUI | ALT |System|Cursor|S(Esc)|N(Spc)|Arrows| Left | Down | Up | Right| + */ + +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, + KC_BSPC, ALT__A, GUI__S, SFT__D, CTL__F, KC_G, KC_H, CTL__J, SFT__K, GUI__L, ALTSCLN, KC_QUOT, + KC_EXLM, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, KC_LGUI, KC_LALT, SYSTEM, CURSOR, SHFTESC, NUMSPAC, ARROWS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* ## Colemak + +| Tab | Q | W | F | P | B | J | L | U | Y | ; | -_ | +| Bsp | A(A) | G(R) | S(S) | C(T) | G | M | C(N) | S(E) | G(I) | A(O) | '" | +| ! | Z | X | C | D | V | K | H | , | . | / | Enter| +| CTRL | GUI | ALT |System|Cursor|S(Esc)|N(Spc)|Arrows| Left | Down | Up | Right| + */ + +[_COLEMAK] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS, + KC_BSPC, ALT__A, GUI__R, SFT__S, CTL__T, KC_G, KC_M, CTL__N, SFT__E, GUI__I, ALT__O, KC_QUOT, + KC_EXLM, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, KC_LGUI, KC_LALT, SYSTEM, CURSOR, SHFTESC, NUMSPAC, ARROWS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* ## Simple + +| Tab | Q | W | E | R | T | Y | U | I | O | P | Bsp | +| Esc | A | S | D | F | G | H | J | K | L | ; | '" | +| SHFT | Z | X | C | V | B | N | M | , | . | / |S(Ent)| +| CTRL | GUI | ALT |System|Cursor| Spc |N(Spc)|Arrows| Left | Down | Up | Right| + */ + +[_SIMPLE] = LAYOUT_planck_grid( + 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, SFTENTR, + KC_LCTL, KC_LGUI, KC_LALT, SYSTEM, CURSOR, KC_SPC, NUMSPAC, ARROWS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* ## Number + +| | \| | & | = | + | @ | % | # | * | $ | ^ | | +| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \` | +| | | [ | { | ( | ~ | ! | ) | } | ] | \ | | +| | | | | | | \\/ | | | | |Normal| + */ + +[_NUMBER] = LAYOUT_planck_grid( + _______, KC_PIPE, KC_AMPR, KC_EQL, KC_PLUS, KC_AT, KC_PERC, KC_HASH, KC_ASTR, KC_DLR, KC_CIRC, _______, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, + _______, XXXXXXX, KC_LBRC, KC_LCBR, KC_LPRN, KC_TILD, KC_EXLM, KC_RPRN, KC_RCBR, KC_RBRC, KC_BSLS, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NORMAL +), + + +/* ## Arrows + +| | |A(->) | | |A(<-) | | P_Up | P_Up |C(->) | | | +| | | |P_Down| | | Left | Down | Up |Right |C(<-) | | +| | | | |P_Down|A(<-) | | | | | | | +| | | | | | | | \\/ | | | |Normal| + */ + +[_ARROWS] = LAYOUT_planck_grid( + _______, _______, ALTRGHT, _______, _______, ALTLEFT, _______, KC_PGUP, KC_PGUP, CTLRGHT, _______, _______, + _______, _______, _______, KC_PGDN, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, CTLLEFT, _______, + _______, _______, _______, _______, KC_PGDN, ALTLEFT, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NORMAL +), + +/* ## Cursor + +| | | |Wh_Dn |M_Btn2| | |Wh_Dn |Wh_Dn | | | | +| |M_Acc2|M_Acc1|Wh_Up |M_Btn1| | M_L |M_Down| M_Up | M_R | | | +| | | | |Wh_Up | | | | | | | | +| | | | | \\/ | | | | | | |Normal| + */ + +[_CURSOR] = LAYOUT_planck_grid( + _______, _______, _______, KC_WH_D, KC_BTN2, _______, _______, KC_WH_D, KC_WH_D, _______, _______, _______, + _______, KC_ACL2, KC_ACL1, KC_WH_U, KC_BTN1, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______, + _______, _______, _______, _______, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NORMAL +), + +/* ## System + +| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | +| | |Pr_Scn|Pr_Scn| | |Brght-| Vol- | Vol+ |Brght+| Mute | | +| | | | | | | | Mute |P_Trac|N_Trac| | Play | +|KBoard| | | \\/ | | | | |Simple|Qwerty|Colemk|Normal| + */ + +[_SYSTEM] = LAYOUT_planck_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, XXXXXXX, KC_PSCR, KC_PSCR, XXXXXXX, XXXXXXX, KC_BRID, KC_VOLD, KC_VOLU, KC_BRIU, KC_MUTE, _______, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_MPRV, KC_MNXT, XXXXXXX, KC_MPLY, + KBOARD, _______, _______, _______, _______, _______, _______, _______, SIMPLE, QWERTY, COLEMAK, NORMAL +), + +/* ## KBoard + +|------| | | | | | | | | | | | +| | | | | | | Hue- | Sat- | Sat+ | Hue+ |Mode+ | | +| | | | | | | |Mode- |Brght-|Brght+| |RGB_Tg| +| \\/ | | | \\/ | | | | | | | |FMWare| + */ + +[_KBOARD] = LAYOUT_planck_grid( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUD, RGB_SAD, RGB_SAI, RGB_HUI, RGB_MOD, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_RMOD, RGB_VAD, RGB_VAI, XXXXXXX, RGB_TOG, + _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, FMWARE +), + +/* ## FMWare + +| | | |EEPROM|Reset | | | | | | | | +| | |Reset |Debug | | | | | | | | | +|------| | | | | | | | | | | | +| \\/ | | | \\/ | | | | | | | | \\/ | + */ + +[_FMWARE] = LAYOUT_planck_grid( + XXXXXXX, XXXXXXX, XXXXXXX, EE_CLR, QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, QK_BOOT, DB_TOGG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______ +) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + set_single_persistent_default_layer(_QWERTY); + return true; + + case COLEMAK: + set_single_persistent_default_layer(_COLEMAK); + return true; + + case SIMPLE: + set_single_persistent_default_layer(_SIMPLE); + return true; + + case NORMAL: + layer_clear(); + return false; + } + return true; +} + +uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case SHFTESC: + case NUMSPAC: + case SFTENTR: + case ALT__A: + case ALTSCLN: + case ALT__O: + case GUI__S: + case GUI__L: + case GUI__R: + case GUI__I: + case SFT__D: + case SFT__K: + case SFT__S: + case SFT__E: + case CTL__F: + case CTL__J: + case CTL__T: + case CTL__N: + return 0; + default: + return QUICK_TAP_TERM; + } +} + +bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case ALT__A: + case ALTSCLN: + case ALT__O: + case GUI__S: + case GUI__L: + case GUI__R: + case GUI__I: + case SFT__D: + case SFT__K: + case SFT__S: + case SFT__E: + case CTL__F: + case CTL__J: + case CTL__T: + case CTL__N: + return false; + default: + return false; + } +} diff --git a/keyboards/planck/keymaps/adamtabrams/readme.md b/keyboards/planck/keymaps/adamtabrams/readme.md new file mode 100644 index 000000000000..6512cb7d7ab2 --- /dev/null +++ b/keyboards/planck/keymaps/adamtabrams/readme.md @@ -0,0 +1,89 @@ +## Normal - Qwerty + +|------|------|------|------|------|------|------|------|------|------|------|------| +|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:| +| Tab | Q | W | E | R | T | Y | U | I | O | P | -_ | +| Bsp | A(A) | G(S) | S(D) | C(F) | G | H | C(J) | S(K) | G(L) | A(;) | '" | +| ! | Z | X | C | V | B | N | M | , | . | / | Enter| +| CTRL | GUI | ALT |System|Cursor|S(Esc)|N(Spc)|Arrows| Left | Down | Up | Right| + +- The `N` in `N(Spc)` stands for Number layer +- Hold down a layer key to temporarily activate or tap twice to toggle on or off + +## Normal - Colemak + +|------|------|------|------|------|------|------|------|------|------|------|------| +|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:| +| Tab | Q | W | F | P | B | J | L | U | Y | ; | -_ | +| Bsp | A(A) | G(R) | S(S) | C(T) | G | M | C(N) | S(E) | G(I) | A(O) | '" | +| ! | Z | X | C | D | V | K | H | , | . | / | Enter| +| CTRL | GUI | ALT |System|Cursor|S(Esc)|N(Spc)|Arrows| Left | Down | Up | Right| + +- The `N` in `N(Spc)` stands for Number layer +- Hold down a layer key to temporarily activate or tap twice to toggle on or off + +## Normal - Simple + +|------|------|------|------|------|------|------|------|------|------|------|------| +|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:| +| Tab | Q | W | E | R | T | Y | U | I | O | P | Bsp | +| Esc | A | S | D | F | G | H | J | K | L | ; | '" | +| SHFT | Z | X | C | V | B | N | M | , | . | / |S(Ent)| +| CTRL | GUI | ALT |System|Cursor| Spc |N(Spc)|Arrows| Left | Down | Up | Right| + +- The `N` in `N(Spc)` stands for Number layer +- Hold down a layer key to temporarily activate or tap twice to toggle on or off + +## Number + +|------|------|------|------|------|------|------|------|------|------|------|------| +|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:| +| | \| | & | = | + | @ | % | # | * | $ | ^ | | +| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \` | +| | | [ | { | ( | ~ | ! | ) | } | ] | \ | | +| | | | | | | \\/ | | | | |Normal| + +## Arrows + +|------|------|------|------|------|------|------|------|------|------|------|------| +|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:| +| | |A(->) | | |A(<-) | | P_Up | P_Up |C(->) | | | +| | | |P_Down| | | Left | Down | Up |Right |C(<-) | | +| | | | |P_Down|A(<-) | | | | | | | +| | | | | | | | \\/ | | | |Normal| + +## Cursor + +|------|------|------|------|------|------|------|------|------|------|------|------| +|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:| +| | | |Wh_Dn |M_Btn2| | |Wh_Dn |Wh_Dn | | | | +| |M_Acc2|M_Acc1|Wh_Up |M_Btn1| | M_L |M_Down| M_Up | M_R | | | +| | | | |Wh_Up | | | | | | | | +| | | | | \\/ | | | | | | |Normal| + +## System + +|------|------|------|------|------|------|------|------|------|------|------|------| +|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:| +| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | +| | |Pr_Scn|Pr_Scn| | |Brght-| Vol- | Vol+ |Brght+| Mute | | +| | | | | | | | Mute |P_Trac|N_Trac| | Play | +|KBoard| | | \\/ | | | | |Simple|Qwerty|Colemk|Normal| + +## KBoard + +|------|------|------|------|------|------|------|------|------|------|------|------| +|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:| +|------| | | | | | | | | | | | +| | | | | | | Hue- | Sat- | Sat+ | Hue+ |Mode+ | | +| | | | | | | |Mode- |Brght-|Brght+| |RGB_Tg| +| \\/ | | | \\/ | | | | | | | |FMWare| + +## FMWare + +|------|------|------|------|------|------|------|------|------|------|------|------| +|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:| +| | | |EEPROM|Reset | | | | | | | | +| | |Reset |Debug | | | | | | | | | +|------| | | | | | | | | | | | +| \\/ | | | \\/ | | | | | | | | \\/ | diff --git a/keyboards/planck/keymaps/adamtabrams/rules.mk b/keyboards/planck/keymaps/adamtabrams/rules.mk new file mode 100644 index 000000000000..bbf6cc119e32 --- /dev/null +++ b/keyboards/planck/keymaps/adamtabrams/rules.mk @@ -0,0 +1,13 @@ +SRC += muse.c +LTO_ENABLE = yes + +MOUSEKEY_ENABLE = yes +EXTRAKEY_ENABLE = yes +NKRO_ENABLE = yes +RGBLIGHT_ENABLE = yes + +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +COMMAND_ENABLE = no +AUDIO_ENABLE = no +ENCODER_ENABLE = no +DIP_SWITCH_ENABLE = no diff --git a/keyboards/planck/keymaps/ajp10304/readme.md b/keyboards/planck/keymaps/ajp10304/readme.md new file mode 100644 index 000000000000..4b7a54bb5495 --- /dev/null +++ b/keyboards/planck/keymaps/ajp10304/readme.md @@ -0,0 +1,126 @@ +# AJP10304 Custom Planck Layout +# Also available for the Shark, Quark, JJ40 and Atreus50 + +**Note:** In the tables below where there are two characters on a key, +the second is the output when shift is applied. + +**Note:** The below tables assume a UK layout. + +#### Flashing +Refer to the README.md of the keyboard you want to flash. + +##### Main Qwerty Layer + +* Tab: when held, operates as shift. +* Enter: when held, operates as shift. +* MENU: perform right-click + +| | | | | | | | | | | | | +| ---- |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| ----:| +| Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | +| Tab | A | S | D | F | G | H | J | K | L | ;: | Enter| +| Shft | Z | X | C | V | B | N | M | ,< | .> | /? | Shft | +| Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | Shift| MENU | Ctrl | Fn2 | + +##### Main Colemak-DHm Layer + +| | | | | | | | | | | | | +| ---- |:----:| :---:|:---:|:-----:|:----:|:-----:|:-----:|:-----:|:----:|:----:| ----:| +| Esc | Q | W | F | P | B | J | L | U | Y | ;: | Bksp | +| Tab | A | R | S | T | G | M | N | E | I | O | Enter| +| Shft | Z | X | C | D | V | K | H | ,< | .> | /? | Shft | +| Fn | Ctrl | Alt | GUI | Lower | Bksp | Space | Raise | Shift | MENU | Ctrl | Fn2 | + +##### Function Layer +Activated when `fn` held in the above `qwerty` layer. + +| | | | | | | | | | | | | +| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| +| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | +| 1! | 2" | 3£ | 4$ | 5% | 6^ | 7& | 8* | 9( | 0) | ~ |INSERT| +| Shift | \| | `¬ | #~ | * | -_ | =+ | \| | [{ | ]} | '@ |Shift | +| Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Mouse | MENU | Alt | Ctrl | Fn2 | + +##### Lower Layer +Activated when `Lower` is held in the above `qwerty` layer. + +* Numbers are along the top row, their shifted counterparts are on row 2. +* WrdBks: `backspace` with `ctrl` applied. I.e. delete a word. +* WrdDel: `delete` with `ctrl` applied. I.e. forward delete a word. + +| | | | | | | | | | | | | +| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| +| 1! | 2" | 3£ | 4$ | 5% | 6^ | 7& | 8* | 9( | 0) | DEL | Bksp | +| ! | " | £ | $ | % | ^ | & | * | ( | ) |WrdDel|WrdBks| +| Shift | \| | `¬ | #~ | '@ | -_ | =+ | #~ | [{ | ]} | '@ |Shift | +| | | | |Lower | Del |Space | | Next | Vol- | Vol+ | Play | + +##### Raise Layer +Activated when `Raise` is held in the above `qwerty` layer. + +* Preferred layer for typing brackets. +* Allows for cursor navigation to be used solely with the right hand. +* WRDSEL: Select the word where the cursor is. +* |< and >|: Apply `ctrl` to `left` and `right` respectively for word jumping. + +| | | | | | | | | | | | | +| :---: |:----:| :---:| :---:| :---:| :---:| :---: | :---:| :---:| :---:| :---: | :---:| +| ` | |WRDSEL| [ | ] | | | PGUP | HOME |PGDOWN| |PRNTSC| +| ` | | | ( | ) | | | HOME | UP | END | |ZOOM +| +| | | | { | } | ||<| LEFT | DOWN |RIGHT |>||ZOOM -| +| Mouse | | | | | Alt | Enter |Raise | | | | | + +##### Lower + Raise +Activated when `Lower` and `Raise` are held together in the above `qwerty` layer. + +* Audio controls in the same position as cursor keys from the `Raise` layer. +* ????: Runs a macro for outputting a text string. Do not use this store passwords. +* Reset: Enter bootloader for flashing firmware to the keyboard. +* CAPS: Toggle caps lock. +* Macro functions: Allows recording of macros. To start recording the macro, press either REC1 or REC2. +To finish the recording, press STOP. To replay the macro, press either PLAY1 or PLAY2. +* MAC: Toggle MAC OS extensions to layers. This allows MLWR to be enabled with LOWER, +MRSE with RAISE, MFNC with FUNC and MFNC2 with FUNC2 respectively. + +| | | | | | | | | | | | | +| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:|:-------:| +| ???? | Reset|Qwerty| | | REC1 | REC2 | | | | | Del | +| CAPS | | | | | PLAY1|PLAY2 | Mute | Vol+ | Play | | Qwerty | +| MAC | | | | | STOP1|STOP2 | Prev | Vol- | Next | | Colemak | +| | | | | | | | | DYN | | | | + +##### Function 2 Layer +Activated when `fn` held in the above `qwerty` layer. +* WRDSEL: Select the word where the cursor is. +* LNDEL: Delete the line where the cursor is. +* LNSEL: Select the line where the cursor is. +* DUP: Duplicate the selected text. +* LNJOIN: Join the line where the cursor is with the following line. +* MODE: Print either `PC` or `OSX` depending on what layer mode is active. + +| | | | | | | | | | | | | +| :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| +| | |WRDSEL| | | | LNDEL| | | | | | +| | | LNSEL| DUP | | | | |LNJOIN| | | | +| | UNDO | CUT | COPY | PASTE| | | | | | | MODE | +| | | | | | | | | | | | | + +##### Mouse Layer +Activated when `fn` and `raise` held together. + +| | | | | | | | | | | | | +| :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| +| ESC | | | | | | W_L | W_UP | BTN3 | W_DWN| W_R | | +| ACC0 | ACC1 | ACC2 | | | | | BTN1 | UP | BTN2 | | | +| ACC0 | ACC1 | ACC2 | | | | | LEFT | DOWN | RIGHT| | | +| | | | | | | | | | | | | + +##### Number Pad Layout +Activated when holding `Esc` key. + +| | | | | | | | | | | | | +| :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| +| | | | | | |NMLOCK| 7 | 8 | 9 | / | | +| | | | | | | | 4 | 5 | 6 | * | | +| | | | | | | | 1 | 2 | 3 | + | | +| | | | | | | | 0 | . | , | - | | diff --git a/keyboards/planck/keymaps/altgr/beakl.h b/keyboards/planck/keymaps/altgr/beakl.h new file mode 100644 index 000000000000..650613a9d9c5 --- /dev/null +++ b/keyboards/planck/keymaps/altgr/beakl.h @@ -0,0 +1,612 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// .................................................................... BEAKL EZ +#ifdef BEAKLEZ + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | K | ^Alt | ^GUI | F | G | R | C | V | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | H | I | E | A | " | ↑Alt | ↑GUI | L | S | T | N | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | ; | , | J | . | X | Caps |^Shift| B | D | M | P | Z | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_Y, KC_O, KC_U, KC_K, CNTR_TL, CNTR_TR, KC_F, KC_G, KC_R, KC_C, KC_V , + KC_H, KC_I, KC_E, HOME_A, TD_QUOT, CNTR_HL, CNTR_HR, KC_L, KC_S, KC_T, KC_N, KC_W , + KC_SCLN, KC_COMM, KC_J, KC_DOT, KC_X, CNTR_BL, CNTR_BR, KC_B, KC_D, KC_M, KC_P, KC_Z , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_K), CNTR_TL, CNTR_TR, S(KC_F), S(KC_G), S(KC_R), S(KC_C), S(KC_V), + S(KC_H), S(KC_I), S(KC_E), S(KC_A), TD_QUOT, CNTR_HL, CNTR_HR, S(KC_L), S(KC_S), S(KC_T), S(KC_N), S(KC_W), + KC_SCLN, KC_COMM, S(KC_J), KC_DOT, S(KC_X), CNTR_BL, CNTR_BR, S(KC_B), S(KC_D), S(KC_M), S(KC_P), S(KC_Z), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | K | ^Alt | ^GUI | F | G | R | C | V | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | H | I | E | A | " | ↑Alt | ↑GUI | L | S | T | N | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | : | ~ | J | ` | X | Caps |^Shift| B | D | M | P | Z | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | _ | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_K), CNTR_TL, CNTR_TR, S(KC_F), S(KC_G), S(KC_R), S(KC_C), S(KC_V), + S(KC_H), S(KC_I), S(KC_E), S(KC_A), TD_DQOT, CNTR_HL, CNTR_HR, S(KC_L), S(KC_S), S(KC_T), S(KC_N), S(KC_W), + TD_COLN, TD_TILD, S(KC_J), TD_GRV, S(KC_X), CNTR_BL, CNTR_BR, S(KC_B), S(KC_D), S(KC_M), S(KC_P), S(KC_Z), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_UNDS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | K | ^Alt | ^GUI | F | G | R | C | V | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | H | I | E | A | " | ↑Alt | ↑GUI | L | S | T | N | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | : | / | J | ? | X | Caps |^Shift| B | D | M | P | Z | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | - | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_K), CNTR_TL, CNTR_TR, S(KC_F), S(KC_G), S(KC_R), S(KC_C), S(KC_V), + S(KC_H), S(KC_I), S(KC_E), S(KC_A), TD_DQOT, CNTR_HL, CNTR_HR, S(KC_L), S(KC_S), S(KC_T), S(KC_N), S(KC_W), + TD_COLN, KC_SLSH, S(KC_J), KC_QUES, S(KC_X), CNTR_BL, CNTR_BR, S(KC_B), S(KC_D), S(KC_M), S(KC_P), S(KC_Z), + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_MINS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + +// ..................................................................... BEAKL 8 +#ifdef BEAKL8 + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | X | ^Alt | ^GUI | G | C | R | F | Z | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | . | ↑Alt | ↑GUI | D | S | T | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | ; | " | I | , | Caps |^Shift| W | M | L | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_Y, KC_O, KC_U, KC_X, CNTR_TL, CNTR_TR, KC_G, KC_C, KC_R, KC_F, KC_Z , + KC_K, KC_H, KC_E, HOME_A, KC_DOT, CNTR_HL, CNTR_HR, KC_D, KC_S, KC_T, KC_N, KC_B , + KC_J, KC_SCLN, TD_QUOT, KC_I, KC_COMM, CNTR_BL, CNTR_BR, KC_W, KC_M, KC_L, KC_P, KC_V , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_X), CNTR_TL, CNTR_TR, S(KC_G), S(KC_C), S(KC_R), S(KC_F), S(KC_Z), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_DOT, CNTR_HL, CNTR_HR, S(KC_D), S(KC_S), S(KC_T), S(KC_N), S(KC_B), + S(KC_J), KC_SCLN, TD_QUOT, S(KC_I), KC_COMM, CNTR_BL, CNTR_BR, S(KC_W), S(KC_M), S(KC_L), S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | X | ^Alt | ^GUI | G | C | R | F | Z | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | ~ | ↑Alt | ↑GUI | D | S | T | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | I | ` | Caps |^Shift| W | M | L | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | _ | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_X), CNTR_TL, CNTR_TR, S(KC_G), S(KC_C), S(KC_R), S(KC_F), S(KC_Z), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), TD_TILD, CNTR_HL, CNTR_HR, S(KC_D), S(KC_S), S(KC_T), S(KC_N), S(KC_B), + S(KC_J), TD_COLN, TD_DQOT, S(KC_I), TD_GRV, CNTR_BL, CNTR_BR, S(KC_W), S(KC_M), S(KC_L), S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_UNDS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | X | ^Alt | ^GUI | G | C | R | F | Z | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | ? | ↑Alt | ↑GUI | D | S | T | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | I | / | Caps |^Shift| W | M | L | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | - | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_X), CNTR_TL, CNTR_TR, S(KC_G), S(KC_C), S(KC_R), S(KC_F), S(KC_Z), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, S(KC_D), S(KC_S), S(KC_T), S(KC_N), S(KC_B), + S(KC_J), TD_COLN, TD_DQOT, S(KC_I), KC_SLSH, CNTR_BL, CNTR_BR, S(KC_W), S(KC_M), S(KC_L), S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_MINS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + +// .................................................................... BEAKL 8P +#ifdef BEAKL8P + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | ^Alt | ^GUI | G | D | R | F | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | . | ↑Alt | ↑GUI | C | T | S | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | ; | " | I | , | Caps |^Shift| W | M | L | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_Y, KC_O, KC_U, KC_Z, CNTR_TL, CNTR_TR, KC_G, KC_D, KC_R, KC_F, KC_X , + KC_K, KC_H, KC_E, HOME_A, KC_DOT, CNTR_HL, CNTR_HR, KC_C, KC_T, KC_S, KC_N, KC_B , + KC_J, KC_SCLN, TD_QUOT, KC_I, KC_COMM, CNTR_BL, CNTR_BR, KC_W, KC_M, KC_L, KC_P, KC_V , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_R), S(KC_F), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_DOT, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_S), S(KC_N), S(KC_B), + S(KC_J), KC_SCLN, TD_QUOT, S(KC_I), KC_COMM, CNTR_BL, CNTR_BR, S(KC_W), S(KC_M), S(KC_L), S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | { | } | $ | ^Alt | ^GUI | G | D | R | F | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | < | > | ~ | ↑Alt | ↑GUI | C | T | S | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | ! | = | ` | Caps |^Shift| W | M | L | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | _ | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), KC_LCBR, KC_RCBR, KC_DLR, CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_R), S(KC_F), S(KC_X), + S(KC_K), S(KC_H), TD_LT, TD_GT, TD_TILD, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_S), S(KC_N), S(KC_B), + S(KC_J), KC_COLN, KC_EXLM, KC_EQL, TD_GRV, CNTR_BL, CNTR_BR, S(KC_W), S(KC_M), S(KC_L), S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_UNDS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | ^Alt | ^GUI | ^ | [ | ] | F | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | ? | ↑Alt | ↑GUI | | | ( | ) | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | I | / | Caps |^Shift| \ | $ | * | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | - | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, KC_CIRC, KC_LBRC, KC_RBRC, S(KC_F), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, KC_PIPE, KC_LPRN, KC_RPRN, S(KC_N), S(KC_B), + S(KC_J), TD_COLN, TD_DQOT, S(KC_I), KC_SLSH, CNTR_BL, CNTR_BR, KC_BSLS, KC_DLR, KC_ASTR, S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_MINS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + +// ................................................................... BEAKL 8TX +#ifdef BEAKL8TX + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | J | ^Alt | ^GUI | G | D | R | F | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | . | ↑Alt | ↑GUI | C | T | S | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | ; | " | I | , | Caps |^Shift| W | M | L | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_Y, KC_O, KC_U, KC_J, CNTR_TL, CNTR_TR, KC_G, KC_D, KC_R, KC_F, KC_X , + HOME_K, HOME_H, HOME_E, HOME_A, KC_DOT, CNTR_HL, CNTR_HR, KC_C, HOME_T, HOME_S, HOME_N, HOME_B , + KC_Z, KC_SCLN, TD_QUOT, KC_I, KC_COMM, CNTR_BL, CNTR_BR, KC_W, KC_M, KC_L, KC_P, KC_V , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_J), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_R), S(KC_F), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_DOT, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_S), S(KC_N), S(KC_B), + S(KC_Z), KC_SCLN, TD_QUOT, S(KC_I), KC_COMM, CNTR_BL, CNTR_BR, S(KC_W), S(KC_M), S(KC_L), S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | $ | { | } | J | ^Alt | ^GUI | G | D | R | F | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | / | < | > | ~ | ↑Alt | ↑GUI | C | T | S | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | : | ! | = | ` | Caps |^Shift| W | M | L | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | _ | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), KC_DLR, KC_LCBR, KC_RCBR, S(KC_J), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_R), S(KC_F), S(KC_X), + S(KC_K), KC_SLSH, TD_LT, TD_GT, TD_TILD, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_S), S(KC_N), S(KC_B), + S(KC_Z), KC_COLN, KC_EXLM, KC_EQL, TD_GRV, CNTR_BL, CNTR_BR, S(KC_W), S(KC_M), S(KC_L), S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_UNDS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | J | ^Alt | ^GUI | G | [ | ] | ^ | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | ? | ↑Alt | ↑GUI | | | ( | ) | $ | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | : | " | I | / | Caps |^Shift| \ | * | . | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | - | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_J), CNTR_TL, CNTR_TR, S(KC_G), KC_LBRC, KC_RBRC, KC_CIRC, S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, KC_PIPE, KC_LPRN, KC_RPRN, KC_DLR, S(KC_B), + S(KC_Z), TD_COLN, TD_DQOT, S(KC_I), KC_SLSH, CNTR_BL, CNTR_BR, KC_BSLS, KC_ASTR, KC_DOT, S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_MINS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + +// ................................................................... BEAKL 8TT +#ifdef BEAKL8TT + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | J | Fn | Caps | G | D | R | F | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | . |Cursor| Mouse| C | T | S | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | ; | " | I | , | Num | Regex| W | M | L | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_Y, KC_O, KC_U, KC_J, CNTR_TL, CNTR_TR, KC_G, KC_D, KC_R, KC_F, KC_X , + HOME_K, HOME_H, HOME_E, HOME_A, KC_DOT, CNTR_HL, CNTR_HR, KC_C, HOME_T, HOME_S, HOME_N, HOME_B , + KC_Z, KC_SCLN, TD_QUOT, KC_I, KC_COMM, CNTR_BL, CNTR_BR, KC_W, KC_M, KC_L, KC_P, KC_V , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_J), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_R), S(KC_F), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_DOT, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_S), S(KC_N), S(KC_B), + S(KC_Z), KC_SCLN, TD_QUOT, S(KC_I), KC_COMM, CNTR_BL, CNTR_BR, S(KC_W), S(KC_M), S(KC_L), S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | $ | { | } | J | Fn | Caps | G | D | R | F | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | / | < | > | ~ |Cursor| Mouse| C | T | S | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | : | ! | = | ` | Num | Regex| W | M | L | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | _ | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), KC_DLR, KC_LCBR, KC_RCBR, S(KC_J), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_R), S(KC_F), S(KC_X), + S(KC_K), KC_SLSH, TD_LT, TD_GT, TD_TILD, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_S), S(KC_N), S(KC_B), + S(KC_Z), KC_COLN, KC_EXLM, KC_EQL, TD_GRV, CNTR_BL, CNTR_BR, S(KC_W), S(KC_M), S(KC_L), S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_UNDS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | J | Fn | Caps | G | [ | ] | ^ | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | ? |Cursor| Mouse| | | ( | ) | $ | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | : | " | I | / | Num | Regex| \ | * | . | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | - | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_J), CNTR_TL, CNTR_TR, S(KC_G), KC_LBRC, KC_RBRC, KC_CIRC, S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, KC_PIPE, KC_LPRN, KC_RPRN, KC_DLR, S(KC_B), + S(KC_Z), TD_COLN, TD_DQOT, S(KC_I), KC_SLSH, CNTR_BL, CNTR_BR, KC_BSLS, KC_ASTR, KC_DOT, S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_MINS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + +// .................................................................... BEAKL 10 +#ifdef BEAKL10 + // ,-----------------------------------------------------------------------------------. + // | Q | H | O | U | X | ^Alt | ^GUI | G | D | N | M | V | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | Y | I | E | A | . | ↑Alt | ↑GUI | C | S | R | T | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | ; | " | , | Z | Caps |^Shift| B | P | L | F | K | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_H, KC_O, KC_U, KC_X, CNTR_TL, CNTR_TR, KC_G, KC_D, KC_N, KC_M, KC_V , + KC_Y, KC_I, KC_E, HOME_A, KC_DOT, CNTR_HL, CNTR_HR, KC_C, KC_S, KC_R, KC_T, KC_W , + KC_J, KC_SCLN, TD_QUOT, KC_COMM, KC_Z, CNTR_BL, CNTR_BR, KC_B, KC_P, KC_L, KC_F, KC_K , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_H), S(KC_O), S(KC_U), S(KC_X), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_V), + S(KC_Y), S(KC_I), S(KC_E), S(KC_A), KC_DOT, CNTR_HL, CNTR_HR, S(KC_C), S(KC_S), S(KC_R), S(KC_T), S(KC_W), + S(KC_J), KC_SCLN, TD_QUOT, KC_COMM, S(KC_Z), CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_K), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | [ | ! | ] | X | ^Alt | ^GUI | G | D | N | M | V | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | Y | < | = | > | ~ | ↑Alt | ↑GUI | C | S | R | T | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | ` | Z | Caps |^Shift| B | P | L | F | K | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | _ | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), TD_LBRC, KC_EXLM, TD_RBRC, S(KC_X), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_V), + S(KC_Y), TD_LT, KC_EQL, TD_GT, TD_TILD, CNTR_HL, CNTR_HR, S(KC_C), S(KC_S), S(KC_R), S(KC_T), S(KC_W), + S(KC_J), KC_COLN, TD_DQOT, TD_GRV, S(KC_Z), CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_K), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_UNDS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | H | O | U | X | ^Alt | ^GUI | G | { | + | } | V | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | Y | I | E | A | ? | ↑Alt | ↑GUI | C | ( | * | ) | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | / | Z | Caps |^Shift| B | P | L | F | K | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | - | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_H), S(KC_O), S(KC_U), S(KC_X), CNTR_TL, CNTR_TR, S(KC_G), TD_LCBR, KC_PLUS, TD_RCBR, S(KC_V), + S(KC_Y), S(KC_I), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, S(KC_C), TD_LPRN, KC_ASTR, TD_RPRN, S(KC_W), + S(KC_J), TD_COLN, TD_DQOT, KC_SLSH, S(KC_Z), CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_K), + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_MINS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + +// ............................................................... BEAKL Mash Up +#ifdef BEAKL810 + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | ^Alt | ^GUI | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | . | ↑Alt | ↑GUI | C | T | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | ; | " | I | , | Caps |^Shift| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_Y, KC_O, KC_U, KC_Z, CNTR_TL, CNTR_TR, KC_G, KC_D, KC_N, KC_M, KC_X , + KC_K, KC_H, KC_E, HOME_A, KC_DOT, CNTR_HL, CNTR_HR, KC_C, KC_T, KC_R, KC_S, KC_W , + KC_J, KC_SCLN, TD_QUOT, KC_I, KC_COMM, CNTR_BL, CNTR_BR, KC_B, KC_P, KC_L, KC_F, KC_V , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_DOT, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_R), S(KC_S), S(KC_W), + S(KC_J), KC_SCLN, TD_QUOT, S(KC_I), KC_COMM, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | { | } | $ | ^Alt | ^GUI | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | < | > | ~ | ↑Alt | ↑GUI | C | T | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | ! | = | ` | Caps |^Shift| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | _ | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), KC_LCBR, KC_RCBR, KC_DLR, CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + S(KC_K), S(KC_H), TD_LT, TD_GT, TD_TILD, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_R), S(KC_S), S(KC_W), + S(KC_J), KC_COLN, KC_EXLM, KC_EQL, TD_GRV, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_UNDS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | ^Alt | ^GUI | ^ | [ | ] | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | ? | ↑Alt | ↑GUI | | | ( | ) | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | I | / | Caps |^Shift| \ | $ | * | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | - | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, KC_CIRC, KC_LBRC, KC_RBRC, S(KC_M), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, KC_PIPE, KC_LPRN, KC_RPRN, S(KC_S), S(KC_W), + S(KC_J), TD_COLN, TD_DQOT, S(KC_I), KC_SLSH, CNTR_BL, CNTR_BR, KC_BSLS, KC_DLR, KC_ASTR, S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_MINS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + +// .................................................................... BEAKL MU +#ifdef BEAKLMU + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | Fn | Caps | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | . |Cursor| Mouse| C | T | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | ; | " | I | , | Num | Regex| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_Y, KC_O, KC_U, KC_Z, CNTR_TL, CNTR_TR, KC_G, KC_D, KC_N, KC_M, KC_X , + HOME_K, HOME_H, HOME_E, HOME_A, KC_DOT, CNTR_HL, CNTR_HR, KC_C, HOME_T, HOME_R, HOME_S, HOME_W , + KC_J, KC_SCLN, TD_QUOT, KC_I, KC_COMM, CNTR_BL, CNTR_BR, KC_B, KC_P, KC_L, KC_F, KC_V , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_DOT, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_R), S(KC_S), S(KC_W), + S(KC_J), KC_SCLN, TD_QUOT, S(KC_I), KC_COMM, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | $ | { | } | Z | Fn | Caps | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | / | < | > | ~ |Cursor| Mouse| C | T | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | ! | = | ` | Num | Regex| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | _ | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), KC_DLR, KC_LCBR, KC_RCBR, S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + S(KC_K), KC_SLSH, TD_LT, TD_GT, TD_TILD, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_R), S(KC_S), S(KC_W), + S(KC_Z), KC_COLN, KC_EXLM, KC_EQL, TD_GRV, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_UNDS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | Fn | Caps | G | [ | ] | ^ | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | ? |Cursor| Mouse| | | ( | ) | $ | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | I | / | Num | Regex| \ | * | . | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | - | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), KC_LBRC, KC_RBRC, KC_CIRC, S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, KC_PIPE, KC_LPRN, KC_RPRN, KC_DLR, S(KC_W), + S(KC_J), TD_COLN, TD_DQOT, S(KC_I), KC_SLSH, CNTR_BL, CNTR_BR, KC_BSLS, KC_ASTR, KC_DOT, S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_MINS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + +// .................................................................... BEAKL SP +#ifdef BEAKLSP + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | Shift| Caps | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | . |Cursor| Mouse| C | T | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | ; | " | I | , | Num | Regex| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Ins | Left | Ent | Bksp | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_Y, KC_O, KC_U, KC_Z, CNTR_TL, CNTR_TR, KC_G, KC_D, KC_N, KC_M, KC_X , + HOME_K, HOME_H, HOME_E, HOME_A, KC_DOT, CNTR_HL, CNTR_HR, KC_C, HOME_T, HOME_R, HOME_S, HOME_W , + KC_J, KC_SCLN, TD_QUOT, KC_I, KC_COMM, CNTR_BL, CNTR_BR, KC_B, KC_P, KC_L, KC_F, KC_V , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_INS, SP_LEFT, TD_ENT, SP_BSPC, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_DOT, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_R), S(KC_S), S(KC_W), + S(KC_J), KC_SCLN, TD_QUOT, S(KC_I), KC_COMM, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_INS, SP_LEFT, TD_ENT, SP_BSPC, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | [ | ] | Z | Shift| Caps | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | ^ | < | > | ~ |Cursor| Mouse| C | T | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | ! | = | ` | Num | Regex| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | ↑Tab | f() | Ins | Left | _ | Del | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), KC_LBRC, KC_RBRC, S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + S(KC_K), KC_CIRC, TD_LT, TD_GT, TD_TILD, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_R), S(KC_S), S(KC_W), + S(KC_Z), KC_COLN, KC_EXLM, KC_EQL, TD_GRV, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, S_TAB, ___fn__, LT_INS, S_LEFT, KC_UNDS, SP_DEL, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | Shift| Caps | G | { | } | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | ? |Cursor| Mouse| | | ( | ) | $ | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | I | / | Num | Regex| \ | * | . | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Tab | - | Ins | Left | f() | Bksp | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), KC_LCBR, KC_RCBR, S(KC_M), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, KC_PIPE, KC_LPRN, KC_RPRN, KC_DLR, S(KC_W), + S(KC_J), TD_COLN, TD_DQOT, S(KC_I), KC_SLSH, CNTR_BL, CNTR_BR, KC_BSLS, KC_ASTR, KC_DOT, S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, KC_TAB, KC_MINS, LT_INS, S_LEFT, ___fn__, SP_BSPC, S_DOWN, S_UP, S_RGHT + ), +#endif + +// .................................................................... BEAKL GR +#ifdef BEAKLGR + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | Shift| Caps | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | . |Cursor| Mouse| C | T | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | ; | " | I | , | Num | Regex| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Ins | Left | Ent | Bksp | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_Y, KC_O, KC_U, KC_Z, CNTR_TL, CNTR_TR, KC_G, KC_D, KC_N, KC_M, KC_X , + HOME_K, HOME_H, HOME_E, HOME_A, KC_DOT, CNTR_HL, CNTR_HR, KC_C, HOME_T, HOME_R, HOME_S, HOME_W , + KC_J, KC_SCLN, TD_QUOT, KC_I, KC_COMM, CNTR_BL, CNTR_BR, KC_B, KC_P, KC_L, KC_F, KC_V , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_INS, SP_LEFT, TD_ENT, SP_BSPC, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_DOT, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_R), S(KC_S), S(KC_W), + S(KC_J), KC_SCLN, TD_QUOT, S(KC_I), KC_COMM, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_INS, SP_LEFT, TD_ENT, SP_BSPC, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | [ | ] | Z | Shift| Caps | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | ^ | < | > | ~ |Cursor| Mouse| C | T | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | ! | = | ` | Num | Regex| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | ↑Tab | f() | Ins | Left | _ | Del | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), KC_LBRC, KC_RBRC, S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + SM_K, KC_CIRC, TD_LT, TD_GT, TD_TILD, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_R), S(KC_S), S(KC_W), + S(KC_Z), KC_COLN, KC_EXLM, KC_EQL, TD_GRV, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, S_TAB, ___fn__, LT_INS, S_LEFT, KC_UNDS, SP_DEL, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | Shift| Caps | G | { | } | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | ? |Cursor| Mouse| | | ( | ) | $ | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | I | / | Num | Regex| \ | * | . | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Tab | - | Ins | Left | f() | Bksp | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), KC_LCBR, KC_RCBR, S(KC_M), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, KC_PIPE, KC_LPRN, KC_RPRN, KC_DLR, SM_W , + S(KC_J), TD_COLN, TD_DQOT, S(KC_I), KC_SLSH, CNTR_BL, CNTR_BR, KC_BSLS, KC_ASTR, KC_DOT, S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, KC_TAB, KC_MINS, LT_INS, S_LEFT, ___fn__, SP_BSPC, S_DOWN, S_UP, S_RGHT + ), +#endif diff --git a/keyboards/planck/keymaps/altgr/colemak.h b/keyboards/planck/keymaps/altgr/colemak.h new file mode 100644 index 000000000000..694f16328955 --- /dev/null +++ b/keyboards/planck/keymaps/altgr/colemak.h @@ -0,0 +1,124 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// .............................................................. Colemak Mod-DH +#ifdef COLEMAK + // ,-----------------------------------------------------------------------------------. + // | Q | W | F | P | B | ^Alt | ^GUI | J | L | U | Y | ; | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | R | S | T | G | ↑Alt | ↑GUI | M | N | E | I | O | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | X | C | D | V | Caps |^Shift| K | H | , | . | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_W, KC_F, KC_P, KC_B, CNTR_TL, CNTR_TR, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, + KC_A, KC_R, KC_S, KC_T, KC_G, CNTR_HL, CNTR_HR, KC_M, KC_N, KC_E, KC_I, KC_O , + KC_Z, KC_X, KC_C, KC_D, KC_V, CNTR_BL, CNTR_BR, KC_K, KC_H, KC_COMM, KC_DOT, TD_QUOT, + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_W), S(KC_F), S(KC_P), S(KC_B), CNTR_TL, CNTR_TR, S(KC_J), S(KC_L), S(KC_U), S(KC_Y), KC_SCLN, + S(KC_A), S(KC_R), S(KC_S), S(KC_T), S(KC_G), CNTR_HL, CNTR_HR, S(KC_M), S(KC_N), S(KC_E), S(KC_I), S(KC_O), + S(KC_Z), S(KC_X), S(KC_C), S(KC_D), S(KC_V), CNTR_BL, CNTR_BR, S(KC_K), S(KC_H), KC_COMM, KC_DOT, TD_QUOT, + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | W | F | P | B | ^Alt | ^GUI | J | L | U | Y | : | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | R | S | T | G | ↑Alt | ↑GUI | M | N | E | I | O | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | X | C | D | V | Caps |^Shift| K | H | / | ? | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | - | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_W), S(KC_F), S(KC_P), S(KC_B), CNTR_TL, CNTR_TR, S(KC_J), S(KC_L), S(KC_U), S(KC_Y), TD_COLN, + S(KC_A), S(KC_R), S(KC_S), S(KC_T), S(KC_G), CNTR_HL, CNTR_HR, S(KC_M), S(KC_N), S(KC_E), S(KC_I), S(KC_O), + S(KC_Z), S(KC_X), S(KC_C), S(KC_D), S(KC_V), CNTR_BL, CNTR_BR, S(KC_K), S(KC_H), KC_SLSH, KC_QUES, TD_DQOT, + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_MINS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | W | F | P | B | ^Alt | ^GUI | J | L | U | Y | : | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | R | S | T | G | ↑Alt | ↑GUI | M | N | E | I | O | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | X | C | D | V | Caps |^Shift| K | H | ~ | ` | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | _ | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_W), S(KC_F), S(KC_P), S(KC_B), CNTR_TL, CNTR_TR, S(KC_J), S(KC_L), S(KC_U), S(KC_Y), TD_COLN, + S(KC_A), S(KC_R), S(KC_S), S(KC_T), S(KC_G), CNTR_HL, CNTR_HR, S(KC_M), S(KC_N), S(KC_E), S(KC_I), S(KC_O), + S(KC_Z), S(KC_X), S(KC_C), S(KC_D), S(KC_V), CNTR_BL, CNTR_BR, S(KC_K), S(KC_H), TD_TILD, TD_GRV, TD_DQOT, + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_UNDS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + +// ..................................................................... ColemaX +#ifdef COLEMAX + // ,-----------------------------------------------------------------------------------. + // | Q | W | C | G | Z | ^Alt | ^GUI | J | L | U | Y | ; | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | R | S | T | B | ↑Alt | ↑GUI | K | N | E | I | O | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | X | V | F | D | P | Caps |^Shift| M | H | , | . | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_W, KC_C, KC_G, KC_Z, CNTR_TL, CNTR_TR, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, + KC_A, KC_R, KC_S, KC_T, KC_B, CNTR_HL, CNTR_HR, KC_K, KC_N, KC_E, KC_I, KC_O , + KC_X, KC_V, KC_F, KC_D, KC_P, CNTR_BL, CNTR_BR, KC_M, KC_H, KC_COMM, KC_DOT, TD_QUOT, + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_W), S(KC_C), S(KC_G), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_J), S(KC_L), S(KC_U), S(KC_Y), KC_SCLN, + S(KC_A), S(KC_R), S(KC_S), S(KC_T), S(KC_B), CNTR_HL, CNTR_HR, S(KC_K), S(KC_N), S(KC_E), S(KC_I), S(KC_O), + S(KC_X), S(KC_V), S(KC_F), S(KC_D), S(KC_P), CNTR_BL, CNTR_BR, S(KC_M), S(KC_H), KC_COMM, KC_DOT, TD_QUOT, + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | W | C | G | Z | ^Alt | ^GUI | J | L | U | Y | : | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | R | S | T | B | ↑Alt | ↑GUI | K | N | E | I | O | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | X | V | F | D | P | Caps |^Shift| M | H | / | ? | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | - | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_W), S(KC_C), S(KC_G), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_J), S(KC_L), S(KC_U), S(KC_Y), TD_COLN, + S(KC_A), S(KC_R), S(KC_S), S(KC_T), S(KC_B), CNTR_HL, CNTR_HR, S(KC_K), S(KC_N), S(KC_E), S(KC_I), S(KC_O), + S(KC_X), S(KC_V), S(KC_F), S(KC_D), S(KC_P), CNTR_BL, CNTR_BR, S(KC_M), S(KC_H), KC_SLSH, KC_QUES, TD_DQOT, + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_MINS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | W | C | G | Z | ^Alt | ^GUI | J | L | U | Y | : | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | R | S | T | B | ↑Alt | ↑GUI | K | N | E | I | O | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | X | V | F | D | P | Caps |^Shift| M | H | ~ | ` | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | _ | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_W), S(KC_C), S(KC_G), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_J), S(KC_L), S(KC_U), S(KC_Y), TD_COLN, + S(KC_A), S(KC_R), S(KC_S), S(KC_T), S(KC_B), CNTR_HL, CNTR_HR, S(KC_K), S(KC_N), S(KC_E), S(KC_I), S(KC_O), + S(KC_X), S(KC_V), S(KC_F), S(KC_D), S(KC_P), CNTR_BL, CNTR_BR, S(KC_M), S(KC_H), TD_TILD, TD_GRV, TD_DQOT, + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_UNDS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif diff --git a/keyboards/planck/keymaps/altgr/common/chord_layout.h b/keyboards/planck/keymaps/altgr/common/chord_layout.h new file mode 100644 index 000000000000..cb1b7f678550 --- /dev/null +++ b/keyboards/planck/keymaps/altgr/common/chord_layout.h @@ -0,0 +1,41 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// .................................................................. Short Cuts + + // .-----------------------------------------------------------------------------------. + // | | | Copy | Paste| | | | | | | | | + // |--------------------------------------------------------------+------+------+------| + // | Undo | Cut | Copy | Paste| | | | | PRIV | PUB | | | + // |-----------------------------------------------------------------------------------| + // | | | Nak | Eot | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | | | | | | f() | | | | | | + // | | | | | | | | f() | | | | | see _PLOVER + // '-----------------------------------------------------------------------------------' + + [_EDIT] = LAYOUT_planck_grid( + _______, _______, TMCOPY, TMPASTE, _______, _______, _______, _______, _______, _______, _______, _______, + UNDO, CUT, COPY, PASTE, _______, _______, _______, _______, TD_PRIV, TD_SEND, _______, _______, + _______, _______, NAK, EOT, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, ___fn__, ___fn__, _______, _______, _______, _______ + ), + +// ................................................................ Adjust Layer + + // ,-----------------------------------------------------------------------------------. + // |Plover| | | | | | | | | | | | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // |Aud on| | | | | | | | | | | | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Reset| | | | | | | | | | | | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | | | | f() | | | | | f() | | | | + // `-----------------------------------------------------------------------------------' + + [_ADJUST] = LAYOUT_planck_grid( + PLOVER, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + AU_ON, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, ___fn__, _______, _______, _______, _______, ___fn__, _______, _______, _______ + ), diff --git a/keyboards/planck/keymaps/altgr/common/init.h b/keyboards/planck/keymaps/altgr/common/init.h new file mode 100644 index 000000000000..6366a19f65eb --- /dev/null +++ b/keyboards/planck/keymaps/altgr/common/init.h @@ -0,0 +1,56 @@ + +// ....................................................................... Audio + +void matrix_init_user(void) +{ +#ifdef STENO_ENABLE + steno_set_mode(STENO_MODE_BOLT); // or STENO_MODE_GEMINI +#endif +#ifdef AUDIO_ENABLE + startup_user(); +#endif +} + +#ifdef AUDIO_ENABLE +#ifdef BACKLIGHT_ENABLE +void led_set_user(uint8_t usb_led) +{ + static uint8_t old_usb_led = 0; + _delay_ms(10); // gets rid of tick + if (!is_playing_notes()) { + if ((usb_led & (1<event.pressed) { + key_timer = timer_read(); + register_code(modifier); + if (modifier2) { + register_code(modifier2); + } + } + else { + unregister_code(modifier); + if (modifier2) { + unregister_code(modifier2); + } + if (timer_elapsed(key_timer) < TAPPING_TERM) { + shift_key(keycode); + } + key_timer = 0; + } +} + +// ................................................................... Mod Masks + +// tap dance persistant mods, see process_record_user() +// keyboard_report->mods (?) appears to be cleared by tap dance +static uint8_t mods = 0; + +void tap_mods(keyrecord_t *record, uint16_t keycode) +{ + if (record->event.pressed) { + mods |= MOD_BIT(keycode); + } + else { + mods &= ~(MOD_BIT(keycode)); + } +} + +// (un)register modifiers +void modifier(void (*f)(uint8_t)) +{ + if (mods & MOD_BIT(KC_LCTL)) { + (*f)(KC_LCTL); + } + if (mods & MOD_BIT(KC_LGUI)) { + (*f)(KC_LGUI); + } + if (mods & MOD_BIT(KC_LALT)) { + (*f)(KC_LALT); + } +} + +// .................................................... Triple Dance Shift/Layer + +static uint8_t dt_shift = 0; + +void double_shift(uint16_t keycode, uint8_t layer) +{ + tap_key (keycode); + if (DT_SHIFT) { + // set_oneshot_mods(MOD_LSFT); + // layer_on(layer); + layer_on (_SHIFT); + set_oneshot_layer(_SHIFT, ONESHOT_START); + dt_shift = 1; + } + else { + layer_on(layer); + } +} + +// tap dance LT (LAYER, KEY) emulation with -> and auto-repeat extensions! +void tap_shift(tap_dance_state_t *state, uint16_t keycode, uint8_t layer) +{ + // double tap plus down + if (state->count > 2) { + // double enter shift + if (keycode == KC_ENT) { + tap_key (keycode); + double_shift(keycode, layer); + } + // repeating keycode + else { + register_code(keycode); + } + } + // tap plus down (or double tap): keycode (one shot) shift + else if (state->count > 1) { + double_shift(keycode, layer); + } + // down: shift + else if (state->pressed) { + layer_on(layer); + } + // tap: keycode + else { + modifier(register_code); + tap_key (keycode); + modifier(unregister_code); + } +} + +void tap_reset(uint16_t keycode, uint8_t layer) +{ + unregister_code(keycode); + if (DT_SHIFT && dt_shift) { + clear_oneshot_layer_state(ONESHOT_PRESSED); + dt_shift = 0; + } + else { + layer_off(layer); + } +} + +// augment pseudo LT (_RSHIFT, KC_ENT) handling below for rapid sequences +void enter(tap_dance_state_t *state, void *user_data) +{ + tap_shift(state, KC_ENT, _RSHIFT); +} + +void enter_reset(tap_dance_state_t *state, void *user_data) +{ + tap_reset(KC_ENT, _RSHIFT); +} + +// augment pseudo LT (_LSHIFT, KC_SPC) handling below for rapid sequences +void space(tap_dance_state_t *state, void *user_data) +{ + tap_shift(state, KC_SPC, _LSHIFT); +} + +void space_reset(tap_dance_state_t *state, void *user_data) +{ + tap_reset(KC_SPC, _LSHIFT); +} + +// ......................................................... Triple Dance Insert + +void double_max(uint8_t count, uint8_t shift, uint16_t keycode) +{ + if (shift) { + shift_key(keycode); + if (count > 1) { + shift_key(keycode); + } + } + else { + tap_key(keycode); + if (count > 1) { + tap_key(keycode); + } + } +} + +void colon(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 2) { + tap_key (KC_SPC); + shift_key(KC_SCLN); + shift_key(KC_SCLN); + tap_key (KC_SPC); + } + else { + double_max(state->count, SHIFT, KC_SCLN); + } + reset_tap_dance(state); +} + +void eql(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 2) { + tap_key(KC_SPC); + tap_key(KC_SLSH); + tap_key(KC_EQL); + tap_key(KC_SPC); + } + else { + double_max(state->count, NOSHIFT, KC_EQL); + } + reset_tap_dance(state); +} + +void greater(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 2) { + tap_key (KC_SPC); + tap_key (KC_MINS); + shift_key(KC_DOT); + tap_key (KC_SPC); + } + else { + double_max(state->count, SHIFT, KC_DOT); + } + reset_tap_dance(state); +} + +void lesser(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 2) { + tap_key (KC_SPC); + shift_key(KC_COMM); + tap_key (KC_MINS); + tap_key (KC_SPC); + } + else { + double_max(state->count, SHIFT, KC_COMM); + } + reset_tap_dance(state); +} + +void tilde(tap_dance_state_t *state, void *user_data) +{ + // double tap plus down: repeating keycode + if (state->count > 2) { + register_code(KC_LSFT); + register_code(KC_GRV); + } + // tap: keycode + else { + shift_key(KC_GRV); + // double tap: unix home directory + if (state->count > 1) { + tap_key(KC_SLSH); + } + } +} + +void tilde_reset(tap_dance_state_t *state, void *user_data) +{ + unregister_code(KC_GRV); + unregister_code(KC_LSFT); +} + +// ............................................................. Tap Dance Pairs + +// tap dance shift rules +#define S_NEVER 0 +#define S_SINGLE 1 +#define S_DOUBLE 2 +#define S_ALWAYS S_SINGLE | S_DOUBLE + +void symbol_pair(uint8_t shift, uint16_t left, uint16_t right) +{ + if (shift & S_DOUBLE) { + shift_key(left); + shift_key(right); + } + else { + tap_key(left); + tap_key(right); + } +} + +#define CLOSE 1 + +// tap dance symbol pairs +void tap_pair(tap_dance_state_t *state, uint8_t shift, uint16_t left, uint16_t right, uint16_t modifier, uint8_t close) +{ + // triple tap: left right with cursor between symbol pair a la vim :-) + if (state->count > 2) { + symbol_pair(shift, left, right); + tap_key (KC_LEFT); + } + // double tap: left right + else if (state->count > 1) { + symbol_pair(shift, left, right); + } + // down: modifier + else if (state->pressed) { + if (modifier) { + register_code(modifier); + } + } + // tap: left (close: right) + else { + if (shift & S_SINGLE) { + shift_key(close ? right : left); + } + else { + tap_key(close ? right : left); + } + } + if (!modifier) { + reset_tap_dance(state); + } +} + +void doublequote(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_QUOT, KC_QUOT, 0, 0); +} + +void grave(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_NEVER, KC_GRV, KC_GRV, 0, 0); +} + +void lbrace(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_NEVER, KC_LBRC, KC_RBRC, 0, 0); +} + +void lcurly(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_LBRC, KC_RBRC, 0, 0); +} + +void lparen(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_9, KC_0, KC_LCTL, 0); +} + +void lparen_reset(tap_dance_state_t *state, void *user_data) +{ + unregister_code(KC_LCTL); +} + +void quote(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_NEVER, KC_QUOT, KC_QUOT, 0, 0); +} + +void rangle(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_COMM, KC_DOT, 0, CLOSE); +} + +void rbrace(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_NEVER, KC_LBRC, KC_RBRC, 0, CLOSE); +} + +void rcurly(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_LBRC, KC_RBRC, 0, CLOSE); +} + +void rparen(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_9, KC_0, 0, CLOSE); +} + +void rparen_reset(tap_dance_state_t *state, void *user_data) +{ + unregister_code(KC_LCTL); +} + +// ............................................................ Tap Dance Insert + +void comma(tap_dance_state_t *state, void *user_data) +{ + tap_key(KC_COMM); + if (state->count > 1) { + tap_key(KC_SPC); + } + reset_tap_dance(state); +} + +void dot(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 1) { + shift_key(KC_COLN); + } + else { + tap_key(KC_DOT); + } + reset_tap_dance(state); +} + +// compile time macro string, see functions/hardware planck script +void private(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 1) { +#ifdef PRIVATE_STRING +#include "private_string.h" +#endif + } + reset_tap_dance(state); +} + +// config.h defined string +void send(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 1) { + SEND_STRING(PUBLIC_STRING); + } + reset_tap_dance(state); +} + +// .......................................................... Tap Dance One Shot + +void caps(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 1) { + tap_key(KC_CAPS); + } + else { + set_oneshot_mods(MOD_LSFT); + register_code (KC_LSFT); // on hold down + } +} + +void caps_reset(tap_dance_state_t *state, void *user_data) +{ + unregister_code(KC_LSFT); +} + +// ................................................................... Tap Dance + +tap_dance_action_t tap_dance_actions[] = { + [_CAPS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, caps, caps_reset) + ,[_COLN] = ACTION_TAP_DANCE_FN (colon) + ,[_COMM] = ACTION_TAP_DANCE_FN (comma) + ,[_DOT] = ACTION_TAP_DANCE_FN (dot) + ,[_DQOT] = ACTION_TAP_DANCE_FN (doublequote) + ,[_ENT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, enter, enter_reset) + ,[_EQL] = ACTION_TAP_DANCE_FN (eql) + ,[_GRV] = ACTION_TAP_DANCE_FN (grave) + ,[_GT] = ACTION_TAP_DANCE_FN (greater) + ,[_LBRC] = ACTION_TAP_DANCE_FN (lbrace) + ,[_LCBR] = ACTION_TAP_DANCE_FN (lcurly) + ,[_LPRN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lparen, lparen_reset) + ,[_LT] = ACTION_TAP_DANCE_FN (lesser) + ,[_PRIV] = ACTION_TAP_DANCE_FN (private) + ,[_QUOT] = ACTION_TAP_DANCE_FN (quote) + ,[_RBRC] = ACTION_TAP_DANCE_FN (rbrace) + ,[_RCBR] = ACTION_TAP_DANCE_FN (rcurly) + ,[_RNGL] = ACTION_TAP_DANCE_FN (rangle) + ,[_RPRN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rparen, rparen_reset) + ,[_SEND] = ACTION_TAP_DANCE_FN (send) + ,[_SPC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, space, space_reset) + ,[_TILD] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tilde, tilde_reset) +}; + +// .............................................................. Dynamic Layers + +#define LEFT 1 +#define RIGHT 2 +static uint8_t thumb = 0; + +// LEFT (KC_SPC, S(KC_BSLS)), RIGHT (KC_LEFT, S(KC_LEFT)) opposite thumb combinations, see process_record_user() +// up, up -> _BASE +// up, down -> _SYMBOL +// down, up -> _NUMBER +// down, down -> _MOUSE // see layer keycodes that raise mouse layer +#define THUMBS_DOWN _MOUSE // layer + +static uint8_t overlayer = 0; + +// left right thumb layer combinations +void thumb_layer(keyrecord_t *record, uint8_t side, uint8_t shift, uint16_t keycode, uint8_t thumb_dn_layer, uint8_t thumb_up_layer) +{ + if (record->event.pressed) { + // layer_on via tap_layer(), see process_record_user() + key_timer = timer_read(); + thumb = thumb | side; + } + else { + layer_off(thumb_dn_layer); + // opposite thumb_layer() thumb may have switched effective layer! + if (overlayer) { + layer_off(overlayer); + overlayer = 0; + } + if (!key_press(shift, keycode)) { + layer_off(THUMBS_DOWN); // both thumbs needed + // opposite thumb down? see left right combination layer table above + if (thumb & (side == LEFT ? RIGHT : LEFT)) { + layer_on(thumb_up_layer); + overlayer = thumb_up_layer; + } + } + clear_mods(); + thumb = thumb & ~side; + key_timer = 0; + } +} + +// #ifdef STENO_ENABLE +// // LT for steno keycode +// void stn_layer(keyrecord_t *record, uint16_t keycode, uint8_t layer) +// { +// if (record->event.pressed) { +// key_timer = timer_read(); +// if (keycode) { +// process_steno(keycode, record); +// } +// layer_on(layer); +// } +// else { +// layer_off(layer); +// if (keycode) { +// if (timer_elapsed(key_timer) < TAPPING_TERM) { +// process_steno(keycode, record); +// } +// else { +// // clear pressed state (request push of updated) process_steno.c and .h +// // steno_clear_state(); +// } +// } +// key_timer = 0; +// } +// } +// #endif + +// LT for S(keycode) +void lt_shift(keyrecord_t *record, uint16_t keycode, uint8_t layer) +{ + if (record->event.pressed) { + key_timer = timer_read(); + layer_on(layer); + } + else { + layer_off(layer); + // for shifted keycodes, hence, LT_SHIFT + key_press(SHIFT, keycode); + clear_mods(); + key_timer = 0; + } +} + +// set layer asap to overcome macro latency errors, notably tap dance and LT usage +// this routine inexplicably (?) sets layer_on() faster than can be done in thumb_layer() +void tap_layer(keyrecord_t *record, uint8_t layer) +{ + if (record->event.pressed) { + layer_on(layer); + } + else { + layer_off(layer); + } +} + +// ..................................................................... Keymaps + +// void persistant_default_layer_set(uint16_t default_layer) +// { +// eeconfig_update_default_layer(default_layer); +// default_layer_set (default_layer); +// } + +void clear_layers(void) +{ + uint8_t layer; + for (layer = 0; layer < _END_LAYERS; layer++) { + layer_off(layer); + } +} + +#ifdef CENTER_TT +static uint16_t tt_keycode = 0; // current TT keycode + +void clear_tt(void) +{ + if (tt_keycode == KC_CAPS) { + tap_key(KC_CAPS); // clear capslock + } + tt_keycode = 0; + clear_layers(); + set_single_persistent_default_layer(_BASE); +} +#endif + +// txbolt plover run state +static uint8_t plover = 0; + +void toggle_plover(uint8_t state) +{ + if (plover != state) { +#ifdef PLOVER_KEYBIND +#include "plover_keybind.h" +#endif + plover = state; + } +} + +void base_layer(void) +{ +#ifdef AUDIO_ENABLE + if (plover) { + PLAY_SONG(song_plover_gb); + } + else { + PLAY_SONG(song_qwerty); + } +#endif + clear_layers(); + set_single_persistent_default_layer(_BASE); + toggle_plover(0); +} + +void steno(keyrecord_t *record) +{ + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(song_plover); +#endif + clear_layers(); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + if (!plover) { + toggle_plover(1); + } + } +} + +void steno_exit(keyrecord_t *record) +{ + if (record->event.pressed) { + base_layer(); + toggle_plover(0); + } +} diff --git a/keyboards/planck/keymaps/altgr/common/number_fkey_layout.h b/keyboards/planck/keymaps/altgr/common/number_fkey_layout.h new file mode 100644 index 000000000000..102d736acb71 --- /dev/null +++ b/keyboards/planck/keymaps/altgr/common/number_fkey_layout.h @@ -0,0 +1,86 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ......................................................... Number Keypad Layer +#ifdef SHIFT_SYMBOLS + // .-----------------------------------------------------------------------------------. + // | | F | E | D | | | | / | 7 | 8 | 9 | * | + // |-----------------------------------------------------------------------------------| + // | GUI | C | B | A | | | | . | 4 | 5 | 6 | - | + // |-----------------------------------------------------------------------------------| + // | | # | G | \ | | | | , | 1 | 2 | 3 | + | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | 0 | = | | | | + // | | | | f() | | | | = | 0 | | | | + // '-----------------------------------------------------------------------------------' + + [_NUMBER] = LAYOUT_planck_grid( + _______, KC_F, MT_E, KC_D, _______, ___x___, ___x___, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, + OS_GUI, GT_C, AT_B, ST_A, _______, ___x___, ___x___, TD_DOT, KC_4, KC_5, KC_6, KC_MINS, + _______, KC_HASH, SM_G, KC_BSLS, _______, ___x___, ___x___, TD_COMM, KC_1, KC_2, KC_3, KC_PLUS, +#ifdef THUMB_0 + ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___, KC_0, LT_EQL, ___x___, ___x___, ___x___ +#else + ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___, KC_EQL, LT_0, ___x___, ___x___, ___x___ +#endif + ), +#else + // .-----------------------------------------------------------------------------------. + // | | F | E | D | | | | / | 7 | 8 | 9 | * | + // |-----------------------------------------------------------------------------------| + // | GUI | C | B | A | | | | . | 4 | 5 | 6 | - | + // |-----------------------------------------------------------------------------------| + // | | # | X | G | | | | , | 1 | 2 | 3 | + | + // |-----------------------------------------------------------------------------------| + // | | f() | | 0 | = | | + // | | f() | | = | 0 | | + // '-----------------------------------------------------------------------------------' + + [_NUMBER] = LAYOUT_planck_grid( + _______, KC_F, MT_E, KC_D, _______, _______, _______, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, + OS_GUI, GT_C, AT_B, LT_A, _______, _______, _______, KC_DOT, KC_4, KC_5, KC_6, KC_MINS, + _______, KC_HASH, MT_X, S(KC_G), _______, _______, _______, TD_COMM, KC_1, KC_2, KC_3, KC_PLUS, +#ifdef THUMB_0 + ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___, KC_0, LT_EQL, ___x___, ___x___, ___x___ +#else + ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___, KC_EQL, LT_0, ___x___, ___x___, ___x___ +#endif + ), + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | { | & | ? | : | } | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | ( | $ | % | ^ | ) | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | [ | < | ~ | > | ] | + // |-----------------------------------------------------------------------------------| + // | | f() | | \ | | | | + // '-----------------------------------------------------------------------------------' + + [_NUMSYM] = LAYOUT_planck_grid( + _______, _______, _______, ___x___, _______, _______, _______, TD_LCBR, KC_AMPR, KC_QUES, KC_COLN, KC_RCBR, + ___x___, ___x___, ___x___, ___fn__, _______, _______, _______, TD_LPRN, KC_DLR, KC_PERC, KC_CIRC, KC_RPRN, + _______, _______, _______, ___x___, _______, _______, _______, TD_LBRC, KC_LT, KC_TILD, KC_GT, KC_RBRC, + ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___, KC_BSLS, KC_PIPE, ___x___, ___x___, ___x___ + ), +#endif + +// ............ .................................................. Function Keys + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | F7 | F8 | F9 | F12 | + // |-----------------------------------------------------------------------------------| + // | Ctrl | GUI | Alt | Shift| | | | | F4 | F5 | F6 | F11 | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | F1 | F2 | F3 | F10 | + // |-----------------------------------------------------------------------------------| + // | | | | | | f() | | + | | | | | + // | | | | | f() | | | + | | | | | see _PLOVER + // '-----------------------------------------------------------------------------------' + + [_FNCKEY] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_F7, KC_F8, KC_F9, KC_F12 , + OS_GUI, OS_CTL, OS_ALT, OS_SFT, _______, ___x___, ___x___, _______, KC_F4, KC_F5, KC_F6, KC_F11 , + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_F1, KC_F2, KC_F3, KC_F10 , + _______, _______, _______, _______, ___fn__, ___fn__, _______, KC_PLUS, _______, _______, _______, _______ + ), diff --git a/keyboards/planck/keymaps/altgr/common/number_fkey_layout.save.h b/keyboards/planck/keymaps/altgr/common/number_fkey_layout.save.h new file mode 100644 index 000000000000..7022863724e2 --- /dev/null +++ b/keyboards/planck/keymaps/altgr/common/number_fkey_layout.save.h @@ -0,0 +1,86 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ......................................................... Number Keypad Layer +#ifdef SHIFT_SYMBOLS + // .-----------------------------------------------------------------------------------. + // | | F | E | D | | | | / | 7 | 8 | 9 | * | + // |-----------------------------------------------------------------------------------| + // | Ctrl | C | B | A | | | | . | 4 | 5 | 6 | - | + // |-----------------------------------------------------------------------------------| + // | | # | G | \ | | | | , | 1 | 2 | 3 | + | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | 0 | = | | | | + // | | | | f() | | | | = | 0 | | | | + // '-----------------------------------------------------------------------------------' + + [_NUMBER] = { + {_______, KC_F, MT_E, KC_D, _______, ___x___, ___x___, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR}, + {OS_CTL, GT_C, AT_B, ST_A, _______, ___x___, ___x___, TD_DOT, KC_4, KC_5, KC_6, KC_MINS}, + {_______, KC_HASH, SM_G, KC_BSLS, _______, ___x___, ___x___, TD_COMM, KC_1, KC_2, KC_3, KC_PLUS}, +#ifdef THUMB_0 + {___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___, KC_0, LT_EQL, ___x___, ___x___, ___x___}, +#else + {___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___, KC_EQL, LT_0, ___x___, ___x___, ___x___}, +#endif + }, +#else + // .-----------------------------------------------------------------------------------. + // | | F | E | D | | | | / | 7 | 8 | 9 | * | + // |-----------------------------------------------------------------------------------| + // | Ctrl | C | B | A | | | | . | 4 | 5 | 6 | - | + // |-----------------------------------------------------------------------------------| + // | | # | X | G | | | | , | 1 | 2 | 3 | + | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | 0 | = | | | | + // | | | | f() | | | | = | 0 | | | | + // '-----------------------------------------------------------------------------------' + + [_NUMBER] = { + {_______, KC_F, MT_E, KC_D, _______, _______, _______, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR}, + {OS_CTL, GT_C, AT_B, LT_A, _______, _______, _______, KC_DOT, KC_4, KC_5, KC_6, KC_MINS}, + {_______, KC_HASH, MT_X, S(KC_G), _______, _______, _______, TD_COMM, KC_1, KC_2, KC_3, KC_PLUS}, +#ifdef THUMB_0 + {___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___, KC_0, LT_EQL, ___x___, ___x___, ___x___}, +#else + {___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___, KC_EQL, LT_0, ___x___, ___x___, ___x___}, +#endif + }, + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | { | & | ? | : | } | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | ( | $ | % | ^ | ) | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | [ | < | ~ | > | ] | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | \ | | | | | | + // '-----------------------------------------------------------------------------------' + + [_NUMSYM] = { + {_______, _______, _______, ___x___, _______, _______, _______, TD_LCBR, KC_AMPR, KC_QUES, KC_COLN, KC_RCBR}, + {___x___, ___x___, ___x___, ___fn__, _______, _______, _______, TD_LPRN, KC_DLR, KC_PERC, KC_CIRC, KC_RPRN}, + {_______, _______, _______, ___x___, _______, _______, _______, TD_LBRC, KC_LT, KC_TILD, KC_GT, KC_RBRC}, + {___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___, KC_BSLS, KC_PIPE, ___x___, ___x___, ___x___}, + }, +#endif + +// ............ .................................................. Function Keys + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | F7 | F8 | F9 | F12 | + // |-----------------------------------------------------------------------------------| + // | Ctrl | GUI | Alt | Shift| | | | | F4 | F5 | F6 | F11 | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | F1 | F2 | F3 | F10 | + // |-----------------------------------------------------------------------------------| + // | | | | | | f() | | + | | | | | + // | | | | | f() | | | + | | | | | see _PLOVER + // '-----------------------------------------------------------------------------------' + + [_FNCKEY] = { + {_______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_F7, KC_F8, KC_F9, KC_F12 }, + {OS_CTL, OS_GUI, OS_ALT, OS_SFT, _______, ___x___, ___x___, _______, KC_F4, KC_F5, KC_F6, KC_F11 }, + {_______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_F1, KC_F2, KC_F3, KC_F10 }, + {_______, _______, _______, _______, ___fn__, ___fn__, _______, KC_PLUS, _______, _______, _______, _______}, + }, diff --git a/keyboards/planck/keymaps/altgr/common/plover_keybind.h b/keyboards/planck/keymaps/altgr/common/plover_keybind.h new file mode 100644 index 000000000000..cb4ef92ef849 --- /dev/null +++ b/keyboards/planck/keymaps/altgr/common/plover_keybind.h @@ -0,0 +1,9 @@ + +// simple window manager specific plover keybind hook + +// toggle plover application, see herbstluftwm/config/appbinds +register_code (KC_LGUI); +register_code (KC_LCTL); +tap_key (KC_EQL); +unregister_code(KC_LCTL); +unregister_code(KC_LGUI); diff --git a/keyboards/planck/keymaps/altgr/common/sounds.h b/keyboards/planck/keymaps/altgr/common/sounds.h new file mode 100644 index 000000000000..1bfc7a6da0c9 --- /dev/null +++ b/keyboards/planck/keymaps/altgr/common/sounds.h @@ -0,0 +1,14 @@ + +// ................................................................ Audio Sounds + +#ifdef AUDIO_ENABLE +float song_startup [][2] = SONG(STARTUP_SOUND); +float song_colemak [][2] = SONG(COLEMAK_SOUND); +float song_qwerty [][2] = SONG(QWERTY_SOUND); +float song_plover [][2] = SONG(PLOVER_SOUND); +float song_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float song_caps_on [][2] = SONG(CAPS_LOCK_ON_SOUND); +float song_caps_off [][2] = SONG(CAPS_LOCK_OFF_SOUND); +float music_scale [][2] = SONG(MUSIC_SCALE_SOUND); +float song_goodbye [][2] = SONG(GOODBYE_SOUND); +#endif diff --git a/keyboards/planck/keymaps/altgr/common/steno_layout.h b/keyboards/planck/keymaps/altgr/common/steno_layout.h new file mode 100644 index 000000000000..c1f2b5b24ab7 --- /dev/null +++ b/keyboards/planck/keymaps/altgr/common/steno_layout.h @@ -0,0 +1,39 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ...................................................................... Plover +#ifdef STENO_ENABLE + // ,-----------------------------------------------------------------------------------. + // | # | # | # | # | # | # | # | # | # | # | # | # | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | Base | S | T | P | H | * | * | F | P | L | T | D | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Base | S | K | W | R | * | * | R | B | G | S | Z | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | | A | O | E | U | | + // `-----------------------------------------------------------------------------------' + + [_PLOVER] = LAYOUT_planck_grid( + STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC , + BASE1, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR , + BASE2, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR , + _______, _______, _______, PS_STNA, PS_STNO, _______, _______, PS_STNE, PS_STNU, _______, _______, _______ + ), +#else + // ,-----------------------------------------------------------------------------------. + // | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | Base | S | T | P | H | * | * | F | P | L | T | D | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Base | S | K | W | R | * | * | R | B | G | S | Z | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | | A | O | E | U | | + // `-----------------------------------------------------------------------------------' + + [_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + BASE1, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + BASE2, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + _______, _______, _______, LT_C, LT_V, _______, _______, LT_N, LT_M, _______, _______, _______ + ), +#endif diff --git a/keyboards/planck/keymaps/altgr/common/symbol_guifn_layout.h b/keyboards/planck/keymaps/altgr/common/symbol_guifn_layout.h new file mode 100644 index 000000000000..e5c902f2dfa9 --- /dev/null +++ b/keyboards/planck/keymaps/altgr/common/symbol_guifn_layout.h @@ -0,0 +1,75 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ..................................................... Symbol Navigation Layer +#ifdef SHIFT_SYMBOLS + // .-----------------------------------------------------------------------------------. + // | | ~ | * | & | | | | | Home | Up | End | PgUp | + // |-----------------------------------------------------------------------------------| + // | GUI | ^ | % | $ | | | | | Left | Down | Right| PgDn | + // |-----------------------------------------------------------------------------------| + // | | # | @ | ! | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | |Adjust| \ | | f() | | + // '-----------------------------------------------------------------------------------' + + [_SYMBOL] = LAYOUT_planck_grid( + _______, KC_TILD, KC_ASTR, KC_AMPR, _______, ___x___, ___x___, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, + OS_GUI, SM_CIRC, SM_PERC, SM_DLR, _______, ___x___, ___x___, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, + _______, KC_HASH, KC_AT, KC_EXLM, _______, ___x___, ___x___, _______, _______, _______, _______, _______, + ___x___, ___x___, ___x___, ADJUST, LT_BSLS, ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___ + ), +#else + // .-----------------------------------------------------------------------------------. + // | { | . | * | & | } | | | | Home | Up | End | PgUp | + // |-----------------------------------------------------------------------------------| + // | ( | ^ | % | $ | ) | | | | Left | Down | Right| PgDn | + // |-----------------------------------------------------------------------------------| + // | [ | # | @ | ! | ] | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | | | \ | | f() | | + // '-----------------------------------------------------------------------------------' + + [_SYMBOL] = LAYOUT_planck_grid( + KC_LCBR, KC_DOT, KC_ASTR, KC_AMPR, TD_RCBR, _______, _______, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, + SM_LPRN, SM_CIRC, SM_PERC, SM_DLR, TD_RPRN, _______, _______, _______, LT_LFTX, KC_DOWN, KC_RGHT, KC_PGDN, + KC_LBRC, KC_HASH, KC_AT, KC_EXLM, TD_RBRC, _______, _______, _______, _______, _______, _______, _______, + ___x___, ___x___, ___x___, SL_PIPE, LT_BSLS, ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___ + ), + + // .-----------------------------------------------------------------------------------. + // | | ? | + | ~ | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | < | = | > | | | | | f() | | | | + // |-----------------------------------------------------------------------------------| + // | | 3 | 2 | 1 | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | | | | f() | | + // '-----------------------------------------------------------------------------------' + + [_SYMREG] = LAYOUT_planck_grid( + ___x___, KC_QUES, KC_PLUS, KC_TILD, ___x___, _______, _______, _______, ___x___, ___x___, ___x___, ___x___, + ___x___, KC_LT, KC_EQL, TD_RNGL, ___x___, _______, _______, _______, ___fn__, ___x___, ___x___, ___x___, + ___x___, KC_3, KC_2, KC_1, ___x___, _______, _______, _______, _______, _______, _______, _______, + ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___ + ), +#endif + +// ............................................................... Mouse Actions + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | Left | Up | Right| Up | + // |-----------------------------------------------------------------------------------| + // | | Btn3 | Btn2 | Btn1 | | | | | Left | Down | Right| Down | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | | f() | | f() | | + // '-----------------------------------------------------------------------------------' + + [_MOUSE] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_WH_U, + _______, KC_BTN3, KC_BTN2, KC_BTN1, _______, ___x___, ___x___, _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, + _______, _______, _______, _______, _______, ___x___, ___x___, _______, _______, _______, _______, _______, + _______, _______, _______, _______, ___fn__, _______, _______, _______, ___fn__, _______, _______, _______ + ), diff --git a/keyboards/planck/keymaps/altgr/common/tapdance.h b/keyboards/planck/keymaps/altgr/common/tapdance.h new file mode 100644 index 000000000000..d778286bf1ed --- /dev/null +++ b/keyboards/planck/keymaps/altgr/common/tapdance.h @@ -0,0 +1,49 @@ + +// tap dance keys +enum tap_dance { + _CAPS = 0 + ,_COLN + ,_COMM + ,_DOT + ,_DQOT + ,_ENT + ,_EQL + ,_GRV + ,_GT + ,_LBRC + ,_LCBR + ,_LPRN + ,_LT + ,_PRIV + ,_QUOT + ,_RBRC + ,_RCBR + ,_RNGL + ,_RPRN + ,_SEND + ,_SPC + ,_TILD +}; + +#define TD_CAPS TD(_CAPS) +#define TD_COLN TD(_COLN) +#define TD_COMM TD(_COMM) +#define TD_DOT TD(_DOT) +#define TD_DQOT TD(_DQOT) +#define TD_ENT TD(_ENT) +#define TD_EQL TD(_EQL) +#define TD_GRV TD(_GRV) +#define TD_GT TD(_GT) +#define TD_LBRC TD(_LBRC) +#define TD_LCBR TD(_LCBR) +#define TD_LPRN TD(_LPRN) +#define TD_LT TD(_LT) +#define TD_PRIV TD(_PRIV) // compile time macro string, provided in private_string.h +#define TD_QUOT TD(_QUOT) +#define TD_RBRC TD(_RBRC) +#define TD_RCBR TD(_RCBR) +#define TD_RNGL TD(_RNGL) +#define TD_RPRN TD(_RPRN) +#define TD_SEND TD(_SEND) // config.h defined macro string +#define TD_SPC TD(_SPC) // see process_record_user() for extended handling of Spc +#define TD_TILD TD(_TILD) diff --git a/keyboards/planck/keymaps/altgr/common/toggle_layout.h b/keyboards/planck/keymaps/altgr/common/toggle_layout.h new file mode 100644 index 000000000000..ed74f42522d8 --- /dev/null +++ b/keyboards/planck/keymaps/altgr/common/toggle_layout.h @@ -0,0 +1,102 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ......................................................... Number Keypad Layer + + // .-----------------------------------------------------------------------------------. + // | | F | E | D | | | | / | 7 | 8 | 9 | * | + // |-----------------------------------------------------------------------------------| + // | GUI | C | B | A | | | | . | 4 | 5 | 6 | - | + // |-----------------------------------------------------------------------------------| + // | | # | G | \ | | | | , | 1 | 2 | 3 | + | + // |-----------------------------------------------------------------------------------| + // | | | | f() | Space| | | 0 | = | | | | + // | | | | f() | Space| | | = | 0 | | | | + // '-----------------------------------------------------------------------------------' + + [_TTNUMBER] = LAYOUT_planck_grid( + _______, KC_F, MT_E, KC_D, _______, ___x___, ___x___, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, + OS_GUI, GT_C, AT_B, ST_A, _______, ___x___, ___x___, TD_DOT, KC_4, KC_5, KC_6, KC_MINS, + _______, KC_HASH, SM_G, KC_BSLS, _______, ___x___, ___x___, TD_COMM, KC_1, KC_2, KC_3, KC_PLUS, +#ifdef THUMB_0 + _______, _______, _______, TT_ESC, KC_SPC, _______, _______, KC_0, LT_EQL, _______, _______, _______ +#else + _______, _______, _______, TT_ESC, KC_SPC, _______, _______, KC_EQL, LT_0, _______, _______, _______ +#endif + ), + +// ............ .................................................. Function Keys + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | F7 | F8 | F9 | F12 | + // |-----------------------------------------------------------------------------------| + // | GUI | Ctrl | Alt | Shift| | | | | F4 | F5 | F6 | F11 | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | F1 | F2 | F3 | F10 | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | + | | | | | + // '-----------------------------------------------------------------------------------' + + [_TTFNCKEY] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_F7, KC_F8, KC_F9, KC_F12 , + OS_GUI, OS_CTL, OS_ALT, OS_SFT, _______, ___x___, ___x___, _______, KC_F4, KC_F5, KC_F6, KC_F11 , + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_F1, KC_F2, KC_F3, KC_F10 , + _______, _______, _______, TT_ESC, _______, _______, _______, KC_PLUS, _______, _______, _______, _______ + ), + +// ....................................................................... Regex + + // ,-----------------------------------------------------------------------------------. + // | | ~ | { | } | & | | | % | [ | ] | @ | | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | | ^ | < | > | ? | | | | | ( | ) | $ | | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | | : | ! | = | / | | | \ | * | . | # | | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | | | | f() | - | | | + | Space| | | | + // `-----------------------------------------------------------------------------------' + + [_TTREGEX] = LAYOUT_planck_grid( + ___x___, KC_TILD, KC_LCBR, KC_RCBR, KC_AMPR, ___x___, ___x___, KC_PERC, KC_LBRC, KC_RBRC, KC_AT, ___x___, + ___x___, KC_CIRC, KC_LT, KC_GT, KC_QUES, ___x___, ___x___, KC_PIPE, KC_LPRN, KC_RPRN, KC_DLR, ___x___, + ___x___, KC_COLN, KC_EXLM, KC_EQL, KC_SLSH, ___x___, ___x___, KC_BSLS, KC_ASTR, KC_DOT, KC_HASH, ___x___, + _______, _______, _______, TT_ESC, KC_MINS, _______, _______, KC_PLUS, KC_SPC, _______, _______, _______ + ), + +// ............................................................ Navigation Layer + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | Home | Up | End | PgUp | + // |-----------------------------------------------------------------------------------| + // | GUI | Ctrl | Alt | Shift| | | | | Left | Down | Right| PgDn | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | | | | | | + // '-----------------------------------------------------------------------------------' + + [_TTCURSOR] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, + OS_GUI, OS_CTL, OS_ALT, OS_SFT, _______, ___x___, ___x___, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, + _______, _______, _______, _______, _______, ___x___, ___x___, _______, _______, _______, _______, _______, + _______, _______, _______, TT_ESC, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +// ............................................................... Mouse Actions + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | Left | Up | Right| Up | + // |-----------------------------------------------------------------------------------| + // | | Btn3 | Btn2 | Btn1 | | | | | Left | Down | Right| Down | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | | | | | | + // '-----------------------------------------------------------------------------------' + + [_TTMOUSE] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_WH_U, + _______, KC_BTN3, KC_BTN2, KC_BTN1, _______, ___x___, ___x___, _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, + _______, _______, _______, _______, _______, ___x___, ___x___, _______, _______, _______, _______, _______, + _______, _______, _______, TT_ESC, _______, _______, _______, _______, _______, _______, _______, _______ + ), diff --git a/keyboards/planck/keymaps/altgr/config.h b/keyboards/planck/keymaps/altgr/config.h new file mode 100644 index 000000000000..b6c010a8255f --- /dev/null +++ b/keyboards/planck/keymaps/altgr/config.h @@ -0,0 +1,46 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// tap dance key press termination interval +#define TAPPING_TERM 250 + +// smooth mouse motion +// #define MOUSEKEY_INTERVAL 20 +// #define MOUSEKEY_DELAY 0 +// #define MOUSEKEY_TIME_TO_MAX 60 +// #define MOUSEKEY_MAX_SPEED 7 +// #define MOUSEKEY_WHEEL_DELAY 0 + +// compile time macro string, see functions/hardware planck script (undefine otherwise) +#define PRIVATE_STRING + +// compile time macro string, must be in quotes +#define PUBLIC_STRING ":%s/arch=(.*)/arch=('any')\n" + +// thumb key tap-shift() double tap: one shot shift (0) off (1) on +#define DT_SHIFT 1 + +// number layer 0 position KEYPAD_0, THUMB_0 +#define THUMB_0 + +// home block shift symbol clustes defined (no overlays required for extended symbols, undefine otherwise) +#define SHIFT_SYMBOLS + +// center column TT assignments (undefine for OSM chords) +#define CENTER_TT +#define TAPPING_TOGGLE 1 + +// home row modifiers +#define HOME_MODS +// fix dual function timing +#define PERMISSIVE_HOLD + +// layout ADNW*, BEAKL*, COLEKA*, QWERTY (default) +#define BEAKLGR + +// sync app with window manager keybind hook defined in plover_keybind.h +#define PLOVER_KEYBIND + +#endif diff --git a/keyboards/planck/keymaps/altgr/keymap.c b/keyboards/planck/keymaps/altgr/keymap.c new file mode 100644 index 000000000000..3ef9690a0a84 --- /dev/null +++ b/keyboards/planck/keymaps/altgr/keymap.c @@ -0,0 +1,482 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. +// +// To flash planck firmware +// ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +// Reset keyboard or press hw reset button on base (hole) +// +// cd qmk_firmware/keyboards/planck +// sudo make KEYMAP=sdothum dfu +// +// sudo make clean (good practice before flashing) +// sudo make KEYMAP=sdothum (to compile check) +// +// Package requirements (for arch linux) +// ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +// avr-gcc-atmel +// avr-libc-atmel +// dfu-programmer +// +// Notes +// ▔▔▔▔▔ +// ** E R G O W I D E S P L I T ** Layout +// +// Autocompletion tap dance key pairs (),[],{} are available from the +// number/symbol layer, as well as, numerous (un)shift key values +// +// The navigation pad provides a single hand right thumb activated cluster +// with left hand modifiers +// +// #define PRIVATE_STRING includes private_string.h, a user defined code +// block for the PRIV tap dance e.g. SEND_STRING("secret messape"), +// see function private() +// +// Modifier clusters +// ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +// The num and sym keys together access the navigation pad layer +// +// ,-----------------------------------------------------------------------------------. +// | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| +// `-----------------------------------------------------------------------------------' +// +// Hint +// ▔▔▔▔ +// For sculpted keycaps such as Cherry or OEM profile, reverse the Alt, Num, +// Shift, Shift, Nav, Sym keycaps for more ergonomic thumb orientation and +// actuation +// +// Code +// ▔▔▔▔ +// This source is shamelessly based on the "default" planck layout +// +// #ifdef/#endif block structures are not indented, as syntax highlighting +// in vim is sufficient for identification +// +// c++ commenting style is used throughout +// +// Change history +// ▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +// See http://thedarnedestthing.com/planck%20constant +// See http://thedarnedestthing.com/planck%20done + + + +// === N O T E === +// +// sudo CPATH=/common make ... + + +#include QMK_KEYBOARD_H +#ifdef STENO_ENABLE +#include "keymap_steno.h" +#endif + +extern keymap_config_t keymap_config; + +enum planck_layers { + _BASE = 0 + ,_SHIFT + ,_LSHIFT + ,_RSHIFT + ,_PLOVER + ,_NUMBER + ,_SYMBOL + ,_FNCKEY + ,_MOUSE +#ifdef CENTER_TT + ,_TTNUMBER + ,_TTREGEX + ,_TTFNCKEY + ,_TTCURSOR + ,_TTMOUSE +#endif +#ifndef SHIFT_SYMBOLS + ,_NUMSYM + ,_SYMREG +#endif + ,_EDIT + ,_QWERTY + ,_ADJUST + ,_END_LAYERS +}; + +enum planck_keycodes { + BASE = SAFE_RANGE + ,BASE1 + ,BASE2 + ,PLOVER + ,PLOEXIT + ,SM_CIRC // pseudo GUI_T(S(KC_6)) for shifted key-codes, see process_record_user() + ,SM_DLR // pseudo SFT_T(S(KC_4)) for shifted key-codes, see process_record_user() + ,SM_G // pseudo MT (MOD_LALT | MOD_LSFT, S(KC_G)) for shifted key-codes, see process_record_user() + ,SM_K // pseudo MT (MOD_LGUI | MOD_LSFT, S(KC_K)) for shifted key-codes, see process_record_user() + ,SM_PERC // pseudo ALT_T(S(KC_5)) for shifted key-codes, see process_record_user() + ,SM_LPRN // pseudo CTL_T(S(KC_9)) for shifted key-codes, see process_record_user() + ,SM_W // pseudo MT (MOD_LGUI | MOD_LSFT, S(KC_W)) for shifted key-codes, see process_record_user() + ,SL_LEFT // pseudo LT (_MOUSE, S(KC_LEFT)) for shifted key-codes, see process_record_user() + ,SP_DEL // pseudo LT (_MOUSE, KC_DEL) for shifted key-codes, see process_record_user() + ,SL_PIPE // pseudo LT (_ADJUST, S(KC_BSLS)) for shifted key-codes, see process_record_user() + ,SL_TAB // pseudo LT (_FNCKEY, S(KC_TAB)) for shifted key-codes, see process_record_user() +#ifdef CENTER_TT + ,TT_ESC +#endif +#ifdef STENO_ENABLE + ,PS_STNA = STN_A + ,PS_STNO = STN_O + ,PS_STNE = STN_E + ,PS_STNU = STN_U +#else + ,LT_C = LT (_NUMBER, KC_C) + ,LT_V = LT (_FNCKEY, KC_V) + ,LT_N = LT (_EDIT, KC_N) + ,LT_M = LT (_SYMBOL, KC_M) +#endif + ,PS_BASE +}; + +// modifier keys +#define AT_B ALT_T(KC_B) +#define AT_DOWN ALT_T(KC_DOWN) +#define CT_RGHT CTL_T(KC_RGHT) +#define GT_C GUI_T(KC_C) +#define GT_UP GUI_T(KC_UP) +#define MT_E MT (MOD_LCTL | MOD_LALT, KC_E) +#define MT_X MT (MOD_LALT | MOD_LSFT, KC_X) +#define ST_A SFT_T(KC_A) +#ifdef HOME_MODS +#define HOME_K GUI_T(KC_K) +#define HOME_H CTL_T(KC_H) +#define HOME_E ALT_T(KC_E) +#define HOME_A SFT_T(KC_A) +#if defined(BEAKLMU) || defined(BEAKLSP) || defined(BEAKLGR) +#define HOME_T SFT_T(KC_T) +#define HOME_R ALT_T(KC_R) +#define HOME_S CTL_T(KC_S) +#define HOME_W GUI_T(KC_W) +#else +#define HOME_T SFT_T(KC_T) +#define HOME_S ALT_T(KC_S) +#define HOME_N GUI_T(KC_N) +#define HOME_B CTL_T(KC_B) +#endif +#else +#define HOME_K KC_K +#define HOME_H KC_H +#define HOME_E KC_E +#define HOME_A KC_A +#define HOME_T KC_T +#define HOME_S KC_S +#define HOME_N KC_N +#define HOME_B KC_B +#endif + +#define S_DOWN S (KC_DOWN) +#define S_LEFT S (KC_LEFT) +#define S_RGHT S (KC_RGHT) +#define S_TAB S (KC_TAB) +#define S_UP S (KC_UP) + +#include "common/tapdance.h" + +// keycodes +#define ___x___ KC_TRNS +#define ___fn__ KC_TRNS +#undef _______ +#define _______ KC_NO + +#define COPY LCTL(KC_C) +#define CUT LCTL(KC_X) +#define EOT LCTL(KC_D) +#define NAK LCTL(KC_U) +#define PASTE LCTL(KC_V) +#define UNDO LCTL(KC_Z) +#define TMCOPY LALT(LCTL(KC_C)) +#define TMPASTE LALT(LCTL(KC_V)) +#define LT_BSLS LT (_MOUSE, KC_BSLS) // see process_record_user() for extended handling +#define LT_BSPC LT (_EDIT, KC_BSPC) +#define SP_LEFT LT (_EDIT, KC_LEFT) +#define LT_ESC LT (_NUMBER, KC_ESC) +#define LT_LEFT LT (_SYMBOL, KC_LEFT) // see process_record_user() for extended handling +#define SP_BSPC LT (_SYMBOL, KC_BSPC) // see process_record_user() for extended handling +#define LT_TAB LT (_FNCKEY, KC_TAB) +#define LT_INS LT (_FNCKEY, KC_INS) +#define LT_ALTG LT (_FNCKEY, KC_RALT) +#define ADJUST MO (_ADJUST) +#define OS_ALT OSM (MOD_LALT) +#define OS_CTL OSM (MOD_LCTL) +#define OS_GUI OSM (MOD_LGUI) +#define OS_SFT OSM (MOD_LSFT) +#define OS_CALT OSM (MOD_LALT | MOD_LCTL) +#define OS_CGUI OSM (MOD_LGUI | MOD_LCTL) +#define OS_CSFT OSM (MOD_LSFT | MOD_LCTL) +#define OS_SALT OSM (MOD_LALT | MOD_LSFT) +#define OS_SGUI OSM (MOD_LGUI | MOD_LSFT) + +#ifdef CENTER_TT +#ifdef BEAKLSP +#define CNTR_TL OSM (MOD_LSFT) +#else +#define CNTR_TL TT (_TTFNCKEY) +#endif +#define CNTR_TR KC_CAPS +#define CNTR_HL TT (_TTCURSOR) +#define CNTR_HR TT (_TTMOUSE) +#define CNTR_BL TT (_TTNUMBER) +#define CNTR_BR TT (_TTREGEX) +#else +#define CNTR_TL OSM (MOD_LALT | MOD_LCTL) +#define CNTR_TR OSM (MOD_LGUI | MOD_LCTL) +#define CNTR_HL OSM (MOD_LALT | MOD_LSFT) +#define CNTR_HR OSM (MOD_LGUI | MOD_LSFT) +#define CNTR_BL TD (_CAPS) +#define CNTR_BR OSM (MOD_LSFT | MOD_LCTL) +#endif + +#ifdef THUMB_0 +#define LT_EQL LT (_ADJUST, KC_EQL) +#else +#define LT_0 LT (_ADJUST, KC_0) +#endif +#ifndef SHIFT_SYMBOLS +#define LT_A LT (_NUMSYM, KC_A) +#define LT_LFTX LT (_SYMREG, KC_LEFT) +#endif + +// ........................................................ Default Alpha Layout + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +#include "beakl.h" +#include "colemak.h" +#include "qwerty.h" +#include "common/steno_layout.h" + +// ...................................................... Number / Function Keys + +#include "common/number_fkey_layout.h" + +// ......................................................... Symbol / Navigation + +#include "common/symbol_guifn_layout.h" + +// ............................................................... Toggle Layers + +#ifdef CENTER_TT +#include "common/toggle_layout.h" +#endif + +// ......................................................... Short Cuts / Adjust + +#include "common/chord_layout.h" + +}; + +// ...................................................................... Sounds + +#include "common/sounds.h" + +// ........................................................... User Keycode Trap + +#include "common/keycode_functions.h" + +#define BASE_1 1 +#define BASE_2 2 +#define BASE_12 3 +static uint8_t base_n = 0; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + switch (keycode) { + case BASE1: + if (record->event.pressed) { + base_n = base_n | BASE_1; + if (base_n == BASE_12) { + base_layer(); + } + } + else { + base_n = base_n & ~BASE_1; + } + return false; + case BASE2: + if (record->event.pressed) { + base_n = base_n | BASE_2; + if (base_n == BASE_12) { + base_layer(); + } + } + else { + base_n = base_n & ~BASE_2; + } + return false; + case AT_DOWN: +#ifdef HOME_MODS + case HOME_E: +#if defined(BEAKLMU) || defined(BEAKLSP) || defined(BEAKLGR) + case HOME_R: +#else + case HOME_S: +#endif +#endif + tap_mods(record, KC_LALT); + break; + case CT_RGHT: +#ifdef HOME_MODS + case HOME_K: +#if defined(BEAKLMU) || defined(BEAKLSP) || defined(BEAKLGR) + case HOME_W: +#else + case HOME_B: +#endif +#endif + tap_mods(record, KC_LGUI); + break; + case GT_UP: +#ifdef HOME_MODS + case HOME_H: +#if defined(BEAKLMU) || defined(BEAKLSP) || defined(BEAKLGR) + case HOME_S: +#else + case HOME_N: +#endif +#endif + tap_mods(record, KC_LCTL); + break; +#ifdef HOME_MODS + case HOME_A: + case HOME_T: + tap_mods(record, KC_LSFT); + break; +#endif +#ifdef CENTER_TT + case TT_ESC: + clear_tt(); // exit TT layer + return false; +#endif + case LT_ESC: +#ifdef CENTER_TT + if (tt_keycode != 0) { + clear_tt(); // exit TT layer + return false; + } +#endif + tap_layer(record, _NUMBER); + break; + case LT_LEFT: + case SP_BSPC: + tap_layer(record, _SYMBOL); + // LT (_SYMBOL, KC_LEFT) left right combination layer + thumb_layer(record, RIGHT, 0, 0, _SYMBOL, _LSHIFT); + break; + case OS_ALT: + tap_mods(record, KC_LALT); + break; + case OS_CTL: + tap_mods(record, KC_LCTL); + break; + case OS_GUI: + tap_mods(record, KC_LGUI); + break; + case SM_CIRC: + // GUI_T(S(KC_6)) + mt_shift(record, KC_LGUI, 0, KC_6); + break; + case SM_DLR: + // SFT_T(S(KC_4)) + mt_shift(record, KC_LSFT, 0, KC_4); + break; + case SM_G: + // MT(MOD_LALT | MOD_LSFT, S(KC_G)) + mt_shift(record, KC_LALT, KC_LSFT, KC_G); + break; + case SM_K: + // MT(MOD_LGUI | MOD_LSFT, S(KC_K)) + mt_shift(record, KC_LGUI, KC_LSFT, KC_K); + break; + case SM_W: + // MT(MOD_LGUI | MOD_LSFT, S(KC_W)) + mt_shift(record, KC_LGUI, KC_LSFT, KC_W); + break; + case SM_LPRN: + // CTL_T(S(KC_9)) + mt_shift(record, KC_LCTL, 0, KC_9); + break; + case SM_PERC: + // ALT_T(S(KC_5)) + mt_shift(record, KC_LALT, 0, KC_5); + break; + case LT_BSLS: + tap_layer(record, _MOUSE); + // LT (_MOUSE, KC_BSLS) left right combination layer, see #define LT_BSLS + thumb_layer(record, LEFT, 0, 0, _MOUSE, _SYMBOL); + break; + case SL_LEFT: + tap_layer(record, _MOUSE); + // LT (_MOUSE, S(KC_LEFT)) left right combination layer + thumb_layer(record, RIGHT, SHIFT, KC_LEFT, _MOUSE, _LSHIFT); + break; + case SP_DEL: + tap_layer(record, _MOUSE); + // LT (_MOUSE, S(KC_LEFT)) left right combination layer + thumb_layer(record, RIGHT, NOSHIFT, KC_DEL, _MOUSE, _LSHIFT); + break; + case SL_PIPE: + // LT (_ADJUST, S(KC_BSLS)) emulation + lt_shift(record, KC_BSLS, _ADJUST); + break; + case SL_TAB: + // LT (_FNCKEY, S(KC_TAB)) emulation + lt_shift(record, KC_TAB, _FNCKEY); + break; + case TD_ENT: + tap_layer(record, _RSHIFT); + // LT (_RSHIFT, KC_ENT) emulation, see tap dance enter + break; + case TD_SPC: + tap_layer(record, _LSHIFT); + // LT (_LSHIFT, KC_SPC) left right combination layer, see tap dance TD_SPC + thumb_layer(record, LEFT, 0, 0, _LSHIFT, _SYMBOL); + break; +#ifdef CENTER_TT + case CNTR_TL: + case CNTR_TR: + case CNTR_HL: + case CNTR_HR: + case CNTR_BL: + case CNTR_BR: + if (tt_keycode != keycode && tt_keycode != 0) { + clear_tt(); // return to base layer first if different TT layer selected + } + tt_keycode = keycode; + break; +#endif +// #ifdef STENO_ENABLE +// case PS_STNA: +// stn_layer(record, STN_A, _NUMBER); +// break; +// case PS_STNO: +// stn_layer(record, STN_O, _FNCKEY); +// break; +// case PS_STNE: +// stn_layer(record, STN_E, _EDIT); +// break; +// case PS_STNU: +// stn_layer(record, STN_U, _SYMBOL); +// break; +// #endif + case PS_BASE: + if (record->event.pressed) { + base_layer(); + } + return false; + case PLOVER: + steno(record); + return false; + case PLOEXIT: + steno_exit(record); + return false; + } + return true; +} + +#include "common/init.h" diff --git a/keyboards/planck/keymaps/altgr/private_string.h b/keyboards/planck/keymaps/altgr/private_string.h new file mode 100644 index 000000000000..6ea34cc8e87e --- /dev/null +++ b/keyboards/planck/keymaps/altgr/private_string.h @@ -0,0 +1 @@ +SEND_STRING("the keys of enoch"); diff --git a/keyboards/planck/keymaps/altgr/qwerty.h b/keyboards/planck/keymaps/altgr/qwerty.h new file mode 100644 index 000000000000..eed52f0af8e6 --- /dev/null +++ b/keyboards/planck/keymaps/altgr/qwerty.h @@ -0,0 +1,64 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ...................................................................... Qwerty +#ifdef QWERTY + // ,-----------------------------------------------------------------------------------. + // | Q | W | E | R | T | ^Alt | ^GUI | Y | U | I | O | P | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | S | D | F | G | ↑Alt | ↑GUI | H | J | K | L | ; | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | X | C | V | B | Caps |^Shift| N | M | , | . | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_W, KC_E, KC_R, KC_T, CNTR_TL, CNTR_TR, KC_Y, KC_U, KC_I, KC_O, KC_P , + KC_A, KC_S, KC_D, KC_F, KC_G, CNTR_HL, CNTR_HR, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + KC_Z, KC_X, KC_C, KC_V, KC_B, CNTR_BL, CNTR_BR, KC_N, KC_M, KC_COMM, KC_DOT, TD_QUOT, + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_W), S(KC_E), S(KC_R), S(KC_T), CNTR_TL, CNTR_TR, S(KC_Y), S(KC_U), S(KC_I), S(KC_O), S(KC_P), + S(KC_A), S(KC_S), S(KC_D), S(KC_F), S(KC_G), CNTR_HL, CNTR_HR, S(KC_H), S(KC_J), S(KC_K), S(KC_L), KC_SCLN, + S(KC_Z), S(KC_X), S(KC_C), S(KC_V), S(KC_B), CNTR_BL, CNTR_BR, S(KC_N), S(KC_M), KC_COMM, KC_DOT, TD_QUOT, + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | W | E | R | T | ^Alt | ^GUI | Y | U | I | O | P | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | S | D | F | G | ↑Alt | ↑GUI | H | J | K | L | : | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | X | C | V | B | Caps |^Shift| N | M | / | ? | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | - | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_W), S(KC_E), S(KC_R), S(KC_T), CNTR_TL, CNTR_TR, S(KC_Y), S(KC_U), S(KC_I), S(KC_O), S(KC_P), + S(KC_A), S(KC_S), S(KC_D), S(KC_F), S(KC_G), CNTR_HL, CNTR_HR, S(KC_H), S(KC_J), S(KC_K), S(KC_L), TD_COLN, + S(KC_Z), S(KC_X), S(KC_C), S(KC_V), S(KC_B), CNTR_BL, CNTR_BR, S(KC_N), S(KC_M), KC_SLSH, KC_QUES, TD_DQOT, + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_MINS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | W | E | R | T | ^Alt | ^GUI | Y | U | I | O | P | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | S | D | F | G | ↑Alt | ↑GUI | H | J | K | L | : | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | X | C | V | B | Caps |^Shift| N | M | ~ | ` | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | _ | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_W), S(KC_E), S(KC_R), S(KC_T), CNTR_TL, CNTR_TR, S(KC_Y), S(KC_U), S(KC_I), S(KC_O), S(KC_P), + S(KC_A), S(KC_S), S(KC_D), S(KC_F), S(KC_G), CNTR_HL, CNTR_HR, S(KC_H), S(KC_J), S(KC_K), S(KC_L), TD_COLN, + S(KC_Z), S(KC_X), S(KC_C), S(KC_V), S(KC_B), CNTR_BL, CNTR_BR, S(KC_N), S(KC_M), TD_TILD, TD_GRV, TD_DQOT, + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_UNDS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + diff --git a/keyboards/planck/keymaps/altgr/readme.md b/keyboards/planck/keymaps/altgr/readme.md new file mode 100644 index 000000000000..58f73e3b445a --- /dev/null +++ b/keyboards/planck/keymaps/altgr/readme.md @@ -0,0 +1,10 @@ +# The sdothum extended Default Planck Layout + +- Colemak-DH layout layer with shift/tab key overlays +- Number and symbol/function key layer +- Hexadecimal keypad layer +- Navigation keypad layer +- Dynamic macro layer +- Autocompletion tap key pairs (),[],{} +- Normalized enter and esc key position across keyboard layers +- Extensive use of tap keys diff --git a/keyboards/planck/keymaps/altgr/rules.mk b/keyboards/planck/keymaps/altgr/rules.mk new file mode 100644 index 000000000000..ea9abc2a80df --- /dev/null +++ b/keyboards/planck/keymaps/altgr/rules.mk @@ -0,0 +1,23 @@ +# Build Options: +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically + +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # mouse keys(+4700) +EXTRAKEY_ENABLE = no # audio control and System control(+450) +CONSOLE_ENABLE = no # console for debug(+400) +COMMAND_ENABLE = no # commands for debug and configuration +NKRO_ENABLE = yes # nkey rollover +BACKLIGHT_ENABLE = no # enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # audio output on port C6 +UNICODE_ENABLE = no # unicode +BLUETOOTH_ENABLE = no # enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # enable WS2812 RGB underlight, do not enable this with audio at the same time. +STENO_ENABLE = yes # enable TX Bolt protocol, requires VIRTSER and may not work with mouse keys + +# do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # breathing sleep LED during USB suspend + +TAP_DANCE_ENABLE = yes # enable double tap completion of (),[],{} + diff --git a/keyboards/planck/keymaps/am/config.h b/keyboards/planck/keymaps/am/config.h new file mode 100644 index 000000000000..fa27834f9831 --- /dev/null +++ b/keyboards/planck/keymaps/am/config.h @@ -0,0 +1,35 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/am/keymap.c b/keyboards/planck/keymaps/am/keymap.c new file mode 100644 index 000000000000..000aeed1d620 --- /dev/null +++ b/keyboards/planck/keymaps/am/keymap.c @@ -0,0 +1,204 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum planck_layers { + _QWERTY, + _COLEMAK, + _LOWER, + _RAISE, + _TOUCHCURSOR, + _MOUSE, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + LOWER, + RAISE, +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +// Taps +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctr +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor +#define LT_ML LT(_MOUSE, KC_A) // L-ayer T-ap M-ouse C-ursor (on A) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,--------------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |--------+------+------+------+------+-------------+------+------+------+------+-------| + * |Ctrl/Esc| ML/A | S | D | F | G | H | J | K | L | ; | " | + * |--------+------+------+------+------+------|------+------+------+------+------+-------| + * | Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent| + * |--------+------+------+------+------+------+------+------+------+------+------+-------| + * | Power | ~ | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play | + * `--------------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + CTL_ESC, LT_ML, 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, SFT_ENT, + KC_CAPS, KC_TILD, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Colemak + * ,-------------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |--------+------+------+------+------+-------------+------+------+------+------+------| + * |Ctrl/Esc| ML/A | R | S | T | D | H | N | E | I | O | " | + * |--------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift | Z | X | C | V | B | K | M | , | . | / |Enter | + * |--------+------+------+------+------+------+------+------+------+------+------+------| + * | Power | ~ | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + CTL_ESC, LT_ML, 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_CAPS, KC_TILD, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | F1 | F2 | F3 | F4 | F5 | F6 | - | + | { | } | ` | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | \ | F7 | F8 | F9 | F10 | F11 | F12 | _ | = | [ | ] | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Sleep | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_PIPE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_PLUS, KC_LCBR, KC_RCBR, KC_GRV, + KC_BSLS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_SLSH, + KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ^ | 4 | 5 | 6 | . | + | * | 4 | 5 | 6 | - | $ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | = | 7 | 8 | 9 | 0 | - | / | 1 | 2 | 3 | . |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Sleep | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_CIRC, KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_ASTR, KC_4, KC_5, KC_6, KC_MINS, KC_DLR, + KC_EQL, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_SLSH, KC_1, KC_2, KC_3, KC_DOT, KC_ENT, + KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* TouchCursor layer (http://martin-stone.github.io/touchcursor/) plus personal customizations + * ,-----------------------------------------------------------------------------------. + * | | | |Shift | GUI | ~ |Insert| Home | Up | End | Bksp | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Alt |Space | | Find |Again | PgUp | Left | Down |Right | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Undo | Cut | Copy |Paste | ` | PgDn | Del | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + * + * The KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND, and KC_AGAIN keycodes don't + * seem to work on Mac. Presumably they'll work under Windows. + */ + +[_TOUCHCURSOR] = LAYOUT_planck_grid( + _______, _______, _______, KC_LSFT, KC_LGUI, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______, + _______, KC_LALT, KC_SPC, _______, KC_FIND,KC_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + _______, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE,KC_GRV, KC_PGDN, KC_DEL, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Mouse Layer + * ,-----------------------------------------------------------------------------------. + * | | |ACCL0 |ACCL1 |ACCL2 |ACCL2 | |WHL_L | Up |WHL_R | BTN2 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | BTN3 | BTN1 | BTN4 |WHL_Up| Left | Down |Right | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | BTN2 | BTN5 |WHL_Dn| BTN1 | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_MOUSE] = LAYOUT_planck_grid( + _______, _______, KC_ACL0, KC_ACL1, KC_ACL2, KC_ACL2, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, _______, + _______, _______, _______, KC_BTN3, KC_BTN1, KC_BTN4, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, + _______, _______, _______, _______, KC_BTN2, KC_BTN5, KC_WH_D, KC_BTN1, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk| | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + } + return true; +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/am/readme.md b/keyboards/planck/keymaps/am/readme.md new file mode 100644 index 000000000000..6e0601bf22e1 --- /dev/null +++ b/keyboards/planck/keymaps/am/readme.md @@ -0,0 +1,17 @@ +# The Am Planck Layout + +Heavily inspired by other layouts out there, and fine tuned to work well on emacs (most recently spacemacs with vim bindings). + +It features: + +- Media keys (bottom right) +- Focused on Qwerty and Colemak +- Number pads (normal and reversed) +- TouchCursor layer +- Mouse layer + +## Build + +Making planck/rev4 with keymap am and target dfu + + make planck/rev4:am:dfu diff --git a/keyboards/planck/keymaps/am/rules.mk b/keyboards/planck/keymaps/am/rules.mk new file mode 100644 index 000000000000..696abda39d04 --- /dev/null +++ b/keyboards/planck/keymaps/am/rules.mk @@ -0,0 +1,10 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +AUDIO_ENABLE = yes # Audio output on port C6 diff --git a/keyboards/planck/keymaps/andylikescandy/config.h b/keyboards/planck/keymaps/andylikescandy/config.h new file mode 100644 index 000000000000..ad5c99081fac --- /dev/null +++ b/keyboards/planck/keymaps/andylikescandy/config.h @@ -0,0 +1,40 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +#define PERMISSIVE_HOLD + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif diff --git a/keyboards/planck/keymaps/andylikescandy/keymap.c b/keyboards/planck/keymaps/andylikescandy/keymap.c new file mode 100644 index 000000000000..367287423c79 --- /dev/null +++ b/keyboards/planck/keymaps/andylikescandy/keymap.c @@ -0,0 +1,287 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST, + _NAVIGATION +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define _NAVIGATION 8 +#define NAVL MO(_NAVIGATION) +#define NAVSPC LT( 8, KC_SPC) +//#define SHFTENT SHFT_T(KC_ENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | CS | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT_planck_grid( + 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, SFT_T(KC_ENT) , + KC_LCTL, LCTL(KC_LSFT), KC_LGUI, KC_LALT, LOWER, NAVSPC, NAVSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + /* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |SftEnt| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | CS | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_COLEMAK] = LAYOUT_planck_grid( + 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, SFT_T(KC_ENT) , + KC_LCTL, LCTL(KC_LSFT), KC_LGUI, KC_LALT, LOWER, NAVSPC, NAVSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + /* Dvorak REUSED AS COLEMAK + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | CS | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_QUOT, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_ENT) , + KC_LCTL, LCTL(KC_LSFT), KC_LGUI, KC_LALT, LOWER, NAVSPC, NAVSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + // /* Dvorak + // * ,-----------------------------------------------------------------------------------. + // * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + // * |------+------+------+------+------+-------------+------+------+------+------+------| + // * | Esc | A | O | E | U | I | D | H | T | N | S | / | + // * |------+------+------+------+------+------|------+------+------+------+------+------| + // * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + // * |------+------+------+------+------+------+------+------+------+------+------+------| + // * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + // * `-----------------------------------------------------------------------------------' + // */ + // [_DVORAK] = LAYOUT_planck_grid( + // KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + // KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + // KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + // BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, NAVSPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + // ), +// +// /* Lower +// * ,-----------------------------------------------------------------------------------. +// * | ~ | F7 | F8 | F9 | F10 | F11 | F12 | _ | + | { | } | Bksp | +// * |------+------+------+------+------+-------------+------+------+------+------+------| +// * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | | | +// * |------+------+------+------+------+------|------+------+------+------+------+------| +// * | |Ctl+z |Ctl+x |Ctl+c |Ctl+v | | | | | | |Enter | +// * |------+------+------+------+------+------+------+------+------+------+------+------| +// * | | | | | | | | HOME | PGDN | PGUP | END | +// * `-----------------------------------------------------------------------------------' +// */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSPC , + KC_DEL , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_PIPE , + _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), _______, _______, _______, _______, _______, _______, KC_ENT , + _______, _______, _______, _______, _______, KC_SPC, KC_SPC, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Raise +* ,-----------------------------------------------------------------------------------. +* | ` | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | Del | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | | | | | | | | | | | |Enter | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | | | | | | | | HOME | PGDN | PGUP | END | +* `-----------------------------------------------------------------------------------' +*/ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC , + KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT , + _______, _______, _______, _______, _______, KC_SPC, KC_SPC, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | Reset| | | | | | | | | | | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |C.A.D.| | | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | CAPS | | | | | | |Insert|PntScn|Scroll|Pause | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | |Qwerty|Colemk|Dvorak|Plover| + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX , + LALT(LCTL(KC_DEL)), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_CAPS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, KC_PSCR, KC_SCRL, KC_PAUS, XXXXXXX, + _______, _______, _______, _______, _______, _______, _______, _______, QWERTY, COLEMAK, DVORAK, XXXXXXX //PLOVER +), +/* Navigation +* ,-----------------------------------------------------------------------------------. +* | | | | | | | | Home | PgDn | PgUp | End |ctlBsp| +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | Del |Ctl+A | |Shift | Ctrl | | | Left | Down | Up |Right | Del | +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | C+S |Ctl+z |Ctl+x |Ctl+c |Ctl+v | | | |Shift |Shift |Shift |Enter | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* |C+A+S | | | | | | |C+Left|C+Down| C+Up |C+Right| +* `-----------------------------------------------------------------------------------' +*/ +[_NAVIGATION] = LAYOUT_planck_grid( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_PGUP, KC_END, LCTL(KC_BSPC) , + KC_DEL, LCTL(KC_A), XXXXXXX, KC_LSFT, KC_LCTL, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_DEL, + LCTL(KC_LSFT), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RSFT, KC_RSFT, KC_RSFT, KC_ENT, + _______, _______, _______, _______, _______, _______, _______, LCTL(KC_LEFT), LCTL(KC_DOWN), LCTL(KC_UP), LCTL(KC_RGHT), _______ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + PORTE &= ~(1<<6); + } else { + unregister_code(KC_RSFT); + PORTE |= (1<<6); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/andylikescandy/readme.md b/keyboards/planck/keymaps/andylikescandy/readme.md new file mode 100644 index 000000000000..de9680b49851 --- /dev/null +++ b/keyboards/planck/keymaps/andylikescandy/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/angerthosenear/keymap.c b/keyboards/planck/keymaps/angerthosenear/keymap.c new file mode 100644 index 000000000000..6e9c69333e2c --- /dev/null +++ b/keyboards/planck/keymaps/angerthosenear/keymap.c @@ -0,0 +1,29 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_planck_grid( /* Qwerty */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, + KC_LCTL, KC_LGUI, KC_LALT, BL_STEP, MO(3), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + // Space is repeated to accommodate for both spacebar wiring positions +), +[1] = LAYOUT_planck_grid( /* WASD + NumPad */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_PSLS, KC_PMNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PAST, KC_PPLS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PDOT, KC_PENT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(3), KC_SPC, KC_P0, MO(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +), +[2] = LAYOUT_planck_grid( /* RAISE */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, DF(0), DF(1), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_TRNS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, MO(2), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), +[3] = LAYOUT_planck_grid( /* LOWER */ + S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_DEL, + KC_TRNS, DF(0), DF(1), 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, MO(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END +) +}; diff --git a/keyboards/planck/keymaps/angerthosenear/rules.mk b/keyboards/planck/keymaps/angerthosenear/rules.mk new file mode 100644 index 000000000000..d86b02fd1ce4 --- /dev/null +++ b/keyboards/planck/keymaps/angerthosenear/rules.mk @@ -0,0 +1,22 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/antosha417/config.h b/keyboards/planck/keymaps/antosha417/config.h new file mode 100644 index 000000000000..3ad322687aee --- /dev/null +++ b/keyboards/planck/keymaps/antosha417/config.h @@ -0,0 +1,33 @@ +// Copyright 2021 Anton Kavalkou (@antosha417) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +#define TAPPING_TERM 200 +#define COMBO_TERM 30 + diff --git a/keyboards/planck/keymaps/antosha417/keymap.c b/keyboards/planck/keymaps/antosha417/keymap.c new file mode 100644 index 000000000000..06bc0b86570b --- /dev/null +++ b/keyboards/planck/keymaps/antosha417/keymap.c @@ -0,0 +1,447 @@ +// Copyright 2021 Anton Kavalkou (@antosha417) +// SPDX-License-Identifier: GPL-2.0-or-later +#include QMK_KEYBOARD_H +#include "sendstring_dvorak.h" +#include "muse.h" + +enum layers { + _QWERTY, + _DVORAK, + _LOWER, + _RAISE, + _TOP, + _BOTTOM, + _ADJUST +}; + +float USSR_SONG[][2] = SONG(B__NOTE(_G6), + B__NOTE(_C7), W__NOTE(_G6), H__NOTE(_A6), + B__NOTE(_B6), W__NOTE(_E6), W__NOTE(_E6), + B__NOTE(_A6), W__NOTE(_G6), H__NOTE(_F6), + B__NOTE(_G6), W__NOTE(_C6), W__NOTE(_C6), + B__NOTE(_D6), W__NOTE(_D6), W__NOTE(_E6), + B__NOTE(_D6), W__NOTE(_D6), W__NOTE(_G6), + B__NOTE(_F6), W__NOTE(_G6), W__NOTE(_A6), + B__NOTE(_B6), + ); + +enum keycodes { + QWERTY = SAFE_RANGE, + + RUS_LANG, + EN_LANG, + HEB_LANG, + + BRUDERSCHAFT, + VIM_SAVE, + +#define MOD_TAP_KEY(keycode, tap_action, mod_on_action, mod_off_action) \ + keycode, +#include "mod_tap_keys.h" +#undef MOD_TAP_KEY +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define TOP MO(_TOP) +#define BOTTOM MO(_BOTTOM) +#define LANG TG(_DVORAK) +#define KC_CAD LALT(LCTL(KC_DEL)) +#define KC_CAH LALT(LCTL(KC_HOME)) + +#define E_SFT LSFT_T(KC_E) +#define D_SFT LSFT_T(KC_D) +#define A_ALT LALT_T(KC_A) +#define O_GUI LGUI_T(KC_O) +#define U_CTRL LCTL_T(KC_U) + +#define T_SFT RSFT_T(KC_T) +#define K_SFT RSFT_T(KC_K) +#define S_ALT RALT_T(KC_S) +#define N_GUI RGUI_T(KC_N) +#define H_CTRL RCTL_T(KC_H) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | | Q | W | E | R | T | Y | U | I | O | P | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | A | S | D | F | G | H | J | K | L | ; | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Z | X | C | V | B | N | M | , | . | / | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Bottom| SPC |Lower |Raise | SPC | TOP | | | | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + _______, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, _______, + _______, A_ALTQ, S_GUIQ, D_SFT, F_CTLQ, KC_G, KC_H, J_CTLQ, K_SFT, L_GUIQ, SCLN_Q, _______, + _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, + _______, _______, _______, BOTTOM, KC_SPC, LOWER, RAISE, KC_SPC, TOP, _______, _______, _______ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | | ' | , | . | P | Y | F | G | C | R | L | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | A | O | E | U | I | D | H | T | N | S | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | ; | Q | J | K | X | B | M | W | V | Z | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______, + _______, A_ALT, O_GUI, E_SFT, U_CTRL, KC_I, KC_D, H_CTRL, T_SFT, N_GUI, S_ALT, _______, + _______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | F11 | _ | - | ~ | % | ' | | ^ | ` | \ | | | - | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | [ | { | + | ( | = | * | ) | ! | } | ] | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | CAD | CAH | | LANG | | | EN | HEB | RUS | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | RCTL | | | | [{}] | | | PSCR | PGDN | PGUP | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_F11, KC_UNDS, KC_MINS, KC_TILD, KC_PERC, KC_QUOT, _______, KC_CIRC, KC_GRV, KC_BSLS, KC_PIPE, KC_MINS, + KC_DEL, KC_LBRC, KC_LCBR, KC_PLUS, KC_LPRN, KC_EQL, KC_ASTR, KC_RPRN, KC_EXLM, KC_RCBR, KC_RBRC, KC_BSPC, + _______, KC_CAD, KC_CAH, _______, LANG, _______, _______, HEB_LANG, EN_LANG, RUS_LANG, _______, _______, + _______, KC_RCTL, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_PGDN, KC_PGUP, _______ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | F11 | | | $ | & | | : | ? | @ | # | / | F12 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | 7 | 5 | 3 | 1 | 9 | 0 | 2 | 4 | 6 | 8 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F5 | F3 | F1 | F9 | F10 | F2 | F4 | F6 | F8 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | [{}] | | Vol- | End | Home | Vol+ | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_F11, _______, _______, KC_DLR, KC_AMPR, _______, KC_COLON, KC_QUES, KC_AT, KC_HASH, KC_SLSH, KC_F12, + _______, KC_7, KC_5, KC_3, KC_1, KC_9, KC_0, KC_2, KC_4, KC_6, KC_8, KC_BSPC, + _______, KC_F7, KC_F5, KC_F3, KC_F1, KC_F9, KC_F10, KC_F2, KC_F4, KC_F6, KC_F8, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_END, KC_HOME, KC_VOLU +), + +/* TOP + * ,----------------------------------------------------------------------------------- + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | Down | Up | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | [{}] | | | | + * `-----------------------------------------------------------------------------------' + */ +[_TOP] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, KC_DOWN, KC_UP, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* BOTTOM + * ,----------------------------------------------------------------------------------- + * | | | | | | | | | | | -> | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | <- | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | vold | volu | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | [{}] | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_BOTTOM] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RGHT, _______, + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Adjust (Lower + Raise) + * v------------------------RGB CONTROL--------------------v + * ,----------------------------------------------------------------------------------- + * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Aud on|Audoff| | | | | | |Dvorak| | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Mus on|Musoff| | | | | | | | | USSR | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | [{}] | [{}] | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, AU_ON, AU_OFF, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, MU_ON, MU_OFF, _______, _______, _______, _______, _______, _______, _______, _______, BRUDERSCHAFT, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +void keyboard_post_init_user(void) { + layer_on(_DVORAK); +} + +void set_english_language(void) { + layer_on(_DVORAK); + SEND_STRING(SS_LSFT(SS_LCTL(SS_LGUI(SS_TAP(X_1))))); +} + +void set_russian_language(void) { + layer_off(_DVORAK); + SEND_STRING(SS_LSFT(SS_LCTL(SS_LGUI(SS_TAP(X_2))))); +} + +void set_hebrew_language(void) { + layer_off(_DVORAK); + SEND_STRING(SS_LSFT(SS_LCTL(SS_LGUI(SS_TAP(X_3))))); +} + + +#define CASE(keycode, key_pressed_action, key_released_action) \ + case (keycode): \ + if (record->event.pressed) { \ + key_pressed_action; \ + } else { \ + key_released_action; \ + } \ + return false; \ + break; + +#define CASE_PRESSED(keycode, key_pressed_action) CASE(keycode, key_pressed_action, {}); + +#define CASE_MOD_TAP_KEY(keycode, tap_action, mod_off_action) \ + CASE(keycode, { \ + keycode ## _TIMER = timer_read(); \ + IS_ ## keycode ## _ACTIVE = true; \ + }, { \ + if(IS_ ## keycode ## _MOD_ACTIVE) { \ + mod_off_action; \ + } else if (IS_ ## keycode ## _ACTIVE) { \ + tap_action; \ + } \ + IS_ ## keycode ## _MOD_ACTIVE = false; \ + IS_ ## keycode ## _ACTIVE = false; \ + }); + +#define MOD_TAP_KEY(keycode, tap_action, mod_on_action, mod_off_action) \ +uint16_t keycode ## _TIMER = 0; \ +bool IS_ ## keycode ## _ACTIVE = false; \ +bool IS_ ## keycode ## _MOD_ACTIVE = false; +#include "mod_tap_keys.h" +#undef MOD_TAP_KEY + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + CASE_PRESSED(BRUDERSCHAFT, PLAY_SONG(USSR_SONG)); + + CASE_PRESSED(EN_LANG, set_english_language()); + CASE_PRESSED(RUS_LANG, set_russian_language()); + CASE_PRESSED(HEB_LANG, set_hebrew_language()); + + CASE_PRESSED(VIM_SAVE, {set_english_language(); SEND_STRING(SS_TAP(X_ESC)SS_LSFT(SS_TAP(X_SCLN))SS_TAP(X_W)SS_TAP(X_ENT));}); + + #define MOD_TAP_KEY(keycode, tap_action, mod_on_action, mod_off_action) \ + CASE_MOD_TAP_KEY(keycode, tap_action, mod_off_action); + #include "mod_tap_keys.h" + #undef MOD_TAP_KEY + } + + #define MOD_TAP_KEY(keycode, tap_action, mod_on_action, mod_off_action) \ + if (IS_ ## keycode ## _ACTIVE && !IS_ ## keycode ## _MOD_ACTIVE) { \ + if (timer_elapsed(keycode ## _TIMER) <= TAPPING_TERM) { \ + tap_action; \ + IS_ ## keycode ## _ACTIVE = false; \ + } \ + } + #include "mod_tap_keys.h" + #undef MOD_TAP_KEY + + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return false; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } + return true; +} + +void matrix_scan_user(void) { + #define MOD_TAP_KEY(keycode, tap_action, mod_on_action, mod_off_action) \ + if (IS_ ## keycode ## _ACTIVE) { \ + if (timer_elapsed(keycode ## _TIMER) > TAPPING_TERM) { \ + mod_on_action; \ + IS_ ## keycode ## _MOD_ACTIVE = true; \ + } \ + } + #include "mod_tap_keys.h" + #undef MOD_TAP_KEY + + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +enum combo_events { + // combos for dvorak layer + RU_COMBO, + EN_COMBO, + HEB_COMBO, + ESC_COMBO, + TAB_COMBO, + ENT_COMBO, + DEL_COMBO, + SAVE_COMBO, + BSPC_COMBO, + BSPCW_COMBO, + + // combos for qwerty layer + RUQ_COMBO, + ENQ_COMBO, + HEBQ_COMBO, + ESCQ_COMBO, + TABQ_COMBO, + ENTQ_COMBO, + DELQ_COMBO, + SAVEQ_COMBO, + BSPCQ_COMBO, + BSPCWQ_COMBO +}; + +const uint16_t PROGMEM ru_combo[] = {KC_R, U_CTRL, COMBO_END}; +const uint16_t PROGMEM en_combo[] = {U_CTRL, S_ALT, COMBO_END}; +const uint16_t PROGMEM heb_combo[] = {KC_I, KC_V, COMBO_END}; +const uint16_t PROGMEM esc_combo[] = {H_CTRL, U_CTRL, COMBO_END}; +const uint16_t PROGMEM tab_combo[] = {T_SFT, A_ALT, COMBO_END}; +const uint16_t PROGMEM ent_combo[] = {E_SFT, N_GUI, COMBO_END}; +const uint16_t PROGMEM del_combo[] = {KC_D, E_SFT, COMBO_END}; +const uint16_t PROGMEM bspc_combo[] = {KC_C, H_CTRL, COMBO_END}; +const uint16_t PROGMEM bspcw_combo[] = {N_GUI, U_CTRL, COMBO_END}; +const uint16_t PROGMEM save_combo[] = {O_GUI, H_CTRL, COMBO_END}; + +const uint16_t PROGMEM ruq_combo[] = {KC_O, F_CTLQ, COMBO_END}; +const uint16_t PROGMEM enq_combo[] = {F_CTLQ, SCLN_Q, COMBO_END}; +const uint16_t PROGMEM hebq_combo[] = {KC_G, KC_DOT, COMBO_END}; +const uint16_t PROGMEM escq_combo[] = {F_CTLQ, J_CTLQ, COMBO_END}; +const uint16_t PROGMEM tabq_combo[] = {K_SFT, A_ALTQ, COMBO_END}; +const uint16_t PROGMEM entq_combo[] = {D_SFT, L_GUIQ, COMBO_END}; +const uint16_t PROGMEM delq_combo[] = {KC_H, D_SFT, COMBO_END}; +const uint16_t PROGMEM bspcq_combo[] = {KC_I, J_CTLQ, COMBO_END}; +const uint16_t PROGMEM bspcwq_combo[] = {L_GUIQ, F_CTLQ, COMBO_END}; +const uint16_t PROGMEM saveq_combo[] = {S_GUIQ, J_CTLQ, COMBO_END}; + +combo_t key_combos[] = { + [RU_COMBO] = COMBO(ru_combo, RUS_LANG), + [EN_COMBO] = COMBO(en_combo, EN_LANG), + [HEB_COMBO] = COMBO(heb_combo, HEB_LANG), + [ESC_COMBO] = COMBO(esc_combo, KC_ESC), + [TAB_COMBO] = COMBO(tab_combo, KC_TAB), + [ENT_COMBO] = COMBO(ent_combo, KC_ENT), + [DEL_COMBO] = COMBO(del_combo, KC_DEL), + [BSPC_COMBO] = COMBO(bspc_combo, KC_BSPC), + [SAVE_COMBO] = COMBO(save_combo, VIM_SAVE), + [BSPCW_COMBO] = COMBO(bspcw_combo, A(KC_BSPC)), + + [RUQ_COMBO] = COMBO(ruq_combo, RUS_LANG), + [ENQ_COMBO] = COMBO(enq_combo, EN_LANG), + [HEBQ_COMBO] = COMBO(hebq_combo, HEB_LANG), + [ESCQ_COMBO] = COMBO(escq_combo, KC_ESC), + [TABQ_COMBO] = COMBO(tabq_combo, KC_TAB), + [ENTQ_COMBO] = COMBO(entq_combo, KC_ENT), + [DELQ_COMBO] = COMBO(delq_combo, KC_DEL), + [BSPCQ_COMBO] = COMBO(bspcq_combo, KC_BSPC), + [SAVEQ_COMBO] = COMBO(saveq_combo, VIM_SAVE), + [BSPCWQ_COMBO] = COMBO(bspcwq_combo, A(KC_BSPC)), +}; diff --git a/keyboards/planck/keymaps/antosha417/mod_tap_keys.h b/keyboards/planck/keymaps/antosha417/mod_tap_keys.h new file mode 100644 index 000000000000..aa82f9692cc0 --- /dev/null +++ b/keyboards/planck/keymaps/antosha417/mod_tap_keys.h @@ -0,0 +1,14 @@ +// Copyright 2021 Anton Kavalkou (@antosha417) +// SPDX-License-Identifier: GPL-2.0-or-later + +// MOD_TAP_KEY(key, tap_action, mod_on_action, mod_off_action) + +MOD_TAP_KEY(S_GUIQ, tap_code(KC_S), {layer_on(_DVORAK); register_code(KC_LGUI);}, {layer_off(_DVORAK); unregister_code(KC_LGUI);}) +MOD_TAP_KEY(L_GUIQ, tap_code(KC_L), {layer_on(_DVORAK); register_code(KC_RGUI);}, {layer_off(_DVORAK); unregister_code(KC_RGUI);}) + +MOD_TAP_KEY(F_CTLQ, tap_code(KC_F), {layer_on(_DVORAK); register_code(KC_LCTL);}, {layer_off(_DVORAK); unregister_code(KC_LCTL);}) +MOD_TAP_KEY(J_CTLQ, tap_code(KC_J), {layer_on(_DVORAK); register_code(KC_RCTL);}, {layer_off(_DVORAK); unregister_code(KC_RCTL);}) + +MOD_TAP_KEY(A_ALTQ, tap_code(KC_A), {layer_on(_DVORAK); register_code(KC_LALT);}, {layer_off(_DVORAK); unregister_code(KC_LALT);}) +MOD_TAP_KEY(SCLN_Q, tap_code(KC_SCLN), {layer_on(_DVORAK); register_code(KC_RALT);}, {layer_off(_DVORAK); unregister_code(KC_RALT);}) + diff --git a/keyboards/planck/keymaps/antosha417/readme.md b/keyboards/planck/keymaps/antosha417/readme.md new file mode 100644 index 000000000000..a7adbf74bbf3 --- /dev/null +++ b/keyboards/planck/keymaps/antosha417/readme.md @@ -0,0 +1,11 @@ +# How to install: + + make planck/rev6:antosha417:flash + +# Useful: + * [keycodes](https://docs.qmk.fm/#/keycodes) + * [string keycodes](https://github.com/qmk/qmk_firmware/blob/master/quantum/send_string_keycodes.h) + +# Todo: + [ ] sync with corne + diff --git a/keyboards/planck/keymaps/antosha417/rules.mk b/keyboards/planck/keymaps/antosha417/rules.mk new file mode 100644 index 000000000000..469769525216 --- /dev/null +++ b/keyboards/planck/keymaps/antosha417/rules.mk @@ -0,0 +1,4 @@ +SRC += muse.c +AUDIO_ENABLE = yes +COMBO_ENABLE = yes + diff --git a/keyboards/planck/keymaps/ariccb/.vscode/settings.json b/keyboards/planck/keymaps/ariccb/.vscode/settings.json new file mode 100644 index 000000000000..31e9436a777b --- /dev/null +++ b/keyboards/planck/keymaps/ariccb/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "select_word.h": "c" + } +} \ No newline at end of file diff --git a/keyboards/planck/keymaps/ariccb/config.h b/keyboards/planck/keymaps/ariccb/config.h new file mode 100644 index 000000000000..e9fcc865fac4 --- /dev/null +++ b/keyboards/planck/keymaps/ariccb/config.h @@ -0,0 +1,55 @@ +/* Copyright 2015-2021 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE +# define STARTUP_SONG SONG(PLANCK_SOUND) +// #define STARTUP_SONG SONG(NO_SOUND) + +# define DEFAULT_LAYER_SONGS \ + { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND) } +#endif +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +#define TAPPING_TERM 150 +#define TAPPING_TERM_PER_KEY +// #define HOLD_ON_OTHER_KEY_PRESS + +#define COMBO_TERM 20 + + + +#define MOUSEKEY_INTERVAL 16 //Time between cursor movements in milliseconds. + //If the refresh rate of your display is 60Hz, you could set it to 16 (1/60). As this raises the cursor speed significantly, you may want to lower MOUSEKEY_MAX_SPEED +#define MOUSEKEY_MAX_SPEED 8 //Maximum cursor speed at which acceleration stops +#define MOUSEKEY_TIME_TO_MAX 50 //Time until maximum scroll speed is reached +#define MOUSEKEY_DELAY 100 //Delay between pressing a movement key and cursor movement +#define MOUSEKEY_MOVE_DELTA 8 //Step size diff --git a/keyboards/planck/keymaps/ariccb/features/caps_word.c b/keyboards/planck/keymaps/ariccb/features/caps_word.c new file mode 100644 index 000000000000..c37e65d28a05 --- /dev/null +++ b/keyboards/planck/keymaps/ariccb/features/caps_word.c @@ -0,0 +1,122 @@ +// Copyright 2021-2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// For full documentation, see +// https://getreuer.info/posts/keyboards/caps-word + +#include "caps_word.h" + +static bool caps_word_active = false; + +bool process_caps_word(uint16_t keycode, keyrecord_t* record) { +#ifndef NO_ACTION_ONESHOT + const uint8_t mods = get_mods() | get_oneshot_mods(); +#else + const uint8_t mods = get_mods(); +#endif // NO_ACTION_ONESHOT + + if (!caps_word_active) { + // Pressing both shift keys at the same time enables caps word. + if ((mods & MOD_MASK_SHIFT) == MOD_MASK_SHIFT) { + caps_word_set(true); // Activate Caps Word. + return false; + } + return true; + } + + if (!record->event.pressed) { return true; } + + if (!(mods & ~MOD_MASK_SHIFT)) { + switch (keycode) { + // Ignore MO, TO, TG, TT, and OSL layer switch keys. + case QK_MOMENTARY ... QK_MOMENTARY + 255: + case QK_TO ... QK_TO + 255: + case QK_TOGGLE_LAYER ... QK_TOGGLE_LAYER + 255: + case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE + 255: + case QK_ONE_SHOT_LAYER ... QK_ONE_SHOT_LAYER + 255: + return true; + +#ifndef NO_ACTION_TAPPING + case QK_MOD_TAP ... QK_MOD_TAP_MAX: + if (record->tap.count == 0) { + // Deactivate if a mod becomes active through holding a mod-tap key. + caps_word_set(false); + return true; + } + keycode &= 0xff; + break; + +#ifndef NO_ACTION_LAYER + case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: +#endif // NO_ACTION_LAYER + if (record->tap.count == 0) { return true; } + keycode &= 0xff; + break; +#endif // NO_ACTION_TAPPING + +#ifdef SWAP_HANDS_ENABLE + case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX: + if (keycode > 0x56F0 || record->tap.count == 0) { return true; } + keycode &= 0xff; + break; +#endif // SWAP_HANDS_ENABLE + } + + if (caps_word_press_user(keycode)) { + return true; + } + } + + caps_word_set(false); // Deactivate Caps Word. + return true; +} + +void caps_word_set(bool active) { + if (active != caps_word_active) { + if (active) { + clear_mods(); +#ifndef NO_ACTION_ONESHOT + clear_oneshot_mods(); +#endif // NO_ACTION_ONESHOT + } + + caps_word_active = active; + caps_word_set_user(active); + } +} + +bool caps_word_get(void) { return caps_word_active; } + +__attribute__((weak)) void caps_word_set_user(bool active) {} + +__attribute__((weak)) bool caps_word_press_user(uint16_t keycode) { + switch (keycode) { + // Keycodes that continue Caps Word, with shift applied. + case KC_A ... KC_Z: + add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to the next key. + return true; + + // Keycodes that continue Caps Word, without shifting. + case KC_1 ... KC_0: + case KC_P1 ... KC_P0: + case KC_BSPC: + case KC_MINS: + case KC_UNDS: + return true; + + default: + return false; // Deactivate Caps Word. + } +} \ No newline at end of file diff --git a/keyboards/planck/keymaps/ariccb/features/caps_word.h b/keyboards/planck/keymaps/ariccb/features/caps_word.h new file mode 100644 index 000000000000..523c81515747 --- /dev/null +++ b/keyboards/planck/keymaps/ariccb/features/caps_word.h @@ -0,0 +1,101 @@ +// Copyright 2021-2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// Caps Word, activated by pressing both shift keys at the same time. +// +// This library implements "Caps Word", which is like conventional Caps Lock, +// but automatically disables itself at the end of the word. This is useful for +// typing all-caps identifiers like `MOD_MASK_ALT`. +// +// Caps Word is activated by pressing the left and right shift keys at the same +// time. This way you don't need a dedicated key for using Caps Word. I've +// tested that this works as expected with one-shot mods and Space Cadet Shift. +// If your shift keys are mod-taps, activate Caps Word by holding both shift +// mod-tap keys until the tapping term, release them, then begin typing. +// +// For full documentation, see +// https://getreuer.info/posts/keyboards/caps-word + +#pragma once + +#include QMK_KEYBOARD_H + +// Call this function from `process_record_user()` to implement Caps Word. +bool process_caps_word(uint16_t keycode, keyrecord_t* record); + +// Activates or deactivates Caps Word. For instance activate Caps Word with a +// combo by defining a `COMBO_ACTION` that calls `caps_word_set(true)`: +// +// void process_combo_event(uint16_t combo_index, bool pressed) { +// switch(combo_index) { +// case CAPS_COMBO: +// if (pressed) { +// caps_word_set(true); // Activate Caps Word. +// } +// break; +// +// // Other combos... +// } +// } +void caps_word_set(bool active); + +// Returns whether Caps Word is currently active. +bool caps_word_get(void); + +// An optional callback that gets called when Caps Word turns on or off. This is +// useful to represent the current Caps Word state, e.g. by setting an LED or +// playing a sound. In your keymap, define +// +// void caps_word_set_user(bool active) { +// if (active) { +// // Do something when Caps Word activates. +// } else { +// // Do something when Caps Word deactivates. +// } +// } +void caps_word_set_user(bool active); + +// An optional callback which is called on every key press while Caps Word is +// active. When the key should be shifted (that is, a letter key), the callback +// should call `add_weak_mods(MOD_BIT(KC_LSFT))` to shift the key. The callback +// also determines whether the key should continue Caps Word. Returning true +// continues the current "word", while returning false is "word breaking" and +// deactivates Caps Word. The default callback is +// +// bool caps_word_press_user(uint16_t keycode) { +// switch (keycode) { +// // Keycodes that continue Caps Word, with shift applied. +// case KC_A ... KC_Z: +// add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to the next key. +// return true; +// +// // Keycodes that continue Caps Word, without shifting. +// case KC_1 ... KC_0: +// case KC_BSPC: +// case KC_MINS: +// case KC_UNDS: +// return true; +// +// default: +// return false; // Deactivate Caps Word. +// } +// } +// +// To customize, copy the above function into your keymap and add/remove +// keycodes to the above cases. +// +// NOTE: Outside of this callback, you can use `caps_word_set(false)` to +// deactivate Caps Word. +bool caps_word_press_user(uint16_t keycode); \ No newline at end of file diff --git a/keyboards/planck/keymaps/ariccb/features/select_word.c b/keyboards/planck/keymaps/ariccb/features/select_word.c new file mode 100644 index 000000000000..c0ffe0a90d05 --- /dev/null +++ b/keyboards/planck/keymaps/ariccb/features/select_word.c @@ -0,0 +1,110 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// For full documentation, see +// https://getreuer.info/posts/keyboards/select-word + +#include "select_word.h" + +// Mac users, uncomment this line: +// #define MAC_HOTKEYS + +enum { STATE_NONE, STATE_SELECTED, STATE_WORD, STATE_FIRST_LINE, STATE_LINE }; + +bool process_select_word(uint16_t keycode, keyrecord_t* record, + uint16_t sel_keycode) { + static uint8_t state = STATE_NONE; + + if (keycode == KC_LSFT || keycode == KC_RSFT) { return true; } + + if (keycode == sel_keycode && record->event.pressed) { // On key press. + const uint8_t mods = get_mods(); +#ifndef NO_ACTION_ONESHOT + const uint8_t all_mods = mods | get_oneshot_mods(); +#else + const uint8_t all_mods = mods; +#endif // NO_ACTION_ONESHOT + if ((all_mods & MOD_MASK_SHIFT) == 0) { // Select word. +#ifdef MAC_HOTKEYS + register_code(KC_LALT); +#else + register_code(KC_LCTL); +#endif // MAC_HOTKEYS + if (state == STATE_NONE) { + tap_code(KC_RGHT); + tap_code(KC_LEFT); + } + register_code(KC_LSFT); + register_code(KC_RGHT); + state = STATE_WORD; + } else { // Select line. + if (state == STATE_NONE) { + clear_mods(); +#ifndef NO_ACTION_ONESHOT + clear_oneshot_mods(); +#endif // NO_ACTION_ONESHOT +#ifdef MAC_HOTKEYS + register_code16(LCTL(KC_A)); + tap_code16(LSFT(KC_E)); + unregister_code16(LCTL(KC_A)); +#else + tap_code(KC_HOME); + tap_code16(LSFT(KC_END)); +#endif // MAC_HOTKEYS + set_mods(mods); + state = STATE_FIRST_LINE; + } else { + register_code(KC_DOWN); + state = STATE_LINE; + } + } + return false; + } + + // `sel_keycode` was released, or another key was pressed. + switch (state) { + case STATE_WORD: + unregister_code(KC_RGHT); + unregister_code(KC_LSFT); +#ifdef MAC_HOTKEYS + unregister_code(KC_LALT); +#else + unregister_code(KC_LCTL); +#endif // MAC_HOTKEYS + state = STATE_SELECTED; + break; + + case STATE_FIRST_LINE: + state = STATE_SELECTED; + break; + + case STATE_LINE: + unregister_code(KC_DOWN); + state = STATE_SELECTED; + break; + + case STATE_SELECTED: + if (keycode == KC_ESC) { + tap_code(KC_RGHT); + state = STATE_NONE; + return false; + } + // Fallthrough. + default: + state = STATE_NONE; + } + + return true; +} diff --git a/keyboards/planck/keymaps/ariccb/features/select_word.h b/keyboards/planck/keymaps/ariccb/features/select_word.h new file mode 100644 index 000000000000..f762ba117932 --- /dev/null +++ b/keyboards/planck/keymaps/ariccb/features/select_word.h @@ -0,0 +1,37 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// Select word/line button. +// +// Implements a button that selects the current word, assuming conventional text +// editor hotkeys. Pressing it again extends the selection to the following +// word. The effect is similar to word selection (W) in the Kakoune editor. +// +// Pressing the button with shift selects the current line, and pressing the +// button again extends the selection to the following line. +// +// Note for Mac users: Windows/Linux editing hotkeys are assumed by default. +// Uncomment the `#define MAC_HOTKEYS` line in select_word.c for Mac hotkeys. +// The Mac implementation is untested, let me know if it has problems. +// +// For full documentation, see +// https://getreuer.info/posts/keyboards/select-word + +#pragma once + +#include QMK_KEYBOARD_H + +bool process_select_word(uint16_t keycode, keyrecord_t* record, + uint16_t sel_keycode); diff --git a/keyboards/planck/keymaps/ariccb/keymap.c b/keyboards/planck/keymaps/ariccb/keymap.c new file mode 100644 index 000000000000..5caaf1922ed7 --- /dev/null +++ b/keyboards/planck/keymaps/ariccb/keymap.c @@ -0,0 +1,671 @@ + /* Copyright 2021 Aric Crosson Bouwers + * + * 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 QMK_KEYBOARD_H +#include "muse.h" +#include "features/select_word.h" +#include "features/caps_word.h" + +// using the Word Selection QMK Macro by Pascal Getreuer, found here: https://getreuer.info/posts/keyboards/select-word/index.html +// THANKS Pascal for such amazing functionality!! + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK_VCP 1 +#define _LOWER 2 +#define _RAISE 3 +#define _NUMPAD 4 +#define _FN 5 +#define _ADJUST 6 +#define _GAMING 7 + +#define MICMUTE LALT(KC_M) +#define DESKTR LGUI(LCTL(KC_RGHT)) // move one virtual desktop to the right +#define DESKTL LGUI(LCTL(KC_LEFT)) // move one virtual desktop to the left +#define MTLCTL_F9 MT(MOD_LCTL, KC_F9) +#define MTLSFT_F10 MT(MOD_LSFT, KC_F10) +#define MTLALT_F11 MT(MOD_LALT, KC_F11) +#define MTLGUI_Z MT(MOD_LGUI, KC_Z) +#define MTLALT_PL MT(MOD_LALT, KC_MPLY) +#define MTLALT_NXT MT(MOD_LALT, KC_MNXT) +#define MTENTER MT(MOD_LCTL, KC_ENT) +#define MTRSFTBSLS MT(MOD_RSFT, KC_BSLS) +#define MTRCTLQUO MT(MOD_RCTL, KC_QUOT) +#define MTTAB MT(MOD_LCTL | MOD_LGUI | MOD_LALT, KC_TAB) +#define LTESC LT(_FN, KC_ESC) +#define MTPLAY MT(MOD_RALT, KC_MPLY) +#define KC_COPY LCTL(KC_C) +#define KC_CUT LCTL(KC_X) +#define KC_PASTE LCTL(KC_V) +#define KC_WINPASTE LGUI(KC_V) +#define KC_PTXT LCTL(LSFT(KC_V)) +#define KC_UNDO LCTL(KC_Z) +#define KC_REDO LCTL(KC_Y) + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK_VCP, + LOWER, + RAISE, + FN, + ADJUST, + NUMPAD, + GAMING, + EXT_NUM, + EXT_GAMING, + SELWORD, + BRACES, + BRACES2, + ARROW, + ALT_TAB +}; + +// Define a type for as many tap dance states as you need +typedef enum { + TD_NONE, + TD_UNKNOWN, + TD_SINGLE_TAP, + TD_SINGLE_HOLD, + TD_DOUBLE_TAP +} td_state_t; + +typedef struct { + bool is_press_action; + td_state_t state; +} td_tap_t; + + // Our custom tap dance keys; add any other tap dance keys to this enum +enum { + UNDS_LOWER, + PLAY_RAISE +}; + +// Declare the functions to be used with your tap dance key(s) +// Function associated with all tap dances +td_state_t cur_dance(tap_dance_state_t *state); + +// Functions associated with individual tap dances +void usl_finished(tap_dance_state_t *state, void *user_data); +void usl_reset(tap_dance_state_t *state, void *user_data); + +/* ----------------------------------------------------------------------------------------------------------------------------- */ + +// This is a completely modified layout that stikes a balance between muscle memory for keys, where I was coming from a standard +// Qwerty keyboard, and efficiency gained by using layers. I've switched tab and esc because it's more natural to me this way, and +// added layer switch on hold functionality for each key. Enter has moved to the key beside LOWER, to allow usage while still having +// the right hand on the mouse. + +// Lower incorporates a numpad on the right side, and all of the symbols included on the left. There is logic for the symbols needed for +// calculators and math are located around the numpad, and coding symbols are placed in easy to remember spots. + +// CAPS has moved to the Fn layer, and a few additional shortcut modifiers like CTRL_ALT_UP and DOWN for adding additional cursors in VSCode. +// Play/Pause has a prime spot on the base layer, and the Fn version skips to next track + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* MIT Layout (QWERTY) + * + * ,------------------------------------------------------------------------. + * |FN,Esc| q | w | e | r | t | y | u | i | o | p |Bsp | + * |------------------------------------------------------------------------| + |CSW,Tab| a | s | d | f | g | h | j | k | l | ; |Ctl,'| + * |------------------------------------------------------------------------| + * |Shift |Win,z| x | c | v | b | n | m | , | . | / |Sft,\| + * |------------------------------------------------------------------------| + * | | | |Ctl,Ent|LOWER| Space |RAISE|Alt,Play| | | | + * `------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( /* QWERTY */ + LTESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + MTTAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MTRCTLQUO, + KC_LSFT, MTLGUI_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MTRSFTBSLS, + KC_NO, KC_NO, KC_NO, MTENTER, TD(UNDS_LOWER), KC_SPC, KC_SPC, MO(3), MTLALT_PL, KC_NO, KC_NO, KC_NO + ), + + /* MIT Layout (COLEMAK_VCP) + * + * ,------------------------------------------------------------------------. + * |FN,ESC| q | w | f | d | b | j | l | u | y | ; | Bsp | + * |------------------------------------------------------------------------| + |CSW,Tab| a | r | s | t | g | m | n | e | i | o |Ctl,'| + * |------------------------------------------------------------------------| + * |Shift |Win,z| x | v | c | p | k | h | , | . | / |Sft,\| + * |------------------------------------------------------------------------| + * | | | |Ctl,Ent|LWR,_| Space |RAISE|Alt,Play| | | | + * `------------------------------------------------------------------------' + */ +[_COLEMAK_VCP] = LAYOUT_planck_grid( /* COLEMAK_VCP */ + LTESC, KC_Q, KC_W, KC_F, KC_D, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + MTTAB, KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, MTRCTLQUO, + KC_LSFT, MTLGUI_Z, KC_X, KC_V, KC_C, KC_P, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, MTRSFTBSLS, + KC_NO, KC_NO, KC_NO, MTENTER, TD(UNDS_LOWER), KC_SPC, KC_SPC, MO(3), MTLALT_PL, KC_NO, KC_NO, KC_NO + ), + +/* MIT Layout (RAISE) + * + * ,----------------------------------------------------------------------------. + * | ~ | ! | | | | | | Cut | Undo| Redo|P2TXT| Bsp | + * |----------------------------------------------------------------------------| + * | |Menu | | | | |ARROW |SELWORD|Copy|Paste|WinPst| " | + * |----------------------------------------------------------------------------| + * | |Vol+ |Vol- | Mute| | |Braces|Braces2| < | > | ? | ! | + * |----------------------------------------------------------------------------| + * | | | | |Adjust| | | | | | | + * `----------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( /* RAISE */ + KC_TILD, KC_EXLM, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_CUT, KC_UNDO, KC_REDO, KC_PTXT, KC_BSPC, + KC_TRNS, KC_APP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ARROW, SELWORD, KC_COPY, KC_PASTE, KC_WINPASTE, KC_DQUO, + KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, BRACES, BRACES2, KC_LABK, KC_RABK, KC_QUES, KC_EXLM, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(6), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO +), + +/* MIT Layout (LOWER) + * XZ + * ,-----------------------------------------------------------------------. + * | ` | ! | # | $ | < | > | : | 7 | 8 | 9 | = | Bsp | + * |-----------------------------------------------------------------------| + * | ' | _ | ^ | % | ( | ) | M | 4 | 5 | 6 | - | + | + * |-----------------------------------------------------------------------| + * |Shift| | | & | " | { | } | @ | 1 | 2 | 3 | / | * | + * |-----------------------------------------------------------------------| + * | | | | | | |MO(6),0| . | | | | + * `-----------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( /* LOWER */ + KC_GRV, KC_EXLM, KC_HASH, KC_DLR, KC_LABK, KC_RABK, KC_COLN, KC_P7, KC_P8, KC_P9, KC_EQL, KC_BSPC, + KC_QUOT, KC_UNDS, KC_CIRC, KC_PERC, KC_LPRN, KC_RPRN, KC_M, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_PPLS, + KC_TRNS, KC_PIPE, KC_AMPR, KC_DQUO, KC_LCBR, KC_RCBR, KC_AT, KC_P1, KC_P2, KC_P3, KC_PSLS, KC_PAST, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P0, KC_PDOT, KC_NO, KC_NO, KC_NO +), + +/* MIT Layout (GAMING) + *. + * ,-----------------------------------------------------------------------. + * |ESC,`| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |EXIT GAMING| + * |-----------------------------------------------------------------------| + * | TAB | Q | W | E | R | T | I | 4 | 5 | 6 | - | + | + * |-----------------------------------------------------------------------| + * |Shift| A | S | D | F | G | K | 1 | 2 | 3 | / | * | + * |-----------------------------------------------------------------------| + * | | | | Ctl | Alt | SPACE | 0 | . | | | | + * `-----------------------------------------------------------------------' + */ +[_GAMING] = LAYOUT_planck_grid( /* GAMING */ + QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_P8, KC_9, KC_0, EXT_GAMING, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_I, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_PPLS, + KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_K, KC_P1, KC_P2, KC_P3, KC_PSLS, KC_PAST, + KC_NO, KC_NO, KC_NO, KC_LCTL, KC_LALT, KC_SPC, KC_SPC, KC_P0, KC_PDOT, KC_NO, KC_NO, KC_NO +), + +/* MIT Layout (FN) + * + * ,----------------------------------------------------------------------------. + * | |Ctl,F9 |Sft,F10|Alt,F11| F12 |MyComp|Calc |home | up | end |PrtScr| Del | + * |-----------------------------------------------------------------------------| + * | | F5 | F6 | F7 | F8 |DeskL |DeskR |left | down |right|ScrLck| CAPS| + * |-----------------------------------------------------------------------------| + * | | F1 | F2 | F3 | F4 |ALT_TAB|MicM |pgup |LCA_dn| pgdn|Pse/Brk| Ins| + * |-----------------------------------------------------------------------------| + * | | | | | | | |Alt,MNext| | | | + * `-----------------------------------------------------------------------------' + */ +[_FN] = LAYOUT_planck_grid( /* FUNCTION */ + KC_TRNS, MTLCTL_F9, MTLSFT_F10, MTLALT_F11, KC_F12, KC_MYCM, KC_CALC, KC_HOME, KC_UP, KC_END, KC_PSCR, KC_DEL, + KC_TRNS, KC_F5, KC_F6, KC_F7, KC_F8, DESKTL, DESKTR, KC_LEFT, KC_DOWN, KC_RGHT, KC_SCRL, KC_CAPS, + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, ALT_TAB, MICMUTE, KC_PGUP, LCA(KC_DOWN), KC_PGDN, KC_PAUSE, KC_INS, + KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MTLALT_NXT, KC_NO, KC_NO, KC_NO +), + +/* MIT Layout (ADJUST) + * + * ,-----------------------------------------------------------------------------. + * |RGBtog|Ms3 | Ms2 |MsUp | Ms1 | Hue+| Hue- | Sat+| Sat- |Brt+ |Brt- | Boot | + * |-----------------------------------------------------------------------------| + * |RGBMod| MWL | MsL |MDn |MsR |GAMING| |AU_ON|AU_OFF|MU_ON|MU_OF| Debug| + * |-----------------------------------------------------------------------------| + * | |MWLft|MWUp |NWDn |NWRght|QWERTY|CMK_VCP|MI_ON|MI_OF | | |MU_Mod| + * |-----------------------------------------------------------------------------| + * | | | |SLEEP| | | | | | | | + * `-----------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( /* ADJUST LAYER */ + RGB_TOG, KC_BTN3, KC_BTN2, KC_MS_U, KC_BTN1, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, QK_BOOT, + RGB_MOD, KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, GAMING, KC_NO, AU_ON, AU_OFF, MU_ON, MU_OFF, DB_TOGG, + KC_TRNS, KC_WH_L, KC_WH_U, KC_WH_D, KC_WH_R, QWERTY, COLEMAK_VCP, MI_ON, MI_OFF, KC_TRNS, KC_TRNS, MU_NEXT, + KC_NO, KC_NO, KC_NO, KC_SLEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO +) +}; + +#ifdef AUDIO_ENABLE +float layerswitch_song[][2] = SONG(PLANCK_SOUND); +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_COLEMAK_VCP[][2] = SONG(COLEMAK_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); + +#endif + +bool is_alt_tab_active = false; +layer_state_t layer_state_set_user(layer_state_t state) { + + static bool is_this_layer_on = false; + if (layer_state_cmp(state, 4) != is_this_layer_on) { + is_this_layer_on = layer_state_cmp(state, 4); + if (is_this_layer_on) { + PLAY_SONG(layerswitch_song); + } + else { + stop_all_notes(); + } + } + if (is_alt_tab_active) { + unregister_code(KC_LALT); + is_alt_tab_active = false; + } + return state; + + switch (get_highest_layer(state)) { + case _ADJUST: + rgblight_setrgb (0xFF, 0x00, 0x00); + break; + case _LOWER: + rgblight_setrgb (0x00, 0x00, 0xFF); + break; + case _NUMPAD: + rgblight_setrgb (0x00, 0x00, 0xFF); + break; + case _RAISE: + rgblight_setrgb (0x7A, 0x00, 0xFF); + break; + case _FN: + rgblight_setrgb (0x00, 0xFF, 0x00); + break; + default: // for any other layers, or the default layer + rgblight_setrgb (0xFF, 0xFF, 0xFF); + break; + } + return state; +} + +// void dance_media (tap_dance_state_t *state, void *user_data) +// if (state->count == 1) { +// tap_code(KC_MPLY); +// } else if (state->count == 2) { +// tap_code (KC_MNXT); +// } else if (state->count == 3) { +// tap_code(KC_MPRV); +// } else { +// reset_tap_dance (state); +// } +// } + +// tap_dance_action_t tap_dance_actions[] = { +// [0] = ACTION_TAP_DANCE_FN (dance_media), +// }; + +// Determine the current tap dance state +td_state_t cur_dance(tap_dance_state_t *state) { + if (state->interrupted) return TD_SINGLE_HOLD; + if (state->count == 1) { + if (!state->pressed) return TD_SINGLE_TAP; + else return TD_SINGLE_HOLD; + } else if (state->count == 2) return TD_DOUBLE_TAP; + else return TD_UNKNOWN; +} + +// Initialize tap structure associated with example tap dance key +static td_tap_t usl_tap_state = { + .is_press_action = true, + .state = TD_NONE +}; + +// Functions that control what our tap dance key does +void usl_finished(tap_dance_state_t *state, void *user_data) { + usl_tap_state.state = cur_dance(state); + switch (usl_tap_state.state) { + case TD_SINGLE_TAP: + tap_code16(KC_UNDS); + break; + case TD_SINGLE_HOLD: + layer_on(_LOWER); + // update_tri_layer(_LOWER, _RAISE, _ADJUST); + break; + case TD_DOUBLE_TAP: + // Check to see if the layer is already set + if (layer_state_is(_LOWER)) { + // If already set, then switch it off + layer_off(_LOWER); + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_goodbye); + #endif + } else { + // If not already set, then switch the layer on + layer_on(_LOWER); + #ifdef AUDIO_ENABLE + PLAY_SONG(layerswitch_song); + #endif + } + break; + default: + break; + } +} + +void usl_reset(tap_dance_state_t *state, void *user_data) { + // If the key was held down and now is released then switch off the layer + if (usl_tap_state.state == TD_SINGLE_HOLD) { + layer_off(_LOWER); + // update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + usl_tap_state.state = TD_NONE; +} + +// Associate our tap dance key with its functionality +tap_dance_action_t tap_dance_actions[] = { + [UNDS_LOWER] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, usl_finished, usl_reset) +}; + +uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case TD(UNDS_LOWER): + return 175; + default: + return TAPPING_TERM; + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_select_word(keycode, record, SELWORD)) { return false; } + if (!process_caps_word(keycode, record)) { return false; } + + const uint8_t mods = get_mods(); + const uint8_t oneshot_mods = get_oneshot_mods(); + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case KC_CAPS: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + register_code(KC_CAPS); + } + return false; + break; + case GAMING: + if (record->event.pressed) { + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_GAMING); + #ifdef AUDIO_ENABLE + PLAY_SONG(layerswitch_song); + #endif + } + return false; + break; + case EXT_GAMING: + if (record->event.pressed) { + layer_off(_GAMING); + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_goodbye); + #endif + } + return false; + break; + case COLEMAK_VCP: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK_VCP); + } + return false; + break; + case BRACES: // Types (), or {}, and puts cursor between braces. + if (record->event.pressed) { + clear_mods(); // Temporarily disable mods. + clear_oneshot_mods(); + if ((mods | oneshot_mods) & MOD_MASK_SHIFT) { + SEND_STRING("{}"); + } else { + SEND_STRING("<>"); + } + tap_code(KC_LEFT); // Move cursor between braces. + set_mods(mods); // Restore mods. + } + return false; + case BRACES2: // Types [], or <>, and puts cursor between braces. + if (record->event.pressed) { + clear_mods(); // Temporarily disable mods. + clear_oneshot_mods(); + if ((mods | oneshot_mods) & MOD_MASK_SHIFT) { + SEND_STRING("()"); + } else { + SEND_STRING("[]"); + } + tap_code(KC_LEFT); // Move cursor between braces. + set_mods(mods); // Restore mods. + } + return false; + case ARROW: // Arrow macro, types -> or =>. + if (record->event.pressed) { + if ((mods | oneshot_mods) & MOD_MASK_SHIFT) { // Is shift held? + del_mods(MOD_MASK_SHIFT); // Temporarily delete shift. + del_oneshot_mods(MOD_MASK_SHIFT); + SEND_STRING("->"); + set_mods(mods); // Restore mods. + } else { + SEND_STRING("=>"); + } + } + return false; + case ALT_TAB: // super alt tab macro + if (record->event.pressed) { + if (!is_alt_tab_active) { + is_alt_tab_active = true; + register_code(KC_LALT); + } + register_code(KC_TAB); + } else { + unregister_code(KC_TAB); + } + return false; + break; + } + return true; +} + + +enum combo_events { + EM_EMAIL, + EM_WORK_EMAIL, + HTML_P, + HTML_TITLE, + HTML_DIV, + HTML_HTML, + HTML_HEAD, + HTML_BODY, + HTML_FOOTER, + HTML_A_HREF, + HTML_IMG, + CSS_STYLE, + HTML_GENERIC_TAG, + CTLRGHT, + CTLLEFT +}; + +const uint16_t PROGMEM email_combo[] = {KC_E, KC_M, COMBO_END}; +const uint16_t PROGMEM email_work_combo[] = {KC_E, KC_K, COMBO_END}; +const uint16_t PROGMEM html_p_combo[] = {KC_P, KC_DOT, COMBO_END}; +const uint16_t PROGMEM html_title_combo[] = {KC_T, KC_DOT, COMBO_END}; +const uint16_t PROGMEM html_div_combo[] = {KC_D, KC_DOT, COMBO_END}; +const uint16_t PROGMEM html_html_combo[] = {KC_Q, KC_DOT, COMBO_END}; +const uint16_t PROGMEM html_head_combo[] = {KC_W, KC_DOT, COMBO_END}; +const uint16_t PROGMEM html_body_combo[] = {KC_R, KC_DOT, COMBO_END}; +const uint16_t PROGMEM html_footer_combo[] = {KC_X, KC_DOT, COMBO_END}; +const uint16_t PROGMEM html_a_href_combo[] = {KC_A, KC_DOT, COMBO_END}; +const uint16_t PROGMEM html_img_combo[] = {KC_F, KC_DOT, COMBO_END}; +const uint16_t PROGMEM css_style_combo[] = {KC_S, KC_DOT, COMBO_END}; +const uint16_t PROGMEM html_generic_tag_combo[] = {KC_G, KC_DOT, COMBO_END}; +const uint16_t PROGMEM ctrrght_combo[] = {KC_RGHT, KC_DOWN, COMBO_END}; +const uint16_t PROGMEM ctrleft_combo[] = {KC_LEFT, KC_DOWN, COMBO_END}; +// const uint8_t combo_mods = get_mods(); +// const uint8_t combo_oneshot_mods = get_oneshot_mods(); + +combo_t key_combos[] = { + [EM_EMAIL] = COMBO_ACTION(email_combo), + [EM_WORK_EMAIL] = COMBO_ACTION(email_work_combo), + [HTML_P] = COMBO_ACTION(html_p_combo), + [HTML_TITLE] = COMBO_ACTION(html_title_combo), + [HTML_DIV] = COMBO_ACTION(html_div_combo), + [HTML_HTML] = COMBO_ACTION(html_html_combo), + [HTML_HEAD] = COMBO_ACTION(html_head_combo), + [HTML_BODY] = COMBO_ACTION(html_body_combo), + [HTML_FOOTER] = COMBO_ACTION(html_footer_combo), + [HTML_A_HREF] = COMBO_ACTION(html_a_href_combo), + [HTML_IMG] = COMBO_ACTION(html_img_combo), + [CSS_STYLE] = COMBO_ACTION(css_style_combo), + [HTML_GENERIC_TAG] = COMBO_ACTION(html_generic_tag_combo), + [CTLRGHT] = COMBO_ACTION(ctrrght_combo), + [CTLLEFT] = COMBO_ACTION(ctrleft_combo), +}; +/* COMBO_ACTION(x) is same as COMBO(x, KC_NO) */ + +void process_combo_event(uint16_t combo_index, bool pressed) { + switch(combo_index) { + case EM_EMAIL: + if (pressed) { + SEND_STRING("aricbouwers@outlook.com"); + } + break; + case EM_WORK_EMAIL: + if (pressed) { + SEND_STRING("acrossonbouwers@rjc.ca"); + } + break; + case HTML_DIV: + if (pressed) { + SEND_STRING("
"); + for (int i = 0; i < 6; i++) { + tap_code16(KC_LEFT); + } + } + break; + case HTML_P: + if (pressed) { + SEND_STRING("

"); + for (int i = 0; i < 4; i++) { + tap_code16(KC_LEFT); + } + } + break; + case HTML_TITLE: + if (pressed) { + SEND_STRING(""); + for (int i = 0; i < 8; i++) { + tap_code16(KC_LEFT); + } + } + break; + case CSS_STYLE: + if (pressed) { + SEND_STRING(""); + for (int i = 0; i < 8; i++) { + tap_code16(KC_LEFT); + } + } + break; + case HTML_HTML: + if (pressed) { + SEND_STRING(""); + for (int i = 0; i < 7; i++) { + tap_code16(KC_LEFT); + } + } + break; + case HTML_HEAD: + if (pressed) { + SEND_STRING(""); + for (int i = 0; i < 7; i++) { + tap_code16(KC_LEFT); + } + } + break; + case HTML_BODY: + if (pressed) { + SEND_STRING(""); + for (int i = 0; i < 7; i++) { + tap_code16(KC_LEFT); + } + } + break; + case HTML_FOOTER: + if (pressed) { + SEND_STRING("
"); + for (int i = 0; i < 9; i++) { + tap_code16(KC_LEFT); + } + } + break; + case HTML_A_HREF: + if (pressed) { + SEND_STRING("name_of_link_goes_here"); + tap_code16(KC_HOME); + for (int i = 0; i < 10; i++) { + tap_code16(KC_RGHT); + } + } + break; + case HTML_IMG: + if (pressed) { + SEND_STRING("\"name_if_cant_load\""); + tap_code16(KC_HOME); + for (int i = 0; i < 11; i++) { + tap_code16(KC_RGHT); + } + } + break; + case HTML_GENERIC_TAG: + if (pressed) { + SEND_STRING(""); + tap_code16(KC_ESC); + for (int i = 0; i < 9; i++) { + tap_code16(KC_LEFT); + } + tap_code16(LCTL(KC_D)); + tap_code16(LCTL(KC_D)); + tap_code16(KC_BSPC); + } + break; + case CTLLEFT: + if (pressed) { + tap_code16(C(KC_LEFT)); + } + break; + case CTLRGHT: + if (pressed) { + tap_code16(C(KC_RGHT)); + } + break; + } +} diff --git a/keyboards/planck/keymaps/ariccb/readme.md b/keyboards/planck/keymaps/ariccb/readme.md new file mode 100644 index 000000000000..3472ce09ec99 --- /dev/null +++ b/keyboards/planck/keymaps/ariccb/readme.md @@ -0,0 +1,78 @@ +``` +QWERTY LAYER + * ,------------------------------------------------------------------------. + * |FN,Esc| q | w | e | r | t | y | u | i | o | p |Bsp | + * |------------------------------------------------------------------------| + |CSW,Tab| a | s | d | f | g | h | j | k | l | ; |Ctl,'| + * |------------------------------------------------------------------------| + * |Shift |Win,z| x | c | v | b | n | m | , | . | / |Sft,\| + * |------------------------------------------------------------------------| + * | | | |Ctl,Ent|LOWER| Space |RAISE|Alt,Play| | | | + * `------------------------------------------------------------------------' + +COLEMAK_VCP(default) LAYER + * ,------------------------------------------------------------------------. + * |FN,ESC| q | w | f | d | b | j | l | u | y | ; | Bsp | + * |------------------------------------------------------------------------| + |CSW,Tab| a | r | s | t | g | m | n | e | i | o |Ctl,'| + * |------------------------------------------------------------------------| + * |Shift |Win,z| x | v | c | p | k | h | , | . | / |Sft,\| + * |------------------------------------------------------------------------| + * | | | |Ctl,Ent|LWR,_| Space |RAISE|Alt,Play| | | | + * `------------------------------------------------------------------------' + +LOWER LAYER + * ,-----------------------------------------------------------------------. + * | ` | ! | # | $ | < | > | : | 7 | 8 | 9 | = | Bsp | + * |-----------------------------------------------------------------------| + * | ' | _ | ^ | % | ( | ) | M | 4 | 5 | 6 | - | + | + * |-----------------------------------------------------------------------| + * |Shift| | | & | " | { | } | @ | 1 | 2 | 3 | / | * | + * |-----------------------------------------------------------------------| + * | | | | | | |MO(6),0| . | | | | + * `-----------------------------------------------------------------------' + + RAISED LAYER + * ,-----------------------------------------------------------------------------. + * | ~ | ! | | | | | | Cut | Undo| Redo|P2TXT| Bsp | + * |-----------------------------------------------------------------------------| + * | |Menu | | | | | ARROW |SELWORD|Copy|Paste|WinPst| " | + * |-----------------------------------------------------------------------------| + * | |Vol+ |Vol- | Mute| | | Braces|Braces2| < | > | ? | ! | + * |-----------------------------------------------------------------------------| + * | | | | |Adjust| | | | | | | + * `-----------------------------------------------------------------------------' + + FN LAYER + * ,----------------------------------------------------------------------------. + * | |Ctl,F9 |Sft,F10|Alt,F11| F12 |MyComp|Calc |home | up | end |PrtScr| Del | + * |-----------------------------------------------------------------------------| + * | | F5 | F6 | F7 | F8 |DeskL |DeskR |left | down |right|ScrLck| CAPS| + * |-----------------------------------------------------------------------------| + * | | F1 | F2 | F3 | F4 |ALT_TAB| MicM|pgup |LCA_dn| pgdn|Pse/Brk| Ins| + * |-----------------------------------------------------------------------------| + * | | | | | | | |Alt,MNext| | | | + * `-----------------------------------------------------------------------------' + +GAMING LAYER + * ,-----------------------------------------------------------------------. + * |ESC,`| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |EXIT GAMING| + * |-----------------------------------------------------------------------| + * | TAB | Q | W | E | R | T | I | 4 | 5 | 6 | - | + | + * |-----------------------------------------------------------------------| + * |Shift| A | S | D | F | G | K | 1 | 2 | 3 | / | * | + * |-----------------------------------------------------------------------| + * | | | | Ctl | Alt | SPACE | 0 | . | | | | + * `-----------------------------------------------------------------------' + + ADJUST LAYER + * ,-----------------------------------------------------------------------------. + * |RGBtog|Ms3 | Ms2 |MsUp | Ms1 | Hue+| Hue- | Sat+| Sat- |Brt+ |Brt- | RESET| + * |-----------------------------------------------------------------------------| + * |RGBMod| MWL | MsL |MDn |MsR |GAMING| |AU_ON|AU_OFF|MU_ON|MU_OF| Debug| + * |-----------------------------------------------------------------------------| + * | |MWLft|MWUp |NWDn |NWRght|QWERTY|CMK_VCP|MI_ON|MI_OF | | |MU_Mod| + * |-----------------------------------------------------------------------------| + * | | | |SLEEP| | | | | | | | + * `-----------------------------------------------------------------------------' + ``` \ No newline at end of file diff --git a/keyboards/planck/keymaps/ariccb/rules.mk b/keyboards/planck/keymaps/ariccb/rules.mk new file mode 100644 index 000000000000..cc92ab40f32a --- /dev/null +++ b/keyboards/planck/keymaps/ariccb/rules.mk @@ -0,0 +1,10 @@ +BOOTMAGIC_ENABLE = no +CONSOLE_ENABLE = no +BACKLIGHT_ENABLE = yes +MIDI_ENABLE = yes +TAP_DANCE_ENABLE = yes +DIP_SWITCH_ENABLE = no +COMBO_ENABLE = yes + +SRC += features/select_word.c +SRC += features/caps_word.c diff --git a/keyboards/planck/keymaps/atreus/config.h b/keyboards/planck/keymaps/atreus/config.h new file mode 100644 index 000000000000..39daa2ec30cd --- /dev/null +++ b/keyboards/planck/keymaps/atreus/config.h @@ -0,0 +1,52 @@ +/* Copyright 2015-2017 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/atreus/keymap.c b/keyboards/planck/keymaps/atreus/keymap.c new file mode 100644 index 000000000000..6fd8c3980475 --- /dev/null +++ b/keyboards/planck/keymaps/atreus/keymap.c @@ -0,0 +1,241 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Default layer + * ,-----------------------------------------------------------------------------------. + * | Q | W | E | R | T | | | Y | U | I | O | P | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | A | S | D | F | G | | | H | J | K | L | ; | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Z | X | C | V | B | ` | \ | N | M | , | . | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | Tab | GUI | Shift| Bksp | Ctrl | Alt |Space | Fun | - | ' |Enter | + * `-----------------------------------------------------------------------------------' + */ +[0] = LAYOUT_ortho_4x12( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_BSLS, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ESC, KC_TAB, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_LALT, KC_SPC, MO(1), KC_MINS, KC_QUOT, KC_ENT), +/* Function layer + * ,-----------------------------------------------------------------------------------. + * | ! | @ | Up | $ | % | | | PgUp | 7 | 8 | 9 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ( | Left | Down |Right | ) | | | PgDn | 4 | 5 | 6 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | [ | ] | # | { | } | ^ | & | * | 1 | 2 | 3 | + | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Upper| Ins | | | | | | | | . | 0 | = | + * `-----------------------------------------------------------------------------------' + */ +[1] = LAYOUT_ortho_4x12( + KC_EXLM, KC_AT, KC_UP, KC_DLR, KC_PERC, KC_NO, KC_NO, KC_PGUP, KC_7, KC_8, KC_9, KC_BSPC, KC_LPRN, KC_LEFT, KC_DOWN, KC_RGHT, KC_RPRN, KC_NO, KC_NO, KC_PGDN, KC_4, KC_5, KC_6, KC_NO, KC_LBRC, KC_RBRC, KC_HASH, KC_LCBR, KC_RCBR, KC_CIRC, KC_AMPR, KC_ASTR, KC_1, KC_2, KC_3, KC_PLUS, TG(2), KC_INS, KC_LGUI, KC_LSFT, KC_DEL, KC_LCTL, KC_LALT, KC_SPC, KC_TRNS, KC_DOT, KC_0, KC_EQL), +/* Upper layer + * ,-----------------------------------------------------------------------------------. + * | Ins | Home | | End | PgUp | | | Up | F7 | F8 | F9 | F10 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | | | | PgDn | | | Down | F4 | F5 | F6 | F11 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Vol+ | | | | | | | F1 | F2 | F3 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Vol- | | | | | | | |PrtSc |ScrLk | Play | + * `-----------------------------------------------------------------------------------' + */ +[2] = LAYOUT_ortho_4x12( + KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_NO, KC_NO, KC_UP, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_NO, KC_NO, KC_DOWN, KC_F4, KC_F5, KC_F6, KC_F11, KC_NO, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F1, KC_F2, KC_F3, KC_F12, KC_NO, KC_VOLD, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, TO(0), KC_PSCR, KC_SCRL, KC_MPLY) +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + writePinLow(E6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + writePinHigh(E6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_song); } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_gb_song); } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } + return true; +} + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/atreus/readme.md b/keyboards/planck/keymaps/atreus/readme.md new file mode 100644 index 000000000000..81940642c57b --- /dev/null +++ b/keyboards/planck/keymaps/atreus/readme.md @@ -0,0 +1,9 @@ +![Layout Image](https://imgur.com/G9TNUzy.png) + +# Keyboardio Atreus layout for Planck + +This is the same layout as the new Atreus from Keyboardio (the one with 44 keys, so not the atreus v1). +There are 4 unused keys in the center as the Planck has 48 keys. +It is mostly for people with a Planck to try this new layout before buying. + +More details here: https://shop.keyboard.io/products/keyboardio-atreus diff --git a/keyboards/planck/keymaps/atreus/rules.mk b/keyboards/planck/keymaps/atreus/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/atreus/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/austin/keymap.c b/keyboards/planck/keymaps/austin/keymap.c new file mode 100644 index 000000000000..3461ca955199 --- /dev/null +++ b/keyboards/planck/keymaps/austin/keymap.c @@ -0,0 +1,29 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_planck_grid( /* 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, MO(3), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + // Space is repeated to accommadate for both spacebar wiring positions +), +[1] = LAYOUT_planck_grid( /* 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, + DF(0), KC_LGUI, KC_LALT, KC_LCTL, MO(3), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), +[2] = LAYOUT_planck_grid( /* 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, DF(0), DF(1), 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, MO(2), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), +[3] = LAYOUT_planck_grid( /* 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, DF(0), DF(1), 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, MO(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +) +}; diff --git a/keyboards/planck/keymaps/austin/rules.mk b/keyboards/planck/keymaps/austin/rules.mk new file mode 100644 index 000000000000..d86b02fd1ce4 --- /dev/null +++ b/keyboards/planck/keymaps/austin/rules.mk @@ -0,0 +1,22 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/aviator/config.h b/keyboards/planck/keymaps/aviator/config.h new file mode 100644 index 000000000000..159e6cd3bbc1 --- /dev/null +++ b/keyboards/planck/keymaps/aviator/config.h @@ -0,0 +1,40 @@ +#pragma once + + +#ifndef KEYBOARD_planck_light +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 3 +#endif + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 diff --git a/keyboards/planck/keymaps/aviator/keyboard-layout.json b/keyboards/planck/keymaps/aviator/keyboard-layout.json new file mode 100644 index 000000000000..84af51859301 --- /dev/null +++ b/keyboards/planck/keymaps/aviator/keyboard-layout.json @@ -0,0 +1,138 @@ +[ + { + "name": "The Aviator", + "author": "John Ramsay", + "notes": "Designed for aeronautical data entry on the OLKB Planck.", + "switchMount": "cherry", + "switchBrand": "gateron", + "switchType": "KS-3-Green", + "plate": true + }, + [ + { + "c": "#ADADAD", + "t": "#000000\n#3f76d4\n#d67509" + }, + "\nDel\nDel\n\n\n\n\n\n\nEsc", + { + "c": "#CDC1B0" + }, + "\n!\nF1\n\n\n\n\n\n\nQ", + "\n@\nF2\n\n\n\n\n\n\nW", + "\n#\nF3\n\n\n\n\n\n\nE", + "\n$\nF4\n\n\n\n\n\n\nR", + "\n%\n\n\n\n\n\n\n\nT", + "\n^\nN\n\n\n\n\n\n\nY", + "\n&\nS\n\n\n\n\n\n\nU", + "\n*\n7\n\n\n\n\n\n\nI", + "\n(\n8\n\n\n\n\n\n\nO", + "\n)\n9\n\n\n\n\n\n\nP", + { + "c": "#ADADAD", + "t": "#000000", + "a": 7 + }, + "Back Space" + ], + [ + "Tab", + { + "c": "#CDC1B0", + "t": "#000000\n#3f76d4\n#d67509", + "a": 4 + }, + "\n~\nF5\n\n\n\n\n\n\nA", + "\n`\nF6\n\n\n\n\n\n\nS", + { + "t": "#000000\n\n#d67509" + }, + "\n\nF7\n\n\n\n\n\n\nD", + "\n\nF8\n\n\n\n\n\n\nF", + { + "t": "#000000", + "a": 7 + }, + "G", + { + "t": "#000000\n\n#d67509", + "a": 4 + }, + "\n\nE\n\n\n\n\n\n\nH", + { + "t": "#000000\n#3f76d4\n#d67509" + }, + "\n_\nW\n\n\n\n\n\n\nJ", + "\n+\n4\n\n\n\n\n\n\nK", + "\n{\n5\n\n\n\n\n\n\nL", + "\n}\n6\n\n\n\n\n\n\n:\n;", + "\n\\\nTab\n\n\n\n\n\n\n\"\n'" + ], + [ + { + "c": "#ADADAD", + "t": "#000000", + "a": 7 + }, + "Shift", + { + "c": "#CDC1B0", + "t": "#000000\n\n#d67509", + "a": 4 + }, + "\n\nF9\n\n\n\n\n\n\nZ", + "\n\nF10\n\n\n\n\n\n\nX", + "\n\nF11\n\n\n\n\n\n\nC", + "\n\nF12\n\n\n\n\n\n\nV", + { + "t": "#000000", + "a": 7 + }, + "B", + { + "t": "#000000\n\n#d67509", + "a": 4 + }, + "\n\n+\n\n\n\n\n\n\nN", + { + "t": "#000000\n#3f76d4\n#d67509" + }, + "\n-\n-\n\n\n\n\n\n\nM", + "\n=\n1\n\n\n\n\n\n\n<\n,", + "\n[\n2\n\n\n\n\n\n\n>\n.", + "\n]\n3\n\n\n\n\n\n\n?\n/", + { + "c": "#ADADAD", + "t": "#000000", + "a": 7 + }, + "Return" + ], + [ + "Fn", + "Ctrl", + "Alt", + "Meta", + { + "c": "#9FACBF" + }, + "⇓", + { + "c": "#CDC1B0" + }, + "", + "", + { + "c": "#E5A65B" + }, + "⇑", + { + "c": "#ADADAD", + "t": "#000000\n#3f76d4\n#d67509", + "a": 4 + }, + "\nHome\n0\n\n\n\n\n\n\n←", + "\nPDwn\n.\n\n\n\n\n\n\n↓", + "\nPUp\nShift\n\n\n\n\n\n\n↑", + "\nEnd\nReturn\n\n\n\n\n\n\n→" + ] +] \ No newline at end of file diff --git a/keyboards/planck/keymaps/aviator/keymap.c b/keyboards/planck/keymaps/aviator/keymap.c new file mode 100644 index 000000000000..6b0308c6c689 --- /dev/null +++ b/keyboards/planck/keymaps/aviator/keymap.c @@ -0,0 +1,199 @@ +/* Copyright 2017 John Ramsay + * Aviator Keymap v1.0 + * + * Designed for aeronautical data entry on the OLKB Planck. + */ + +#include QMK_KEYBOARD_H + + extern keymap_config_t keymap_config; + + enum planck_layers { + _QWERTY, + _DATA, + _LOWER, + _RAISE, + _ADJUST + }; + + enum planck_keycodes { + QWERTY = SAFE_RANGE, + DATA, + LOWER, + RAISE, + BACKLIT + }; + +#define ___x___ KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Data + * ,-----------------------------------------------------------------------------------. + * | Esc | Home | Up | End | | | N | S | 7 | 8 | 9 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | Left | Down | Right| | | E | W | 4 | 5 | 6 | Tab | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | | + | - | 1 | 2 | 3 |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | 0 | . |Shift |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_DATA] = LAYOUT_planck_grid( + KC_ESC, KC_HOME, KC_UP, KC_END, ___x___, ___x___, KC_N, KC_S, KC_7, KC_8, KC_9, KC_BSPC, + KC_TAB, KC_LEFT, KC_DOWN, KC_RIGHT, ___x___, ___x___, KC_E, KC_W, KC_4, KC_5, KC_6, KC_TAB, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, ___x___, KC_PLUS, KC_MINS, KC_1, KC_2, KC_3, KC_ENT, + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_0, KC_DOT, KC_RSFT, KC_ENT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | ~ | ` | | | | | _ | + | { | } | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | - | = | [ | ] | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Home |Pg Dn |Pg Up | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + _______, KC_TILD, KC_GRV, ___x___, ___x___, ___x___, ___x___, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSLS, + _______, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | Del | F1 | F2 | F3 | F4 | | N | S | 7 | 8 | 9 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F5 | F6 | F7 | F8 | | E | W | 4 | 5 | 6 | Tab | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F9 | F10 | F11 | F12 | | + | - | 1 | 2 | 3 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | 0 | . |Shift |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, ___x___, KC_N, KC_S, KC_7, KC_8, KC_9, KC_BSPC, + _______, KC_F5, KC_F6, KC_F7, KC_F8, ___x___, KC_E, KC_W, KC_4, KC_5, KC_6, KC_TAB, + _______, KC_F9, KC_F10, KC_F11, KC_F12, ___x___, KC_PLUS, KC_MINS, KC_1, KC_2, KC_3, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_RSFT, KC_ENT +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | Esc | Reset| Debug| | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| Data | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + KC_ESC, QK_BOOT, DB_TOGG, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, KC_DEL, + _______, ___x___, ___x___, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, DATA, ___x___, ___x___, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, ___x___, ___x___, ___x___, ___x___, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + #ifdef BACKLIGHT_BREATHING + breathing_self_disable(); + #endif + } + return false; + break; + case DATA: + if (record->event.pressed) { + set_single_persistent_default_layer(_DATA); + #ifdef BACKLIGHT_BREATHING + breathing_enable(); + #endif + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + uint8_t default_layer = get_highest_layer(default_layer_state); + if (default_layer == _QWERTY) { + #ifdef BACKLIGHT_BREATHING + breathing_enable(); + #endif + } + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + uint8_t default_layer = get_highest_layer(default_layer_state); + if (default_layer == _QWERTY) { + #ifdef BACKLIGHT_BREATHING + breathing_self_disable(); + #endif + } + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + uint8_t default_layer = get_highest_layer(default_layer_state); + if (default_layer == _QWERTY) { + #ifdef BACKLIGHT_BREATHING + breathing_enable(); + #endif + } + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + uint8_t default_layer = get_highest_layer(default_layer_state); + if (default_layer == _QWERTY) { + #ifdef BACKLIGHT_BREATHING + breathing_self_disable(); + #endif + } + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_BREATHING + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/aviator/readme.md b/keyboards/planck/keymaps/aviator/readme.md new file mode 100644 index 000000000000..3319c7fe13e3 --- /dev/null +++ b/keyboards/planck/keymaps/aviator/readme.md @@ -0,0 +1,68 @@ +# The Aviator + +Designed for aeronautical data entry on the OLKB Planck. + +![Imgur](https://i.imgur.com/lj6uMYI.png) + +## Layers + +```` +Qwerty +,-----------------------------------------------------------------------------------. +| Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Tab | A | S | D | F | G | H | J | K | L | ; | " | +|------+------+------+------+------+------|------+------+------+------+------+------| +| Shift| Z | X | C | V | B | N | M | , | . | / |Enter | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | +`-----------------------------------------------------------------------------------' + +Data +,-----------------------------------------------------------------------------------. +| Esc | Home | Up | End | | | N | S | 7 | 8 | 9 | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Tab | Left | Down | Right| | | E | W | 4 | 5 | 6 | Tab | +|------+------+------+------+------+------|------+------+------+------+------+------| +| Shift| Z | X | C | V | | + | - | 1 | 2 | 3 |Enter | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Brite| Ctrl | Alt | GUI |Lower | Space |Raise | 0 | . |Shift |Enter | +`-----------------------------------------------------------------------------------' + +Lower +,-----------------------------------------------------------------------------------. +| Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | ~ | ` | | | | | _ | + | { | } | \ | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | | | | | | | - | = | [ | ] | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | Home |Pg Dn |Pg Up | End | +`-----------------------------------------------------------------------------------' + +Raise +,-----------------------------------------------------------------------------------. +| Del | F1 | F2 | F3 | F4 | | N | S | 7 | 8 | 9 | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | F5 | F6 | F7 | F8 | | E | W | 4 | 5 | 6 | Tab | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | F9 | F10 | F11 | F12 | | + | - | 1 | 2 | 3 | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | 0 | . |Shift |Enter | +`-----------------------------------------------------------------------------------' + +Adjust (Lower + Raise) +,-----------------------------------------------------------------------------------. +| Esc | Reset| Debug| | | | | | | | | Del | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| Data | | | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | +`-----------------------------------------------------------------------------------' +```` + +## Notes + +Supports LED backlighting. diff --git a/keyboards/planck/keymaps/aviator/rules.mk b/keyboards/planck/keymaps/aviator/rules.mk new file mode 100644 index 000000000000..bd518d8f273f --- /dev/null +++ b/keyboards/planck/keymaps/aviator/rules.mk @@ -0,0 +1 @@ +BACKLIGHT_ENABLE = yes diff --git a/keyboards/planck/keymaps/badger/keymap.c b/keyboards/planck/keymaps/badger/keymap.c new file mode 100644 index 000000000000..5235ac90f7b5 --- /dev/null +++ b/keyboards/planck/keymaps/badger/keymap.c @@ -0,0 +1,60 @@ +/* +Copyright 2020 Dan White + +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 "ortho.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY_MAC_ORTHO] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + MOMAC, 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_LCTL, KC_LALT, KC_LGUI, RAISE, P_ADJ, KC_SPC, LOWER, KC_NO, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC), + + [_MOVE_MAC_ORTHO] = LAYOUT_ortho_4x12( + KC_BACK, IJ_STEP, IJ_INTO, IJ_OUT, IJ_RUN, IJ_STOP, _______, WD_BACK, KC_HOME, KC_END, WD_FRWD, KC_NEXT, + _______, MM_LH, MM_MAX, MM_RH, IJ_FIND, IJ_IMPS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, CM_RIGHT, CM_DOWN, + _______, MM_UH, MM_BH, MAC_CPY, MAC_PST, IJ_IMPH, _______, IJ_REN, IJ_IMPL, IJ_DECL, IJ_USAG, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + [_QWERTY_LINUX_ORTHO] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + MOLNX, 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_LCTL, KC_LALT, KC_LGUI, RAISE, P_ADJ, KC_SPC, LOWER, KC_NO, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC), + + [_MOVE_LINUX_ORTHO] = LAYOUT_ortho_4x12( + _______, WM_VD1, WM_UH, WM_VD2, KC_MAC1, KC_MSTP, KC_MPLY, KC_PGUP, KC_HOME, KC_END, KC_PGDN, KC_INS, + _______, WM_LH, WM_MAX, WM_RH, KC_MAC2, KC_PSCR, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, CS_RIGHT, CS_DOWN, + _______, WM_VD3, WM_BH, OS_COPY, OS_PAST, KC_MPRV, KC_MNXT, KC_MUTE, KC_WBAK, KC_WFWD, KC_WSCH, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + [_RAISE] = LAYOUT_ortho_4x12( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DQUO, + _______, KC_UNDO, KC_CUT, OS_COPY, OS_PAST, KC_MPRV, KC_MNXT, KC_MUTE, KC_LT, KC_GT, KC_QUES, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + [_LOWER] = LAYOUT_ortho_4x12( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + _______, KC_4, KC_5, KC_6, KC_PMNS, KC_PSCR, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_SCLN, KC_QUOT, + _______, KC_1, KC_2, KC_3, KC_PPLS, KC_NO, KC_NO, KC_WHOM, KC_WBAK, KC_WFWD, KC_WSCH, _______, + _______, KC_0, KC_DOT, KC_ENT, _______, _______, _______, _______, _______, _______, _______, _______), + + [_ADJUST] = LAYOUT_ortho_4x12( + _______, NK_ON, NK_OFF, EE_CLR, QK_BOOT, KC_MSTP, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_BTN2, KC_INS, + _______, GE_SWAP, GE_NORM, DB_TOGG, AG_SWAP, AG_NORM, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_BTN1, _______, + _______, KC_LYRC, KC_FIRST, KC_CAPS, KC_NO, KC_MPRV, KC_MNXT, KC_MUTE, KC_ACL0, KC_ACL1, KC_ACL2, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) +}; diff --git a/keyboards/planck/keymaps/basic/keymap.c b/keyboards/planck/keymaps/basic/keymap.c new file mode 100644 index 000000000000..7ce327302f31 --- /dev/null +++ b/keyboards/planck/keymaps/basic/keymap.c @@ -0,0 +1,65 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[0] = LAYOUT_planck_grid( + 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, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Reset | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[1] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, + QK_BOOT, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Reset | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[2] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, + QK_BOOT, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + + +}; diff --git a/keyboards/planck/keymaps/basic/readme.md b/keyboards/planck/keymaps/basic/readme.md new file mode 100644 index 000000000000..3a4824b5b4d6 --- /dev/null +++ b/keyboards/planck/keymaps/basic/readme.md @@ -0,0 +1,2 @@ +# A more basic Planck Layout for copying + diff --git a/keyboards/planck/keymaps/basic/rules.mk b/keyboards/planck/keymaps/basic/rules.mk new file mode 100644 index 000000000000..e3a405f494e9 --- /dev/null +++ b/keyboards/planck/keymaps/basic/rules.mk @@ -0,0 +1,22 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/bghull/combos.def b/keyboards/planck/keymaps/bghull/combos.def new file mode 100644 index 000000000000..a525113a0936 --- /dev/null +++ b/keyboards/planck/keymaps/bghull/combos.def @@ -0,0 +1,14 @@ +// name result chord keys +COMB(QW_ESC, KC_ESC, KC_Q, KC_W) +COMB(CV_DEL, KC_DEL, KC_C, KC_V) +COMB(XC_BSPC, KC_BSPC, KC_X, KC_C) +COMB(WE_LBRC, KC_LBRC, KC_W, KC_E) +COMB(ER_RBRC, KC_RBRC, KC_E, KC_R) +COMB(SD_LPRN, KC_LPRN, KC_S, KC_D) +COMB(DF_RPRN, KC_RPRN, KC_D, KC_F) +COMB(FG_BSLS, KC_BSLS, KC_F, KC_G) +COMB(HJ_SLSH, KC_SLSH, KC_H, KC_J) +COMB(DQ_LGUI, KC_LGUI, KC_DOT, KC_QUOT) +COMB(CD_LALT, KC_LALT, KC_COMM, KC_DOT) +COMB(MC_LSFT, KC_LSFT, KC_M, KC_COMM) +COMB(NM_LCTL, KC_LCTL, KC_N, KC_M) \ No newline at end of file diff --git a/keyboards/planck/keymaps/bghull/config.h b/keyboards/planck/keymaps/bghull/config.h new file mode 100644 index 000000000000..96a6aefb0e53 --- /dev/null +++ b/keyboards/planck/keymaps/bghull/config.h @@ -0,0 +1,7 @@ +// Copyright 2021 Your Name (@bghull) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once +#define AUTO_SHIFT_TIMEOUT 135 +#define ONESHOT_TIMEOUT 1000 +#define COMBO_TERM 20 diff --git a/keyboards/planck/keymaps/bghull/keymap.c b/keyboards/planck/keymaps/bghull/keymap.c new file mode 100644 index 000000000000..4e556fc215ac --- /dev/null +++ b/keyboards/planck/keymaps/bghull/keymap.c @@ -0,0 +1,101 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "keymap_steno.h" +#include "g/keymap_combo.h" +#include "muse.h" + +#define COMBO_ONLY_FROM_LAYER QWERTY + +enum planck_layers { + QWERTY, + COLMAK, + NAVNUM, + FUNC + +}; + +#define BspNAV LT(NAVNUM, KC_BSPC) +#define SpcFUN LT(FUNC, KC_SPC) +#define OneSFT OSM(MOD_LSFT) +#define OneALT OSM(MOD_LALT) +#define OneCTL OSM(MOD_LCTL) +#define OneWIN OSM(MOD_LGUI) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* QWERTY + * ,-----------------------------------------------------------------------------------. + * | Q | W | E | R | T | | Y | U | I | O | P | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | A | S | D | F | G | | H | J | K | L | ; : | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Z | X | C | V | B | | N | M | , < | . > | ' " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Ctrl |NAVNUM| |Space |BspNAV| | + * `-----------------------------------------------------------------------------------' + */ +[QWERTY] = LAYOUT_planck_grid( + KC_Q, KC_W, KC_E, KC_R, KC_T, _______, _______, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, _______, _______, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + KC_Z, KC_X, KC_C, KC_V, KC_B, _______, _______, KC_N, KC_M, KC_COMM, KC_DOT, KC_QUOT, + _______, _______, _______, KC_LCTL, MO(NAVNUM),_______, _______, KC_SPC, BspNAV, _______, _______, _______ +), + +[COLMAK] = LAYOUT_planck_grid( + KC_Q, KC_W, KC_F, KC_P, KC_B, _______, _______, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, + KC_A, KC_R, KC_S, KC_T, KC_G, _______, _______, KC_M, KC_N, KC_E, KC_I, KC_O, + KC_Z, KC_X, KC_C, KC_D, KC_V, _______, _______, KC_K, KC_H, KC_COMM, KC_DOT, KC_QUOT, + _______, _______, _______, KC_LCTL, MO(NAVNUM),_______, _______, KC_SPC, BspNAV, _______, _______, _______ + +), +/* NAVNUM + * ,-----------------------------------------------------------------------------------. + * |Enter | Home | Up | End | | RST | - | 7 | 8 | 9 | 0 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |OneSFT| Left | Down |Right | ` ~ | CLMK | + | 4 | 5 | 6 |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |OneCTL|OneALT| Tab | _ |OneWIN| QWER | = | 1 | 2 | 3 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | |SpcFUN| Ctrl | | + * `-----------------------------------------------------------------------------------' + */ +[NAVNUM] = LAYOUT_planck_grid( + KC_ENT, KC_HOME, KC_UP, KC_END, _______, _______, QK_BOOT, KC_PMNS, KC_7, KC_8, KC_9, KC_0, + OneSFT, KC_LEFT, KC_DOWN, KC_RGHT, KC_GRV, _______, DF(COLMAK), KC_PPLS, KC_4, KC_5, KC_6, KC_ENT, + OneCTL, OneALT, KC_TAB, KC_UNDS, OneWIN, _______, DF(QWERTY), KC_EQL, KC_1, KC_2, KC_3, _______, + _______, _______, _______, _______, _______, _______, _______, SpcFUN, KC_LCTL, _______, _______, _______ +), +/* FUNC: Mousekeys + F keys + * ,-----------------------------------------------------------------------------------. + * | |Rclick| MsUp |Lclick| WhUp | | | F7 | F8 | F9 | F10 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | MsLt | MsDn | MsRt | WhDn | |OneALT| F4 | F5 | F6 | F11 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | |Mclick| | | | | F1 | F2 | F3 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[FUNC] = LAYOUT_planck_grid( + _______, KC_BTN2, KC_MS_U, KC_BTN1, KC_WH_U, _______, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, + _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, _______, _______, OneALT , KC_F4, KC_F5, KC_F6, KC_F11, + _______, _______, KC_BTN3, _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F12, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +}; + diff --git a/keyboards/planck/keymaps/bghull/rules.mk b/keyboards/planck/keymaps/bghull/rules.mk new file mode 100644 index 000000000000..664ed740781c --- /dev/null +++ b/keyboards/planck/keymaps/bghull/rules.mk @@ -0,0 +1,6 @@ +SRC += muse.c +AUTO_SHIFT_ENABLE = yes +MOUSEKEY_ENABLE = yes +AUDIO_ENABLE = no +COMBO_ENABLE = yes +VPATH += keyboards/gboards \ No newline at end of file diff --git a/keyboards/planck/keymaps/bone2planck/keymap.c b/keyboards/planck/keymaps/bone2planck/keymap.c new file mode 100644 index 000000000000..6e84ca796a3e --- /dev/null +++ b/keyboards/planck/keymaps/bone2planck/keymap.c @@ -0,0 +1,135 @@ +#include QMK_KEYBOARD_H +#include "keymap_german.h" + +// for intellisense, has to be commented for building +/* +#include "..\..\..\..\quantum\keymap_extras\keymap_german.h" +#include "..\..\..\..\tmk_core\common\keycode.h" +*/ + +/* This Layout tries to emulate the Bone2 Variant of Neo2, and is intended to be used with a German QWERTZ Softwarelayout. +It has "üäöß" as it is optimized for a mix of German & English. +My favourite features are the placement of the special characters often used for programming right on the home row +and the number & navigation block combo, so you never have to move your hands from their home position. + +Bone2 wiki page: http://wiki.neo-layout.org/wiki/Bone +*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Bone2 (adapted) +* ,-----------------------------------------------------------------------------------. +* | ß | J | D | U | A | X | P | H | L | M | W | Q | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | M1 | C | T | I | E | O | B | N | R | S | G |M1/Ent| //hold for M1, tap for Enter +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | Shift| F | V | Ü | Ä | Ö | Y | Z | , | . | K |Shift | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | Ctrl | GUI | Alt | M4 | M2 | Space | M2 | M4 | Alt | Esc | Ctrl | +* `-----------------------------------------------------------------------------------' +*/ +[0] = LAYOUT_planck_grid( + DE_SS, DE_J, DE_D, DE_U, DE_A, DE_X, DE_P, DE_H, DE_L, DE_M, DE_W, DE_Q , + // LT(1,KC_TAB), DE_C, DE_T, DE_I, DE_E, DE_O, DE_B, DE_N, DE_R, DE_S, DE_G, LT(1,KC_ENT) , + MO(1), DE_C, DE_T, DE_I, DE_E, DE_O, DE_B, DE_N, DE_R, DE_S, DE_G, LT(1,KC_ENT) , + KC_LSFT, DE_F, DE_V, DE_UDIA, DE_ADIA, DE_ODIA, DE_Y, DE_Z, DE_COMM, DE_DOT, DE_K, KC_LSFT , + KC_LCTL, KC_LGUI, KC_LALT, MO(4), MO(2), KC_SPC, KC_SPC, MO(2), MO(4), KC_RALT, KC_ESC, KC_RCTL +), + +/* M1 Special Characters +* very ergonomic placement for coding +* ,-----------------------------------------------------------------------------------. +* | ° | @ | _ | [ | ] | ^ | ! | < | > | = | & | ´ | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | M1 | \ | / | { | } | * | ? | ( | ) | - | : |M1/Ent| //hold for M1, tap for Enter +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | Shift| # | ~ | | | $ | € | + | % | " | ' | ; |Shift | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | Ctrl | GUI | Alt | M4 | M2 | Space | M2 | M4 | Alt | Esc | Ctrl | +* `-----------------------------------------------------------------------------------' +*/ +[1] = LAYOUT_planck_grid( + DE_DEG, DE_AT, DE_UNDS, DE_LBRC, DE_RBRC, DE_CIRC, DE_EXLM, DE_LABK, DE_RABK, DE_EQL, DE_AMPR, DE_ACUT , + _______, DE_BSLS, DE_SLSH, DE_LCBR, DE_RCBR, DE_ASTR, DE_QUES, DE_LPRN, DE_RPRN, DE_MINS, DE_COLN, _______ , + _______, DE_HASH, DE_TILD, DE_PIPE, DE_DLR, DE_EURO, DE_PLUS, DE_PERC, DE_DQUO, DE_QUOT, DE_SCLN, _______ , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* M2 Navigation & Number Blocks +* very easy to get used to & intuituve placement +* ,-----------------------------------------------------------------------------------. +* | | PgUp | Bksp | Up | DEL | PgDn | | 7 | 8 | 9 | | Ins | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | Tab | Home | Lft | Down | Right| End | | 4 | 5 | 6 | . | Enter| +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | Shift| | Tab | | Enter| | 0 | 1 | 2 | 3 | , |Shift | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | Ctrl | GUI | Alt | M3 | M2 | Space | M2 | M3 | Alt | Esc | Ctrl | +* `-----------------------------------------------------------------------------------' +*/ +[2] = LAYOUT_planck_grid( + XXXXXXX, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, XXXXXXX, DE_7, DE_8, DE_9, XXXXXXX, KC_INS , + KC_TAB, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, DE_4, DE_5, DE_6, DE_DOT, KC_ENT , + _______, XXXXXXX, KC_TAB, XXXXXXX, KC_ENT, XXXXXXX, DE_0, DE_1, DE_2, DE_3, DE_COMM, _______ , + _______, _______, _______, MO(3), _______, _______, _______, _______, MO(3), _______, _______, _______ +), + +/* M3 Switched Navigation & Number Blocks for one handed use +* accessed by sliding from M2 to M3 with thumb +* ,-----------------------------------------------------------------------------------. +* | Ins | | 7 | 8 | 9 | | PgUp | Bksp | Up | DEL | PgDn | | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | Tab | | 4 | 5 | 6 | . | Home | Left | Down | Right| End | Enter| +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | Shift| 0 | 1 | 2 | 3 | , | | Tab | | Enter| |Shift | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | Ctrl | GUI | Alt | M3 | | Space | | M3 | Alt | Esc | Ctrl | +* `-----------------------------------------------------------------------------------' +*/ + +[3] = LAYOUT_planck_grid( + KC_INS, XXXXXXX, DE_7, DE_8, DE_9, XXXXXXX, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, XXXXXXX , + _______, XXXXXXX, DE_4, DE_5, DE_6, DE_DOT, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______ , + _______, DE_0, DE_1, DE_2, DE_3, DE_COMM, XXXXXXX, KC_TAB, XXXXXXX, KC_ENT, XXXXXXX, _______ , + _______, _______, _______, _______, XXXXXXX, _______, _______, XXXXXXX, _______, _______, _______, _______ +), + + +/* M4 Function & Media Keys +* ,-----------------------------------------------------------------------------------. +* | | | Print|Scroll|Pause | | | F7 | F8 | F9 | F12 | | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | Tab | | Mute | Vol- | Vol+ | | ³ | F4 | F5 | F6 | F11 | Enter| +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | Shift| | Prev | Play | Next | | ² | F1 | F2 | F3 | F10 |Shift | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | Ctrl | GUI | Alt | M4 | M5 | Space | M5 | M4 | Alt | Esc | Ctrl | +* `-----------------------------------------------------------------------------------' +*/ +[4] = LAYOUT_planck_grid( + XXXXXXX, XXXXXXX, KC_PSCR, KC_SCRL, KC_PAUS, XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F12, XXXXXXX , + KC_TAB, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, DE_SUP3, KC_F4, KC_F5, KC_F6, KC_F11, KC_ENT , + _______, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, DE_SUP2, KC_F1, KC_F2, KC_F3, KC_F10, _______ , + _______, _______, _______, _______, MO(5), _______, _______, MO(5), _______, _______, _______, _______ +), + + +/* M5 Switched Function & Media Keys| +* accessed by sliding from M4 to M5 with thumb +* ,-----------------------------------------------------------------------------------. +* | | | F7 | F8 | F9 | F12 | | Print|Scroll| Pause| | | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | Tab | ³ | F4 | F5 | F6 | F11 | | Mute | Vol- | Vol+ | | Enter| +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | Shift| ² | F1 | F2 | F3 | F10 | | Prev | Play | Next | |Shift | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | Ctrl | GUI | Alt | | M5 | Space | M5 | | Alt | Esc | Ctrl | +* `-----------------------------------------------------------------------------------' +*/ +[5] = LAYOUT_planck_grid( + XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F12, XXXXXXX, KC_PSCR, KC_SCRL, KC_PAUS, XXXXXXX, XXXXXXX , + _______, DE_SUP3, KC_F4, KC_F5, KC_F6, KC_F11, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, _______ , + _______, DE_SUP2, KC_F1, KC_F2, KC_F3, KC_F10, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, _______ , + _______, _______, _______, XXXXXXX, _______, _______, _______, _______, XXXXXXX, _______, _______, _______ +) +}; diff --git a/keyboards/planck/keymaps/bone2planck/readme.md b/keyboards/planck/keymaps/bone2planck/readme.md new file mode 100644 index 000000000000..be22eabdb99c --- /dev/null +++ b/keyboards/planck/keymaps/bone2planck/readme.md @@ -0,0 +1,96 @@ +Bone2Planck +===================================== + +This layout tries to emulate the Bone2 variant of Neo2, and is intended to be used with a German QWERTZ softwarelayout. +It has "üäöß" as it is optimized for a mix of German & English. +The special character layer and the navigation & number block layer are inspired by the Neo2 layers, +designed to keep the fingers near the home row. + +Bone2 wiki page: http://wiki.neo-layout.org/wiki/Bone + +To build, run "make" from within the \bone2planck folder. + +## Bone2 (adapted) Base Layer +``` + ,-----------------------------------------------------------------------------------. + | ß | J | D | U | A | X | P | H | L | M | W | Q | + |------+------+------+------+------+-------------+------+------+------+------+------| + | M1 | C | T | I | E | O | B | N | R | S | G |M1/Ent| hold: M1, tap: Enter + |------+------+------+------+------+------|------+------+------+------+------+------| + | Shift| F | V | Ü | Ä | Ö | Y | Z | , | . | K |Shift | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Ctrl | GUI | Alt | M4 | M2 | Space | M2 | M4 | Alt | Esc | Ctrl | + `-----------------------------------------------------------------------------------' +``` + +## M1 Special Characters + very ergonomic placement for coding +``` + ,-----------------------------------------------------------------------------------. + | ° | @ | _ | [ | ] | ^ | ! | < | > | = | & | ´ | + |------+------+------+------+------+-------------+------+------+------+------+------| + | M1 | \ | / | { | } | * | ? | ( | ) | - | : |M1/Ent| hold: M1, tap: Enter + |------+------+------+------+------+------|------+------+------+------+------+------| + | Shift| # | ~ | | | $ | € | + | % | " | ' | ; |Shift | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Ctrl | GUI | Alt | M4 | M2 | Space | M2 | M4 | Alt | Esc | Ctrl | + `-----------------------------------------------------------------------------------' +``` + +## M2 Navigation & Number Blocks + very easy to get used to & intuituve placement +``` + ,-----------------------------------------------------------------------------------. + | | PgUp | Bksp | Up | DEL | PgDn | | 7 | 8 | 9 | | Ins | + |------+------+------+------+------+-------------+------+------+------+------+------| + | Tab | Home | Lft | Down | Right| End | | 4 | 5 | 6 | . | Enter| + |------+------+------+------+------+------|------+------+------+------+------+------| + | Shift| | Tab | | Enter| | 0 | 1 | 2 | 3 | , |Shift | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Ctrl | GUI | Alt | M3 | M2 | Space | M2 | M3 | Alt | Esc | Ctrl | + `-----------------------------------------------------------------------------------' +``` + +## M4 Function & Media Keys +``` + ,-----------------------------------------------------------------------------------. + | | | Print|Scroll|Pause | | | F7 | F8 | F9 | F12 | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | Tab | | Mute | Vol- | Vol+ | | ³ | F4 | F5 | F6 | F11 | Enter| + |------+------+------+------+------+------|------+------+------+------+------+------| + | Shift| | Prev | Play | Next | | ² | F1 | F2 | F3 | F10 |Shift | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Ctrl | GUI | Alt | M4 | M5 | Space | M5 | M4 | Alt | Esc | Ctrl | + `-----------------------------------------------------------------------------------' +``` + + +##Switched layers for one handed access: + +### M3 Switched Navigation & Number Blocks + accessed by sliding from M2 to M3 with thumb +``` + ,-----------------------------------------------------------------------------------. + | Ins | | 7 | 8 | 9 | | PgUp | Bksp | Up | DEL | PgDn | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | Tab | | 4 | 5 | 6 | . | Home | Left | Down | Right| End | Enter| + |------+------+------+------+------+------|------+------+------+------+------+------| + | Shift| 0 | 1 | 2 | 3 | , | | Tab | | Enter| |Shift | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Ctrl | GUI | Alt | M3 | | Space | | M3 | Alt | Esc | Ctrl | + `-----------------------------------------------------------------------------------' +``` + +### M5 Switched Function & Media Keys + accessed by sliding from M4 to M5 with thumb +``` + ,-----------------------------------------------------------------------------------. + | | | F7 | F8 | F9 | F12 | | Print|Scroll| Pause| | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | Tab | ³ | F4 | F5 | F6 | F11 | | Mute | Vol- | Vol+ | | Enter| + |------+------+------+------+------+------|------+------+------+------+------+------| + | Shift| ² | F1 | F2 | F3 | F10 | | Prev | Play | Next | |Shift | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Ctrl | GUI | Alt | | M5 | Space | M5 | | Alt | Esc | Ctrl | + `-----------------------------------------------------------------------------------' +``` \ No newline at end of file diff --git a/keyboards/planck/keymaps/bone2planck/rules.mk b/keyboards/planck/keymaps/bone2planck/rules.mk new file mode 100644 index 000000000000..628f1fb0a105 --- /dev/null +++ b/keyboards/planck/keymaps/bone2planck/rules.mk @@ -0,0 +1,20 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/buffet/config.h b/keyboards/planck/keymaps/buffet/config.h new file mode 100644 index 000000000000..a6567d8e565c --- /dev/null +++ b/keyboards/planck/keymaps/buffet/config.h @@ -0,0 +1,46 @@ +#pragma once + +#define TAPPING_TERM 150 +#define PERMISSIVE_HOLD + +// Disable all RGB effects +#undef ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +#undef ENABLE_RGB_MATRIX_ALPHAS_MODS +#undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +#undef ENABLE_RGB_MATRIX_BREATHING +#undef ENABLE_RGB_MATRIX_BAND_SAT +#undef ENABLE_RGB_MATRIX_BAND_VAL +#undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +#undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +#undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +#undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#undef ENABLE_RGB_MATRIX_CYCLE_ALL +#undef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +#undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN +#undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#undef ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#undef ENABLE_RGB_MATRIX_DUAL_BEACON +#undef ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +#undef ENABLE_RGB_MATRIX_CYCLE_SPIRAL +#undef ENABLE_RGB_MATRIX_RAINBOW_BEACON +#undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#undef ENABLE_RGB_MATRIX_RAINDROPS +#undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#undef ENABLE_RGB_MATRIX_TYPING_HEATMAP +#undef ENABLE_RGB_MATRIX_DIGITAL_RAIN +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#undef ENABLE_RGB_MATRIX_SPLASH +#undef ENABLE_RGB_MATRIX_MULTISPLASH +#undef ENABLE_RGB_MATRIX_SOLID_SPLASH +#undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/buffet/keymap.c b/keyboards/planck/keymaps/buffet/keymap.c new file mode 100644 index 000000000000..abcb5f756897 --- /dev/null +++ b/keyboards/planck/keymaps/buffet/keymap.c @@ -0,0 +1,384 @@ +/* Copyright 2015-2017 Jack Humbert + * 2020 Niclas Meyer + * + * 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 QMK_KEYBOARD_H + +#define K(kc) (1ull<<((kc) - ALPHA)) + +#define KALPHA K(ALPHA) +#define KBETA K(BETA) +#define KGAMMA K(GAMMA) +#define KDELTA K(DELTA) +#define KEPSILON K(EPSILON) +#define KZETA K(ZETA) +#define KTHETA K(THETA) +#define KIOTA K(IOTA) +#define KKAPPA K(KAPPA) + +enum keys { + ALPHA = SAFE_RANGE, + BETA, + GAMMA, + DELTA, + EPSILON, + ZETA, + THETA, + IOTA, + KAPPA, + LOCK, + NONE, +}; + +enum layers { + NORMAL, + QWERTY, + GAME, + LOWER, + RAISE, + PHI, + FN, +}; + +#define XXXX KC_NO +#define ____ KC_TRNS + +#define CQWER LM(QWERTY, MOD_LCTL) +#define AQWER LM(QWERTY, MOD_LALT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [NORMAL] = LAYOUT_planck_grid( + ALPHA, BETA, GAMMA, DELTA, ____, ____, ____, ____, DELTA, GAMMA, BETA, ALPHA, + EPSILON, ZETA, THETA, IOTA, ____, ____, ____, ____, IOTA, THETA, ZETA, EPSILON, + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, + MO(PHI), CQWER, AQWER, MO(FN), KAPPA, ____, XXXX, KAPPA, MO(FN), ____, ____, MO(PHI) + ), + [QWERTY] = LAYOUT_planck_grid( + 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, SC_SENT, + MO(PHI), KC_LCTL, KC_LALT, KC_LGUI, MO(LOWER), KC_SPC, XXXX, MO(RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT + ), + [GAME] = LAYOUT_planck_grid( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, KC_Z, KC_X, KC_C, KC_SPC, ____, XXXX, ____, KC_V, KC_B, ____, MO(PHI) + ), + [LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_DEL, ____, ____, ____, ____, ____, ____, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + ____, ____, ____, ____, ____, ____, ____, KC_PGUP, KC_PGDN, KC_HOME, KC_END, ____, + ____, ____, ____, ____, ____, ____, XXXX, ____, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + [RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_DEL, ____, ____, ____, ____, ____, ____, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + ____, ____, ____, ____, ____, ____, ____, KC_PGUP, KC_PGDN, KC_HOME, KC_END, ____, + ____, ____, ____, ____, ____, ____, XXXX, ____, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + [PHI] = LAYOUT_planck_grid( + QK_BOOT, KC_F1, KC_F2, KC_F3, KC_F4, ____, ____, ____, ____, ____, ____, KC_DEL, + ____, KC_F5, KC_F6, KC_F7, KC_F8, ____, ____, DF(QWERTY), DF(NORMAL), DF(GAME), ____, KC_F13, + ____, KC_F9, KC_F10, KC_F11, KC_F12, ____, ____, ____, ____, ____, ____, ____, + ____, RGB_TOG, RGB_MOD, ____, ____, ____, XXXX, ____, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + [FN] = LAYOUT_planck_grid( + ____, ____, KC_UP, ____, ____, ____, ____, ____, ____, KC_UP, ____, ____, + KC_DEL, KC_LEFT, KC_DOWN, KC_RIGHT, ____, ____, ____, ____, KC_LEFT, KC_DOWN, KC_RIGHT, KC_DEL, + KC_HOME, KC_END, KC_PGUP, KC_PGDN, ____, ____, ____, ____, KC_PGDN, KC_PGUP, KC_HOME, KC_END, + ____, ____, ____, ____, ____, ____, XXXX, ____, ____, ____, ____, ____ + ), +}; + +static uint16_t left_chord = 0; +static uint16_t right_chord = 0; + +static bool locking = false; +static bool locked = false; +static uint16_t mods = 0; + +#define PROCESS_MOD(mod) \ + do { \ + if ((mods & MOD_##mod) && !(keys & MOD_##mod)) { \ + unregister_code16(KC_##mod); \ + } \ + if (!(mods & MOD_##mod) && (keys & MOD_##mod)) { \ + register_code16(KC_##mod); \ + } \ + } while (0) + +static void process_keys(uint16_t keys) { + if (keys == NONE) { + return; + } + + if (keys == LOCK) { + locking = !locking; + return; + } + + if ((keys & QK_ONE_SHOT_MOD) == QK_ONE_SHOT_MOD) { + PROCESS_MOD(LCTL); + PROCESS_MOD(LSFT); + PROCESS_MOD(LALT); + PROCESS_MOD(LGUI); + + mods = keys & ~QK_ONE_SHOT_MOD; + locked = false; + + if (locking) { + locking = false; + locked = true; + } + + return; + } + + // Normal key + tap_code16(keys); + locking = false; + + if (mods && !locked) { + if (mods & MOD_LCTL) { + unregister_code16(KC_LCTL); + } + + if (mods & MOD_LSFT) { + unregister_code16(KC_LSFT); + } + + if (mods & MOD_LALT) { + unregister_code16(KC_LALT); + } + + if (mods & MOD_LGUI) { + unregister_code16(KC_LGUI); + } + + mods = 0; + } +} + +static uint16_t chord_to_keys(uint16_t chord) { + switch (chord) { + // Unshifted Extra + case KKAPPA: return KC_SPC; + case KEPSILON | KZETA | KTHETA | KIOTA: return KC_ENT; + case KEPSILON | KZETA | KGAMMA | KIOTA: return KC_TAB; + case KEPSILON | KIOTA: return KC_BSPC; + case KKAPPA | KEPSILON: return KC_ESC; + + // Shifted Extra + case KKAPPA | KEPSILON | KZETA | KTHETA | KIOTA: return S(KC_ENT); + case KKAPPA | KEPSILON | KZETA | KGAMMA | KIOTA: return S(KC_TAB); + case KKAPPA | KEPSILON | KIOTA: return S(KC_BSPC); + + // Lowercase Letters + case KBETA: return KC_A; + case KZETA | KDELTA: return KC_B; + case KBETA | KGAMMA | KDELTA: return KC_C; + case KZETA | KTHETA | KIOTA: return KC_D; + case KDELTA: return KC_E; + case KGAMMA | KIOTA: return KC_F; + case KBETA | KTHETA: return KC_G; + case KZETA | KTHETA: return KC_H; + case KGAMMA: return KC_I; + case KBETA | KGAMMA | KIOTA: return KC_J; + case KBETA | KTHETA | KIOTA: return KC_K; + case KBETA | KGAMMA: return KC_L; + case KBETA | KDELTA: return KC_M; + case KZETA: return KC_N; + case KTHETA: return KC_O; + case KZETA | KGAMMA: return KC_P; + case KBETA | KTHETA | KDELTA: return KC_Q; + case KGAMMA | KDELTA: return KC_R; + case KTHETA | KIOTA: return KC_S; + case KIOTA: return KC_T; + case KZETA | KIOTA: return KC_U; + case KTHETA | KDELTA: return KC_V; + case KZETA | KGAMMA | KIOTA: return KC_W; + case KZETA | KTHETA | KDELTA: return KC_X; + case KBETA | KIOTA: return KC_Y; + case KZETA | KGAMMA | KDELTA: return KC_Z; + + // Uppercase Letters + case KKAPPA | KBETA: return S(KC_A); + case KKAPPA | KZETA | KDELTA: return S(KC_B); + case KKAPPA | KBETA | KGAMMA | KDELTA: return S(KC_C); + case KKAPPA | KZETA | KTHETA | KIOTA: return S(KC_D); + case KKAPPA | KDELTA: return S(KC_E); + case KKAPPA | KGAMMA | KIOTA: return S(KC_F); + case KKAPPA | KBETA | KTHETA: return S(KC_G); + case KKAPPA | KZETA | KTHETA: return S(KC_H); + case KKAPPA | KGAMMA: return S(KC_I); + case KKAPPA | KBETA | KGAMMA | KIOTA: return S(KC_J); + case KKAPPA | KBETA | KTHETA | KIOTA: return S(KC_K); + case KKAPPA | KBETA | KGAMMA: return S(KC_L); + case KKAPPA | KBETA | KDELTA: return S(KC_M); + case KKAPPA | KZETA: return S(KC_N); + case KKAPPA | KTHETA: return S(KC_O); + case KKAPPA | KZETA | KGAMMA: return S(KC_P); + case KKAPPA | KBETA | KTHETA | KDELTA: return S(KC_Q); + case KKAPPA | KGAMMA | KDELTA: return S(KC_R); + case KKAPPA | KTHETA | KIOTA: return S(KC_S); + case KKAPPA | KIOTA: return S(KC_T); + case KKAPPA | KZETA | KIOTA: return S(KC_U); + case KKAPPA | KTHETA | KDELTA: return S(KC_V); + case KKAPPA | KZETA | KGAMMA | KIOTA: return S(KC_W); + case KKAPPA | KZETA | KTHETA | KDELTA: return S(KC_X); + case KKAPPA | KBETA | KIOTA: return S(KC_Y); + case KKAPPA | KZETA | KGAMMA | KDELTA: return S(KC_Z); + + // Unshifted Numbers + case KEPSILON | KZETA: return KC_0; + case KEPSILON | KZETA | KIOTA: return KC_1; + case KEPSILON | KZETA | KTHETA: return KC_2; + case KEPSILON | KBETA: return KC_3; + case KEPSILON | KBETA | KDELTA: return KC_4; + case KEPSILON | KBETA | KGAMMA: return KC_5; + case KEPSILON | KBETA | KIOTA: return KC_6; + case KEPSILON | KTHETA: return KC_7; + case KEPSILON | KBETA | KGAMMA | KIOTA: return KC_8; + case KEPSILON | KGAMMA | KDELTA: return KC_9; + + // Shifted Numbers + case KKAPPA | KEPSILON | KZETA | KIOTA: return KC_EXLM; + case KKAPPA | KEPSILON | KZETA | KTHETA: return KC_AT; + case KKAPPA | KEPSILON | KBETA: return KC_HASH; + case KKAPPA | KEPSILON | KBETA | KDELTA: return KC_DLR; + case KKAPPA | KEPSILON | KBETA | KGAMMA: return KC_PERC; + case KKAPPA | KEPSILON | KBETA | KIOTA: return KC_CIRC; + case KKAPPA | KEPSILON | KTHETA: return KC_AMPR; + case KKAPPA | KEPSILON | KBETA | KGAMMA | KIOTA: return KC_ASTR; + case KKAPPA | KEPSILON | KGAMMA | KDELTA: return KC_LPRN; + case KKAPPA | KEPSILON | KZETA: return KC_RPRN; + + // Unshifted Symbols + case KEPSILON | KBETA | KTHETA | KIOTA: return KC_MINS; + case KEPSILON | KZETA | KTHETA | KDELTA: return KC_EQL; + case KEPSILON | KZETA | KGAMMA: return KC_LBRC; + case KEPSILON | KGAMMA | KIOTA: return KC_RBRC; + case KEPSILON | KBETA | KTHETA: return KC_BSLS; + case KEPSILON | KBETA | KGAMMA | KDELTA: return KC_SCLN; + case KEPSILON | KZETA | KDELTA: return KC_QUOT; + case KEPSILON | KTHETA | KIOTA: return KC_COMM; + case KEPSILON | KZETA | KGAMMA | KDELTA: return KC_DOT; + case KEPSILON | KGAMMA: return KC_SLSH; + case KEPSILON | KDELTA: return KC_GRV; + + // Shifted Symbols + case KKAPPA | KEPSILON | KBETA | KTHETA | KIOTA: return KC_UNDS; + case KKAPPA | KEPSILON | KZETA | KTHETA | KDELTA: return KC_PLUS; + case KKAPPA | KEPSILON | KZETA | KGAMMA: return KC_LCBR; + case KKAPPA | KEPSILON | KGAMMA | KIOTA: return KC_RCBR; + case KKAPPA | KEPSILON | KBETA | KTHETA: return KC_PIPE; + case KKAPPA | KEPSILON | KBETA | KGAMMA | KDELTA: return KC_COLN; + case KKAPPA | KEPSILON | KZETA | KDELTA: return KC_DQT; + case KKAPPA | KEPSILON | KTHETA | KIOTA: return KC_LT; + case KKAPPA | KEPSILON | KZETA | KGAMMA | KDELTA: return KC_GT; + case KKAPPA | KEPSILON | KGAMMA: return KC_QUES; + case KKAPPA | KEPSILON | KDELTA: return KC_TILD; + + // Modifiers + case KALPHA | KIOTA: return LOCK; + + case KALPHA: return QK_ONE_SHOT_MOD; // Release all + + case KALPHA | KBETA: return OSM(MOD_LCTL); + case KALPHA | KGAMMA: return OSM(MOD_LSFT); + case KALPHA | KDELTA: return OSM(MOD_LALT); + case KALPHA | KKAPPA: return OSM(MOD_LGUI); + + case KALPHA | KBETA | KGAMMA: return OSM(MOD_LCTL | MOD_LSFT); + case KALPHA | KBETA | KDELTA: return OSM(MOD_LCTL | MOD_LALT); + case KALPHA | KBETA | KKAPPA: return OSM(MOD_LCTL | MOD_LGUI); + case KALPHA | KGAMMA | KDELTA: return OSM(MOD_LSFT | MOD_LALT); + case KALPHA | KGAMMA | KKAPPA: return OSM(MOD_LSFT | MOD_LGUI); + case KALPHA | KDELTA | KKAPPA: return OSM(MOD_LALT | MOD_LGUI); + + case KALPHA | KBETA | KGAMMA | KDELTA: return OSM(MOD_LCTL | MOD_LSFT | MOD_LALT); + case KALPHA | KBETA | KGAMMA | KKAPPA: return OSM(MOD_LCTL | MOD_LSFT | MOD_LGUI); + case KALPHA | KBETA | KDELTA | KKAPPA: return OSM(MOD_LCTL | MOD_LALT | MOD_LGUI); + case KALPHA | KGAMMA | KDELTA | KKAPPA: return OSM(MOD_LSFT | MOD_LALT | MOD_LGUI); + + case KALPHA | KBETA | KGAMMA | KDELTA | KKAPPA: return OSM(MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI); + } + + return NONE; +} + +static uint16_t *get_hand(keypos_t *key) { + if (key->row <= 3) { + return &left_chord; + } + + if (key->row <= 6) { + return &right_chord; + } + + // row 7 + if (key->col <= 2) { + return &right_chord; + } else { + return &left_chord; + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (keycode < ALPHA) { + return true; + } + + uint16_t *chord = get_hand(&record->event.key); + + if (record->event.pressed) { + *chord |= K(keycode); + return false; + } + + if (*chord != 0) { + process_keys(chord_to_keys(*chord)); + *chord = 0; + } + + return false; +} + +#ifdef KEYBOARD_planck_ez + +#define LED_BRIGHTNESS 50 + +layer_state_t default_layer_state_set_user(layer_state_t state) { + switch (state) { + case 1U << NORMAL: + planck_ez_left_led_off(); + planck_ez_right_led_off(); + break; + case 1U << QWERTY: + planck_ez_left_led_level(LED_BRIGHTNESS); + planck_ez_right_led_off(); + break; + case 1U << GAME: + planck_ez_left_led_off(); + planck_ez_right_led_level(LED_BRIGHTNESS); + break; + } + + return state; +} + +#endif /* KEYBOARD_planck_ez */ diff --git a/keyboards/planck/keymaps/buffet/readme.md b/keyboards/planck/keymaps/buffet/readme.md new file mode 100644 index 000000000000..223595b92c0b --- /dev/null +++ b/keyboards/planck/keymaps/buffet/readme.md @@ -0,0 +1,104 @@ +# buffet's planck layout + +## Layout + +The Layout is based on keychords. +The general idea is that you're able to type everything with either hand, so that you can alternate between hands as you type. + +The keys are in a 2x4 block in the top left and top right respectively (mirrored). +They have greek letter names (see `keymap.c` for more info). + +Thumb added to any key means shift is pressed as well. + +`-` means the finger presses nothing. +`^` means the finger presses the upper row. +`v` means the finger presses the lower row. + +``` +Space: thumb +Return: vvvv vvvv +Tab: vv^v v^vv +Bspace: v--v v--v +Esc: lower pinky and thumb +``` + +### Letters + +``` +a: -^-- --^- +b: -v-^ ^-v- +c: -^^^ ^^^- +d: -vvv vvv- +e: ---^ ^--- +f: --^v v^-- +g: -^v- -v^- +h: -vv- -vv- +i: --^- -^-- +j: -^^v v^^- +k: -^vv vv^- +l: -^^- -^^- +m: -^-^ ^-^- +n: -v-- --v- +o: --v- -v-- +p: -v^- -^v- +q: -^v^ ^v^- +r: --^^ ^^-- +s: --vv vv-- +t: ---v v--- +u: -v-v v-v- +v: --v^ ^v-- +w: -v^v v^v- +x: -vv^ ^vv- +y: -^-v v-^- +z: -v^^ ^^v- +``` + +### Numbers and Symbols + +``` +0: vv-- --vv +1: vv-v v-vv +2: vvv- -vvv +3: v^-- --^v +4: v^-^ ^-^v +5: v^^- -^^v +6: v^-v v-^v +7: v-v- -v-v +8: v^^v v^^v +9: v-^^ ^^-v +-: v^vv vv^v +=: vvv^ ^vvv +[: vv^- -^vv +]: v-^v v^-v +\: v^v- -v^v +;: v^^^ ^^^v +': vv-^ ^-vv +,: v-vv vv-v +.: vv^^ ^^vv +/: v-^- -^-v +`: v--^ ^--v +``` + +### Modifiers + +Modifiers all use the top pinky key, and a combinations of modifiers you want to activate for the next keypress (very similar to how OMS work). +For the modifiers the top row of keys is used. + +``` +Control: Ringfinger +Shift: Middlefinger +Alt: Indexfinger +Super: Thumb +``` + +`^--v v--^` can be used to lock the next modifier input. + +### Remaining + +These combinations are unused. + +``` +v^v^ +v-v^ +v--- +``` diff --git a/keyboards/planck/keymaps/buffet/rgb_matrix_user.inc b/keyboards/planck/keymaps/buffet/rgb_matrix_user.inc new file mode 100644 index 000000000000..e217d1010a3b --- /dev/null +++ b/keyboards/planck/keymaps/buffet/rgb_matrix_user.inc @@ -0,0 +1,18 @@ +RGB_MATRIX_EFFECT(rainbow_stripe) + +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static HSV rainbow_stripe_math(HSV hsv, uint8_t i, uint8_t time) { + if (i >= 14 && i <= 21) { + hsv.h = g_led_config.point[i].x - time; + } else { + hsv.v = 0; + } + return hsv; +} + +bool rainbow_stripe(effect_params_t* params) { + return effect_runner_i(params, &rainbow_stripe_math); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS diff --git a/keyboards/planck/keymaps/buffet/rules.mk b/keyboards/planck/keymaps/buffet/rules.mk new file mode 100644 index 000000000000..cda82158a2b6 --- /dev/null +++ b/keyboards/planck/keymaps/buffet/rules.mk @@ -0,0 +1,6 @@ +AUDIO_ENABLE = no +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +COMMAND_ENABLE = no +MOUSEKEY_ENABLE = no + +RGB_MATRIX_CUSTOM_USER = yes diff --git a/keyboards/planck/keymaps/buhearns/config.h b/keyboards/planck/keymaps/buhearns/config.h new file mode 100644 index 000000000000..142fa1df2143 --- /dev/null +++ b/keyboards/planck/keymaps/buhearns/config.h @@ -0,0 +1,15 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(MARIO_MUSHROOM) + #define UNICODE_SONG_MAC SONG(COIN_SOUND) + #define UNICODE_SONG_LNX SONG(UNICODE_LINUX) + #define UNICODE_SONG_WIN SONG(UNICODE_WINDOWS) + #define UNICODE_SONG_WINC SONG(UNICODE_WINDOWS) +#endif + +#define ENCODER_RESOLUTION 4 +#define MOUSEKEY_DELAY 300 +#define MOUSEKEY_INTERVAL 50 +#define MOUSEKEY_MAX_SPEED 8 +#define MOUSEKEY_TIME_TO_MAX 20 diff --git a/keyboards/planck/keymaps/buhearns/keymap.c b/keyboards/planck/keymaps/buhearns/keymap.c new file mode 100644 index 000000000000..ea7e516e3403 --- /dev/null +++ b/keyboards/planck/keymaps/buhearns/keymap.c @@ -0,0 +1,99 @@ +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum custom_keycodes { + B_UPD = SAFE_RANGE, + B_SSH, + B_SSHK, + B_USR, + B_X11, + B_X12, + B_X13 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[0] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT(5,KC_TAB),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(4,KC_BSLS), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_RSFT,KC_ENT), + KC_LCTL, KC_LGUI, KC_LALT, MO(3), MO(2), KC_SPC, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +[1] = LAYOUT_planck_grid( + KC_TRNS, B_UPD, B_USR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_7, KC_8, KC_9, KC_DEL, + KC_TRNS, B_SSH, B_SSHK, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_4, KC_5, KC_6, KC_TRNS, + KC_TRNS, B_X11, B_X12, B_X13, KC_NO, KC_NO, KC_NO, KC_NO, KC_1, KC_2, KC_3, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_PDOT, KC_PPLS, KC_PMNS +), + +[2] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SLSH, KC_QUOT, KC_MINS, KC_LCBR, KC_RCBR, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_DQUO, KC_EQL, KC_LBRC, KC_RBRC, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UNDS, KC_LT, KC_GT, KC_NO +), + +[3] = LAYOUT_planck_grid( + KC_TRNS, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_NO, KC_PSCR, KC_SCRL, KC_PAUS, KC_DEL, + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_PGUP, KC_MS_U, KC_PGDN, KC_TRNS, + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_HOME, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_BTN3, KC_END +), + +[4] = LAYOUT_planck_grid( + KC_TRNS, QK_BOOT, DB_TOGG, KC_NO, KC_NO, KC_NO, KC_NO, MU_NEXT, AU_NEXT, MU_ON, AU_ON, KC_EJCT, + KC_TRNS, EE_CLR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, AU_PREV, MU_OFF, AU_OFF, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MUTE, KC_MPRV, KC_MNXT, KC_NO, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MSTP, KC_VOLD, KC_VOLU, KC_MPLY +), + +[5] = LAYOUT_planck_grid( + UC(0xB0), UC(0xB9), UC(0xB2), UC(0xB3), UC(0xDF), UC(0x20AC), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, UC(0xC4), UC(0xD6), UC(0xDC), UC(0xBB), UC(0xAB), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, UC(0xE4), UC(0xF6), UC(0xFC), UC(0x2022), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, UC_MAC, UC_LINX, UC_WIN, UC_WINC +)}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case B_UPD: + if (record->event.pressed) { + SEND_STRING("sudo apt update && sudo apt full-upgrade -yyy" SS_TAP(X_ENTER)); + } + break; + case B_SSH: + if (record->event.pressed) { + SEND_STRING("cd /etc/ssh" SS_TAP(X_ENTER) "sudo shasum ssh_host_*" SS_TAP(X_ENTER) "sudo rm ssh_host_*" SS_TAP(X_ENTER) "sudo dpkg-reconfigure openssh-server" SS_TAP(X_ENTER)); + } + break; + case B_SSHK: + if (record->event.pressed) { + SEND_STRING("ssh-keygen -t ed25519" SS_TAP(X_ENTER) SS_TAP(X_ENTER) SS_TAP(X_ENTER) SS_TAP(X_ENTER)); + } + break; + case B_USR: + if (record->event.pressed) { + SEND_STRING("useradd -m user" SS_TAP(X_ENTER) "usermod -a -G sudo user" SS_TAP(X_ENTER) "chsh -s /bin/bash user" SS_TAP(X_ENTER) "passwd user" SS_TAP(X_ENTER)); + } + break; + case B_X11: + if (record->event.pressed) { + SEND_STRING("sudo x11vnc -storepasswd /etc/x11vnc.pass" SS_TAP(X_ENTER)); + } + break; + case B_X12: + if (record->event.pressed) { + SEND_STRING("sudo nano /lib/systemd/system/x11vnc.service" SS_TAP(X_ENTER) "[Unit]" SS_TAP(X_ENTER) "Description=Start X11VNC" SS_TAP(X_ENTER) "After=multi-user.target" SS_TAP(X_ENTER) SS_TAP(X_ENTER) "[Service]" SS_TAP(X_ENTER) "Type=simple" SS_TAP(X_ENTER) "ExecStart=/usr/bin/x11vnc -display :0 -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared -localhost -o /var/log/x11vnc.log" SS_TAP(X_ENTER) SS_TAP(X_ENTER) "[Install]" SS_TAP(X_ENTER) "WantedBy=multi-user.target"); + } + break; + case B_X13: + if (record->event.pressed) { + SEND_STRING("sudo systemctl enable x11vnc.service" SS_TAP(X_ENTER)); + } + break; + } + return true; +}; diff --git a/keyboards/planck/keymaps/buhearns/readme.md b/keyboards/planck/keymaps/buhearns/readme.md new file mode 100644 index 000000000000..4dcf4f05dbb6 --- /dev/null +++ b/keyboards/planck/keymaps/buhearns/readme.md @@ -0,0 +1,20 @@ +Buhearns Keymap (February 12th, 2019) +===================================== + +Simple QWERTY keymap with german Unicode umlauts, special characters and several Linux commands. Intended to be working with ENGLISH layout. + + +## Buhearns base layer +``` + ,-----------------------------------------------------------------------------------. + | GESC | Q | W | E | R | T | Y | U | I | O | P | BKSP | + |------+------+------+------+------+-------------+------+------+------+------+------| + |M5/TAB| A | S | D | F | G | H | J | K | L | ; |M4/BSL| hold: M5, tap: TAB // hold: M4, tap: Backslash + |------+------+------+------+------+------|------+------+------+------+------+------| + |LSHIFT| Z | X | C | V | B | N | M | , | . | / |ST/ENT| hold: RSHIFT, tap: Enter + |------+------+------+------+------+------+------+------+------+------+------+------| + | CTRL | LGUI | LALT | M3 | M2 | SPACE | M1 | LEFT | DOWN | UP | RIGHT| + `-----------------------------------------------------------------------------------' +``` + +## Other layers are a WIP and being tested (DON'T WAIT FOR UPDATES!) diff --git a/keyboards/planck/keymaps/buhearns/rules.mk b/keyboards/planck/keymaps/buhearns/rules.mk new file mode 100644 index 000000000000..13e6567c9841 --- /dev/null +++ b/keyboards/planck/keymaps/buhearns/rules.mk @@ -0,0 +1,13 @@ +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/charlesrocket/config.h b/keyboards/planck/keymaps/charlesrocket/config.h new file mode 100644 index 000000000000..070635a38d5a --- /dev/null +++ b/keyboards/planck/keymaps/charlesrocket/config.h @@ -0,0 +1,35 @@ +#pragma once + +#ifdef AUDIO_ENABLE +#define STARTUP_SONG SONG(PLANCK_SOUND) +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC +#define AUDIO_CLICKY +#define AUDIO_CLICKY_FREQ_DEFAULT 2360.0f +#define AUDIO_CLICKY_FREQ_MAX 9500.0f +#define AUDIO_CLICKY_FREQ_RANDOMNESS 0.05f +#define DAC_SAMPLE_MAX 9754U + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 +#define ORYX_CONFIGURATOR \ No newline at end of file diff --git a/keyboards/planck/keymaps/charlesrocket/keymap.c b/keyboards/planck/keymaps/charlesrocket/keymap.c new file mode 100644 index 000000000000..4d3d16f4a7a8 --- /dev/null +++ b/keyboards/planck/keymaps/charlesrocket/keymap.c @@ -0,0 +1,205 @@ +#include QMK_KEYBOARD_H +#ifdef AUDIO_ENABLE +#include "muse.h" +#endif +#include "eeprom.h" + +#define KC_MAC_UNDO LGUI(KC_Z) +#define KC_MAC_CUT LGUI(KC_X) +#define KC_MAC_COPY LGUI(KC_C) +#define KC_MAC_PASTE LGUI(KC_V) +#define KC_PC_UNDO LCTL(KC_Z) +#define KC_PC_CUT LCTL(KC_X) +#define KC_PC_COPY LCTL(KC_C) +#define KC_PC_PASTE LCTL(KC_V) +#define ES_LABK_MAC KC_GRAVE +#define ES_RABK_MAC LSFT(KC_GRAVE) +#define ES_BSLS_MAC ALGR(KC_6) +#define NO_PIPE_ALT KC_GRAVE +#define NO_BSLS_ALT KC_EQUAL +#define LSA_T(kc) MT(MOD_LSFT | MOD_LALT, kc) + +enum planck_keycodes { + RGB_SLD = SAFE_RANGE, +}; + +enum planck_layers { + _BASE, + _LOWER, + _RAISE, + _ADJUST, +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_planck_grid( + 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_ESCAPE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOTE, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_ENTER, + WEBUSB_PAIR, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPACE, KC_NO, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT + ), + + [_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + KC_DELETE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NONUS_HASH, KC_NUBS, KC_HOME, KC_END, _______, + KC_COMMA, _______, _______, _______, _______, _______, KC_NO, _______, KC_MEDIA_NEXT_TRACK, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE + ), + + [_RAISE] = LAYOUT_planck_grid( + KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + KC_DELETE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINUS, KC_EQUAL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NONUS_HASH, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, KC_NO, _______, KC_MEDIA_NEXT_TRACK, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE + ), + + [_ADJUST] = LAYOUT_planck_grid( + _______, CK_UP, _______, _______, _______, _______, _______, _______, _______,_______, _______, _______, + KC_DELETE, CK_TOGG, AU_ON, AU_OFF, AU_TOGG, _______, _______, _______, RGB_VAI,RGB_VAD , _______, QK_BOOT, + _______, CK_DOWN, MU_ON, MU_OFF, MU_TOGG, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_NO, _______, _______, _______, _______, _______ + ), + +}; + +extern bool g_suspend_state; +extern rgb_config_t rgb_matrix_config; + +void keyboard_post_init_user(void) { + rgb_matrix_enable(); +} + +const uint8_t PROGMEM ledmap[][RGB_MATRIX_LED_COUNT][3] = { + [0] = { {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255} }, + + [1] = { {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255} }, + + [2] = { {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255} }, + + [3] = { {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255} }, + +}; + +void set_layer_color(int layer) { + for (int i = 0; i < RGB_MATRIX_LED_COUNT; i++) { + HSV hsv = { + .h = pgm_read_byte(&ledmap[layer][i][0]), + .s = pgm_read_byte(&ledmap[layer][i][1]), + .v = pgm_read_byte(&ledmap[layer][i][2]), + }; + if (!hsv.h && !hsv.s && !hsv.v) { + rgb_matrix_set_color( i, 0, 0, 0 ); + } else { + RGB rgb = hsv_to_rgb( hsv ); + float f = (float)rgb_matrix_config.hsv.v / UINT8_MAX; + rgb_matrix_set_color( i, f * rgb.r, f * rgb.g, f * rgb.b ); + } + } +} + +bool rgb_matrix_indicators_user(void) { + if (g_suspend_state || keyboard_config.disable_layer_led) { return; } + switch (get_highest_layer(layer_state)) { + case 0: + set_layer_color(0); + break; + case 1: + set_layer_color(1); + break; + case 2: + set_layer_color(2); + break; + case 3: + set_layer_color(3); + break; + default: + if (rgb_matrix_get_flags() == LED_FLAG_NONE) + rgb_matrix_set_color_all(0, 0, 0); + break; + } + return false; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case RGB_SLD: + if (record->event.pressed) { + rgblight_mode(1); + } + return false; + } + return true; +} + +#ifdef AUDIO_ENABLE +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} diff --git a/keyboards/planck/keymaps/charlesrocket/readme.md b/keyboards/planck/keymaps/charlesrocket/readme.md new file mode 100644 index 000000000000..9e9f0d255142 --- /dev/null +++ b/keyboards/planck/keymaps/charlesrocket/readme.md @@ -0,0 +1,55 @@ +# Red Planck EZ (Glow) with beeps + +QWERTY layout with colored layers (red, purple, green and white) for Planck EZ Glow. Soft beep feedback is On by default. Sound level is hardcoded with `DAC_SAMPLE_MAX` and tone settings (`CK`) are in Adjust (WHITE) layer. + +``` +RED Base + ,-----------------------------------------------------------------------------------. + | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Esc | A | S | D | F | G | H | J | K | L | ; | " | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + |------+------+------+------+------+------+------+------+------+------+------+------| + | QMK | Ctrl | Alt | OS |Lower | Space |Raise | Left | Down | Up |Right | + `-----------------------------------------------------------------------------------' +``` + +``` +PURPLE Lower + ,-----------------------------------------------------------------------------------. + | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | |Lower | |Raise | Next | Vol- | Vol+ | Play | + `-----------------------------------------------------------------------------------' +``` + +``` +GREEN Raise + ,-----------------------------------------------------------------------------------. + | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | |Lower | |Raise | Next | Vol- | Vol+ | Play | + `-----------------------------------------------------------------------------------' +``` + +``` +WHITE (Lower + Raise) + ,-----------------------------------------------------------------------------------. + | | CkUp | | | | | | | | | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Del | CkTg |Aud On|AudOff|AudTog| | | |BRGTH+|BRGTH-| | Reset| + |------+------+------+------+------+------+------+------+------+------+------+------| + | | CkDn |Mus On|MusOff|MusTog| | | | | | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | |Lower | |Raise | | | | | + `-----------------------------------------------------------------------------------' +``` diff --git a/keyboards/planck/keymaps/charlesrocket/rules.mk b/keyboards/planck/keymaps/charlesrocket/rules.mk new file mode 100644 index 000000000000..6e4985a8b171 --- /dev/null +++ b/keyboards/planck/keymaps/charlesrocket/rules.mk @@ -0,0 +1,8 @@ +SRC += muse.c +# Set any rules.mk overrides for your specific keymap here. +# See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file +LTO_ENABLE = yes +COMMAND_ENABLE = no +MOUSEKEY_ENABLE = no +WEBUSB_ENABLE = yes +ORYX_ENABLE = yes diff --git a/keyboards/planck/keymaps/charlie/keymap.c b/keyboards/planck/keymaps/charlie/keymap.c new file mode 100644 index 000000000000..4a3adba51331 --- /dev/null +++ b/keyboards/planck/keymaps/charlie/keymap.c @@ -0,0 +1,22 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_planck_grid( /* Native */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, DF(1), + 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] = LAYOUT_planck_grid( /* QWERTY->PHOTOSHOP */ + KC_DELETE, KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, DF(0), + KC_O, KC_G, KC_S, KC_U, KC_T, C(KC_R), KC_F21, KC_F10, KC_F11, KC_F7, KC_F8, KC_F9, + KC_TAB, C(S(A(KC_F9))), C(S(KC_I)), S(KC_M), KC_F1, A(KC_BSPC), KC_F18, KC_F19, KC_F23, KC_F20, KC_F22, C(S(A(KC_F12))), + KC_COMM, KC_DOT, KC_R, C(KC_H), MO(2), KC_SPC, C(KC_S), KC_F2, C(S(A(KC_X))), KC_F3, KC_F14 + ), + [2] = LAYOUT_planck_grid( /* PHOTOSHOP */ + KC_ESC, C(KC_Z), C(KC_Y), 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, C(S(A(KC_F7))), C(S(A(KC_F8))), C(S(KC_X)), + KC_C, KC_NO, S(KC_MINS), C(S(KC_I)), KC_NO, C(S(KC_BSPC)), KC_NO, KC_NO, KC_NO, KC_NO, C(S(KC_F5)), KC_NO, + C(KC_F2), C(S(KC_F2)), C(KC_0), C(S(KC_H)), MO(2), KC_SPC, C(S(KC_S)), KC_NO, KC_NO, KC_F24, KC_NO + ) +}; diff --git a/keyboards/planck/keymaps/charlie/rules.mk b/keyboards/planck/keymaps/charlie/rules.mk new file mode 100644 index 000000000000..d86b02fd1ce4 --- /dev/null +++ b/keyboards/planck/keymaps/charlie/rules.mk @@ -0,0 +1,22 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/circuit/Readme.md b/keyboards/planck/keymaps/circuit/Readme.md new file mode 100644 index 000000000000..58ea0140fdb2 --- /dev/null +++ b/keyboards/planck/keymaps/circuit/Readme.md @@ -0,0 +1,46 @@ +##Design goals: +1. Arrow keys always available. +2. As close to a to my US layout 107-key QWERTY keyboard as I could manage, (i.e. as few arbitrary decisions as possible). +3. Togglable DVORAK keyboard. +4. most frequently used things in the easiest to reach places. +5. Ability to game on it, just for fun. + +My layout differs from most in the placement the ARROW keys, `ESC`, VOL keys, use of double-tap `CAPS`, and the GAME LOCK function. + +I put the layer buttons in the usual spots. I originally wanted only function/symbols layer, but that proved detrimental. I use some timed press actions to save some space, but this has been accounted for, (see GAME LOCK below). I'm not fully satisfied with the current product (see NOTES below), so it may change in the future. + +##Effective layers: +* Default later is obviously your letters and modifiers. +* Lower layer [NUMBER] is your numbers and punctuation. +* Upper layer [ACTION] is your symbols and actions. +* Function layer is the infrequently used function keys, layout toggle, game lock, and reset. + +There is also a toggle for the DVORAK/QWERTY layers, but in normal typing this is not of concern. + +###Special keys: +* `RSHFT` and `ENTER` are combined. Tap once for `ENTER` and hold for `RSHFT`. `ENTER` will be registered on release if released within 200 ms, else `RSHFT` is registered starting at 201 ms until release. +* If for some reason, this interferes with the normal usage of the `ENTER` key in any way, (some problem that may never happen), I have added a regular non-modified `ENTER` key on the same key in the [ACTION] layer. +* `LSHFT` and `CAPS` are also combined. The key works like a normal `LSHFT` unless double-tapped, in which case it counts as `CAPS`. This functionality unfortunately delays all key presses by at most 200 ms, but I have added ways to disable this both temporarily or permanently, described below. +* A failsafe `CAPS` key is on the same key in the [ACTION] layer. +* There are `UNDO`, `CUT`, `COPY`, and `PASTE` keys. This was intended to be a universal way to use these commands since in macOS cut is `⌘ + C` but in Windows it is `⌃ + C`. Unfortunately these special keys only work in Windows. ¯\\\_(ツ)\_/¯ + +##Game lock: +**TL;DR** the game lock toggle disables the double-tap `CAPS`, and disables `GUI` keys (WINDOWS key). + +I wished for this keyboard to be fully usable in the most demanding of games. The most demanding game I know of is ARMA 3 which has a binding to practically every individual key of a 107-key keyboard. This means I need to have pretty much every key possible somewhere. I also wanted the keyboard to be responsive in games for every critical keypress. This means having a way to disable features that introduce an inherent delay to registering keys, such as double-tap. + +I do not expect to see this used by the pros, but I enjoyed making it. As for use in ARMA 3, I got a little ways into the APEX campaign, but I found a few flaws. For Example, I cannot enable my HUD GPS since that requires `RCTRL`+`M` but `RCTRL` is not bound. The obvious fix is to rebind the action to a new key, but I still take this as a shortcoming of my layout. + +###If you wish to disable double-tap +####Disable it temporarily +Turn on the game lock. While on, it registers as normal `LSHFT` and has no delay. Whether in game mode or not, `CAPS` is on the same key in the [ACTION] layer. + +####Disable it permanently +Open the `Makefile` and set `TAP_DANCE_ENABLE = no`. I wrote the layout to compensate for this change, and no further changes to the code should be necessary. Whether or not it's disabled, `CAPS` is on the same key in the [ACTION] layer. + +##Notes: +* `ALT` and `GUI` are reversed compared to the normal US layout. I will also be using my Planck on my mac, and that's the standard in the Apple ecosystem. I may add a special compiler flag in the future to swap the two. +* The DVORAK `Z` key is to the right of the `S` key instead of under it as part of a compromise I made to keep the ARROW keys available on the default layer. I prioritize the ARROW keys, so the DVORAK layout is the one to suffer. +* I also support the little tones that the default Planck layout features, identical to them too, (minus those for layouts I don't support). To enable it, open the `Makefile` and set `AUDIO_ENABLE = yes`. + +![keyboard-layout](https://i.imgur.com/HHSZSQq.png) diff --git a/keyboards/planck/keymaps/circuit/config.h b/keyboards/planck/keymaps/circuit/config.h new file mode 100644 index 000000000000..2bebf48a1ca9 --- /dev/null +++ b/keyboards/planck/keymaps/circuit/config.h @@ -0,0 +1,26 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/circuit/keymap.c b/keyboards/planck/keymaps/circuit/keymap.c new file mode 100644 index 000000000000..d150905dc89c --- /dev/null +++ b/keyboards/planck/keymaps/circuit/keymap.c @@ -0,0 +1,245 @@ +// Layout picture at http://www.keyboard-layout-editor.com/#/gists/125febfad6960add078e6f14256539b6 + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _DVORAK 1 +#define _LOCKED 2 +#define _NUMBER 3 +#define _ACTION 4 +#define _FUNCTN 5 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + DVORAK, + NUMBER, + ACTION +}; + +// Key code names +#define SFT_ENT MT(MOD_RSFT, KC_ENT) // Tap for enter, hold for right shift +#define LOCK TG(_LOCKED) +#define KC_PSTE KC_PASTE + +#ifdef TAP_DANCE_ENABLE +#define SFT_CAP TD(0) // Left shift, double tap for caps +#endif +#ifndef TAP_DANCE_ENABLE +#define SFT_CAP KC_LSFT // Regular left shift +#endif + +// Tap Dance Definitions +#ifdef TAP_DANCE_ENABLE +tap_dance_action_t tap_dance_actions[] = { + [0] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) +}; +#endif + +// Layout definitions +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | BKSP | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |*Shift| Z | X | C | V | B | N | M | , | . | Up |SftEnt| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | Alt | Cmd | Vol- | ACTN | Space | NUMS | Vol+ | Left | Down | Left | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + SFT_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SFT_ENT, + KC_LCTL, KC_LALT, KC_LGUI, KC_VOLD, ACTION, KC_SPC, KC_SPC, NUMBER, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT +), + +/* DVORAK + * ,-----------------------------------------------------------------------------------. + * | | ' | , | . | P | Y | F | G | C | R | L | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | A | O | E | U | I | D | H | T | N | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | ; | Q | J | K | X | B | M | W | V | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______, + _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_Z , + _______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* LOCK + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | NULL | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LOCKED] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* NUMBERS + * ,-----------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | ~ | NULL | NULL | NULL | | | _ | + | { | } | ? | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | ` | NULL | NULL | NULL | \ | - | = | [ | ] | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | NULL | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_NUMBER] = LAYOUT_planck_grid( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, KC_TILD, XXXXXXX, XXXXXXX, XXXXXXX, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_QUES, KC_SLSH, + _______, KC_GRV, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, _______, + _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______ +), + +/* ACTIONS + * ,-----------------------------------------------------------------------------------. + * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | CAPS | Undo | Cut | Copy | Paste| NULL | NULL | NULL | NULL | NULL | PgUp | Enter| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | Mute | | NULL | | NULL | Home | PgDn | End | + * `-----------------------------------------------------------------------------------' + */ +[_ACTION] = LAYOUT_planck_grid( + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL , + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_CAPS, KC_UNDO, KC_CUT, KC_COPY, KC_PSTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, KC_ENT , + _______, _______, _______, KC_MUTE, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_HOME, KC_PGDN, KC_END +), + +/* FUNCTIONS + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | F21 | F22 | F23 | F24 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | NULL | NULL | NULL | NULL | NULL |QWERTY|DVORAK| NULL | NULL | NULL | NULL | NULL | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Reset| NULL | Lock | NULL | | NULL | | NULL | NULL | NULL | NULL | + * `-----------------------------------------------------------------------------------' + */ +[_FUNCTN] = LAYOUT_planck_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 , + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24 , + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, QWERTY, DVORAK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + QK_BOOT, XXXXXXX, LOCK, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +) + +}; + +#ifdef AUDIO_ENABLE +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + if (IS_LAYER_ON(_DVORAK)) { +#ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); +#endif + layer_off(_DVORAK); + } + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + if (!IS_LAYER_ON(_DVORAK)) { +#ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); +#endif + layer_on(_DVORAK); + } + } + return false; + break; + case NUMBER: + if (record->event.pressed) { + layer_on(_NUMBER); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } else { + layer_off(_NUMBER); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } + return false; + break; + case ACTION: + if (record->event.pressed) { + layer_on(_ACTION); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } else { + layer_off(_ACTION); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { +#ifdef AUDIO_ENABLE + startup_user(); +#endif +} + +#ifdef AUDIO_ENABLE + +void startup_user(void) +{ + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user(void) +{ + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif diff --git a/keyboards/planck/keymaps/circuit/rules.mk b/keyboards/planck/keymaps/circuit/rules.mk new file mode 100644 index 000000000000..14247d1a5c4d --- /dev/null +++ b/keyboards/planck/keymaps/circuit/rules.mk @@ -0,0 +1,22 @@ + +# Build Options +# change to "no" to disable the options, or define them in the makefile.mk in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +TAP_DANCE_ENABLE = yes # Enables the double-tap functionality of keys + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/coloneljesus/config.h b/keyboards/planck/keymaps/coloneljesus/config.h new file mode 100644 index 000000000000..928ddb1617eb --- /dev/null +++ b/keyboards/planck/keymaps/coloneljesus/config.h @@ -0,0 +1,38 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/coloneljesus/keymap.c b/keyboards/planck/keymaps/coloneljesus/keymap.c new file mode 100644 index 000000000000..0ccc932cb01a --- /dev/null +++ b/keyboards/planck/keymaps/coloneljesus/keymap.c @@ -0,0 +1,260 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | App |Lower | Space |Raise | - | = | \ | Alt | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT) , + KC_LCTL, KC_LGUI, KC_LALT, KC_APP, LOWER, KC_SPC, KC_SPC, RAISE, KC_MINS, KC_EQL, KC_BSLS, KC_RALT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | { | } | Del | Home | PgDn | PgUp | End | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Mute | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + _______, _______, _______, KC_LCBR, KC_RCBR, KC_DEL, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, S(KC_NUHS), KC_MPRV, KC_MNXT, S(KC_NUBS), _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MPLY, KC_MUTE +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | [ | ] | Del | Left | Down | Up | Right| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Mute | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_LBRC, KC_RBRC, KC_DEL, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_MPRV, KC_MNXT, KC_NUBS, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MPLY, KC_MUTE +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/coloneljesus/readme.md b/keyboards/planck/keymaps/coloneljesus/readme.md new file mode 100644 index 000000000000..31107f59ce08 --- /dev/null +++ b/keyboards/planck/keymaps/coloneljesus/readme.md @@ -0,0 +1,2 @@ +# /u/Coloneljesus's Planck Layout + diff --git a/keyboards/planck/keymaps/copface/config.h b/keyboards/planck/keymaps/copface/config.h new file mode 100644 index 000000000000..da5d3858c834 --- /dev/null +++ b/keyboards/planck/keymaps/copface/config.h @@ -0,0 +1,17 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MIDI_BASIC +#define ENCODER_RESOLUTION 4 + +#define LEADER_TIMEOUT 300 +#define TAPPING_TERM 180 diff --git a/keyboards/planck/keymaps/copface/keymap.c b/keyboards/planck/keymaps/copface/keymap.c new file mode 100644 index 000000000000..376ceeb288ed --- /dev/null +++ b/keyboards/planck/keymaps/copface/keymap.c @@ -0,0 +1,197 @@ +#include QMK_KEYBOARD_H +#include "muse.h" + +// Custom Keycode Definitions +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define META MO(_META) + +#define KC_PRS LGUI(LALT(LCTL(KC_4))) +#define KC_EUR LALT(KC_4) +#define KC_MGRV LALT(KC_GRV) + +#define KC_FORMAT LGUI(LALT(KC_L)) +#define KC_FBSP LALT(KC_BSPC) +#define KC_FDEL LALT(KC_DEL) +#define KC_PS3 LSFT(LCTL(LGUI(KC_3))) +#define KC_PS4 LSFT(LCTL(LGUI(KC_4))) + +#define HK_TM LALT(KC_2) +#define HK_AF9 LALT(KC_F9) + +#define KC_SRC LGUI(KC_F12) +#define KC_RNME LSFT(KC_F6) + +#define M_LGSPC LGUI_T(KC_SPC) +#define M_LCENT LCTL_T(KC_ENT) +#define M_LGENT LGUI_T(KC_ENT) + +enum planck_layers { + _DEFAULT = 0, + _LOWER, + _RAISE, + _META, + _ADJUST +}; + +enum planck_keycodes { + KC_ARR = SAFE_RANGE, // -> + KC_FARR, // => + HK_CLOS, // /> + XD1, // :D + XD3, // :DDD + XD5, // :DDDDD + XD15, // :DDDDDDDDDDDDDDD +}; + +enum tapdancers { + T_BR = 0, // [, ] + T_PA, // (, ) + T_CU, // {, } + T_DL, // $, € + T_SL, // slash, backslash +}; + +//Tap Dance Definitions +tap_dance_action_t tap_dance_actions[] = { + [T_BR] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_RBRC), + [T_PA] = ACTION_TAP_DANCE_DOUBLE(KC_LPRN, KC_RPRN), + [T_CU] = ACTION_TAP_DANCE_DOUBLE(KC_LCBR, KC_RCBR), + [T_DL] = ACTION_TAP_DANCE_DOUBLE(KC_DLR, KC_EUR), + [T_SL] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_BSLS), +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_DEFAULT] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, XXXXXXX, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, XXXXXXX, QK_LEAD, + KC_LGUI, KC_LCTL, KC_LALT, KC_LALT, LOWER, KC_SPC, META, RAISE, KC_RALT, KC_MPRV, KC_MPLY, KC_MNXT +), + +[_LOWER] = LAYOUT_planck_grid( + KC_F1, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, XXXXXXX, XXXXXXX, XXXXXXX, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, XXXXXXX, + _______, HK_TM, XD1, XD3, XD5, XD15, XXXXXXX, XXXXXXX, KC_ARR, KC_FARR, HK_CLOS, XXXXXXX, + _______, _______, _______, _______, _______, KC_DEL, KC_FBSP, RAISE, KC_RALT, KC_VOLD, KC_MUTE, KC_VOLU +), + +[_RAISE] = LAYOUT_planck_grid( + KC_MGRV, KC_MINUS, KC_EQL, KC_EXLM, KC_QUES, KC_PLUS, KC_PGUP, KC_HOME, KC_UP, KC_END, XXXXXXX, KC_FBSP, + KC_TILD, TD(T_BR), TD(T_CU), TD(T_PA), TD(T_DL), KC_SLSH, KC_RNME, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, KC_FORMAT, + _______, KC_UNDS, KC_DQUO, KC_QUOT, KC_PIPE, KC_BSLS, XXXXXXX, KC_SCLN, KC_COLN, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, _______, _______, KC_DEL, KC_FDEL, _______, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU +), + +[_META] = LAYOUT_planck_grid( + XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SRC, XXXXXXX, + KC_CAPS, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, KC_F10, KC_F11, KC_F12, HK_AF9, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +), + +[_ADJUST] = LAYOUT_planck_grid( + XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, CG_TOGG, XXXXXXX, + XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, QK_BOOT +) +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_ARR: + if (record->event.pressed) { + SEND_STRING("->"); + } + + return false; + + case KC_FARR: + if (record->event.pressed) { + SEND_STRING("=>"); + } + + return false; + + case XD1: + if (record->event.pressed) { + SEND_STRING(":D"); + } + + return false; + + case XD3: + if (record->event.pressed) { + SEND_STRING(":DDD"); + } + + return false; + + case XD5: + if (record->event.pressed) { + SEND_STRING(":DDDDD"); + } + + return false; + + case XD15: + if (record->event.pressed) { + SEND_STRING(":DDDDDDDDDDDDDDD"); + } + + return false; + + case HK_CLOS: + if (record->event.pressed) { + SEND_STRING("/>"); + } + + return false; + } + + return true; +} + +void leader_end_user(void) { + // Screenshot + if (leader_sequence_one_key(KC_S)) { + tap_code16(G(C(S(KC_4)))); + } + // Record Screen + if (leader_sequence_two_keys(KC_S, KC_S)) { + tap_code16(S(G(KC_5))); + } + // 1Pass browser + if (leader_sequence_one_key(KC_A)) { + tap_code16(G(A(KC_BSLS))); + } + // 1Pass mini + if (leader_sequence_two_keys(KC_A, KC_A)) { + tap_code16(G(KC_BSLS)); + } + // Comment out + if (leader_sequence_one_key(KC_F)) { + tap_code16(G(KC_SLSH)); + } + // Spotlight + if (leader_sequence_one_key(KC_SPC)) { + tap_code16(G(KC_SPC)); + } + // Auto format + if (leader_sequence_one_key(KC_ENT)) { + tap_code16(S(G(A(KC_F)))); + } + // Focus file tree + if (leader_sequence_one_key(KC_TAB)) { + tap_code16(G(KC_1)); + } + // Caps-lock + if (leader_sequence_two_keys(KC_TAB, KC_TAB)) { + tap_code16(KC_CAPS); + } +} diff --git a/keyboards/planck/keymaps/copface/readme.md b/keyboards/planck/keymaps/copface/readme.md new file mode 100644 index 000000000000..56a048c4a9ef --- /dev/null +++ b/keyboards/planck/keymaps/copface/readme.md @@ -0,0 +1,11 @@ +# Copface's planck keyboard layout + +This layout utilizes tapdancing and leader keys as well as 3 extra layers for maximizing the efficiancy when programming. + +Please see the keymap.c for how the keymap looks and works. +The home row is filled with everything one could need when working on web development, +It's all a layer away. + +To build and flash this keymap, use this command: + + qmk compile -kb planck/rev6 -km copface diff --git a/keyboards/planck/keymaps/copface/rules.mk b/keyboards/planck/keymaps/copface/rules.mk new file mode 100644 index 000000000000..e259574a4e44 --- /dev/null +++ b/keyboards/planck/keymaps/copface/rules.mk @@ -0,0 +1,11 @@ +SRC += muse.c + +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no +CONSOLE_ENABLE = no +COMMAND_ENABLE = no +MIDI_ENABLE = no +AUDIO_ENABLE = yes +RGBLIGHT_ENABLE = no +TAP_DANCE_ENABLE = yes +LEADER_ENABLE = yes diff --git a/keyboards/planck/keymaps/corvec/config.h b/keyboards/planck/keymaps/corvec/config.h new file mode 100644 index 000000000000..ec955ebc5280 --- /dev/null +++ b/keyboards/planck/keymaps/corvec/config.h @@ -0,0 +1,49 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#define PERMISSIVE_HOLD + +// AutoShift config +#define AUTO_SHIFT_TIMEOUT 135 +#define NO_AUTO_SHIFT_SPECIAL +// #define NO_AUTO_SHIFT_NUMERIC +// #define NO_AUTO_SHIFT_ALPHA + +// TapDance config +#define TAPPING_TERM 150 + +#endif diff --git a/keyboards/planck/keymaps/corvec/keymap.c b/keyboards/planck/keymaps/corvec/keymap.c new file mode 100644 index 000000000000..dda349b2a62e --- /dev/null +++ b/keyboards/planck/keymaps/corvec/keymap.c @@ -0,0 +1,200 @@ +/* Copyright 2015-2018 Jack Humbert, Corey Kump + * + * 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 QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _COLEMAK, + _QWERTY, + _LOWER, + _LEANDOWN, + _RAISE, + _WOBBLE, + _PLOVER, + _ADJUST +}; + +/* This include relies on the layer constants above and so must be declared after them */ +#include "tapdance.c" + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + LOWER, + RAISE, + BACKLIT +}; + +/** + * Custom Corvec Bindings + * + * Previously used but currently unused bindings are commented out. + **/ + +// Activate the Wobble layer +#define KC_WOBL MO(_WOBBLE) +// Dual function with Raise +#define KC_RESC LT(_RAISE, KC_ESC) +// Dual functions with Lower +#define KC_LENT LT(_LOWER, KC_ENT) +#define KC_LQUT LT(_LEANDOWN, KC_QUOT) +// Dual functions with Shift +#define KC_SDEL MT(MOD_LSFT, KC_DEL) +#define KC_SAPP MT(MOD_LSFT, KC_APP) + +/** + * Functions taking advantage of tap dance: + **/ +// Tap once: quote. Hold: LEANDOWN layer. Tap twice: minus. +#define KC_TQTD TD(TD_QUOT_LEAN_MINS) +// Tap once: [. Hold: RALT. Tap twice: { +#define KC_TALT TD(TD_LBRC_RALT_LCBR) +// Tap once: ]. Hold: RGUI. Tap twice: } +#define KC_TGUI TD(TD_RBRC_RGUI_RCBR) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_COLEMAK] = LAYOUT_planck_grid( + //-----+----+----+----+----+----+----+----+----+----+----+---- + 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_RESC, KC_A , KC_R , KC_S , KC_T , KC_D , KC_H , KC_N , KC_E , KC_I , KC_O ,KC_TQTD, + //-----+----+----+----+----+----+----+----+----+----+----+---- + KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_K , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT, + //-----+----+----+----+----+----+----+----+----+----+----+---- + KC_LCTL,KC_LGUI,KC_WOBL,KC_LALT,KC_LENT, KC_SPC, KC_SPC,RAISE,KC_SDEL,KC_TALT,KC_TGUI,KC_RCTL + ), + + [_QWERTY] = LAYOUT_planck_grid( + //-----+----+----+----+----+----+----+----+----+----+----+---- + 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_RESC, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_TQTD, + //-----+----+----+----+----+----+----+----+----+----+----+---- + KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT, + //-----+----+----+----+----+----+----+----+----+----+----+---- + KC_LCTL,KC_LGUI,KC_WOBL,KC_LALT,KC_LENT, KC_SPC, KC_SPC,RAISE,KC_RALT,KC_SAPP,KC_RGUI,KC_RCTL + ), + + [_LOWER] = LAYOUT_planck_grid( + KC_GRV ,KC_EXLM, KC_AT ,KC_HASH, KC_DLR,KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,_______, + _______,KC_LPRN,KC_RPRN,KC_LBRC,KC_RBRC,XXXXXXX,KC_LEFT,KC_DOWN, KC_UP ,KC_RGHT,XXXXXXX,KC_MINS, + _______,KC_BSLS,KC_TILD,KC_PIPE,KC_EQL ,KC_UNDS,KC_HOME,KC_PGDN,KC_PGUP,KC_END ,KC_BSLS,_______, + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ + ), + + [_LEANDOWN] = LAYOUT_planck_grid( + KC_GRV ,KC_EXLM, KC_AT ,KC_HASH, KC_DLR,KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,_______, + _______,KC_LPRN,KC_RPRN,KC_LBRC,KC_RBRC,KC_LCBR,KC_LCBR,KC_DLR ,KC_PERC,KC_CIRC,_______,_______, + _______,KC_BSLS,KC_TILD,KC_PIPE,KC_EQL ,KC_UNDS,KC_HOME,KC_EXLM, KC_AT ,KC_HASH,KC_BSLS,_______, + _______,_______,_______,_______,_______,_______,_______,_______,KC_LEFT,KC_DOWN, KC_UP ,KC_RGHT + ), + + [_RAISE] = LAYOUT_planck_grid( + KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,_______, + _______,KC_LPRN,KC_RPRN,KC_LCBR,KC_RCBR,XXXXXXX,XXXXXXX, KC_4 , KC_5 , KC_6 ,KC_PPLS,KC_MINS, + _______,KC_BSLS,KC_TILD,KC_PIPE,KC_EQL ,KC_UNDS,XXXXXXX, KC_1 , KC_2 , KC_3 ,KC_PAST,_______, + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ + ), + + [_WOBBLE] = LAYOUT_planck_grid( + KC_GRV , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_NO ,KC_MUTE,KC_VOLD,KC_VOLU, KC_NO , KC_NO , KC_DEL, + _______, KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_NO ,KC_MPRV,KC_MPLY,KC_MSTP,KC_MNXT, KC_NO ,KC_BSLS, + _______, KC_F9 , KC_F10, KC_F11, KC_F12, KC_NO , KC_NO , KC_NO , KC_NO , KC_INS,KC_PSCR,_______, + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ + ), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * |Colemk| | Debug|RGB Tg|RGB Md|RGB H+|RGB H-|RGB S+|RGB S-|RGB V+|RGB V-|Qwerty| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk| |AS On | AS + | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | |AS Rep|AS Off| AS - | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | Reset| + * `-----------------------------------------------------------------------------------' + */ + +[_ADJUST] = LAYOUT_planck_grid( + COLEMAK, _______, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, QWERTY , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, _______, AS_ON, AS_UP, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, AS_RPT, AS_OFF, AS_DOWN, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + PORTE &= ~(1<<6); + } else { + unregister_code(KC_RSFT); + PORTE |= (1<<6); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/corvec/readme.md b/keyboards/planck/keymaps/corvec/readme.md new file mode 100644 index 000000000000..05591455560b --- /dev/null +++ b/keyboards/planck/keymaps/corvec/readme.md @@ -0,0 +1,28 @@ +# Corvec's Planck Layout + +This layout is a development-focused layout with an emphasis on ergonomics. It is intended to be used in Colemak mode, +but has a full-QWERTY mode for gaming compatibility. + +It utilizes redundancy for common keys so that they are more easily accessible in every task. For example, the common +layers, Raise and Lower, both can be activated with two different keys, each pressed with either hand. Certain symbols +( \~|+_ ) are on both layers, since the keys they take up are a bit out of the way. The minus symbol is available on the +quote key in a variety of ways - both layers, as well as via tap dance. + +The right-hand Lower activation key activates a slightly different layer. The keys accessed by the opposite hand are the +same as the Lower layer, but the keys on the right hand differ. For this reason, we refer to this instead as the +Leandown layer. + +Auto-shift is enabled, but there are also three shift keys, since typing with auto-shift is by necessity slow. + +Movement is done Vim-style, on the hjkl / hnei keys, on the Lower layer so that it is easiest to activate it. +The arrow keys are mimicked by Home/PgDn/PgUp/End on the next row. + +The arrow keys and broad navigation keys are replaced by a symbol-pad on the Leandown layer. However, in order to allow +single-hand navigation, the bottom right corner cluster becomes arrow keys. + +Media keys are in the same location as the arrow keys, but are on the Wobble layer instead. + +Toggle layers are minimized so that the state of the keyboard is more predictable. Shift Toggle is in the works, but +will not be included until it can be set to deactivate automatically. + +Delete is accessible from the third Shift key. diff --git a/keyboards/planck/keymaps/corvec/rules.mk b/keyboards/planck/keymaps/corvec/rules.mk new file mode 100644 index 000000000000..4398ea545274 --- /dev/null +++ b/keyboards/planck/keymaps/corvec/rules.mk @@ -0,0 +1,4 @@ +AUTO_SHIFT_ENABLE = yes +TAP_DANCE_ENABLE = yes +CONSOLE_ENABLE = no +EXTRAKEY_ENABLE = no diff --git a/keyboards/planck/keymaps/corvec/tapdance.c b/keyboards/planck/keymaps/corvec/tapdance.c new file mode 100644 index 000000000000..35eef2d838f9 --- /dev/null +++ b/keyboards/planck/keymaps/corvec/tapdance.c @@ -0,0 +1,156 @@ +/** + * Tap Dance config and functions + **/ +/* Copyright 2018 Corey Kump + * + * 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 . + */ + +enum { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, + DOUBLE_TAP = 3, + DOUBLE_SINGLE_TAP = 4, + UNKNOWN_TAPS = 5 +}; + +typedef struct { + bool is_press_action; + int state; +} tap; + +int cur_dance (tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) { + return SINGLE_TAP; + } else { + return SINGLE_HOLD; + } + } + if (state->count == 2) { + if (state->interrupted) { + return DOUBLE_SINGLE_TAP; + } else if (!state->pressed) { + return DOUBLE_TAP; + } + } + return UNKNOWN_TAPS; +} + +/** + * quote + **/ + +static tap quote_state = { + .is_press_action = true, + .state = 0 +}; + +void quote_finished(tap_dance_state_t *state, void *user_data) { + quote_state.state = cur_dance(state); + switch(quote_state.state) { + case SINGLE_TAP: register_code(KC_QUOT); break; + case SINGLE_HOLD: layer_on(_LEANDOWN); break; + case DOUBLE_TAP: register_code(KC_MINS); break; + case DOUBLE_SINGLE_TAP: register_code(KC_QUOT); unregister_code(KC_QUOT); register_code(KC_QUOT); break; + } +} +void quote_reset(tap_dance_state_t *state, void *user_data) { + switch(quote_state.state) { + case SINGLE_TAP: unregister_code(KC_QUOT); break; + case SINGLE_HOLD: layer_off(_LEANDOWN); break; + case DOUBLE_TAP: unregister_code(KC_MINS); break; + case DOUBLE_SINGLE_TAP: unregister_code(KC_QUOT); break; + } + quote_state.state = 0; +} + +/** + * ralt / left bracket / left curly brace + **/ + +static tap ralt_state = { + .is_press_action = true, + .state = 0 +}; + +void ralt_finished(tap_dance_state_t *state, void *user_data) { + ralt_state.state = cur_dance(state); + switch(ralt_state.state) { + case SINGLE_TAP: register_code(KC_LBRC); break; + case SINGLE_HOLD: register_code(KC_RALT); break; + case DOUBLE_TAP: register_code(KC_LSFT); register_code(KC_LBRC); break; + // fallback to alt because it's the primary purpose of this key + case DOUBLE_SINGLE_TAP: register_code(KC_RALT); break; + } +} +void ralt_reset(tap_dance_state_t *state, void *user_data) { + switch(ralt_state.state) { + case SINGLE_TAP: unregister_code(KC_LBRC); break; + case SINGLE_HOLD: unregister_code(KC_RALT); break; + case DOUBLE_TAP: unregister_code(KC_LBRC); unregister_code(KC_LSFT); break; + case DOUBLE_SINGLE_TAP: unregister_code(KC_RALT); break; + } + ralt_state.state = 0; +} + +/** + * rgui / right bracket / right curly brace + **/ + +static tap rgui_state = { + .is_press_action = true, + .state = 0 +}; + +void rgui_finished(tap_dance_state_t *state, void *user_data) { + rgui_state.state = cur_dance(state); + switch(rgui_state.state) { + case SINGLE_TAP: register_code(KC_RBRC); break; + case SINGLE_HOLD: register_code(KC_RGUI); break; + case DOUBLE_TAP: register_code(KC_LSFT); register_code(KC_RBRC); break; + // fallback to alt because it's the primary purpose of this key + case DOUBLE_SINGLE_TAP: register_code(KC_RGUI); break; + } +} +void rgui_reset(tap_dance_state_t *state, void *user_data) { + switch(rgui_state.state) { + case SINGLE_TAP: unregister_code(KC_RBRC); break; + case SINGLE_HOLD: unregister_code(KC_RGUI); break; + case DOUBLE_TAP: unregister_code(KC_RBRC); unregister_code(KC_LSFT); break; + case DOUBLE_SINGLE_TAP: unregister_code(KC_RGUI); break; + } + rgui_state.state = 0; +} + +/** + * Define the available tap dance keys + **/ + +enum { + TD_ALT_SHIFT = 0, + TD_LQUT_MINS, + TD_QUOT_LEAN_MINS, + TD_LBRC_RALT_LCBR, + TD_RBRC_RGUI_RCBR +}; + +tap_dance_action_t tap_dance_actions[] = { + // Tap once for Alt, twice for Shift + [TD_ALT_SHIFT] = ACTION_TAP_DANCE_DOUBLE(KC_RALT, KC_RSFT), + [TD_QUOT_LEAN_MINS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, quote_finished, quote_reset), + [TD_LBRC_RALT_LCBR] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ralt_finished, ralt_reset), + [TD_RBRC_RGUI_RCBR] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rgui_finished, rgui_reset) +}; + diff --git a/keyboards/planck/keymaps/csc027/config.h b/keyboards/planck/keymaps/csc027/config.h new file mode 100644 index 000000000000..2a620db279f7 --- /dev/null +++ b/keyboards/planck/keymaps/csc027/config.h @@ -0,0 +1,21 @@ +/* +Copyright 2021 Constantine Chen @csc027 + +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 . +*/ + +#pragma once + +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/keyboards/planck/keymaps/csc027/keymap.c b/keyboards/planck/keymaps/csc027/keymap.c new file mode 100644 index 000000000000..71155eca7520 --- /dev/null +++ b/keyboards/planck/keymaps/csc027/keymap.c @@ -0,0 +1,79 @@ +/* +Copyright 2020 Constantine Chen @csc027 + +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 QMK_KEYBOARD_H +#include "csc027.h" + +#define LAYOUT_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = LAYOUT_wrapper( + _____________________QWERTY_L1_____________________, _____________________QWERTY_R1_____________________, + _____________________QWERTY_L2_____________________, _____________________QWERTY_R2_____________________, + _____________________QWERTY_L3_____________________, _____________________QWERTY_R3_____________________, + _____________________QWERTY_L4_____________________, _____________________QWERTY_R4_____________________ + ), + + [_RS] = LAYOUT_wrapper( + ______________________RAISE_L1_____________________, ______________________RAISE_R1_____________________, + ______________________RAISE_L2_____________________, ______________________RAISE_R2_____________________, + ______________________RAISE_L3_____________________, ______________________RAISE_R3_____________________, + ______________________RAISE_L4_____________________, ______________________RAISE_R4_____________________ + ), + + [_LW] = LAYOUT_wrapper( + ______________________LOWER_L1_____________________, ______________________LOWER_R1_____________________, + ______________________LOWER_L2_____________________, ______________________LOWER_R2_____________________, + ______________________LOWER_L3_____________________, ______________________LOWER_R3_____________________, + ______________________LOWER_L4_____________________, ______________________LOWER_R4_____________________ + ), + + [_MS] = LAYOUT_wrapper( + ______________________MOUSE_L1_____________________, ______________________MOUSE_R1_____________________, + ______________________MOUSE_L2_____________________, ______________________MOUSE_R2_____________________, + ______________________MOUSE_L3_____________________, ______________________MOUSE_R3_____________________, + ______________________MOUSE_L4_____________________, ______________________MOUSE_R4_____________________ + ), + + [_WT] = LAYOUT_wrapper( + ________________WINDOWS_TERMINAL_L1________________, ________________WINDOWS_TERMINAL_R1________________, + ________________WINDOWS_TERMINAL_L2________________, ________________WINDOWS_TERMINAL_R2________________, + ________________WINDOWS_TERMINAL_L3________________, ________________WINDOWS_TERMINAL_R3________________, + ________________WINDOWS_TERMINAL_L4________________, ________________WINDOWS_TERMINAL_R4________________ + ), + + [_CN] = LAYOUT_wrapper( + ___________________CONVENIENCE_L1__________________, ___________________CONVENIENCE_R1__________________, + ___________________CONVENIENCE_L2__________________, ___________________CONVENIENCE_R2__________________, + ___________________CONVENIENCE_L3__________________, ___________________CONVENIENCE_R3__________________, + ___________________CONVENIENCE_L4__________________, ___________________CONVENIENCE_R4__________________ + ), + + [_GG] = LAYOUT_wrapper( + ________________General_Game_4x12_L1_______________, ________________General_Game_4x12_R1_______________, + ________________General_Game_4x12_L2_______________, ________________General_Game_4x12_R2_______________, + ________________General_Game_4x12_L3_______________, ________________General_Game_4x12_R3_______________, + ________________General_Game_4x12_L4_______________, ________________General_Game_4x12_R4_______________ + ), + + [_CS] = LAYOUT_wrapper( + ___________________CSGO_4x12_L1____________________, ___________________CSGO_4x12_R1____________________, + ___________________CSGO_4x12_L2____________________, ___________________CSGO_4x12_R2____________________, + ___________________CSGO_4x12_L3____________________, ___________________CSGO_4x12_R3____________________, + ___________________CSGO_4x12_L4____________________, ___________________CSGO_4x12_R4____________________ + ) +}; diff --git a/keyboards/planck/keymaps/csc027/rules.mk b/keyboards/planck/keymaps/csc027/rules.mk new file mode 100644 index 000000000000..0c35b2c28fd4 --- /dev/null +++ b/keyboards/planck/keymaps/csc027/rules.mk @@ -0,0 +1,8 @@ +BOOTMAGIC_ENABLE = no +COMMAND_ENABLE = no +CONSOLE_ENABLE = no +EXTRAKEY_ENABLE = yes +LTO_ENABLE = no +MOUSEKEY_ENABLE = yes +NKRO_ENABLE = yes +RGBLIGHT_ENABLE = no diff --git a/keyboards/planck/keymaps/daniel/keymap.c b/keyboards/planck/keymaps/daniel/keymap.c new file mode 100644 index 000000000000..e5b52022368e --- /dev/null +++ b/keyboards/planck/keymaps/daniel/keymap.c @@ -0,0 +1,30 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_planck_grid( /* Qwerty */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + MO(3), KC_LCTL, KC_LALT, KC_LGUI, MO(2), KC_SPC, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + // Space is repeated to accommadate for both spacebar wiring positions +), +[1] = LAYOUT_planck_grid( /* RAISE */ + KC_GRV, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_EQL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, S(KC_MINS), KC_BSLS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), +[2] = LAYOUT_planck_grid( /* LOWER */ + S(KC_GRV), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, S(KC_EQL), + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_ENT, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), +[3] = LAYOUT_planck_grid( /* Qwerty */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_TRNS, KC_LCTL, KC_LALT, KC_LGUI, MO(2), KC_SPC, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + // Space is repeated to accommadate for both spacebar wiring positions +) +}; diff --git a/keyboards/planck/keymaps/daniel/rules.mk b/keyboards/planck/keymaps/daniel/rules.mk new file mode 100644 index 000000000000..d86b02fd1ce4 --- /dev/null +++ b/keyboards/planck/keymaps/daniel/rules.mk @@ -0,0 +1,22 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/danielhklein/keymap.c b/keyboards/planck/keymaps/danielhklein/keymap.c new file mode 100644 index 000000000000..a62138e33193 --- /dev/null +++ b/keyboards/planck/keymaps/danielhklein/keymap.c @@ -0,0 +1,137 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum custom_layers { + _QWERTY, + _LOWER, + _RAISE, + _ARROW +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ARROW +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * .----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P |Enter | + * |-----+------+------+------+------+------|------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |-----+------+------+------+------+------|------+------+------+------+------+------| + * |Lshft| Z | X | C | V | B | N | M | , | . | / |Rshft | + * |-----+------+------+------+------+------|------+------+------+------+------+------| + * |Arrow| LCtrl| LAlt | LGui | Lower| Bspc | Space| Raise| RGui | RAlt |RCtrl | - | + * `----------------------------------------------------------------------------------' + */ + +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + ARROW, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_RGUI, KC_RALT, KC_RCTL, KC_MINS +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | | | | | | | 7 | 8 | 9 | / | \ | ` | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | 4 | 5 | 6 | * | ( | ) | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Lshft| | | | | | 1 | 2 | 3 | - | [ | ] | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | LGui | | | 0 | . | = | + | { | } | + * `-----------------------------------------------------------------------------------' + */ + +[_LOWER] = LAYOUT_planck_grid( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_7, KC_8, KC_9, KC_PSLS, KC_BSLS, KC_GRV, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_4, KC_5, KC_6, KC_PAST, KC_LPRN, KC_RPRN, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, KC_MINS, KC_LBRC, KC_RBRC, + XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, KC_0, KC_DOT, KC_PEQL, KC_PPLS, KC_LCBR, KC_RCBR +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | >/|| | Mute | Vol- | Vol+ | |<< | >>| | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' +*/ + +[_RAISE] = LAYOUT_planck_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Arrow + * ,----------------------------------------------------------------------------------. + * | | | | | | | | | Up | | | | + * |------+------+------+------+------+------|-----+------+------+------+------+------| + * | | | | | | | | Left | Down |Right | | | + * |------+------+------+------+------+------|-----+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------|-----+------+------+------+------+------| + * | | | | Gui | | | | | | | | | + * `----------------------------------------------------------------------------------' + */ + +[_ARROW] = LAYOUT_planck_grid( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + break; + case ARROW: + if (record->event.pressed) { + layer_on(_ARROW); + } else { + layer_off(_ARROW); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/danielhklein/rules.mk b/keyboards/planck/keymaps/danielhklein/rules.mk new file mode 100644 index 000000000000..e31e20009a0b --- /dev/null +++ b/keyboards/planck/keymaps/danielhklein/rules.mk @@ -0,0 +1,14 @@ +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = no # Enable Tap Dance \ No newline at end of file diff --git a/keyboards/planck/keymaps/david/keymap.c b/keyboards/planck/keymaps/david/keymap.c new file mode 100644 index 000000000000..59a23d9223d9 --- /dev/null +++ b/keyboards/planck/keymaps/david/keymap.c @@ -0,0 +1,29 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_planck_grid( /* Qwerty */ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ESC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + M(10), KC_LCTL, KC_LALT, KC_LGUI, MO(3), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + // Space is repeated to accommadate for both spacebar wiring positions +), +[1] = LAYOUT_planck_grid( /* 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, + DF(0), KC_LCTL, KC_LALT, KC_LGUI, MO(3), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), +[2] = LAYOUT_planck_grid( /* 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, DF(0), DF(1), QK_BOOT, M(0), M(1), M(2), KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_TRNS, KC_F11, KC_F12, M(0), M(1), M(2), M(3), M(4), M(5), M(6), M(7), KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(2), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), +[3] = LAYOUT_planck_grid( /* 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, DF(0), DF(1), QK_BOOT, M(0), M(1), M(2), S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS), + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +) +}; diff --git a/keyboards/planck/keymaps/david/rules.mk b/keyboards/planck/keymaps/david/rules.mk new file mode 100644 index 000000000000..d86b02fd1ce4 --- /dev/null +++ b/keyboards/planck/keymaps/david/rules.mk @@ -0,0 +1,22 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/davidrambo/config.h b/keyboards/planck/keymaps/davidrambo/config.h new file mode 100644 index 000000000000..ccb18de3dd8b --- /dev/null +++ b/keyboards/planck/keymaps/davidrambo/config.h @@ -0,0 +1,6 @@ +#pragma once + +#define TAPPING_TERM 200 +#define PERMISSIVE_HOLD + + diff --git a/keyboards/planck/keymaps/davidrambo/keymap.c b/keyboards/planck/keymaps/davidrambo/keymap.c new file mode 100644 index 000000000000..2770bb60e368 --- /dev/null +++ b/keyboards/planck/keymaps/davidrambo/keymap.c @@ -0,0 +1,114 @@ +/* Copyright 2021 David Rambo + * + * 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 QMK_KEYBOARD_H + +#define A_BSPC LALT(KC_BSPC) +#define A_LEFT LALT(KC_LEFT) +#define A_RGHT LALT(KC_RGHT) +#define C_TAB LCTL(KC_TAB) +#define CTLPGUP LCTL(KC_PGUP) // back one tab in Brave +#define CTLPGDN LCTL(KC_PGDN) // forward one tab in Brave +#define G_TAB LGUI(KC_TAB) +#define G_GRV LGUI(KC_GRV) +#define SftEnt SFT_T(KC_ENT) +#define NAV LT(2, KC_TAB) +#define RECT LCA_T(KC_DEL) // Ctrl+Alt is the basis for Rectangle WM shortcuts + +enum custom_layers { + _COLEMAK, + _SYMBOL, + _NAVIGATION, +} + +//tapdance declarations +enum { + SFT_LCK +}; + +#define SftLck TD(SFT_LCK) /* alias for tapdance */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | ESC` | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |SftLck| Z | X | C | V | B | K | M | , | . | /? |SftEnt| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | GUI | Ctrl | Alt | GUI | Space |Symbol| Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' +*/ + +[_COLEMAK] = LAYOUT_planck_grid( + QK_GESC, KC_Q , KC_W , KC_F , KC_P , KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + NAV , KC_A , KC_R , KC_S , KC_T , KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + SftLck , KC_Z , KC_X , KC_C , KC_V , KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SftEnt , + RECT , KC_LGUI, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + +/* Symbol + * ,-----------------------------------------------------------------------------------. + * | [ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ] | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | \| | ! | @ | # | $ | % | ^ | & | * | ( | ) | =+ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Home | End | | | BRMD | BRMU | -_ |Pg Up | | / | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | `~ | | | |Alt(Bk)| | |Pg Dn | Vol- | Vol+ | | + * `-----------------------------------------------------------------------------------' + */ +[_SYMBOL] = LAYOUT_planck_grid( + KC_LBRC, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_RBRC, + KC_BSLS, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_EQL , + _______, KC_HOME, KC_END , _______, _______, KC_BRMD, KC_BRMU, KC_MINS, KC_PGUP, _______, _______, _______, + _______, KC_GRV , _______, _______, _______ , _______, _______, _______, KC_PGDN, KC_VOLD, KC_VOLU, KC_MUTE + ), + +/* Navigation*/ + +[_NAVIGATION] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, C_TAB , A_LEFT, KC_UP, A_RGHT , KC_DEL , _______, + _______, _______, _______, _______, _______, _______, CTLPGUP, KC_LEFT, KC_DOWN, KC_RGHT, CTLPGDN, _______, + _______, _______, _______, _______, _______, _______, G_TAB , A_BSPC , KC_HOME, KC_END, G_GRV , _______, + QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) +}; + +// Shift vs capslock function. From bbaserdem's Planck keymap. +void caps_tap (tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_LSFT); + } else if (state->count == 2) { + unregister_code (KC_LSFT); + register_code (KC_CAPS); + } +} +void caps_tap_end (tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_LSFT); + } else { + unregister_code (KC_CAPS); + } +} + +//Tap Dance Definitions +tap_dance_action_t tap_dance_actions[] = { + //Tap once for Shift, twice for Caps Lock + [SFT_LCK] = ACTION_TAP_DANCE_FN_ADVANCED( caps_tap, NULL, caps_tap_end ) +}; diff --git a/keyboards/planck/keymaps/davidrambo/rules.mk b/keyboards/planck/keymaps/davidrambo/rules.mk new file mode 100644 index 000000000000..4272493950e8 --- /dev/null +++ b/keyboards/planck/keymaps/davidrambo/rules.mk @@ -0,0 +1,3 @@ +TAP_DANCE_ENABLE = yes + + diff --git a/keyboards/planck/keymaps/dbroqua/config.h b/keyboards/planck/keymaps/dbroqua/config.h new file mode 100644 index 000000000000..2bebf48a1ca9 --- /dev/null +++ b/keyboards/planck/keymaps/dbroqua/config.h @@ -0,0 +1,26 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/dbroqua/keymap.c b/keyboards/planck/keymaps/dbroqua/keymap.c new file mode 100644 index 000000000000..95d0b8540872 --- /dev/null +++ b/keyboards/planck/keymaps/dbroqua/keymap.c @@ -0,0 +1,218 @@ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _MULTIMEDIA 3 +#define _ADJUST 4 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + BACKLIT +}; + +// Func macro definitions. +#define SFT_TAB LT(_MULTIMEDIA, KC_TAB) // Tap for Enter, hold for Shift + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | AltGr| Alt | Lower| Space | Raise| Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + SFT_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_LCTL, KC_LGUI, KC_RALT, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | ( | ) | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| | | | | | | | | | { | } | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | [ | ] | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Home | PgDwn| PgUp | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LPRN, KC_RPRN, + BACKLIT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LCBR, KC_RCBR, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | - | = | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | ` | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | \ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_GRV, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSLS, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* _MULTIMEDIA + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Psc | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | Mute | Vol+ | Vol- | | | |Insert| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Prev | Play | Next | Del | + * `-----------------------------------------------------------------------------------' + */ +[_MULTIMEDIA] = LAYOUT_planck_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______, _______, _______, _______, + _______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, KC_VOLD, _______, _______, _______, KC_INS, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_DEL +), + + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user(void) +{ + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user(void) +{ + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif diff --git a/keyboards/planck/keymaps/dbroqua/readme.md b/keyboards/planck/keymaps/dbroqua/readme.md new file mode 100644 index 000000000000..090af649e1c2 --- /dev/null +++ b/keyboards/planck/keymaps/dbroqua/readme.md @@ -0,0 +1,14 @@ +# Dbroqua Layout + +![Layout](https://i.imgur.com/XxBtDBy.png "Dbroqua Keymap") + +* Online keyboard layout editor: http://www.keyboard-layout-editor.com/#/gists/e77306f9d14cc93fa26123b93b106474 +* Online keyboard layout editor (lower layer): http://www.keyboard-layout-editor.com/#/gists/786e03f6fbd274cb4f4e77a3d67f85fa +* Online keyboard layout editor (raise layer): http://www.keyboard-layout-editor.com/#/gists/2e22c71f6910103c20d595d1caa713d6 +* Online keyboard layout editor (multimedia layer): http://www.keyboard-layout-editor.com/#/gists/132ebf8053508a7a81dfa8e0756edb40 + +# Programming Instructions: +Enter into programming mode and run the following command. +``` +$ sudo KEYMAP=dbroqua make dfu +``` \ No newline at end of file diff --git a/keyboards/planck/keymaps/dc/config.h b/keyboards/planck/keymaps/dc/config.h new file mode 100644 index 000000000000..07d8533b830e --- /dev/null +++ b/keyboards/planck/keymaps/dc/config.h @@ -0,0 +1,9 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#define TAPPING_TERM 200 +#define TAPPING_TOGGLE 3 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/dc/keymap.c b/keyboards/planck/keymaps/dc/keymap.c new file mode 100644 index 000000000000..6a4da9546fa4 --- /dev/null +++ b/keyboards/planck/keymaps/dc/keymap.c @@ -0,0 +1,161 @@ +#include QMK_KEYBOARD_H + +enum planck_layers { + _DVORAK, + _NUMBERS, + _SYMBOLS, + _ACTIONS, + _SPECIAL + }; + +enum planck_keycodes { + DVORAK, + NUMBERS, + SYMBOLS, + ACTIONS, + SPECIAL +}; + +enum tap_dance_codes { + CT_SC_LP = 0, + CT_Q_LBRC, + CT_J_LBRK, + CT_W_RBRK, + CT_V_RBRC, + CT_Z_RP, + CT_DEL_ESC +}; + +tap_dance_action_t tap_dance_actions[] = { + [0] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_LPRN), + [1] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_LCBR), + [2] = ACTION_TAP_DANCE_DOUBLE(KC_J, KC_LBRC), + [3] = ACTION_TAP_DANCE_DOUBLE(KC_W, KC_RBRC), + [4] = ACTION_TAP_DANCE_DOUBLE(KC_V, KC_RCBR), + [5] = ACTION_TAP_DANCE_DOUBLE(KC_Z, KC_RPRN) +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | '" | ,< | .> | P | Y | F | G | C | R | L | BS | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | /? | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |LShift| ;:/( | Q/{ | J/[ | K | X | B | M | W/] | V/} | Z/) |RS/Ent| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Action| Ctrl | GUI | Alt |Number| Space/Enter |Symbol| Left | Down | Up | Right| + * `-----------------------------------------------------------------------------------' + */ + [_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLASH, + KC_LSFT, TD(0), TD(1), TD(2), KC_K, KC_X, KC_B, KC_M, TD(3), TD(4), TD(5), MT(MOD_RSFT, KC_ENT), + MO(ACTIONS), KC_LCTL, KC_LGUI, KC_LALT, NUMBERS, KC_SPACE, KC_SPACE, SYMBOLS,KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT + ), + + /* Numbers + * ,-----------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | 7 | 8 | 9 | * | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | 4 | 5 | 6 | - | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | 0 | 1 | 2 | 3 | + | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_NUMBERS] = LAYOUT_planck_grid( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_7, KC_8, KC_9, KC_KP_ASTERISK, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_4, KC_5, KC_6, KC_KP_MINUS, _______, + _______, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, KC_KP_PLUS, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Symbols + * ,-----------------------------------------------------------------------------------. + * | `~ | ! | @ | # | $ | % | ^ | & | * | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | | Ins | Pgup | | | | _ | + | | | \| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Home | End | Pgdn | | | | - | = | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_SYMBOLS] = LAYOUT_planck_grid( + KC_GRV, KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, _______, _______, KC_DEL, + KC_CAPS, _______, KC_INS, KC_PGUP, _______, _______, _______, KC_UNDS, KC_PLUS, _______, _______, KC_BSLS, + _______, KC_HOME, KC_END, KC_PGDN, _______, _______, _______, KC_MINUS, KC_EQL, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Actions + * ,-----------------------------------------------------------------------------------. + * | LED | | | | | Sleep|Reset | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Redo | | | | | | Play | << | >> | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Undo | Cut | Copy | Paste| | | Mute | Vol- | Vol+ | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ACTIONS] = LAYOUT_planck_grid( + BL_STEP, _______, _______, _______, _______, KC_SLEP, QK_BOOT, _______, _______, _______, _______, KC_DEL, + _______, LCTL(KC_Y), _______, _______, _______, _______, _______, KC_MPLY, KC_MPRV, KC_MNXT, _______, _______, + _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Special + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_SPECIAL] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case SYMBOLS: + if (record->event.pressed) { + layer_on(_SYMBOLS); + update_tri_layer(_NUMBERS, _SYMBOLS, _SPECIAL); + } else { + layer_off(_SYMBOLS); + update_tri_layer(_NUMBERS, _SYMBOLS, _SPECIAL); + } + return false; + break; + case NUMBERS: + if (record->event.pressed) { + layer_on(_NUMBERS); + update_tri_layer(_NUMBERS, _SYMBOLS, _SPECIAL); + } else { + layer_off(_NUMBERS); + update_tri_layer(_NUMBERS, _SYMBOLS, _SPECIAL); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/dc/readme.md b/keyboards/planck/keymaps/dc/readme.md new file mode 100644 index 000000000000..58dd1eb6e692 --- /dev/null +++ b/keyboards/planck/keymaps/dc/readme.md @@ -0,0 +1,2 @@ +# Practical keymap for Planck Ortholinear 40% Mechanical Keyboard +A custom Dvorak keymap with layers for numbers, symbols, and media keys. \ No newline at end of file diff --git a/keyboards/planck/keymaps/dc/rules.mk b/keyboards/planck/keymaps/dc/rules.mk new file mode 100644 index 000000000000..384f8e088a36 --- /dev/null +++ b/keyboards/planck/keymaps/dc/rules.mk @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +TAP_DANCE_ENABLE = yes + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/dcompact/config.h b/keyboards/planck/keymaps/dcompact/config.h new file mode 100644 index 000000000000..2c207edc7c93 --- /dev/null +++ b/keyboards/planck/keymaps/dcompact/config.h @@ -0,0 +1,38 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif diff --git a/keyboards/planck/keymaps/dcompact/keymap.c b/keyboards/planck/keymaps/dcompact/keymap.c new file mode 100644 index 000000000000..a63f86e7a8ca --- /dev/null +++ b/keyboards/planck/keymaps/dcompact/keymap.c @@ -0,0 +1,362 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "keymap_steno.h" + +// Custom Keycodes and Combinations Used +#define DEL_SHF SFT_T(KC_DEL) +#define QUAKE LCTL(KC_GRV) + +#define WKSP_L LALT(LCTL(KC_LEFT)) +#define WKSP_D LALT(LCTL(KC_DOWN)) +#define WKSP_U LALT(LCTL(KC_UP)) +#define WKSP_R LALT(LCTL(KC_RGHT)) + +#define AM_CYC A(S(KC_SPC)) +#define AM_SHR A(S(KC_COMM)) +#define AM_GRW A(S(KC_DOT)) +#define AM_REL A(S(KC_Z)) +#define AM_LFT A(S(KC_H)) +#define AM_RGH A(S(KC_L)) +#define AM_CW A(S(KC_K)) +#define AM_CCW A(S(KC_J)) +#define AM_TLL A(S(KC_1)) +#define AM_TLW A(S(KC_2)) +#define AM_BSP A(S(KC_3)) +#define AM_FUL A(S(KC_4)) + + +extern keymap_config_t keymap_config; + +enum planck_layers { + _BASE, + _LOWER, + _RAISE, + _FUNC, + _PLOVER, + _GAME, + _LNUM, + _LFUN, + _ADJUST, + _MOUSE +}; + +enum planck_keycodes { + BASE = SAFE_RANGE, + PLOVER, + GAME, + LNUM, + LFUN, + LOWER, + RAISE, + FUNC, + MOUSE, + ADJUST, + EXT_PLV, + EXT_GM +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Base + * ,-----------------------------------------------------------------------------------. + * | Tab | " ' | < , | > . | P | Y | F | G | C | R | L | ? / | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | _ - | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |Del/Sf| : ; | Q | J | K | X | B | M | W | V | Z | Bspc | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Game | GUI | Alt |Lower |Shift |Space |Raise | Alt | GUI | Fn |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_BASE] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, + DEL_SHF, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_BSPC, + KC_LCTL, GAME, KC_LGUI, KC_LALT, LOWER, KC_LSFT, KC_SPC, RAISE, KC_RALT, KC_RGUI, FUNC, KC_ENT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | |AmCycl|AmShrk|AmGrow|AmReld| | | Home |PgDwn | PgUp | End | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | |AmLeft|AmCcw |AmCw |AmRght| | | Left | Down | Up |Right | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |AmTall|AmTllW|AmBsp |AmFull| | |WkLeft|WkDown| WkUp |WkRigh| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | |Raise | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + XXXXXXX, AM_CYC, AM_SHR, AM_GRW, AM_REL, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_PGUP, KC_END, XXXXXXX, + XXXXXXX, AM_LFT, AM_CCW, AM_CW, AM_RGH, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, + XXXXXXX, AM_TLL, AM_TLW, AM_BSP, AM_FUL, XXXXXXX, XXXXXXX, WKSP_L, WKSP_D, WKSP_U, WKSP_R, XXXXXXX, + _______, XXXXXXX, _______, _______, _______, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * |Quake | ` | ~ | \ | | | ( | ) | 7 | 8 | 9 | / | = | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | ! | @ | # | $ | { | } | 4 | 5 | 6 | * | + | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | % | ^ | & | * | [ | ] | 1 | 2 | 3 | - |Bkspc | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | |Lower | < | > | | 0 | . | , | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + QUAKE, KC_GRV, KC_TILD, KC_BSLS, KC_PIPE, KC_LPRN, KC_RPRN, KC_7, KC_8, KC_9, KC_SLSH, KC_EQL, + XXXXXXX, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_4, KC_5, KC_6, KC_ASTR, KC_PLUS, + XXXXXXX, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LBRC, KC_RBRC, KC_1, KC_2, KC_3, KC_MINS, KC_BSPC, + _______, XXXXXXX, _______, _______, _______, KC_LABK, KC_RABK, _______, KC_0, KC_DOT, KC_COMM, XXXXXXX +), + +/* Func + * ,-----------------------------------------------------------------------------------. + * | |Sleep |Prev-W|Ply/Ps|Next-W| | | F9 | F10 | F11 | F12 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Wake | Mute | Vol- | Vol+ | | | F5 | F6 | F7 | F8 | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Power |Prev-M|Ply/Ps|Next-M| | | F1 | F2 | F3 | F4 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_FUNC] = LAYOUT_planck_grid( + XXXXXXX, KC_SLEP, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, + XXXXXXX, KC_WAKE, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, + XXXXXXX, KC_PWR, KC_MRWD, KC_MPLY, KC_MFFD, XXXXXXX, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, + _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX +), + +/* Game + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | H | Z | I | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |Shift | A | S | D | U | X | P | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Ctrl | F | G | R | M | C | O | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | ~ | Alt |Space |Shift | LNUM | LFUN | | | | | Exit | + * `-----------------------------------------------------------------------------------' + */ +[_GAME] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_H, KC_Z, KC_I, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LSFT, KC_A, KC_S, KC_D, KC_U, KC_X, KC_P, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LCTL, KC_F, KC_G, KC_R, KC_M, KC_C, KC_O, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_ESC, KC_TILD, KC_LALT, KC_SPC, KC_LSFT, LNUM, LFUN, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, EXT_GM +), + +/* LNum + * ,-----------------------------------------------------------------------------------. + * | Tab | 1 | 2 | 3 | 4 | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |Shift | 5 | 6 | 7 | 8 | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Ctrl | 9 | 10 | , | . | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | | Alt |Space |Shift | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LNUM] = LAYOUT_planck_grid( + _______, KC_1, KC_2, KC_3, KC_4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, KC_5, KC_6, KC_7, KC_8, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, KC_9, KC_0, KC_COMM, KC_DOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* LFun + * ,-----------------------------------------------------------------------------------. + * | Tab | F1 | F2 | F3 | F4 | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |Shift | F5 | F6 | F7 | F8 | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Ctrl | F9 | F10 | F11 | F12 | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | | Alt |Space |Shift | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LFUN] = LAYOUT_planck_grid( + _______, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, _______, _______, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +), + + +/* Mouse (Not Reachable on Planck) + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | |Click1|Click3|Click2| | |MouseL|MouseD|MouseU|MouseR| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | |Accel0|Accel1|Accel2| | |ScrllL|ScrllD|ScrllU|ScrllR| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_MOUSE] = LAYOUT_planck_grid( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, KC_BTN1, KC_BTN3, KC_BTN2, XXXXXXX, XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, XXXXXXX, + XXXXXXX, XXXXXXX, KC_ACL0, KC_ACL1, KC_ACL2, XXXXXXX, XXXXXXX, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, XXXXXXX, + _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | FN | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | | E | U | PWR | RES1 | RES2 | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC , + STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR , + XXXXXXX, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR , + EXT_PLV, XXXXXXX, XXXXXXX, STN_A, STN_O, XXXXXXX, XXXXXXX, STN_E, STN_U, STN_PWR, STN_RE1, STN_RE2 +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|RGBTog|RGBMod| | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof|Light-|Light+| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, RGB_TOG, RGB_MOD, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, RGB_VAD, RGB_VAI, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case FUNC: + if (record->event.pressed) { + layer_on(_FUNC); + } else { + layer_off(_FUNC); + } + return false; + break; + case PLOVER: + if (!record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_on(_PLOVER); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + case GAME: + if (!record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_on(_GAME); + } + return false; + break; + case EXT_GM: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_GAME); + } + return false; + break; + case LNUM: + if (record->event.pressed) { + layer_on(_LNUM); + } else { + layer_off(_LNUM); + } + return false; + break; + case LFUN: + if (record->event.pressed) { + layer_on(_LFUN); + } else { + layer_off(_LFUN); + } + return false; + break; + case MOUSE: + if (record->event.pressed) { + layer_on(_MOUSE); + } else { + layer_off(_MOUSE); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + steno_set_mode(STENO_MODE_GEMINI); +} diff --git a/keyboards/planck/keymaps/dcompact/readme.md b/keyboards/planck/keymaps/dcompact/readme.md new file mode 100644 index 000000000000..f3f3d8ca6ead --- /dev/null +++ b/keyboards/planck/keymaps/dcompact/readme.md @@ -0,0 +1,45 @@ +# DCompact Layout + +**Dvorak, Layered, Mouse-Enabled, Compact -- now with Game Mode~** + +_See [the layout source](keymap.c) for the actual layout_ + +## Goals + +The following are the goals kept in mind when designing the DCompact +layout: + +- Provide minimal travel distance when typing English or coding +- Consistent muscle memory translation from standard QWERTY +- Stateless typing experience +- OS-agnostic features, macros, and key placement +- Minimize dependence on mouse usage + +These are generally all met or balanced within reason. This layout is +not intended at all to be a familiar layout for much of anyone (except +maybe those who already type in Dvorak) -- this is meant to amplify the +best parts of having limited, ortholinear keys with layering. + +## As Reference Material + +If you're reading this hoping to find reference material to implement +your own layout, then please feel free to copy over this layout and +make edits where you see fit. I removed a lot of the features I felt +extraneous to my usage and simplified style where I felt needed. This +would hopefully mean that my code should feel like a good base to +develop from for those new to QMK. + +_Remember that settings defined in the layout directory override and +merge with those in the keyboard folder_ + +## Relevant Links + +- [Online Dvorak Layout Trainer](https://learn.dvorak.nl/) +- [Dvorak Wikipedia Page](https://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard) +- [QMK Docs](https://docs.qmk.fm/#/) +- [QMK KeyCode Reference](https://docs.qmk.fm/#/keycodes) + +## Contact + +Maintainer: [Dan](https://github.com/loksonarius) + diff --git a/keyboards/planck/keymaps/dcompact/rules.mk b/keyboards/planck/keymaps/dcompact/rules.mk new file mode 100644 index 000000000000..12b4e44c2b76 --- /dev/null +++ b/keyboards/planck/keymaps/dcompact/rules.mk @@ -0,0 +1,12 @@ +# https://beta.docs.qmk.fm/reference/config-options#feature-options +# Features Specifically Wanted +EXTRAKEY_ENABLE = yes +STENO_ENABLE = yes +NKRO_ENABLE = yes +AUDIO_ENABLE = yes + +# Features taking up space +MOUSEKEY_ENABLE = no +MIDI_ENABLE = no +CONSOLE_ENABLE = no + diff --git a/keyboards/planck/keymaps/dear_vehicle_owner/config.h b/keyboards/planck/keymaps/dear_vehicle_owner/config.h new file mode 100644 index 000000000000..cff232c97451 --- /dev/null +++ b/keyboards/planck/keymaps/dear_vehicle_owner/config.h @@ -0,0 +1,57 @@ +/* Copyright 2021 Timothy Beck + * + * 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +//switch polling rate to 1000 per second +#define USB_POLLING_INTERVAL_MS 1 diff --git a/keyboards/planck/keymaps/dear_vehicle_owner/keymap.c b/keyboards/planck/keymaps/dear_vehicle_owner/keymap.c new file mode 100644 index 000000000000..413888902515 --- /dev/null +++ b/keyboards/planck/keymaps/dear_vehicle_owner/keymap.c @@ -0,0 +1,360 @@ +/* Copyright 2021 Timothy Beck + * + * 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 QMK_KEYBOARD_H +#include "muse.h" + + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV, + DR_VO +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | DR_VO| DR_VO| DR_VO| DR_VO| | | | DR_VO| DR_VO| DR_VO| DR_VO| + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, + DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, + DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, + DR_VO, DR_VO, DR_VO, DR_VO, _______, _______, _______, _______, DR_VO, DR_VO, DR_VO, DR_VO +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| DR_VO| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | DR_VO| DR_VO| DR_VO| DR_VO| | | | DR_VO| DR_VO| DR_VO| DR_VO| + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, + DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, + DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, DR_VO, + DR_VO, DR_VO, DR_VO, DR_VO, _______, _______, _______, _______, DR_VO, DR_VO, DR_VO, DR_VO +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * v------------------------RGB CONTROL--------------------v + * ,-----------------------------------------------------------------------------------. + * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | |MUSmod|Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + writePinLow(E6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + writePinHigh(E6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + case DR_VO: + if (record->event.pressed) { + SEND_STRING("We've been trying to reach you concerning your vehicle's extended warranty. You should've received a notice in the mail about your car's extended warranty eligibility. Since we've not gotten a response, we're giving you a final courtesy call before we close out your file. Press 2 to be removed and placed on our do-not-call list. To speak to someone about possibly extending or reinstating your vehicle's warranty, press 1 to speak with a warranty specialist.\n"); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_song); } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_gb_song); } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } + return true; +} + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/dear_vehicle_owner/readme.md b/keyboards/planck/keymaps/dear_vehicle_owner/readme.md new file mode 100644 index 000000000000..c8173cd9a238 --- /dev/null +++ b/keyboards/planck/keymaps/dear_vehicle_owner/readme.md @@ -0,0 +1,4 @@ +# dear vehicle owner + +We've been trying to reach you concerning your vehicle's extended warranty. You should've received a notice in the mail about your car's extended warranty eligibility. Since we've not gotten a response, we're giving you a final courtesy call before we close out your file. Press 2 to be removed and placed on our do-not-call list. To speak to someone about possibly extending or reinstating your vehicle's warranty, press 1 to speak with a warranty specialist. + diff --git a/keyboards/planck/keymaps/dear_vehicle_owner/rules.mk b/keyboards/planck/keymaps/dear_vehicle_owner/rules.mk new file mode 100644 index 000000000000..d03e978b827d --- /dev/null +++ b/keyboards/planck/keymaps/dear_vehicle_owner/rules.mk @@ -0,0 +1,2 @@ +SRC += muse.c +DEBOUNCE_TYPE = sym_eager_pk diff --git a/keyboards/planck/keymaps/default/config.h b/keyboards/planck/keymaps/default/config.h new file mode 100644 index 000000000000..464b7b29f8ce --- /dev/null +++ b/keyboards/planck/keymaps/default/config.h @@ -0,0 +1,49 @@ +/* Copyright 2015-2021 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE +# define STARTUP_SONG SONG(PLANCK_SOUND) +// #define STARTUP_SONG SONG(NO_SOUND) + +# define DEFAULT_LAYER_SONGS \ + { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND) } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/default/keymap.c b/keyboards/planck/keymaps/default/keymap.c new file mode 100644 index 000000000000..93ee9199237c --- /dev/null +++ b/keyboards/planck/keymaps/default/keymap.c @@ -0,0 +1,355 @@ +/* Copyright 2015-2021 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 . + */ + +#include QMK_KEYBOARD_H + +#ifdef AUDIO_ENABLE +# include "muse.h" +#endif + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | ' | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * v------------------------RGB CONTROL--------------------v + * ,-----------------------------------------------------------------------------------. + * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | |MUSmod|Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + writePinLow(E6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + writePinHigh(E6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_song); } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_gb_song); } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } + return true; +} + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/default/readme.md b/keyboards/planck/keymaps/default/readme.md new file mode 100644 index 000000000000..de9680b49851 --- /dev/null +++ b/keyboards/planck/keymaps/default/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/default/rules.mk b/keyboards/planck/keymaps/default/rules.mk new file mode 100644 index 000000000000..10751dc952e4 --- /dev/null +++ b/keyboards/planck/keymaps/default/rules.mk @@ -0,0 +1,3 @@ +ifeq ($(strip $(AUDIO_ENABLE)), yes) + SRC += muse.c +endif diff --git a/keyboards/planck/keymaps/deft/config.h b/keyboards/planck/keymaps/deft/config.h new file mode 100644 index 000000000000..9020d2b9f882 --- /dev/null +++ b/keyboards/planck/keymaps/deft/config.h @@ -0,0 +1,36 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/deft/deft-plank.json b/keyboards/planck/keymaps/deft/deft-plank.json new file mode 100644 index 000000000000..49dc57c3e555 --- /dev/null +++ b/keyboards/planck/keymaps/deft/deft-plank.json @@ -0,0 +1,141 @@ +[ + { + "backcolor": "#ffffff", + "name": "Deft Plank", + "author": "Michael Speiserß", + "switchMount": "cherry", + "switchBrand": "gateron", + "switchType": "KS-3-Tea", + "plate": true, + "pcb": true + }, + [ + { + "c": "#ba0000", + "sb": "gateron", + "st": "KS-3-Tea", + "a": 5 + }, + "\nDel\n\n\n\n\nEsc", + { + "c": "#cccccc", + "a": 4 + }, + "\n\n!\n\n\n\n\n\n1\nQ\nAlt 1", + "\n\n@\n\n\n\n\n\n2\nW\nAlt 2", + "\n\n#\n\n\n\n\n\n3\nE\nAlt 3", + "\n\n$\n\n\n\n\n\n4\nR\nAlt 4", + "\n\n%\n\n\n\n\n\n5\nT\n(", + "\n\n^\n\n\n\n\n\n6\nY\n)", + "\n\n&\n\n\n\n\n\n7\nU\nNum 7", + "\n\n*\n\n\n\n\n\n8\nI\nNum 8", + "\n\n(\n\n\n\n\n\n9\nO\nNum 9", + "\n\n)\n\n\n\n\n\n0\nP\nNum 0", + { + "c": "#ba0000", + "a": 7 + }, + "Bksp" + ], + [ + { + "c": "#365eff" + }, + "Tab", + { + "c": "#cccccc", + "a": 4 + }, + "\n\n\n~\n\n\n\n\nF1\nA\n`", + "\n\n\n|\n\n\n\n\nF2\nS\n\\", + "\n\n\n+\n\n\n\n\nF3\nD\n=", + { + "n": true + }, + "\n\n\n_\n\n\n\n\nF4\nF\n-", + { + "a": 5 + }, + "F5\n<\n\n\n\n\nG", + "F6\n>\n\n\n\n\nH", + { + "n": true + }, + "F7\nNum 4\n\n\n\n\nJ", + "F8\nNum 5\n\n\n\n\nK", + "F9\nNum 6\n\n\n\n\nL", + { + "a": 4 + }, + "\n\n\n\n\n\n\n:\nF10\n;\nNum .", + "\n\n\n\n\n\n\n\"\n\n'\nNumLk" + ], + [ + { + "c": "#365eff", + "a": 7 + }, + "Shift", + { + "c": "#cccccc", + "a": 5 + }, + "F11\nNum /\n\n\n\n\nZ", + "F12\nNum *\n\n\n\n\nX", + "F13\nNum -\n\n\n\n\nC", + "F14\nNum +\n\n\n\n\nV", + "F15\n[\n\n\n\n\nB", + "F16\n]\n\n\n\n\nN", + "F17\nNum 1\n\n\n\n\nM", + { + "a": 4 + }, + "\n\n\n\n\n\n\n<\nF18\n,\nNum 2", + "\n\n\n\n\n\n\n>\nF19\n.\nNum 3", + { + "c": "#365eff", + "a": 5 + }, + "Vol+\nPgup\n\n\n\n\n↑", + { + "c": "#cccccc", + "a": 4 + }, + "\n\n\n\n\n\n\n?\n\n/\nNum =" + ], + [ + { + "c": "#365eff", + "a": 7 + }, + "Ctrl", + { + "a": 5 + }, + "\nOption\n\n\n\n\nAlt", + "\n⌘\n\n\n\n\nWin", + "Cut\nPaste\n\n\n\n\nCopy", + { + "c": "#3f8f00", + "a": 7 + }, + "Lower", + { + "c": "#cccccc", + "w": 2 + }, + "", + { + "c": "#3f8f00" + }, + "Raise", + { + "c": "#365eff", + "a": 5 + }, + "\nNumE\n\n\n\n\nReturn", + "Play\nHome\n\n\n\n\n←", + "Vol -\nPgdn\n\n\n\n\n↓", + "Next\nEnd\n\n\n\n\n→" + ] +] \ No newline at end of file diff --git a/keyboards/planck/keymaps/deft/keymap.c b/keyboards/planck/keymaps/deft/keymap.c new file mode 100644 index 000000000000..b3f670a33606 --- /dev/null +++ b/keyboards/planck/keymaps/deft/keymap.c @@ -0,0 +1,138 @@ +/* + * The Deft layout for the Planck Keyboard + * Version 1.0 + * + * A keyboard layout designed for efficiency in programming and transferability between ortholinear boards. + * Deft is currently supported on the following boards: + * Planck (12x4) + * + * The Deft keyboard layout was designed by Michael Speiser. You can find other Deft layouts at my Github: + * https://github.com/Speiserm + * + * For questions, issues, or feedback, feel free to email me at Speiserm@pm.me. + * + * + * Flashing: + * + * Rev 5 or earlier: + * make planck/revX:deft:dfu + * + * Rev 6: + * make planck/rev6:deft:dfu-util + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * Follow my cat: + * https://twitter.com/CatBucha + * https://www.instagram.com/buchathecat/ + * + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |Shift | Z | X | C | V | B | N | M | , | . | Up | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | GUI | Copy |Lower | Space |Raise |Enter | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_SLSH, + KC_LCTL, KC_LALT, KC_LGUI, C(KC_C), LOWER, KC_SPC, KC_SPC, RAISE, KC_ENT, KC_LEFT, KC_DOWN, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | Del | Alt1 | Alt2 | Alt3 | Alt4 | ( | ) | Num7 | Num8 | Num9 | Num0 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | ` | \ | = | - | < | > | Num4 | Num5 | Num6 | Num. | NumL | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Num/ | Num* | Num- | Num+ | [ | ] | Num1 | Num2 | Num3 | Pgup | Num= | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Paste | | | | NumE | Home | Pgdn | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_DEL, A(KC_1), A(KC_2), A(KC_3), A(KC_4), S(KC_9), S(KC_0), KC_P7, KC_P8, KC_P9, KC_P0, _______, + _______, KC_GRV,KC_BSLS,KC_EQL, KC_MINS,S(KC_COMM),S(KC_DOT), KC_P4, KC_P5, KC_P6, KC_PDOT, KC_NUM, + _______, KC_PSLS, KC_PAST, KC_PMNS, KC_PPLS, KC_LBRC, KC_RBRC, KC_P1, KC_P2, KC_P3, KC_PGUP, KC_PEQL, + _______, _______, _______, C(KC_V), _______, _______, _______, _______, KC_PENT, KC_HOME,KC_PGDN, KC_END +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | Vol+ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | Cut | | | | | Play | Vol- | Next | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_VOLU, _______, + _______, _______, _______, C(KC_X), _______, _______, _______, _______, _______, KC_MPLY, KC_VOLD, KC_MNXT +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * |Reset | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} diff --git a/keyboards/planck/keymaps/deft/readme.md b/keyboards/planck/keymaps/deft/readme.md new file mode 100644 index 000000000000..715ab37965bf --- /dev/null +++ b/keyboards/planck/keymaps/deft/readme.md @@ -0,0 +1,73 @@ +# The Deft Planck Layout + +![Deft layout for the Planck keyboard](https://i.imgur.com/VtUkAyh.png) + +The Deft Planck layout is designed for efficiency in programming and transferability between ortholinear boards. It features a fairly standard default layer with properly placed arrow keys, a lower layer with a usable numpad and symbols, and a raise layer for numbers, f-keys, and music controls. The code is also cut down to only what you need. The result is a very usable Planck that can easily replace fullsize layouts. + +The strangely placed Enter key is meant to be closer to your thumb and moving it allows for proper arrow key placement without disturbing our layout too much. I wanted to separate the enter key from the forward slash key anyway, as I was commonly pressing enter when I meant to type a question mark. You get used to it pretty fast. + +Follow my cat: + +https://twitter.com/CatBucha + +https://www.instagram.com/buchathecat/ + + +## Flashing: +| Rev 5 or earlier: | Rev 6: | +|-|-| +| `make planck/revX:deft:dfu` | `make planck/rev6:deft:dfu-util` | + +## Layout: + +### QWERTY layer +``` +,-----------------------------------------------------------------------------------. +| Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Tab | A | S | D | F | G | H | J | K | L | ; | ' | +|------+------+------+------+------+------|------+------+------+------+------+------| +|Shift | Z | X | C | V | B | N | M | , | . | Up | / | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Ctrl | Alt | GUI | Copy |Lower | Space |Raise |Enter | Left | Down |Right | +`-----------------------------------------------------------------------------------' +``` + +### Lower layer +``` +,-----------------------------------------------------------------------------------. +| Del | Alt1 | Alt2 | Alt3 | Alt4 | ( | ) | Num7 | Num8 | Num9 | Num0 | | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | ` | \ | = | - | < | > | Num4 | Num5 | Num6 | Num. | NumL | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | Num/ | Num* | Num- | Num+ | [ | ] | Num1 | Num2 | Num3 | Pgup | Num= | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | |Paste | | | | NumE | Home | Pgdn | End | +`-----------------------------------------------------------------------------------' +``` + +### Raise layer +``` +,-----------------------------------------------------------------------------------. +| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | Vol+ | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | Cut | | | | | Play | Vol- | Next | +`-----------------------------------------------------------------------------------' +``` + +### Adjust layer +``` +,-----------------------------------------------------------------------------------. +|Reset | | | | | | | | | | | | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | | | | | | | | | | | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | +`-----------------------------------------------------------------------------------' +``` diff --git a/keyboards/planck/keymaps/deft/rules.mk b/keyboards/planck/keymaps/deft/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/deft/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/dodger/config.h b/keyboards/planck/keymaps/dodger/config.h new file mode 100644 index 000000000000..1fa9b4265e7c --- /dev/null +++ b/keyboards/planck/keymaps/dodger/config.h @@ -0,0 +1,34 @@ +/* +Copyright 2012 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 . +*/ + +#pragma once + +#undef BACKLIGHT_LEVELS +#define BACKLIGHT_LEVELS 15 + +#define RGBLIGHT_EFFECT_BREATHING +#define RGBLIGHT_EFFECT_RAINBOW_MOOD +#define RGBLIGHT_EFFECT_RAINBOW_SWIRL +#define RGBLIGHT_EFFECT_SNAKE +#define RGBLIGHT_EFFECT_KNIGHT +#define RGBLIGHT_EFFECT_CHRISTMAS +#define RGBLIGHT_EFFECT_STATIC_GRADIENT +#define RGBLIGHT_EFFECT_RGB_TEST +#define RGBLIGHT_EFFECT_ALTERNATING +#define RGBLIGHT_EFFECT_TWINKLE + +#define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL+5 diff --git a/keyboards/planck/keymaps/dodger/keymap.c b/keyboards/planck/keymaps/dodger/keymap.c new file mode 100644 index 000000000000..76493e714db2 --- /dev/null +++ b/keyboards/planck/keymaps/dodger/keymap.c @@ -0,0 +1,238 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; +bool isGame = false; +bool qwertGame = false; + + +enum planck_layers { + _COLEMAK, + _GAME, + _QWERTGAME, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + COLEMAK = SAFE_RANGE, + GCTOGG, + QGCTOGG, + LOWER, + RAISE, + PAREN +}; + +enum { + TD_SPC_ENT = 0, + TD_ESC_CAPS +}; + +tap_dance_action_t tap_dance_actions[] = { + [TD_SPC_ENT] = ACTION_TAP_DANCE_DOUBLE(KC_SPC, KC_ENT), + [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS) +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | = | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / | - | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt |PAREN |Lower | shift|space |Raise | Left | Down | Up | Right| + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_EQL, + 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_MINS, + KC_LCTL, KC_LGUI, KC_LALT, PAREN, LOWER, RSFT_T(KC_BSPC), TD(TD_SPC_ENT), RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | | | | [ | ] | | ( | ) | { | } | | + | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | left | down | up | right| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | _ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + _______, _______, _______, KC_LBRC, KC_RBRC, _______, KC_LPRN, KC_RPRN, KC_LCBR, KC_RCBR, _______, S(KC_EQL), + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_MPRV, KC_MNXT, _______, KC_UNDS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | ! | @ | # | $ | % | ^ | & | * | ( | ) | DEL | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | GCTG | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, GCTOGG +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * |EEPRst| Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap| | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff| | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + EE_CLR, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_GAME] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_EQL, + 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_MINS, + KC_LCTL, QGCTOGG, KC_LALT, LOWER, KC_SPC, RSFT_T(KC_BSPC), TD(TD_SPC_ENT), RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT +), + +[_QWERTGAME] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_EQL, + 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_MINS, + KC_LCTL, QGCTOGG, KC_LALT, LOWER, KC_SPC, RSFT_T(KC_BSPC), TD(TD_SPC_ENT), RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT +) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + #ifdef BACKLIGHT_ENABLE + backlight_set(0); + #endif + } + return false; + break; + case GCTOGG: + if (record->event.pressed) { + if (!isGame) { + set_single_persistent_default_layer(_GAME); + isGame = true; + } + else { + set_single_persistent_default_layer(_COLEMAK); + isGame = false; + qwertGame = false; + } + } + return false; + break; + case QGCTOGG: + if (record->event.pressed) { + if (!qwertGame) { + set_single_persistent_default_layer(_QWERTGAME); + qwertGame = true; + } else { + set_single_persistent_default_layer(_GAME); + qwertGame = false; + } + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case PAREN: + if (record->event.pressed) { + SEND_STRING("()"); + } + return false; break; + } + return true; +} + +layer_state_t default_layer_state_set_user(layer_state_t state) { + switch (get_highest_layer(state)) { + case _GAME: + rgblight_sethsv_noeeprom(0, UINT8_MAX, RGBLIGHT_LIMIT_VAL); + rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_SWIRL+5); + break; + case _QWERTGAME: + rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_MOOD+2); + break; + case _COLEMAK: + rgblight_sethsv_noeeprom(0, 0, 0); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + break; + default: + break; + } + return state; +} + +void matrix_init_user(void) { + set_single_persistent_default_layer(_COLEMAK); + isGame = false; + qwertGame = false; + #ifdef BACKLIGHT_ENABLE + backlight_level(0); + #endif +} + +void keyboard_post_init_user(void) { + rgblight_sethsv_noeeprom(0, 0, 0); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); +} diff --git a/keyboards/planck/keymaps/dodger/readme.md b/keyboards/planck/keymaps/dodger/readme.md new file mode 100644 index 000000000000..01021081de7c --- /dev/null +++ b/keyboards/planck/keymaps/dodger/readme.md @@ -0,0 +1,2 @@ +# dodger + diff --git a/keyboards/planck/keymaps/dodger/rules.mk b/keyboards/planck/keymaps/dodger/rules.mk new file mode 100644 index 000000000000..f5d20511e229 --- /dev/null +++ b/keyboards/planck/keymaps/dodger/rules.mk @@ -0,0 +1,4 @@ +CONSOLE_ENABLE = no +BACKLIGHT_ENABLE = yes +TAP_DANCE_ENABLE = yes +RGBLIGHT_ENABLE = yes diff --git a/keyboards/planck/keymaps/dr0ck/config.h b/keyboards/planck/keymaps/dr0ck/config.h new file mode 100644 index 000000000000..59bf4aa2a3ea --- /dev/null +++ b/keyboards/planck/keymaps/dr0ck/config.h @@ -0,0 +1,39 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/dr0ck/keymap.c b/keyboards/planck/keymaps/dr0ck/keymap.c new file mode 100644 index 000000000000..78adb7533f97 --- /dev/null +++ b/keyboards/planck/keymaps/dr0ck/keymap.c @@ -0,0 +1,287 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST, + _FUNCTION +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV, + FUNCTION +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Func | A | S | D | F | G | H | J | K | L | ; | ‘ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | GUI | Esc |Lower |Enter |Space |Raise | Func | Alt |Prt Sc| Ctrl | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + FUNCTION,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT , + KC_LCTL, KC_LALT, KC_LGUI, KC_ESC, LOWER, KC_ENT, KC_SPC, RAISE, FUNCTION, KC_RALT,KC_PSCR, KC_RCTL +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Func | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Esc | Alt |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + FUNCTION,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_LCTL, KC_LGUI, KC_ESC, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Func | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Esc | Alt |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + FUNCTION,KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + KC_LCTL, KC_LGUI, KC_ESC, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Home |Pg Up |Pg Dn | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL , + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Home |Pg Up |Pg Dn | End | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL , + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Caps |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + KC_CAPS, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Function + * ,-----------------------------------------------------------------------------------. + * | Esc | | Prev | Play | Next | F5 | |Pg Up | Up |Pg Dn |Prt Sc| Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Mute | Vol- | Vol+ | | | Home | Left | Down |Right | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| | | | | | End | | | | | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | | | | |Enter |Space | | | | | Ctrl | + * `-----------------------------------------------------------------------------------' + */ +[_FUNCTION] = LAYOUT_planck_grid( + KC_ESC , _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_F5, _______, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_DEL, + _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + KC_LSFT, _______, _______, _______, _______, _______, KC_END , _______, _______, _______, _______, KC_RSFT, + KC_LCTL, _______, _______, _______, KC_ENT, KC_SPC, _______, _______, _______, _______, _______, KC_RCTL +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + case FUNCTION: + if (record->event.pressed) { + layer_on(_FUNCTION); + } else { + layer_off(_FUNCTION); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/dr0ck/readme.md b/keyboards/planck/keymaps/dr0ck/readme.md new file mode 100644 index 000000000000..e19eb9ed4499 --- /dev/null +++ b/keyboards/planck/keymaps/dr0ck/readme.md @@ -0,0 +1,15 @@ +This layout adds a new function layer similar to the default one from the pok3r: + + /* Function + * ,-----------------------------------------------------------------------------------. + * | Esc | | Prev | Play | Next | | |Pg Up | Up |Pg Dn |Prt Sc| Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | Vol- | Mute | Vol+ | | Home | Left | Down |Right | End | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Home |Pg Up |Pg Dn | End | + * `-----------------------------------------------------------------------------------' + */ + +You can acces this layer by holding the first key on the second line from the top. \ No newline at end of file diff --git a/keyboards/planck/keymaps/dr_notsokind/Readme.md b/keyboards/planck/keymaps/dr_notsokind/Readme.md new file mode 100644 index 000000000000..a336de2f3563 --- /dev/null +++ b/keyboards/planck/keymaps/dr_notsokind/Readme.md @@ -0,0 +1,96 @@ +# Dr NotSoKind's layout + +*Feel free to ask questions or send suggestions to [me on Twitter](https://twitter.com/pnikosis)* + +I love some features from the default layout, although there are things that definitively I can't get used to. Other layouts such as *circuit* gave me some good ideas, so I combined them all plus some own stuff to fit better my needs. + +BTW, I don't use Dvorak or other layouts than QWERTY and I'm too old and grumpy for learning something new (I'm lying a bit here, I learn new stuff every day), so I removed the ther typing layouts + +## Things I love about the default layout +1. I love the consistency between the raise and lower layers, like one is the shifted version of the other. +2. I like the F keys distributed in two rows, from F1 to F6 and F7 to F12, which makes them easier to find and access. + +## Things I don't like from the default layout +1. Arrow keys distributed VIM like. I use VIM frequently, but there I navigate using HJKL. Moving to the arrows intituively I tend to expect three arrows on the bottom (left, down, right) and one up in the middle (up). +2. Tab and Esc. I switched them. +3. Alt and Super. Switched them too. + +## Needs, changes and goals +1. Arrow keys distributed "traditionally". +2. Media keys easily accessible. +3. A button for Sleep/Power. +4. As close as possible to a US QWERTY layout. +5. A Numpad, for when I want to feel like an accountant. +6. Be able to record Dynamic Macros. +7. Zoom in and Zoom out (basically Ctrl - and Ctrl +) + +I've been experimenting a lot and I think I'm getting closer to my customization end game. + +## Layers: + +## Main Layer / QWERTY + +Apart from the default, lower and raise, I added an extra Media/Action layer, for volume and playback control, plus some keyboard actions such as Print Screen, Insert, Calculator or Power/Sleep/Wake. Also in the [MEDIA] layer, you can record two different macros and reproduce them. + +### About the volume up and down + +That was a hard decision. I wanted the vol up, down and mute easily accessible, and in an obvious palce. I finally decided to use the `Raise` and `Lower` modifier keys to manage the volume, in combination with the [MEDIA] modifier key. This could look a little weird, since the modifier keys are having a different function than modify the layer, but ended up working fairly well, so while pressing [MEDIA] you have the `Lower` key to put the volume down, `Raise` to raise the volume, and `Space` for mute. + +### Zoom in and Zoom out + +Using the [MEDIA] modifier you can zoom in and zoom out in browsers and other applications using `,` (for zooming out) and `.` (for zooming in). These keys are mapped to `LCTRL -` and `LCTRL =`. I initially thought about mapping zoom in to `LCTRL +` but most apps also map the zoom in using the `=` key, and some they don't event support zooming in with `+` (I'm looking at you Sublime Text). + +### Right Shift and Enter + +`RSHFT` and `ENTER` are combined. Tap once for `ENTER` and hold for `RSHFT`. `ENTER` will be registered on release if released within 200 ms, else `RSHFT` is registered starting at 201 ms until release. + +If for some reason, this interferes with the normal usage of the `ENTER` key in any way, (some problem that may never happen), there is a regular non-modified `ENTER` key on the same key in the [LOWER] and [RAISE] layers, as well in the [LOCK] mode (see below). + +### Caps Lock + +`LSHFT` and `CAPS` are also combined. The key works like a normal `LSHFT` unless double-tapped, in which case it counts as `CAPS`. This functionality unfortunately delays all key presses by at most 200 ms, but I have added ways to disable this both temporarily or permanently, described below. + +A normal behavior for `LSHFT` key is on the same key in the [LOWER], [RAISE] and [MEDIA] layers (so you can double tap it, as in IntelliJ IDEA), you can also use the [LOCK] mode. + +### Copy/Paste + +There are `UNDO`, `CUT`, `COPY`, and `PASTE` keys with the [MEDIA] modifier. This was intended to be a universal way to use these commands since in macOS cut is `⌘ + C` but in Windows it is `⌃ + C`. Unfortunately these special keys only work in Windows. + +### How to record and play dynamic Macros + +I wanted the macros a little "harder" to start recording than usual, since I didn't want to accidentally delete a macro. Also I wanted to share the same key for storing and reproducing the macros, made more sense for me than using one key for storing the Macro1, and use another one for reproducing that Macro. + +**Record a Macro** + +Press `Media` and `LCtrl` (that's left control), you will hear a beep if you have the audio on. Then choose where you want to store the Macro, in `;` or `'`, so press that key, you will now hear a tone for the macro start being recorded. + +When you are done, press `Media` and `Enter`. You will finally hear a tune confirming that the macro has been stored. + +**Play a Macro** + +Press `Media` and the key where you stored your Macro, either `;` or `'`. The Macro will play. + +![Imgur](https://i.imgur.com/TcVyNag.png) + +http://www.keyboard-layout-editor.com/#/gists/4cfb26f84bbb4fabe5e6c7cc22c85e24 + +## Lock Mode + +The Lock mode toggle disables the double-tap `CAPS` and disables `GUI` keys (WINDOWS key), also makes `ENTER` behave normally (not `RSHIFT` when hold). + +## Lower + Raise (adjust) Layer + +Lower + Raise gives access to the layer switching, plus keyboard modes (such as enabling music mode for annoying your coworkers), reset, SysReq and Lock Mode, which disables the double shift tap for CapsLock (taken from the *circuit* layout, see the comments below). Also provides another distribution for the F keys. + +![Adjust](https://i.imgur.com/6m6baos.png) + +http://www.keyboard-layout-editor.com/#/gists/12462bfba17d16bb40b54ed914209d92 + +## Numpad Layer + +![Numpad](https://i.imgur.com/od1plfz.png) + +http://www.keyboard-layout-editor.com/#/gists/5ab730ab278d2050c5250498806e8edc + +This layer is mostly for quick typing numbers using the numpad. You have NumLock available to switch before the keypad numbers or the actions (movement, del, insert, etc). Esc serves as a quick way to go abck to the QWERTY layer (also you can go to the QWERTY layer through the adjust layer). + diff --git a/keyboards/planck/keymaps/dr_notsokind/config.h b/keyboards/planck/keymaps/dr_notsokind/config.h new file mode 100644 index 000000000000..2bebf48a1ca9 --- /dev/null +++ b/keyboards/planck/keymaps/dr_notsokind/config.h @@ -0,0 +1,26 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/dr_notsokind/keymap.c b/keyboards/planck/keymaps/dr_notsokind/keymap.c new file mode 100644 index 000000000000..ffceef11cca6 --- /dev/null +++ b/keyboards/planck/keymaps/dr_notsokind/keymap.c @@ -0,0 +1,338 @@ +// Layout picture at http://www.keyboard-layout-editor.com/#/gists/125febfad6960add078e6f14256539b6 + +#include QMK_KEYBOARD_H +#ifdef AUDIO_ENABLE +#include "audio.h" +#endif +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _NUMPAD 1 +#define _LOCKED 2 +#define _RAISE 3 +#define _LOWER 4 +#define _FUNCTN 5 +#define _MEDIA 6 +#define _ONESHOT 7 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + NUMPAD, + RAISE, + LOWER, + MEDIA, + ONESHOT, + DYNAMIC_MACRO_RANGE +}; + +#include "dynamic_macro.h" + +// Key code names +#define SFT_ENT MT(MOD_RSFT, KC_ENT) // Tap for enter, hold for right shift +#define LOCK TG(_LOCKED) +#define KC_PSTE KC_PASTE +#define ZOOM_IN LCTL(KC_EQL) +#define ZOOM_OUT LCTL(KC_MINS) +#define ZOOM_NML LCTL(KC_0) + +#ifdef TAP_DANCE_ENABLE +#define SFT_CAP TD(0) // Left shift, double tap for caps +#endif +#ifndef TAP_DANCE_ENABLE +#define SFT_CAP KC_LSFT // Regular left shift +#endif + +// Tap Dance Definitions +#ifdef TAP_DANCE_ENABLE +tap_dance_action_t tap_dance_actions[] = { + [0] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) +}; +#endif + +// Layout definitions +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | BKSP | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |*Shift| Z | X | C | V | B | N | M | , | . | Up |SftEnt| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | GUI | Alt | Mute | Lower| Space | Raise| / | Left | Down | Right| + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + SFT_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SFT_ENT, + KC_LCTL, KC_LGUI, KC_LALT, MEDIA, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT +), + +/* NUMPAD + * ,-----------------------------------------------------------------------------------. + * |QWERTY| NULL | Up | NULL | NULL | NULL | NULL | / | 7 | 8 | 9 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Left | Down | Right| NULL | NULL | NULL | * | 4 | 5 | 6 | + | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |NumLck| NULL | NULL | NULL | NULL | NULL |BckSp | 1 | 2 | 3 | Ent | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | 0 | . | , | = | + * `-----------------------------------------------------------------------------------' + */ +[_NUMPAD] = LAYOUT_planck_grid( + QWERTY, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, + _______, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAST, KC_P4, KC_P5, KC_P6, KC_PPLS, + _______, KC_NUM, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, KC_P1, KC_P2, KC_P3, KC_PENT, + _______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PCMM, KC_PEQL +), + +/* LOCK + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| | | | | | | | | | | Enter| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | NULL | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LOCKED] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT, + _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* RAISE + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F11 | F12 | F13 | F14 | F15 | | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |LShift| F16 | F17 | F18 | F19 | F20 | |ISO # |ISO / | NULL | PgUp | Enter| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | Home | PgDn | End | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV , KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_DEL , KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_LSFT, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, KC_NUHS, KC_NUBS, XXXXXXX, KC_PGUP, KC_ENT, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END +), + +/* LOWER + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |LShift| F6 | F7 | F8 | F9 | F10 | |ISO ~ |ISO | | NULL | PgUp | Enter| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | Home | PgDn | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL , + KC_DEL , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_LSFT, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, S(KC_NUHS), S(KC_NUBS), XXXXXXX, KC_PGUP, KC_ENT , + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END +), + +/* MEDIA AND COMMANDS + * ,-----------------------------------------------------------------------------------. + * | NULL | NULL |WbHome| NULL | NULL | NULL |Again | NULL |Insert| NULL |PrntSc| NULL | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | NULL | NULL |WbSrch| NULL | Find | NULL | NULL | NULL | NULL | NULL |PlyMc1|PlyMc2| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |LShift| NULL | NULL | Calc | NULL | NULL | NULL | NULL |ZoomOu|ZoomIn| Prev |RecStp| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |ONESHT| NULL | NULL | | Vol- | Mute | Vol+ |Zoom 0| Stop | Next | Play | + * `-----------------------------------------------------------------------------------' + */ +[_MEDIA] = LAYOUT_planck_grid( + XXXXXXX, XXXXXXX, KC_WHOM, XXXXXXX, XXXXXXX, XXXXXXX, KC_AGAIN, XXXXXXX, KC_INS, XXXXXXX, KC_PSCR, XXXXXXX, + XXXXXXX, XXXXXXX, KC_WSCH, XXXXXXX, KC_FIND, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DM_PLY1, DM_PLY2, + KC_LSFT, XXXXXXX, XXXXXXX, KC_CALC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ZOOM_OUT, ZOOM_IN, KC_MPRV, DM_RSTP, + ONESHOT, XXXXXXX, XXXXXXX, _______, KC_VOLD, KC_MUTE, KC_MUTE, KC_VOLU, ZOOM_NML, KC_MSTP, KC_MNXT, KC_MPLY +), + +/* ONESHOT + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | |RecMc1|RecMc2| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ONESHOT] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, DM_REC1, DM_REC2, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* FUNCTIONS + * ,-----------------------------------------------------------------------------------. + * | SLEEP| NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | POWER| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | WAKE | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | NULL | NULL | NULL |AudOff|MusOff|QWERTY|NUMPAD|Mus On|Aud On| NULL |Voice+|SysReq| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Reset| NULL | LOCK | NULL | | NULL | | NULL |AGNorm|Voice-|AGSwap| + * `-----------------------------------------------------------------------------------' + */ +[_FUNCTN] = LAYOUT_planck_grid( + KC_SLEP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PWR, + KC_WAKE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, AU_OFF, MU_OFF, QWERTY, NUMPAD, MU_ON, AU_ON, XXXXXXX, AU_NEXT, KC_SYRQ, + QK_BOOT, XXXXXXX, LOCK, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, AG_NORM, AU_PREV, AG_SWAP +) + +}; + +#ifdef AUDIO_ENABLE +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_numpad[][2] = SONG(NUM_LOCK_ON_SOUND); +float tone_oneshot[][2] = SONG(TERMINAL_SOUND); +float tone_dyn_macro_rec[][2] = SONG(SONIC_RING); +float tone_dyn_macro_stop[][2] = SONG(COIN_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +void press_key(uint16_t key) { + register_code(key); + unregister_code(key); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + // uint16_t macro_kc = (keycode == ONESHOT ? DM_RSTP : keycode); + if (!process_record_dynamic_macro(keycode, record)) { + switch(keycode) { + case QK_DYNAMIC_MACRO_RECORD_START_1: + case QK_DYNAMIC_MACRO_RECORD_START_2: +#ifdef AUDIO_ENABLE + PLAY_SONG(tone_dyn_macro_rec); +#endif + break; + case QK_DYNAMIC_MACRO_RECORD_STOP: +#ifdef AUDIO_ENABLE + PLAY_SONG(tone_dyn_macro_stop); +#endif + break; + } + return false; + } + switch (keycode) { + case ONESHOT: + if (record->event.pressed) { + layer_on(_ONESHOT); + set_oneshot_layer(_ONESHOT, ONESHOT_START); + clear_oneshot_layer_state(ONESHOT_PRESSED); +#ifdef AUDIO_ENABLE + PLAY_SONG(tone_oneshot); +#endif + } + return false; + break; + case QWERTY: + if (record->event.pressed) { + if (IS_LAYER_ON(_NUMPAD)) { +#ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); +#endif + layer_off(_NUMPAD); + } + } + return false; + break; + case NUMPAD: + if (record->event.pressed) { + if (!IS_LAYER_ON(_NUMPAD)) { +#ifdef AUDIO_ENABLE + PLAY_SONG(tone_numpad); +#endif + layer_on(_NUMPAD); + } + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_RAISE, _LOWER, _FUNCTN); + } else { + layer_off(_RAISE); + update_tri_layer(_RAISE, _LOWER, _FUNCTN); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_RAISE, _LOWER, _FUNCTN); + } else { + layer_off(_LOWER); + update_tri_layer(_RAISE, _LOWER, _FUNCTN); + } + return false; + break; + case MEDIA: + if (record->event.pressed) { + layer_on(_MEDIA); + } else { + layer_off(_MEDIA); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { +#ifdef AUDIO_ENABLE + startup_user(); +#endif +} + +#ifdef AUDIO_ENABLE + +void startup_user(void) +{ + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user(void) +{ + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif diff --git a/keyboards/planck/keymaps/dr_notsokind/rules.mk b/keyboards/planck/keymaps/dr_notsokind/rules.mk new file mode 100644 index 000000000000..311ee8ec111b --- /dev/null +++ b/keyboards/planck/keymaps/dr_notsokind/rules.mk @@ -0,0 +1,22 @@ + +# Build Options +# change to "no" to disable the options, or define them in the makefile.mk in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +TAP_DANCE_ENABLE = yes # Enables the double-tap functionality of keys + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/dsanchezseco/config.h b/keyboards/planck/keymaps/dsanchezseco/config.h new file mode 100644 index 000000000000..501d118632e6 --- /dev/null +++ b/keyboards/planck/keymaps/dsanchezseco/config.h @@ -0,0 +1,7 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(DVORAK_SOUND) +#endif + +#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 5 diff --git a/keyboards/planck/keymaps/dsanchezseco/keymap.c b/keyboards/planck/keymaps/dsanchezseco/keymap.c new file mode 100644 index 000000000000..57c22bb95311 --- /dev/null +++ b/keyboards/planck/keymaps/dsanchezseco/keymap.c @@ -0,0 +1,55 @@ +#include QMK_KEYBOARD_H +#include "muse.h" + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define ESC_CTL LCTL_T(KC_ESC) + +extern keymap_config_t keymap_config; + +enum planck_layers { + _DVORAK, + _LOWER, + _RAISE, + _ADJUST +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, + ESC_CTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINUS, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SC_SENT, + KC_LCTL, _______, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_BSPC, RAISE, KC_RGUI, KC_RALT, _______, KC_RCTL +), + +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RIGHT,KC_RPRN, + _______, KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, _______, KC_LEFT, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, _______, _______, KC_DOWN, KC_UP, _______, _______, _______, _______, KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______ +), + +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_RIGHT, KC_0, + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, _______, _______, KC_DOWN, KC_UP, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______ +), + +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, _______, _______, _______, _______, + _______, KC_PSCR, _______, KC_DOWN, KC_UP, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +//void matrix_init_user(void) { +// eeconfig_init(); +//} + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} diff --git a/keyboards/planck/keymaps/dsanchezseco/readme.md b/keyboards/planck/keymaps/dsanchezseco/readme.md new file mode 100644 index 000000000000..de9680b49851 --- /dev/null +++ b/keyboards/planck/keymaps/dsanchezseco/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/dsanchezseco/rules.mk b/keyboards/planck/keymaps/dsanchezseco/rules.mk new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/keyboards/planck/keymaps/dsanchezseco/rules.mk @@ -0,0 +1 @@ + diff --git a/keyboards/planck/keymaps/dshields/config.h b/keyboards/planck/keymaps/dshields/config.h new file mode 100644 index 000000000000..857c8164e316 --- /dev/null +++ b/keyboards/planck/keymaps/dshields/config.h @@ -0,0 +1,4 @@ +#pragma once + +#define RGB_DIGITAL_RAIN_DROPS 24 + diff --git a/keyboards/planck/keymaps/dshields/keymap.c b/keyboards/planck/keymaps/dshields/keymap.c new file mode 100644 index 000000000000..c3dd7a50b46e --- /dev/null +++ b/keyboards/planck/keymaps/dshields/keymap.c @@ -0,0 +1,30 @@ +#include QMK_KEYBOARD_H +#include "dshields.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DEF] = LAYOUT_planck_grid( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ESC, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P , + MT_A, MT_S, MT_D, MT_F, LT_G, KC_TAB, KC_ENT, LT_H, MT_J, MT_K, MT_L, MT_SCLN, + KC_Z, KC_X, KC_C, KC_V, KC_B, OSMLSFT, DM_PLY1, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, + OSMLCTL, KC_LGUI, OSMLALT, OSL_FUN, OSL_LWR, MT_SPC, MT_SPC, OSL_RSE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + [LWR] = LAYOUT_planck_grid( + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, KC_DEL, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, + KC_TILD, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, _______, KC_LCBR, KC_RCBR, + _______, _______, _______, _______, _______, _______, DM_PLY2, _______, _______, _______, KC_DQUO, KC_PIPE, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END + ), + [RSE] = LAYOUT_planck_grid( + KC_1, KC_2, KC_3, KC_4, KC_5, _______, KC_DEL, KC_6, KC_7, KC_8, KC_9, KC_0 , + KC_GRV, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, _______, KC_LBRC, KC_RBRC, + _______, _______, _______, _______, _______, _______, DM_PLY2, _______, _______, _______, KC_QUOT, KC_BSLS, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END + ), + [FUN] = LAYOUT_planck_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, QK_BOOT, EE_CLR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 , + KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, _______, DM_RSTP, _______, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, + LGT_TOG, LGT_MOD, LGT_BRT, LGT_INC, LGT_DEC, DM_REC1, DM_REC2, _______, _______, KC_BTN1, KC_BTN2, KC_BTN3, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R + ) +}; + diff --git a/keyboards/planck/keymaps/dshields/readme.md b/keyboards/planck/keymaps/dshields/readme.md new file mode 100644 index 000000000000..6070fd2e9e13 --- /dev/null +++ b/keyboards/planck/keymaps/dshields/readme.md @@ -0,0 +1,12 @@ + +About +------ + +A simple split qwerty Planck layout that makes use of one-shot modifiers, +one-shot layers, tap-dance keys and dynamic macros. + +Layout +------- + +![Layout](https://i.imgur.com/vZR3c8m.jpg "Keyboard Layout") + diff --git a/keyboards/planck/keymaps/dudeofawesome/config.h b/keyboards/planck/keymaps/dudeofawesome/config.h new file mode 100644 index 000000000000..0029c262625b --- /dev/null +++ b/keyboards/planck/keymaps/dudeofawesome/config.h @@ -0,0 +1,41 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" +#include "dudeofawesome.h" + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(WORKMAN_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +// #define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif diff --git a/keyboards/planck/keymaps/dudeofawesome/keymap.c b/keyboards/planck/keymaps/dudeofawesome/keymap.c new file mode 100644 index 000000000000..054a76c0718e --- /dev/null +++ b/keyboards/planck/keymaps/dudeofawesome/keymap.c @@ -0,0 +1,233 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _WORKMAN, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _ADJUST, + _NUMPAD, +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + WORKMAN, + COLEMAK, + DVORAK, + LOWER, + RAISE, + BACKLIT +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | Enter| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Num | Ctrl | Alt | GUI | Lower| Space | Raise| Left | Down | Up | Right| + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT_planck_grid( + 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, RSFT_T(KC_ENT), + TT(_NUMPAD), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + /* Workman + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | D | R | W | B | J | F | U | P | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | H | T | G | Y | N | E | O | I | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | M | C | V | K | L | , | . | / | Enter| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Num | Ctrl | Alt | GUI | Lower| Space | Raise| Left | Down | Up | Right| + * `-----------------------------------------------------------------------------------' + */ + [_WORKMAN] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSPC , + KC_ESC, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT , + KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT), + TT(_NUMPAD), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + /* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / | Enter| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Num | Ctrl | Alt | GUI | Lower| Space | Raise| Left | Down | Up | Right| + * `-----------------------------------------------------------------------------------' + */ + [_COLEMAK] = LAYOUT_planck_grid( + 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, RSFT_T(KC_ENT), + TT(_NUMPAD), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + /* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z | Enter| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Num | Ctrl | Alt | GUI | Lower| Space | Raise| Left | Down | Up | Right| + * `-----------------------------------------------------------------------------------' + */ + [_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC , + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH , + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, RSFT_T(KC_ENT), + TT(_NUMPAD), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Play | Vol- | Vol+ | Next | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_VOLD, KC_VOLU, KC_MNXT + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Play | Vol- | Vol+ | Next | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_planck_grid( + 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_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_VOLD, KC_VOLU, KC_MNXT + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |CPSLCK| | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Wrkman|Dvorak|Colemk| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , + KC_CAPS, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, WORKMAN, DVORAK, COLEMAK, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, RGB_M_R, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Numpad + * ,-----------------------------------------------------------------------------------. + * | | ✗ | Home | Up | End | PgUp | ✗ | 7 | 8 | 9 | + | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | ✗ | Left | Down | Right| PgDn | ✗ | 4 | 5 | 6 | - | ✗ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | / | * | - | + | Enter| ✗ | 1 | 2 | 3 | * | Enter| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | ✗ | | 0 | 0 | . | / | = | + * `-----------------------------------------------------------------------------------' + */ + [_NUMPAD] = LAYOUT_planck_grid( + _______, KC_NO, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_NO, KC_P7, KC_P8, KC_P9, KC_PPLS, _______, + _______, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_NO, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_NO, + _______, KC_PSLS, KC_PAST, KC_PMNS, KC_PPLS, KC_PENT, KC_NO, KC_P1, KC_P2, KC_P3, KC_PAST, KC_PENT, + _______, _______, _______, _______, KC_NO, _______, _______, KC_P0, KC_P0, KC_PDOT, KC_PSLS, KC_PEQL + ) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + case WORKMAN: + if (record->event.pressed) { + set_single_persistent_default_layer(_WORKMAN); + } + return false; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + } + return true; +} diff --git a/keyboards/planck/keymaps/dudeofawesome/readme.md b/keyboards/planck/keymaps/dudeofawesome/readme.md new file mode 100644 index 000000000000..7e2f7dc943c6 --- /dev/null +++ b/keyboards/planck/keymaps/dudeofawesome/readme.md @@ -0,0 +1,22 @@ +# DudeOfAwesome's Planck Layout + +![Planck Layout](https://i.imgur.com/mOc2Sbd.png) + +## Features + +- Base Layers + - QWERTY + - Workman + - Dvorak + - Colemak +- Numpad layer + ![numpad layer](https://i.imgur.com/PQENcut.png) +- Audio + +## Building and flashing + +1. Put your board in DFU mode with either the button on the bottom, or with a software key in your current firmware +1. Flash: + ```bash + $ make make planck/rev4:dudeofawesome:dfu + ``` diff --git a/keyboards/planck/keymaps/dudeofawesome/rules.mk b/keyboards/planck/keymaps/dudeofawesome/rules.mk new file mode 100644 index 000000000000..eeee270d5e0c --- /dev/null +++ b/keyboards/planck/keymaps/dudeofawesome/rules.mk @@ -0,0 +1,7 @@ +AUDIO_ENABLE = yes # Audio output on port C6 +CONSOLE_ENABLE = no # Console for debug(+400) +MIDI_ENABLE = no # MIDI controls +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + diff --git a/keyboards/planck/keymaps/dvorak2space/config.h b/keyboards/planck/keymaps/dvorak2space/config.h new file mode 100644 index 000000000000..0927fa016e19 --- /dev/null +++ b/keyboards/planck/keymaps/dvorak2space/config.h @@ -0,0 +1,3 @@ +#pragma once +#define TAPPING_TOGGLE 1 +#define PERMISSIVE_HOLD diff --git a/keyboards/planck/keymaps/dvorak2space/keymap.c b/keyboards/planck/keymaps/dvorak2space/keymap.c new file mode 100644 index 000000000000..928f71ab1cfe --- /dev/null +++ b/keyboards/planck/keymaps/dvorak2space/keymap.c @@ -0,0 +1,242 @@ +#include QMK_KEYBOARD_H +#include "passwords.c" //Instead of extern just to cut down on compile time. Holds a single array. +#define MOUSEL KC_BTN1 +#define MOUSER KC_BTN2 +#define CTRLL LCTL(KC_LEFT) +#define CTRLR LCTL(KC_RGHT) +#define CAD LCTL(LALT(KC_DEL)) + +#define BASE_L 0 +#define SHFT_L 1 +#define MOD_L 2 +#define NAV_L 3 +#define AHK_L 4 +#define LOCK_L 5 +#define PASS_L 6 + +static host_driver_t *host_driver = 0; + +enum { + HK_SLP = SAFE_RANGE, + HK_IF, + HK_ELSE, + HK_COSL +}; + +enum { + FB = 0, + LPN, + RPN, + BCK, + DSH +}; + +enum { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, + DOUBLE_TAP = 3, + DOUBLE_HOLD = 4, + DOUBLE_SINGLE_TAP = 5, //Distinguishes between double tapping and typing, "tapping", for example. Not sure how accurate it is, and I have no need, so avoiding it at the moment. + TRIPLE_TAP = 6, + TRIPLE_HOLD = 7 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Base + * ,-----------------------------------------------------------------------------------. + * | Tab | ' | , | . | p | y | f | g | c | r | l | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Nav | a | o | e | u | i | d | h | t | n | s | Enter| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shft | ; | q | j | k | x | b | m | w | v | z | Shft | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | RClk | LClk | Ctrl | Space | Modifier | GUI | VolD | VolU |Macros| + * `-----------------------------------------------------------------------------------' + */ + [0] = LAYOUT_planck_2x2u( + KC_TAB, KC_QUOT,KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, TD(BCK), + MO(NAV_L),KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT, + KC_LSFT, KC_SCLN,KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, + KC_ESC, MOUSER, MOUSEL, KC_LCTL, KC_SPC, MO(MOD_L), KC_LGUI, KC_VOLD, KC_VOLU, OSL(AHK_L) + ), +/* Custom Shifts + * ,-----------------------------------------------------------------------------------. + * | | | ? | ! | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [1] = LAYOUT_planck_2x2u( + KC_TRNS,KC_TRNS,KC_SLSH,KC_1, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_NO, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS + ), +/* Modifier + * ,-----------------------------------------------------------------------------------. + * | Tab | + | - | * | / \ | if | else | ( [ | ) ] | { | } | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | = | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Enter| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | ` | < | > | & | | | _ | $ | @ | # | % | ^ | ~ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | Space | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [2] = LAYOUT_planck_2x2u( + KC_TRNS,KC_PLUS,TD(DSH),KC_ASTR,TD(FB), HK_IF, HK_ELSE,TD(LPN),TD(RPN),KC_LCBR,KC_RCBR,KC_TRNS, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_GRV, KC_LT, KC_GT, KC_AMPR,KC_PIPE,KC_UNDS,KC_DLR, KC_AT, KC_HASH,KC_PERC,KC_CIRC,LSFT(KC_GRV), + KC_NO, KC_NO, KC_NO, KC_NO, KC_SPC, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO + ), +//Nav + [3] = LAYOUT_planck_2x2u( + KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_HOME,KC_UP, KC_END, KC_NO, KC_TRNS, + KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, CTRLL, KC_LEFT,KC_DOWN,KC_RGHT, CTRLR, KC_TRNS, + KC_LSFT,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_SPC, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + ), +//AHK-Bindable Macros + [4] = LAYOUT_planck_2x2u( + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, + LCTL(KC_F13),LCTL(KC_F14),LCTL(KC_F15),LCTL(KC_F16),LCTL(KC_F17),LCTL(KC_F18),LCTL(KC_F19),LCTL(KC_F20),LCTL(KC_F21),LCTL(KC_F22),LCTL(KC_F23),LCTL(KC_F24), + LSFT(KC_F13),LSFT(KC_F14),LSFT(KC_F15),LSFT(KC_F16),LSFT(KC_F17),LSFT(KC_F18),LSFT(KC_F19),LSFT(KC_F20),LSFT(KC_F21),LSFT(KC_F22),LSFT(KC_F23),LSFT(KC_F24), + QK_BOOT, LALT(KC_F14),LALT(KC_F15),OSL(PASS_L), CAD, LALT(KC_F19), LALT(KC_F21),LALT(KC_F22),HK_SLP, HK_COSL + ), +//Locked Screen + [5] = LAYOUT_planck_2x2u( + 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, 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, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, HK_SLP, KC_NO + ), +//Passwords (by first letter of service name, at least better than just one) + [6] = LAYOUT_planck_2x2u( + KC_NO, KC_NO, KC_NO, KC_NO, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_NO, + KC_NO, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_NO, + KC_NO, KC_NO, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_NO, + KC_NO, KC_NO, KC_NO, HK_COSL, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { //X_KEY doesn't support aliases + switch(keycode) { + //if shift pressed and not shift layer or released and other shift not pressed + //in separate things because MOD_BIT (probably?) isn't toggled until after this returns true and shift is actually toggled + case KC_LSFT: //if pressed and not shift layer or released and other shift not pressed + if((record->event.pressed && IS_LAYER_OFF(SHFT_L)) || (!record->event.pressed && !(get_mods() & MOD_BIT(KC_RSFT)))) { layer_invert(SHFT_L); } + break; + case KC_RSFT: + if((record->event.pressed && IS_LAYER_OFF(SHFT_L)) || (!record->event.pressed && !(get_mods() & MOD_BIT(KC_LSFT)))) { layer_invert(SHFT_L); } + break; + case KC_ENT: //won't repeat on hold and I can't find a solution other than hardcoding timers but I kinda prefer it anyway. Swaps enter and shift enter + if(record->event.pressed) { + (IS_LAYER_ON(SHFT_L)) //if shifted release correct shift, send, and press same shift, else send shift enter + ? (get_mods() & MOD_BIT(KC_LSFT)) + ? SEND_STRING(SS_UP(X_LSFT) SS_TAP(X_ENTER) SS_DOWN(X_LSFT)) + : SEND_STRING(SS_UP(X_RSFT) SS_TAP(X_ENTER) SS_DOWN(X_RSFT)) + : SEND_STRING(SS_LSFT(SS_TAP(X_ENTER))); + } + return false; + case HK_IF: + if(record->event.pressed) { SEND_STRING("if"); } + break; + case HK_ELSE: + if(record->event.pressed) { SEND_STRING("else"); } + break; + case HK_COSL: + clear_keyboard(); + break; + case HK_SLP: + if(record->event.pressed) { + if(IS_LAYER_OFF(LOCK_L)) { + host_driver = host_get_driver(); + SEND_STRING(SS_LALT(SS_TAP(X_F23))); + host_set_driver(0); + } + else { + host_set_driver(host_driver); + SEND_STRING(SS_LALT(SS_TAP(X_F24))); + } + return false; + } + layer_invert(LOCK_L); + if(IS_LAYER_ON(AHK_L)) + layer_invert(AHK_L); + break; + default: + if(IS_LAYER_ON(PASS_L) && keycode <= KC_Z) { + SEND_STRING(passwords[keycode - KC_A]); + layer_invert(PASS_L); + return false; + } + } + return true; +}; + +//tapdance state evaluation +int cur_dance(tap_dance_state_t *state) { + int press = 0; + switch(state->count) { + case 1: + press = (state->interrupted || !state->pressed) + ? SINGLE_TAP + : SINGLE_HOLD; + break; + case 2: + press = DOUBLE_TAP; + break; + case 3: + press = TRIPLE_TAP; + } + return press; +} + +void back_tap(tap_dance_state_t *state, void *user_data) { tap_code(KC_BACKSPACE); } + +void back_finished(tap_dance_state_t *state, void *user_data) { if(!(state->interrupted || !state->pressed)) tap_code16(LCTL(KC_BACKSPACE)); } + +void slash_finished(tap_dance_state_t *state, void *user_data) { + int td_state = cur_dance(state); + switch(td_state) { + case SINGLE_TAP: + clear_mods(); + clear_weak_mods(); + tap_code(KC_SLSH); + break; + case DOUBLE_TAP: + tap_code(KC_NUBS); + } +} + +void dash_finished(tap_dance_state_t *state, void *user_data) { + int td_state = cur_dance(state); + switch(td_state) { + case SINGLE_TAP: + tap_code(KC_PMNS); + break; + case SINGLE_HOLD: + register_mods(MOD_BIT(KC_LALT)); + tap_code(KC_KP_0); + tap_code(KC_KP_1); + tap_code(KC_KP_5); + tap_code(KC_KP_1); + unregister_mods(MOD_BIT(KC_LALT)); + break; + case DOUBLE_TAP: + tap_code(KC_PMNS); + tap_code(KC_PMNS); + } +} + +tap_dance_action_t tap_dance_actions[] = { + [LPN] = ACTION_TAP_DANCE_DOUBLE(KC_LPRN, KC_LBRC), + [RPN] = ACTION_TAP_DANCE_DOUBLE(KC_RPRN, KC_RBRC), + [FB] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, slash_finished, NULL), + [BCK] = ACTION_TAP_DANCE_FN_ADVANCED(back_tap, back_finished, NULL), //each tap, on finished, and reset. Normally register_code on press unregister on reset so keys can be held down. + [DSH] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dash_finished, NULL) +}; diff --git a/keyboards/planck/keymaps/dvorak2space/passwords.c b/keyboards/planck/keymaps/dvorak2space/passwords.c new file mode 100644 index 000000000000..161c564dd5c3 --- /dev/null +++ b/keyboards/planck/keymaps/dvorak2space/passwords.c @@ -0,0 +1,28 @@ +char *passwords[26] = { + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" +}; diff --git a/keyboards/planck/keymaps/dvorak2space/readme.md b/keyboards/planck/keymaps/dvorak2space/readme.md new file mode 100644 index 000000000000..1844a57f3731 --- /dev/null +++ b/keyboards/planck/keymaps/dvorak2space/readme.md @@ -0,0 +1,5 @@ +![Keyboard Layout](https://i.imgur.com/9jYjllM.png) + +# IsaacElenbaas's Planck Layout + +Split spacebar, Dvorak. Bottom right button leads to layer with lots of things to be mapped in AutoHotkey. The ones I use (of which the best are sleep, which turns off the monitors and locks all inputs, rebinding keyboard-only mouse inputs, and redirecting media keys to a specific player) can be found [here.](https://github.com/IsaacElenbaas/personal_scripts/blob/master/Keyboard.ahk) Capslock goes to a right-hand navigation layer, there is a custom layer when holding shift, holding dash gives an em dash, holding backspace deletes a word, and I have a obfuscation-based password system you probably shouldn't use, but the rest is pretty standard. diff --git a/keyboards/planck/keymaps/dvorak2space/rules.mk b/keyboards/planck/keymaps/dvorak2space/rules.mk new file mode 100644 index 000000000000..df48d1a71e67 --- /dev/null +++ b/keyboards/planck/keymaps/dvorak2space/rules.mk @@ -0,0 +1,19 @@ +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work. Can make windows not recognize device. +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +TAP_DANCE_ENABLE = yes + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/keymaps/dvz/config.h b/keyboards/planck/keymaps/dvz/config.h new file mode 100644 index 000000000000..ab925009ed86 --- /dev/null +++ b/keyboards/planck/keymaps/dvz/config.h @@ -0,0 +1,76 @@ + /* Copyright 2021 Milan Düwel + * + * 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + /*#define DEFAULT_LAYER_SONGS { + SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + }*/ + + #define PING_SOUND Q__NOTE(_A6), WD_NOTE(_E7) +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +#ifdef AUDIO_ENABLE + #define DAC_SAMPLE_MAX 65535/2 +#endif + +#define RGBLIGHT_LAYERS +#define RGBLIGHT_SAT_STEP 5 +#define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_SLEEP +#define RGBLED_NUM 9 + +#define RGBLIGHT_EFFECT_BREATHING +#define RGBLIGHT_EFFECT_TWINKLE +#define RGBLIGHT_EFFECT_KNIGHT +#define RGBLIGHT_EFFECT_STATIC_GRADIENT +#define RGBLIGHT_EFFECT_SNAKE +#define RGBLIGHT_EFFECT_RAINBOW_SWIRL + +#undef RGBLIGHT_EFFECT_RAINBOW_MOOD +#undef RGBLIGHT_EFFECT_CHRISTMAS +#undef RGBLIGHT_EFFECT_STATIC_GRADIENT +#undef RGBLIGHT_EFFECT_RGB_TEST +#undef RGBLIGHT_EFFECT_ALTERNATING + +#define RGBLIGHT_RAINBOW_SWIRL_RANGE 127 diff --git a/keyboards/planck/keymaps/dvz/keymap.c b/keyboards/planck/keymaps/dvz/keymap.c new file mode 100644 index 000000000000..ff57d28cf82c --- /dev/null +++ b/keyboards/planck/keymaps/dvz/keymap.c @@ -0,0 +1,280 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" +#include "keymap_german.h" + +enum combos { + AE, + OE, + UE, + SZ +}; + +const uint16_t PROGMEM ae_combo[] = {KC_A, KC_E, COMBO_END}; +const uint16_t PROGMEM oe_combo[] = {KC_O, KC_E, COMBO_END}; +const uint16_t PROGMEM ue_combo[] = {KC_U, KC_E, COMBO_END}; +const uint16_t PROGMEM sz_combo[] = {KC_S, DE_Z, COMBO_END}; + +combo_t key_combos[] = { + [AE] = COMBO(ae_combo, DE_AE), + [OE] = COMBO(oe_combo, DE_OE), + [UE] = COMBO(ue_combo, DE_UE), + [SZ] = COMBO(sz_combo, DE_SS) +}; + +enum planck_layers { + _QWERTZ, + _NUMPD, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + QWERTZ = SAFE_RANGE, + NUMPD, + SCROLL +}; + +bool scroll = false; + +#ifdef AUDIO_ENABLE + float ping_song[][2] = SONG(PING_SOUND); +#endif + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTZ + * ,-----------------------------------------------------------------------------------. + * | RtEnc| Q | W | E | R | T | Z | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | + | - | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | SfTab| Y | X | C | V | B | N | M | , | . | Up |SfEnt | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | NumPd| Alt | Num | Space | Sym | Del | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTZ] = LAYOUT_planck_grid( + SCROLL, KC_Q, KC_W, KC_E, KC_R, KC_T, DE_Z, 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, DE_PLUS, DE_MINS, +LSFT_T(KC_TAB),DE_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SC_SENT, + KC_LCTL, KC_LGUI, NUMPD, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT +), + +/* Numpad + * ,-----------------------------------------------------------------------------------. + * | | 7 | 8 | 9 | / | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | NLCK | 4 | 5 | 6 | - | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | 1 | 2 | 3 | + | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | . | 0 | , |NumOFF| Enter |Raise | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_NUMPD] = LAYOUT_planck_grid( + SFT_T(KC_PASTE),KC_P7, KC_P8, KC_P9, DE_SLSH, _______, _______, _______, _______, _______, _______, _______, + KC_NUM, KC_P4, KC_P5, KC_P6, DE_MINS, _______, _______, _______, _______, _______, _______, _______, + _______, KC_P1, KC_P2, KC_P3, DE_PLUS, _______, _______, _______, _______, _______, _______, _______, + CTL_T(KC_COPY),KC_DOT, KC_P0, KC_COMM, NUMPD, KC_ENT, KC_ENT, _______, _______, _______, _______, _______ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ^ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F10 | F11 | F12 | F13 | F14 | F15 | | | |Pg Up | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Home |Pg Dn | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, _______, _______, + _______, KC_F10, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, _______, _______, _______, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | | ! | " | § | $ | % | & | / | ( | ) | = | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ° | | | | | | | | ? | [ | ] | ' | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | \ | < | > | { | } | Vol+ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Brt- | Vol- | Brt+ | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, DE_SLSH, DE_LPRN, DE_RPRN, DE_EQL, KC_BSPC, + KC_TILD, _______, _______, _______, _______, _______, DE_PIPE, DE_QUES, DE_LBRC, DE_RBRC, DE_QUOT, DE_HASH, + _______, _______, _______, _______, _______, DE_BSLS, DE_LABK, DE_RABK, DE_LCBR, DE_RCBR, KC_VOLU, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BRID, KC_VOLD, KC_BRIU +), + +/* Adjust (Lower + Raise) + * v------------------------RGB CONTROL--------------------v + * ,-----------------------------------------------------------------------------------. + * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |PowOff| |MUSmod|Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + KC_PWR, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + /*case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break;*/ + case NUMPD: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(ping_song); + #endif + if (layer_state_is(_NUMPD)) { + layer_off(_NUMPD); + } else { + layer_on(_NUMPD); + } + } + return false; + break; + case SCROLL: + if (record->event.pressed) { + scroll = true; + } else { + scroll = false; + } + default: + return true; + } +} + +void encoder_update(bool clockwise) { + if (layer_state_is(_NUMPD)){ + if (clockwise) { + tap_code(KC_RIGHT); + } else { + tap_code(KC_LEFT); + } + } else if (scroll) { //scroll fast mode + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } +} + +void matrix_scan_user(void) { +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} +const rgblight_segment_t PROGMEM numbers_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {3, 4, HSV_GREEN} +); +const rgblight_segment_t PROGMEM symbols_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {2, 5, HSV_PURPLE} +); +const rgblight_segment_t PROGMEM numpad_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {5, 4, HSV_RED} // Light 4 LEDs, starting with LED 6 +); +const rgblight_segment_t PROGMEM config_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {2, 6, HSV_YELLOW} +); + +// Now define the array of layers. Later layers take precedence +const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( + numbers_layer, + symbols_layer, + numpad_layer, // Overrides other layers + config_layer +); + +void keyboard_post_init_user(void) { + // Enable the LED layers + rgblight_layers = my_rgb_layers; +} + +layer_state_t layer_state_set_user(layer_state_t state) { + if (!(layer_state_is(_NUMPD))) { + state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); + } + rgblight_set_layer_state(2, layer_state_cmp(state, 1)); + rgblight_set_layer_state(0, layer_state_cmp(state, 2)); + rgblight_set_layer_state(1, layer_state_cmp(state, 3)); + rgblight_set_layer_state(3, layer_state_cmp(state, 4)); + return state; +} diff --git a/keyboards/planck/keymaps/dvz/readme.md b/keyboards/planck/keymaps/dvz/readme.md new file mode 100644 index 000000000000..f4c1eb6ad81b --- /dev/null +++ b/keyboards/planck/keymaps/dvz/readme.md @@ -0,0 +1,11 @@ +# devilzmods's german Planck Layout + +- QWERTZ +- Lefthand Numpad layer (toggle) +- Standard Numbers (left) +- Symbols (right) +- Settings + +This layout feature "rolling umlauts". Typing ae, oe, ue, sz respectively gets recognized and spits out ä, ö, ü, ß. For this, your systems keyboard layout/language has to be set to DE/German + +The layout is also designed around a rotary encoder in the top left corner that switches between slow and fast scrolling in the default layer by pressing it down while turning. In the numpad layer it scrolls left/right and pressing it down holds shift to select while scrolling. diff --git a/keyboards/planck/keymaps/dvz/rules.mk b/keyboards/planck/keymaps/dvz/rules.mk new file mode 100644 index 000000000000..7216951bf964 --- /dev/null +++ b/keyboards/planck/keymaps/dvz/rules.mk @@ -0,0 +1,5 @@ +SRC += muse.c + +COMBO_ENABLE = yes +#VIA_ENABLE = yes +AUDIO_ENABLE = yes diff --git a/keyboards/planck/keymaps/dzobert/keymap.c b/keyboards/planck/keymaps/dzobert/keymap.c new file mode 100644 index 000000000000..2ae760244a0f --- /dev/null +++ b/keyboards/planck/keymaps/dzobert/keymap.c @@ -0,0 +1,29 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_planck_grid( /* Qwerty */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_TAB, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_BSPC, + KC_LALT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + DF(1), KC_RSFT, KC_LGUI, KC_LSFT, MO(3), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + // Space is repeated to accommadate for both spacebar wiring positions +), +[1] = LAYOUT_planck_grid( /* Colemak */ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_TAB, + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_BSPC, + KC_LALT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + DF(0), KC_RSFT, KC_LGUI, KC_LSFT, MO(3), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), +[2] = LAYOUT_planck_grid( /* RAISE */ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_DEL, + KC_TRNS, KC_GRV, KC_MINS, KC_EQL, KC_QUOT, S(KC_QUOT), S(KC_LBRC), S(KC_RBRC), KC_LBRC, KC_RBRC, KC_BSLS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(2), KC_HOME, KC_PGUP, KC_PGDN, KC_END +), +[3] = LAYOUT_planck_grid( /* LOWER */ + KC_PWR, KC_PSCR, KC_SCRL, KC_PAUSE, KC_NUM, KC_EXECUTE, KC_MENU, KC_APP, KC_7, KC_8, KC_9, KC_KP_SLASH, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_CAPS, KC_CANCEL, KC_UNDO, KC_AGAIN, KC_4, KC_5, KC_6, KC_KP_ASTERISK, + KC_TRNS, KC_INSERT,KC_CUT, KC_COPY, KC_PASTE, KC_BSLS, KC_9, KC_0, KC_1, KC_2, KC_3, KC_KP_MINUS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_KP_DOT, KC_KP_ENTER, KC_KP_PLUS +) +}; diff --git a/keyboards/planck/keymaps/dzobert/rules.mk b/keyboards/planck/keymaps/dzobert/rules.mk new file mode 100644 index 000000000000..d86b02fd1ce4 --- /dev/null +++ b/keyboards/planck/keymaps/dzobert/rules.mk @@ -0,0 +1,22 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/emiller/config.h b/keyboards/planck/keymaps/emiller/config.h new file mode 100644 index 000000000000..18fb275105a0 --- /dev/null +++ b/keyboards/planck/keymaps/emiller/config.h @@ -0,0 +1,36 @@ +#pragma once + + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + diff --git a/keyboards/planck/keymaps/emiller/keymap.c b/keyboards/planck/keymaps/emiller/keymap.c new file mode 100644 index 000000000000..3b0e2c285bce --- /dev/null +++ b/keyboards/planck/keymaps/emiller/keymap.c @@ -0,0 +1,307 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST, + _VIM, + _NUM +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV, + VIM, + NUM +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | VIM | Lower| Space |Raise | NUM | Vol- | Vol+ | Del | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid ( + 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_LCTL, KC_LGUI, KC_LALT, MO(_VIM), LOWER, KC_SPC, KC_SPC, RAISE, TT(NUM), KC_VOLD, KC_VOLU, KC_RSFT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | Prev | | | | Next | BL- | BL+ |Print | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, KC_MPRV, _______, _______, _______, _______, KC_MNXT, BL_DOWN,BL_UP, KC_PSCR +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, KC_MPRV, _______, _______, _______, _______, KC_MNXT, BL_DOWN,BL_UP, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +/* VIM + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | Copy | Undo | | Paste| | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | Cut | | | | Left | Down | Up | Right | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | Del | |Select| | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_VIM] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, KC_COPY, KC_UNDO, _______, KC_PASTE, _______, + _______, _______, _______, KC_CUT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, + _______, _______, KC_DEL, _______, KC_SELECT, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +/* NUM + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | 7 | 8 | 9 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | 4 | 5 | 6 | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | 1 | 2 | 3 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | 0 | | | + * `-----------------------------------------------------------------------------------' + */ +[_NUM] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_0, _______, _______ +), +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + case NUM: + if (record->event.pressed) { + layer_on(_NUM); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_NUM); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/emiller/readme.md b/keyboards/planck/keymaps/emiller/readme.md new file mode 100644 index 000000000000..de9680b49851 --- /dev/null +++ b/keyboards/planck/keymaps/emiller/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/emiller/rules.mk b/keyboards/planck/keymaps/emiller/rules.mk new file mode 100644 index 000000000000..509cf9fd5654 --- /dev/null +++ b/keyboards/planck/keymaps/emiller/rules.mk @@ -0,0 +1 @@ +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality diff --git a/keyboards/planck/keymaps/emilyh/config.h b/keyboards/planck/keymaps/emilyh/config.h new file mode 100644 index 000000000000..59bf4aa2a3ea --- /dev/null +++ b/keyboards/planck/keymaps/emilyh/config.h @@ -0,0 +1,39 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/emilyh/keymap.c b/keyboards/planck/keymaps/emilyh/keymap.c new file mode 100644 index 000000000000..17bbc98b7e3b --- /dev/null +++ b/keyboards/planck/keymaps/emilyh/keymap.c @@ -0,0 +1,308 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | Up |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Brite| GUI | Alt |Lower | Space |Raise | / | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT , + KC_LCTL, BACKLIT, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ | Home | Next | Vol+ | Mute | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | End | Prev | Vol- | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), KC_HOME, KC_MNXT, KC_VOLU, KC_MUTE, + _______, _______, _______, _______, _______, _______, _______, _______, KC_END, KC_MPRV, KC_VOLD, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |Plover|Pg Up | Next | Vol+ | Mute | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | |Pg Dn | Prev | Vol- | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, TO(_PLOVER), KC_PGUP, KC_MNXT, KC_VOLU, KC_MUTE, + _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_MPRV, KC_VOLD, KC_MPLY +), + +/* Numpad Layer + * ,-----------------------------------------------------------------------------------. + * | ESC | | | ( | ) | | | 7 | 8 | 9 | + | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | + | - | * | / | | | 4 | 5 | 6 | - | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | Up | | | | | 1 | 2 | 3 | Up | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |ToQrty| Left | Down |Right | | Space | 0 | . | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_ESC , XXXXXXX, XXXXXXX, KC_LPRN, KC_RPRN,XXXXXXX, XXXXXXX, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_BSPC, + KC_TAB , KC_PPLS, KC_PMNS, KC_PAST, KC_PSLS,XXXXXXX, XXXXXXX, KC_P4, KC_P5, KC_P6, KC_PMNS, XXXXXXX, + XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX,XXXXXXX, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_UP, _______, + TO(_QWERTY),KC_LEFT,KC_DOWN,KC_RGHT,XXXXXXX, KC_SPC, KC_SPC, KC_P0, KC_PDOT, KC_LEFT, KC_DOWN, KC_RGHT +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(tone_plover); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_plover_gb); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user(void) +{ + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user(void) +{ + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif diff --git a/keyboards/planck/keymaps/emilyh/readme.md b/keyboards/planck/keymaps/emilyh/readme.md new file mode 100644 index 000000000000..5805480ebfe1 --- /dev/null +++ b/keyboards/planck/keymaps/emilyh/readme.md @@ -0,0 +1,2 @@ +# A modified planck layout with arrow cluster + diff --git a/keyboards/planck/keymaps/eosti/config.h b/keyboards/planck/keymaps/eosti/config.h new file mode 100644 index 000000000000..d5915a78ad98 --- /dev/null +++ b/keyboards/planck/keymaps/eosti/config.h @@ -0,0 +1,52 @@ +/* Copyright 2020 Reid Sox-Harris + * + * 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +// #define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages + #define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/eosti/keymap.c b/keyboards/planck/keymaps/eosti/keymap.c new file mode 100644 index 000000000000..f1d66d2a913f --- /dev/null +++ b/keyboards/planck/keymaps/eosti/keymap.c @@ -0,0 +1,122 @@ +/* Copyright 2020 Reid Sox-Harris + * + * 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 QMK_KEYBOARD_H +#include "muse.h" + +enum planck_layers { + _QWERTY, + _GAME, + _UPPER, + _LOWER, + _UTILS +}; + +enum planck_keycodes { + TMUX_WN = SAFE_RANGE, + TMUX_WL +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case TMUX_WN: // Moves to the next tmux window + if (record->event.pressed) { + SEND_STRING(SS_LCTL("a") "n"); + } + break; + + case TMUX_WL: // Moves to the last tmux window + if (record->event.pressed) { + SEND_STRING(SS_LCTL("a") "n"); + } + break; + } + return true; +}; + +#define UPPER MO(_UPPER) +#define LOWER MO(_LOWER) +#define UTILS MO(_UTILS) +#define GAME TG(_GAME) + +#define WM_R LCTL(KC_RGHT) // Moves the MacOS WM window to the right +#define WM_L LCTL(KC_LEFT) // ...and to the left +#define WM_MC LCTL(KC_UP) // Opens MacOS Mission Control +#define WEB_R LGUI(KC_RCBR) // Move one tab to the right, works on Firefox, Chrome +#define WEB_L LGUI(KC_LCBR) // ...and to the left +#define TMUX_U RALT(KC_UP) // Changes focus in tmux, requires a keybinding in tmux.conf +#define TMUX_D RALT(KC_DOWN) +#define TMUX_R RALT(KC_RGHT) +#define TMUX_L RALT(KC_LEFT) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_planck_grid( + // ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, + // ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + 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_BSPC, + // ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_NO, KC_NO, KC_LCTL, KC_LGUI, UPPER, KC_ENT, KC_SPC, LOWER, KC_RALT, KC_VOLU, KC_VOLD, KC_MUTE + // └────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┘ + ), + [_GAME] = LAYOUT_planck_grid( + // ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + // ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + // ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + // ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, KC_SPC, KC_ENT, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┘ + ), + [_UPPER] = LAYOUT_planck_grid( + // ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, + // ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, WEB_L, WEB_R, WM_MC, WM_L, WM_R, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_PGUP, KC_BSLS, + // ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_NO, KC_LABK, KC_LBRC, KC_LPRN, KC_LCBR, KC_RCBR, KC_RPRN, KC_RBRC, KC_RABK, KC_PGDN, _______, + // ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, UPPER, _______, _______, UTILS, _______, KC_MPRV, KC_MPLY, KC_MNXT + // └────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┘ + ), + [_LOWER] = LAYOUT_planck_grid( + // ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PLUS, + // ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, TMUX_WL, TMUX_WN, KC_NO, KC_NO, KC_NO, TMUX_L, TMUX_D, TMUX_U, TMUX_R, KC_NO, KC_PIPE, + // ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_NO, _______, _______, _______, _______, _______, _______, _______, _______, KC_NO, KC_DEL, + // ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, UTILS, _______, _______, LOWER, _______, _______, _______, _______ + // └────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┘ + ), + [_UTILS] = LAYOUT_planck_grid( + // ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + // ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_NO, KC_INS, KC_HOME, AU_ON, KC_NO, GAME, + // ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_NO, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_SLEP, KC_DEL, KC_END, AU_OFF, KC_NO, QK_BOOT, + // ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, UTILS, _______, _______, UTILS, _______, _______, _______, _______ + // └────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┘ + ) +}; diff --git a/keyboards/planck/keymaps/eosti/readme.md b/keyboards/planck/keymaps/eosti/readme.md new file mode 100644 index 000000000000..eb775c52ce12 --- /dev/null +++ b/keyboards/planck/keymaps/eosti/readme.md @@ -0,0 +1,9 @@ +# eosti's Planck (rev6) Keymap +## Features +* QWERTY main layout +* Gaming sublayer that switches space and enter for ease of WASDing +* Common programming enclosers {([<>])} easily accessable +* Vim-style HJKL arrow navigation +* tmux keybindings for easy navigation +* Plays well with my Iris Rev.3 keymap for ease of switching +* I like it diff --git a/keyboards/planck/keymaps/eosti/rules.mk b/keyboards/planck/keymaps/eosti/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/eosti/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/eshesh2/config.h b/keyboards/planck/keymaps/eshesh2/config.h new file mode 100644 index 000000000000..60c979b8a154 --- /dev/null +++ b/keyboards/planck/keymaps/eshesh2/config.h @@ -0,0 +1,54 @@ +/* Copyright 2021 Eshan Dalal + * + * 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +#define TAP_CODE_DELAY 10 + +#define ENCODERS_PAD_A { B12 } +#define ENCODERS_PAD_B { B13 } diff --git a/keyboards/planck/keymaps/eshesh2/keymap.c b/keyboards/planck/keymaps/eshesh2/keymap.c new file mode 100644 index 000000000000..ccb1db659a88 --- /dev/null +++ b/keyboards/planck/keymaps/eshesh2/keymap.c @@ -0,0 +1,262 @@ +/* Copyright 2020 Eshan Dalal + * + * 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 QMK_KEYBOARD_H +#include "muse.h" + + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _NUMPAD, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + ADJUST, + NUMPAD, + EXT_NUM +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Mute | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | Ctrl | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_MUTE, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_ESC, KC_LCTL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | Mute | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_MPLY, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Numpad layer + * ,-----------------------------------------------------------------------------------. + * | | | | | | | |NumLck| 7 | 8 | 9 |Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Left | Down | Up |Right | | | | 4 | 5 | 6 |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | 1 | 2 | 3 |Tab | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | | | | | . | 0 | | | + * `-----------------------------------------------------------------------------------' + */ +[_NUMPAD] = LAYOUT_planck_grid( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NUM, KC_KP_7, KC_KP_8, KC_KP_9, KC_BSPC, + XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, KC_ENTER, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, KC_TAB, + EXT_NUM, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_DOT, KC_KP_0, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * v------------------------RGB CONTROL--------------------v + * ,-----------------------------------------------------------------------------------. + * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | |MUSmod|Aud on|Audoff|AGnorm|AGswap|Qwerty| | |Numpad| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, XXXXXXX, XXXXXXX, NUMPAD, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case NUMPAD: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_NUMPAD); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_NUM: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_NUMPAD); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + switch (get_highest_layer(layer_state)) { + case _LOWER: // Seek Track + if (clockwise) { + tap_code16(KC_MPRV); + } else { + tap_code16(KC_MNXT); + break; + case _RAISE: // Page Scroll + if (clockwise) { + tap_code16(KC_BRID); + } else { + tap_code16(KC_BRIU); + break; + default: // Volume + if (clockwise) { + tap_code16(KC_VOLD); + } else { + tap_code16(KC_VOLU); + } + } + } + } + } + return true; +} + + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/eshesh2/readme.md b/keyboards/planck/keymaps/eshesh2/readme.md new file mode 100644 index 000000000000..f5ee73f1e618 --- /dev/null +++ b/keyboards/planck/keymaps/eshesh2/readme.md @@ -0,0 +1,64 @@ +![eshesh2's Planck Layout](https://i.imgur.com/eVgHH6k.png) + +eshesh2's Planck layout with a rotary encoder on the top left of the Planck. It is designed for everyday use along with a numpad layer for quickly typing in Excel and other workbook programs. + +## Qwerty + + ,-----------------------------------------------------------------------------------. + | Mute | Q | W | E | R | T | Y | U | I | O | P | Bksp | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Tab | A | S | D | F | G | H | J | K | L | ; | " | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Esc | Ctrl | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right | + `-----------------------------------------------------------------------------------' + +## Lower + + ,-----------------------------------------------------------------------------------. + | Play | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | Next | Vol- | Vol+ | Play | + `-----------------------------------------------------------------------------------' + +## Raise + + ,-----------------------------------------------------------------------------------. + | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | Next | Vol- | Vol+ | Play | + `-----------------------------------------------------------------------------------' + +# Numpad layer + + ,-----------------------------------------------------------------------------------. + | | | Up | | | | | |NumLck| 7 | 8 | 9 | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | Left | Down | Right| | | | | | 4 | 5 | 6 | + |------+------+------+------+------+------+------+------+------+------+------+------| + | |Enter | Tab | | | | | | | 1 | 2 | 3 | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Exit | | | | | | | | . | 0 |Bksp | + `-----------------------------------------------------------------------------------' + +# Adjust (Lower + Raise) + + v------------------------RGB CONTROL--------------------v + ,-----------------------------------------------------------------------------------. + | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | |MUSmod|Aud on|Audoff|AGnorm|AGswap|Qwerty| | |Numpad| | + |------+------+------+------+------+------+------+------+------+------+------+------| + | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | | | | + `-----------------------------------------------------------------------------------' diff --git a/keyboards/planck/keymaps/eshesh2/rules.mk b/keyboards/planck/keymaps/eshesh2/rules.mk new file mode 100644 index 000000000000..07a64e2fb60e --- /dev/null +++ b/keyboards/planck/keymaps/eshesh2/rules.mk @@ -0,0 +1,4 @@ +SRC += muse.c +ENCODER_ENABLE = yes +EXTRAKEY_ENABLE = yes +MOUSEKEY_ENABLE = yes diff --git a/keyboards/planck/keymaps/experimental/config.h b/keyboards/planck/keymaps/experimental/config.h new file mode 100644 index 000000000000..9ee7d9fac4da --- /dev/null +++ b/keyboards/planck/keymaps/experimental/config.h @@ -0,0 +1,45 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#define LEADER_TIMEOUT 300 +#define BACKLIGHT_BREATHING + +/* ws2812 RGB LED */ +#define WS2812_DI_PIN B1 +#define RGBLIGHT_EFFECT_BREATHING +#define RGBLIGHT_EFFECT_RAINBOW_MOOD +#define RGBLIGHT_EFFECT_RAINBOW_SWIRL +#define RGBLIGHT_EFFECT_SNAKE +#define RGBLIGHT_EFFECT_KNIGHT +#define RGBLIGHT_EFFECT_CHRISTMAS +#define RGBLIGHT_EFFECT_STATIC_GRADIENT +#define RGBLIGHT_EFFECT_RGB_TEST +#define RGBLIGHT_EFFECT_ALTERNATING +#define RGBLIGHT_EFFECT_TWINKLE +#define RGBLED_NUM 8 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif diff --git a/keyboards/planck/keymaps/experimental/keymap.c b/keyboards/planck/keymaps/experimental/keymap.c new file mode 100644 index 000000000000..d5c7425439d6 --- /dev/null +++ b/keyboards/planck/keymaps/experimental/keymap.c @@ -0,0 +1,403 @@ + +#include QMK_KEYBOARD_H +#include "keymap_steno.h" +#include "version.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 10 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _PLOVER 5 +#define _ADJUST 16 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV, + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL, +}; + +#define SW_SPC SH_T(KC_SPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_planck_grid( + QWERTY, KC_NO, KC_NO, KC_NO, RGBLED_TOGGLE, RGBLED_STEP_MODE, RGBLED_INCREASE_HUE, RGBLED_DECREASE_HUE, RGBLED_INCREASE_SAT, RGBLED_DECREASE_SAT, RGBLED_INCREASE_VAL, RGBLED_DECREASE_VAL, + KC_NO, KC_NO, KC_NO, KC_NO, RGBLED_TOGGLE, RGBLED_STEP_MODE, RGBLED_INCREASE_HUE, RGBLED_DECREASE_HUE, RGBLED_INCREASE_SAT, RGBLED_DECREASE_SAT, RGBLED_INCREASE_VAL, RGBLED_DECREASE_VAL, + KC_NO, KC_NO, KC_NO, KC_NO, RGBLED_TOGGLE, RGBLED_STEP_MODE, RGBLED_INCREASE_HUE, RGBLED_DECREASE_HUE, RGBLED_INCREASE_SAT, RGBLED_DECREASE_SAT, RGBLED_INCREASE_VAL, RGBLED_DECREASE_VAL, + KC_NO, KC_NO, KC_NO, KC_NO, RGBLED_TOGGLE, RGBLED_STEP_MODE, RGBLED_INCREASE_HUE, RGBLED_DECREASE_HUE, RGBLED_INCREASE_SAT, RGBLED_DECREASE_SAT, RGBLED_INCREASE_VAL, RGBLED_DECREASE_VAL +), + +/* Qwerty + ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M |, | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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 , + QK_LEAD, KC_LCTL, KC_LALT, KC_LGUI, LOWER, SW_SPC, SW_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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 , + QK_LEAD, KC_LCTL, KC_LALT, KC_LGUI, LOWER, SW_SPC, SW_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + QK_LEAD, KC_LCTL, KC_LALT, KC_LGUI, LOWER, SW_SPC, SW_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUHS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC , + STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR , + XXXXXXX, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR , + EXT_PLV, XXXXXXX, XXXXXXX, STN_A, STN_O, XXXXXXX, XXXXXXX, STN_E, STN_U, STN_PWR, STN_RE1, STN_RE2 +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff| | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + break; + return false; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + break; + return false; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + break; + return false; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + #ifdef BACKLIGHT_ENABLE + breathing_period_set(2); + breathing_pulse(); + #endif + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + break; + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + #ifdef BACKLIGHT_ENABLE + breathing_period_set(2); + breathing_pulse(); + #endif + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + break; + return false; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + break; + return false; + case PLOVER: + if (!record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(tone_plover); + #endif + layer_on(_PLOVER); + } + break; + return false; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_plover_gb); + #endif + layer_off(_PLOVER); + } + break; + return false; + + case RGBLED_TOGGLE: + //led operations + if (record->event.pressed) { + rgblight_toggle(); + } + return false; + break; + case RGBLED_INCREASE_HUE: + if (record->event.pressed) { + rgblight_increase_hue(); + } + return false; + break; + case RGBLED_DECREASE_HUE: + if (record->event.pressed) { + rgblight_decrease_hue(); + } + return false; + break; + case RGBLED_INCREASE_SAT: + if (record->event.pressed) { + rgblight_increase_sat(); + } + return false; + break; + case RGBLED_DECREASE_SAT: + if (record->event.pressed) { + rgblight_decrease_sat(); + } + return false; + break; + case RGBLED_INCREASE_VAL: + if (record->event.pressed) { + rgblight_increase_val(); + } + return false; + break; + case RGBLED_DECREASE_VAL: + if (record->event.pressed) { + rgblight_decrease_val(); + } + return false; + break; + case RGBLED_STEP_MODE: + if (record->event.pressed) { + rgblight_step(); + } + return false; + break; + + + } + return true; +}; + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE +void startup_user(void) +{ + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user(void) +{ + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif + +void leader_end_user(void) { + if (leader_sequence_one_key(KC_R)) { + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + } + if (leader_sequence_one_key(KC_V)) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + if (leader_sequence_one_key(KC_F)) { + SEND_STRING("if yes\n\tpeanut butter\nelse\n\trice snacks"); + } + if (leader_sequence_two_keys(KC_A, KC_S)) { + register_code(KC_H); + unregister_code(KC_H); + } + if (leader_sequence_three_keys(KC_A, KC_S, KC_D)) { + register_code(KC_LGUI); + register_code(KC_S); + unregister_code(KC_S); + unregister_code(KC_LGUI); + } +} diff --git a/keyboards/planck/keymaps/experimental/readme.md b/keyboards/planck/keymaps/experimental/readme.md new file mode 100644 index 000000000000..de9680b49851 --- /dev/null +++ b/keyboards/planck/keymaps/experimental/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/experimental/rules.mk b/keyboards/planck/keymaps/experimental/rules.mk new file mode 100644 index 000000000000..0ede1a0c2d63 --- /dev/null +++ b/keyboards/planck/keymaps/experimental/rules.mk @@ -0,0 +1,25 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = yes # Enable one-hand typing +STENO_ENABLE = yes # Enable TX Bolt protocol for Stenography, requires VIRTSER and may not work with mouse keys +LEADER_ENABLE = yes + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/fabian/config.h b/keyboards/planck/keymaps/fabian/config.h new file mode 100644 index 000000000000..d21e85693a48 --- /dev/null +++ b/keyboards/planck/keymaps/fabian/config.h @@ -0,0 +1,35 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/fabian/keymap.c b/keyboards/planck/keymaps/fabian/keymap.c new file mode 100644 index 000000000000..1569ed5e985b --- /dev/null +++ b/keyboards/planck/keymaps/fabian/keymap.c @@ -0,0 +1,346 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define CTL_ESC CTL_T(KC_ESC) // Tap for Escape, hold for Control +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift) +#define MEH_GRV MEH_T(KC_GRV) // Tap for Backtick, hold for Meh (Ctrl+Alt+Shift) +#define SFT_BSP SFT_T(KC_BSPC) // Tap for Backspace, hold for Shift +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define SFT_SPC SFT_T(KC_SPC) // Tap for Space, hold for Shift +#define UMLAUT RALT(KC_U) // Combine Alt and U + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Meh | Alt | GUI |Lower |Space | Tab |Raise | GUI |AltGr | Umlt | Ctrl | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + SFT_BSP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, + KC_LCTL, MEH_GRV, KC_LALT, KC_LGUI, LOWER, KC_SPC, HPR_TAB, RAISE, KC_RGUI, KC_RALT, UMLAUT, KC_RCTL +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Meh | Alt | GUI |Lower |Space | Tab |Raise | GUI |AltGr | Umlt | Ctrl | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + SFT_BSP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, + KC_LCTL, MEH_GRV, KC_LALT, KC_LGUI, LOWER, KC_SPC, HPR_TAB, RAISE, KC_RGUI, KC_RALT, UMLAUT, KC_RCTL +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Meh | Alt | GUI |Lower |Space | Tab |Raise | GUI |AltGr | Umlt | Ctrl | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + SFT_BSP, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, + KC_LCTL, MEH_GRV, KC_LALT, KC_LGUI, LOWER, KC_SPC, HPR_TAB, RAISE, KC_RGUI, KC_RALT, UMLAUT, KC_RCTL +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | RGBM | F7 | F8 | F9 | F10 | F11 | F12 | MS L | MS D |MS U | MS R |MS Btn| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_BTN1, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | RGBM | F7 | F8 | F9 | F10 | F11 | F12 | Left | Down | Up | Rght |MS_BN2| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_BTN2, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifndef KEYBOARD_planck_rev6 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifndef KEYBOARD_planck_rev6 + PORTE |= (1<<6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); +#endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } + return true; +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/fabian/rules.mk b/keyboards/planck/keymaps/fabian/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/fabian/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/foreveranapple/config.h b/keyboards/planck/keymaps/foreveranapple/config.h new file mode 100644 index 000000000000..6e6d0f3ac731 --- /dev/null +++ b/keyboards/planck/keymaps/foreveranapple/config.h @@ -0,0 +1,46 @@ +/* Copyright 2015-2021 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE +# define STARTUP_SONG SONG(PLANCK_SOUND) +// #define STARTUP_SONG SONG(NO_SOUND) + +# define DEFAULT_LAYER_SONGS \ + { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND) } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/foreveranapple/keymap.c b/keyboards/planck/keymaps/foreveranapple/keymap.c new file mode 100644 index 000000000000..c9d9c9f6ad35 --- /dev/null +++ b/keyboards/planck/keymaps/foreveranapple/keymap.c @@ -0,0 +1,413 @@ +/* Copyright 2015-2021 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + + +enum planck_layers { + _QWERTY, + _OSX, + _NIXQWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + OSX, + NIXQWERTY, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl |Brite | Alt | GUI |Raise | Space |Lower | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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_LCTL, BACKLIT, KC_LALT, KC_LGUI, RAISE, KC_SPC, KC_SPC, LOWER, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* OSX - Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | CMD |Brite | Alt | CTRL |Raise | Space |Lower | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_OSX] = LAYOUT_planck_grid( + 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_LGUI, BACKLIT, KC_LALT, KC_LCTL, RAISE, KC_SPC, KC_SPC, LOWER, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* NixQwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl |Brite | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_NIXQWERTY] = LAYOUT_planck_grid( + 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_LCTL, BACKLIT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * v------------------------RGB CONTROL--------------------v + * ,-----------------------------------------------------------------------------------. + * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | |MUSmod|Aud on|Audoff|AGnorm|AGswap|Qwerty|NixQty| OSX |Plover|Colemk| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL, + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, NIXQWERTY, OSX, PLOVER, COLEMAK, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, DVORAK, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case OSX: + if (record->event.pressed) { + set_single_persistent_default_layer(_OSX); + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + } + return false; + break; + case NIXQWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_NIXQWERTY); + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + writePinLow(E6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + writePinHigh(E6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_song); } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_gb_song); } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } + return true; +} + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/foreveranapple/readme.md b/keyboards/planck/keymaps/foreveranapple/readme.md new file mode 100644 index 000000000000..ddaa58ea3693 --- /dev/null +++ b/keyboards/planck/keymaps/foreveranapple/readme.md @@ -0,0 +1,3 @@ +# The Almost Default Planck Layout + +Simple changes right now, just some key shifts. Nothing major. \ No newline at end of file diff --git a/keyboards/planck/keymaps/foreveranapple/rules.mk b/keyboards/planck/keymaps/foreveranapple/rules.mk new file mode 100644 index 000000000000..87df38d49e74 --- /dev/null +++ b/keyboards/planck/keymaps/foreveranapple/rules.mk @@ -0,0 +1,2 @@ +SRC += muse.c +AUDIO_ENABLED = yes \ No newline at end of file diff --git a/keyboards/planck/keymaps/fsck/config.h b/keyboards/planck/keymaps/fsck/config.h new file mode 100644 index 000000000000..d68bc86cad3a --- /dev/null +++ b/keyboards/planck/keymaps/fsck/config.h @@ -0,0 +1,25 @@ +#pragma once + +#define USB_MAX_POWER_CONSUMPTION 100 + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC diff --git a/keyboards/planck/keymaps/fsck/keymap.c b/keyboards/planck/keymaps/fsck/keymap.c new file mode 100644 index 000000000000..b05d0e9859a1 --- /dev/null +++ b/keyboards/planck/keymaps/fsck/keymap.c @@ -0,0 +1,154 @@ +/* Copyright 2015-2017 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 . + */ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl |Brite | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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_LCTL, BACKLIT, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Vol- | Vol+ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | ALTGr| | | | Home |Pg Dn |Pg Up | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_VOLD, KC_VOLU, _______, + _______, _______, _______, KC_RALT, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | Vol- | Vol+ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | ALTGr| | | | Home |Pg Dn |Pg Up | End | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_VOLD, KC_VOLU, _______, + _______, _______, _______, KC_RALT, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + } + return true; +} diff --git a/keyboards/planck/keymaps/fsck/readme.md b/keyboards/planck/keymaps/fsck/readme.md new file mode 100644 index 000000000000..755da3e219c0 --- /dev/null +++ b/keyboards/planck/keymaps/fsck/readme.md @@ -0,0 +1,5 @@ +![preonic:fsck Layout Image](https://i.imgur.com/GOLyPGP.png) + +# fsck's Planck Layout + +This is largely based on the default planck layout. \ No newline at end of file diff --git a/keyboards/planck/keymaps/fsck/rules.mk b/keyboards/planck/keymaps/fsck/rules.mk new file mode 100644 index 000000000000..bd0181d620e2 --- /dev/null +++ b/keyboards/planck/keymaps/fsck/rules.mk @@ -0,0 +1,3 @@ +#pragma once +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality \ No newline at end of file diff --git a/keyboards/planck/keymaps/gabriel/keymap.c b/keyboards/planck/keymaps/gabriel/keymap.c new file mode 100644 index 000000000000..9e56724c1bda --- /dev/null +++ b/keyboards/planck/keymaps/gabriel/keymap.c @@ -0,0 +1,88 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QW 0 +#define _LW 1 +#define _RS 2 +#define _FN 3 + +// This a slightly modified 'default' keymap that's closer to the Mac keyboard layout. I like the position +// of 'esc' and 'tab' better this way. I also got rid of the backlighting control key and the dvorak and +// colemak layers. I added an 'fn' layer that makes the 'bspc' a forward delete (like on OSX). +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* MIT Layout (QWERTY layer) + * + * ,-----------------------------------------------------------------------. + * | esc | q | w | e | r | t | y | u | i | o | p | bspc| + * |-----------------------------------------------------------------------| + * | tab | a | s | d | f | g | h | j | k | l | ; | ' | + * |-----------------------------------------------------------------------| + * |shift| z | x | c | v | b | n | m | , | . | / |enter| + * |-----------------------------------------------------------------------| + * | fn | ctl | alt | cmd |lower| spc |raise|left |down | up |right| + * `-----------------------------------------------------------------------' + */ +[_QW] = LAYOUT_planck_grid( /* QWERTY */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + MO(_FN), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), +/* MIT Layout (Raised layer) + * + * ,-----------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |-----------------------------------------------------------------------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | - | + | [ | ] | | | + * |-----------------------------------------------------------------------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------' + */ +[_RS] = LAYOUT_planck_grid( /* RAISE */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_PLUS, KC_LBRC, KC_RBRC, KC_PIPE, + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +), +/* MIT Layout (Lowered layer) + * + * ,-----------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |-----------------------------------------------------------------------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | = | { | } | \ | + * |-----------------------------------------------------------------------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------' + */ +[_LW] = LAYOUT_planck_grid( /* LOWER */ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_EQL, KC_LCBR, KC_RCBR, KC_BSLS, + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +), +/* MIT Layout (FN layer) + * + * ,-----------------------------------------------------------------------. + * | | | | | | | | | | | | del | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | |home |pgdn |pgup | end | + * `-----------------------------------------------------------------------' + */ +[_FN] = LAYOUT_planck_grid( /* FUNCTION */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END +) +}; diff --git a/keyboards/planck/keymaps/gabriel/rules.mk b/keyboards/planck/keymaps/gabriel/rules.mk new file mode 100644 index 000000000000..d86b02fd1ce4 --- /dev/null +++ b/keyboards/planck/keymaps/gabriel/rules.mk @@ -0,0 +1,22 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/gitdrik/config.h b/keyboards/planck/keymaps/gitdrik/config.h new file mode 100644 index 000000000000..455e33d6d288 --- /dev/null +++ b/keyboards/planck/keymaps/gitdrik/config.h @@ -0,0 +1,53 @@ +/* Copyright 2015-2021 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 . + */ + +/* Passed along from planck default to Finnish SFS 5966 by gitdrik, 2020-2023. */ + +#pragma once + +#ifdef AUDIO_ENABLE +# define STARTUP_SONG SONG(NO_SOUND) +//# define STARTUP_SONG SONG(PLANCK_SOUND) +//# define AUDIO_INIT_DELAY // Get startup_song to actually play + +# define DEFAULT_LAYER_SONGS \ + { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND) } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/gitdrik/keymap.c b/keyboards/planck/keymaps/gitdrik/keymap.c new file mode 100644 index 000000000000..c62e93671a99 --- /dev/null +++ b/keyboards/planck/keymaps/gitdrik/keymap.c @@ -0,0 +1,233 @@ +/* Copyright 2015-2021 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 . + */ + +/* Modified from planck default to Finnish SFS 5966 by gitdrik, 2020-2023. */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +enum planck_layers { + _BASE, + _LEFT, + _RIGHT, + _LEFTER, + _RIGHTER +}; + +#define LEFT TT(_LEFT) +#define RIGHT MO(_RIGHT) +#define LEFTER MO(_LEFTER) +#define RIGHTER MO(_RIGHTER) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Base + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Å | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | H | J | K | L | Ö | Ä | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | Shift| X | C | V | B | N | M | , | . | Shift| Enter| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Z | GUI | Alt |Left2 | Left |BkSpc | Spc |Right |Rghter| \ | - | / | + * `-----------------------------------------------------------------------------------' + */ +[_BASE] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_ESC, KC_LSFT, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_ENT , + KC_Z, KC_LGUI, KC_LALT, LEFTER, LEFT, KC_BSPC, KC_SPC, RIGHT, RIGHTER, RALT(KC_MINS), KC_SLSH, KC_PSLS +), + +/* Left + * ,-----------------------------------------------------------------------------------. + * | Tab | F10 | F9 | F8 | F7 | { | } | 7 | 8 | 9 | ^ | = | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | RCtrl| F11 | F6 | F5 | F4 | ( | ) | 4 | 5 | 6 | + | * | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | Shift| F3 | F2 | F1 | [ | ] | 1 | 2 | 3 | Shift| Enter| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | F12 | GUI | Alt |Lefter| Left |BkSpc | Spc |Right | 0 | , | - | / | + * `-----------------------------------------------------------------------------------' + */ +[_LEFT] = LAYOUT_planck_grid( + KC_TRNS, KC_F10, KC_F9, KC_F8, KC_F7, RALT(KC_7), RALT(KC_0), KC_7, KC_8, KC_9, LSFT(KC_RBRC), LSFT(KC_0), + KC_RCTL, KC_F11, KC_F6, KC_F5, KC_F4, LSFT(KC_8), LSFT(KC_9), KC_4, KC_5, KC_6, KC_PPLS, KC_PAST, + KC_TRNS, KC_TRNS, KC_F3, KC_F2, KC_F1, RALT(KC_8), RALT(KC_9), KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS, + KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_COMM, KC_PMNS, KC_PSLS +), + +/* Right + * ,-----------------------------------------------------------------------------------. + * | Tab | ◌̄ | ◌̈ | ◌́ | ◌̀ | ◌̃ | ◌̆ | Home | Up | End | Ins | PgUp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | RCtrl| @ | $ | ° | & | # | % | Left | Down | Right| Del | PgDn | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | Shift| ” | « | » | ‚ „ | ‰ |PlayPs| << | >> | Shift| Enter| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | “ | GUI | Alt |Lefter| |BkSpc | Spc |Right |Rghter| Vol- | Vol+ | Mute | + * `-----------------------------------------------------------------------------------' + */ + [_RIGHT] = LAYOUT_planck_grid( + KC_TRNS, RALT(LSFT(KC_RBRC)), KC_RBRC, KC_EQL , LSFT(KC_EQL), RALT(KC_RBRC), RALT(KC_NUHS), KC_HOME, KC_UP, KC_END , KC_INS , KC_PGUP, + KC_RCTL, RALT(KC_2), RALT(KC_4), RALT(LSFT(KC_0)), LSFT(KC_6), LSFT(KC_3), LSFT(KC_5), KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_PGDN, + KC_TRNS, KC_TRNS, RALT(LSFT(KC_2)), RALT(LSFT(KC_4)), RALT(LSFT(KC_3)), RALT(KC_6), RALT(KC_5), KC_MPLY, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + RALT(LSFT(KC_5)), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE +), + +/* Lefter + * ,-----------------------------------------------------------------------------------. + * | Tab | § ½ | " | € | | þ Þ | ¡ | ! | ı | œ Œ | ◌̛ ◌̉ | ◌̋ ◌̊ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | ə Ə | ß ẞ | ð Ð | ' | < | > | | ĸ | ◌̵ | ø Ø | æ Æ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | Shift| × · | ◌̧ ◌̨ | | | ŋ Ŋ | µ — | ’ ‘ | ◌̣ ◌̇ | Shift| Enter| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ʒ Ʒ | GUI | Alt |Lefter| | BkSpc| NbSp | |Rghter| | | – ◌̦ | ? | + * `-----------------------------------------------------------------------------------' + */ + [_LEFTER] = LAYOUT_planck_grid( + KC_TRNS, KC_GRV, LSFT(KC_2), RALT(KC_E), RALT(KC_R), RALT(KC_T), RALT(LSFT(KC_1)), LSFT(KC_1), RALT(KC_I), RALT(KC_O), RALT(KC_P), RALT(KC_LBRC), + KC_TRNS, RALT(KC_A),RALT(KC_S), RALT(KC_D), KC_NUHS, KC_NUBS, LSFT(KC_NUBS), RALT(KC_J), RALT(KC_K), RALT(KC_L), RALT(KC_SCLN), RALT(KC_QUOT), + KC_TRNS, KC_TRNS, RALT(KC_X), RALT(KC_EQL), RALT(KC_V), RALT(KC_B), RALT(KC_N), RALT(KC_M), RALT(KC_COMM), RALT(KC_DOT), KC_TRNS, KC_TRNS, + RALT(KC_Z),KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RALT(KC_BSPC), RALT(KC_SPC), KC_TRNS, KC_TRNS, RALT(KC_NUBS), RALT(KC_SLSH), LSFT(KC_MINS) +), + +/* Righter + * ,-----------------------------------------------------------------------------------. + * | | Reset| Debug| | | | |WheLft| MUp |WheRgt| MBt2 | WheUp| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | MBt4 | MBt3 | MBt2 | MBt1 | | | MLeft| MDown|MRight| MBt1 | WheDn| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | |MUSmod|Mus on|Musoff| | | MBt1 | MBt2 | MBt3 | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | |Rghter|Light-|Light+| | + * `-----------------------------------------------------------------------------------' + */ + [_RIGHTER] = LAYOUT_planck_grid( + KC_TRNS, QK_BOOT, DB_TOGG, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, KC_WH_U, + KC_TRNS, KC_BTN4, KC_BTN3, KC_BTN2, KC_BTN1, KC_NO, KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN1, KC_WH_D, + KC_TRNS, KC_TRNS, MU_NEXT, MU_ON, MU_OFF, KC_NO, KC_NO, KC_BTN1, KC_BTN2, KC_BTN3, KC_TRNS, KC_TRNS, + KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_BRID, KC_BRIU, KC_NO +), + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RIGHT)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_song); } +#endif + layer_on(_LEFTER); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_gb_song); } +#endif + layer_off(_LEFTER); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } + return true; +} + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case _LEFTER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/gitdrik/readme.md b/keyboards/planck/keymaps/gitdrik/readme.md new file mode 100644 index 000000000000..44fba1db9a7e --- /dev/null +++ b/keyboards/planck/keymaps/gitdrik/readme.md @@ -0,0 +1 @@ +# Finnish SFS 5966 layout by gitdrik 2020-2023. diff --git a/keyboards/planck/keymaps/gitdrik/rules.mk b/keyboards/planck/keymaps/gitdrik/rules.mk new file mode 100644 index 000000000000..67528de9c834 --- /dev/null +++ b/keyboards/planck/keymaps/gitdrik/rules.mk @@ -0,0 +1,3 @@ +SRC += muse.c +MOUSEKEY_ENABLE = yes +AUDIO_ENABLE = yes diff --git a/keyboards/planck/keymaps/grahampheath/config.h b/keyboards/planck/keymaps/grahampheath/config.h new file mode 100644 index 000000000000..11e395dd9361 --- /dev/null +++ b/keyboards/planck/keymaps/grahampheath/config.h @@ -0,0 +1,43 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#define TAPPING_TERM 200 + +#undef BACKLIGHT_LEVELS +#define BACKLIGHT_LEVELS 4 + +#undef MOUSEKEY_WHEEL_MAX_SPEED +#define MOUSEKEY_WHEEL_MAX_SPEED 5 + diff --git a/keyboards/planck/keymaps/grahampheath/keymap.c b/keyboards/planck/keymaps/grahampheath/keymap.c new file mode 100644 index 000000000000..5704f869ae77 --- /dev/null +++ b/keyboards/planck/keymaps/grahampheath/keymap.c @@ -0,0 +1,448 @@ +/* Copyright 2015-2017 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 . + */ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _EMOJI, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV, + TOUNGE, + JOY, + FROWN, + HEART, + THMBUP, + THMBDN, + SHRUG, + WINK, + GRIN, + LLAP, + CRY, + SHIT, + FLIP, + FNGLEFT, + ABOVE, + FNGRIGHT, + CONFUSED +}; + + +#define KC_X0 MT(MOD_LCTL, KC_ESC) // Hold for Left Ctrl, Tap for ESC +#define KC_X1 MT(MOD_RSFT, KC_ENT) // Hold for Right Shift, Tap for Enter +#define KC_X2 MT(MOD_RSFT, LGUI(KC_ENT)) // Send Command Enter +#define KC_MOUS TT(_EMOJI) // Hold for Mouse Layer, or tap 5 times. +#define KC_QS LGUI(KC_SPC) // Send Command + Space (for QuickSilver). +#define KC_TABR LGUI(KC_RCBR) // Send Command + } (for tab changing). +#define KC_TABL LGUI(KC_LCBR) // Send Command + { (for tab changing). +#define HYPR_0 HYPR(KC_TILD) // Send Hyper + ~. +#define HYPR_1 HYPR(KC_EXLM) // Send Hyper + !. +#define HYPR_2 HYPR(KC_AT) // Send Hyper + @. + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc* | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift*| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | GUI | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + * - Right Shift: Tap for Enter, hold for shift. + * - Escape: Tap for Esc, hold for Ctrl. + */ +[_QWERTY] = LAYOUT_planck_grid( + 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_X0, 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_X1 , + KC_MOUS, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + + +/* Emoji Layer + * + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │HYPR0│ │ ;-) │ │ │ :-P │ │ │:'-( │FLIP │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │HYPR1│ 👆 │SHRUG│ │ :-( │ │ <3 │ :-) │ │LLAP │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │HYPR2│ │ │ | :-\ │ │ │ :-D │ SHIT│ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┴─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │Brig-│ Sleep │Brig+│ 👈 │ 👎 | 👍 │ 👉 │ + * └─────┴─────┴─────┴─────┴─────┴───────────┴─────┴─────┴─────┴─────┴─────┘ + */ +[_EMOJI] = LAYOUT_planck_grid( + HYPR_0, _______, WINK, _______, _______, TOUNGE, _______, _______, CRY, FLIP, _______, _______, + HYPR_1, ABOVE, SHRUG, _______, FROWN, _______, HEART, JOY, _______, LLAP, _______, _______, + HYPR_2, _______, _______, _______, CONFUSED, _______, _______, GRIN, SHIT, _______, _______, _______, + _______, _______, _______, _______, KC_SCRL, KC_SLEP, KC_SLEP, KC_PAUS, FNGLEFT, THMBDN, THMBUP, FNGRIGHT +), + + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shft | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | |Tab-L | 👎 | 👍 |Tab-R | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), _______, _______, _______, + _______, _______, _______, _______, _______, KC_QS, KC_QS, _______, KC_TABL, THMBDN, THMBUP, KC_TABR +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shft | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | Up |CTLENT| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Left | Down | Right| + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, KC_UP, KC_X2, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Brite | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + BACKLIT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +#ifdef BACKLIGHT_ENABLE + bool has_layer_changed = true; + + void matrix_scan_user(void) { + uint8_t layer = get_highest_layer(layer_state); + static uint8_t old_layer = 0; + + if (old_layer != layer) { + has_layer_changed = true; + old_layer = layer; + } + + if (has_layer_changed) { + has_layer_changed = false; + + switch (layer) { + case _LOWER: + backlight_set(1); + break; + case _QWERTY: + backlight_set(2); + break; + case _RAISE: + backlight_set(3); + break; + case _ADJUST: + backlight_set(4); + break; + } + } + }; +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_off(_EMOJI); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + case FLIP: + if (record->event.pressed) { + SEND_STRING("&fliptable;"); + } + return false; + break; + case CONFUSED: + if (record->event.pressed) { + SEND_STRING(":-\\"); + } + return false; + break; + case SHIT: + if (record->event.pressed) { + SEND_STRING("&shit; "); + } + return false; + break; + case CRY: + if (record->event.pressed) { + SEND_STRING(":'-( "); + } + return false; + break; + case LLAP: + if (record->event.pressed) { + SEND_STRING("&llap; "); + } + return false; + break; + case GRIN: + if (record->event.pressed) { + SEND_STRING(":-D "); + } + return false; + break; + case TOUNGE: + if (record->event.pressed) { + SEND_STRING(":-P "); + } + return false; + break; + case JOY: + if (record->event.pressed) { + SEND_STRING(":-) "); + } + return false; + break; + case FROWN: + if (record->event.pressed) { + SEND_STRING(":-( "); + } + return false; + break; + case HEART: + if (record->event.pressed) { + SEND_STRING("<3 "); + } + return false; + break; + case SHRUG: + if (record->event.pressed) { + SEND_STRING("&shrug; "); + } + return false; + break; + case THMBUP: + if (record->event.pressed) { + SEND_STRING("&thumbup; "); + } + return false; + break; + case THMBDN: + if (record->event.pressed) { + SEND_STRING("&thumbdown; "); + } + return false; + break; + case FNGLEFT: + if (record->event.pressed) { + SEND_STRING("&fingerleft; "); + } + return false; + break; + case FNGRIGHT: + if (record->event.pressed) { + SEND_STRING("&fingerright; "); + } + return false; + break; + case WINK: + if (record->event.pressed) { + SEND_STRING(";-) "); + } + return false; + break; + case ABOVE: + if (record->event.pressed) { + SEND_STRING("&above; "); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/grahampheath/readme.md b/keyboards/planck/keymaps/grahampheath/readme.md new file mode 100644 index 000000000000..ec8020f18c43 --- /dev/null +++ b/keyboards/planck/keymaps/grahampheath/readme.md @@ -0,0 +1,4 @@ +# Graham's Planck + +## Sounds +I've added a [8ohm 0.5W speaker](http://a.co/6MIKZSy), its a bit large, but it fits in approximately the same space as the ProMicro. I soldered to the pcb hole labeled PC6 on my Rev 3 Planck PCB, and GND on the near by chip. [Pic of an identical mod][https://i1.sndcdn.com/artworks-000128070066-myh0ls-t500x500.jpg] (not mine). diff --git a/keyboards/planck/keymaps/grahampheath/rules.mk b/keyboards/planck/keymaps/grahampheath/rules.mk new file mode 100644 index 000000000000..e84f6d5e6da5 --- /dev/null +++ b/keyboards/planck/keymaps/grahampheath/rules.mk @@ -0,0 +1,7 @@ +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +NKRO_ENABLE = yes # N-Key rollover. +# MOUSEKEY_ENABLE = yes # Mouse mode. +TAP_DANCE_ENABLE = no # Tap dance enabled. +UNICODEMAP_ENABLE = no # Unicode keymap (sucks on osx). +AUDIO_ENABLE = yes # Audio output on port C6 + diff --git a/keyboards/planck/keymaps/grant24/config.h b/keyboards/planck/keymaps/grant24/config.h new file mode 100644 index 000000000000..8b5d93ef8524 --- /dev/null +++ b/keyboards/planck/keymaps/grant24/config.h @@ -0,0 +1,52 @@ + /* Copyright Greg Anto + * + * 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 . + */ + + +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/grant24/keymap.c b/keyboards/planck/keymaps/grant24/keymap.c new file mode 100644 index 000000000000..3af4642af562 --- /dev/null +++ b/keyboards/planck/keymaps/grant24/keymap.c @@ -0,0 +1,376 @@ +/* An 8-layer, 4x12, grid keymap for the Planck Rev 6. + * + * + * Copyright 2015-2017 Greg Anto + * + * 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 QMK_KEYBOARD_H +#include "muse.h" + + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST, + _FN +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define FN MO(_FN) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Fn | GUI | Alt |Lower | Spce | Bksp |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + 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, MT(MOD_RSFT, KC_ENT), + KC_LCTL, OSL(FN), KC_LGUI, KC_LALT, LT(LOWER, KC_1), KC_SPC, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Fn | Gui | Alt |Lower | Bksp | Spce |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, + 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, RSFT_T(KC_ENT), + KC_LCTL, OSL(FN), KC_LGUI, KC_LALT, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Fn | Gui | Alt |Lower | Bksp | Spce |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, MT(MOD_RSFT, KC_ENT), + KC_LCTL, OSL(FN), KC_LGUI, KC_LALT, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |M Lft |M Dwn | M Up |M Rght| M UP | * | 4 | 5 | 6 | + | = | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | M5 | M4 | M3 | M2 | M1 | M DN | / | 1 | 2 | 3 | - | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | 0 | , | . | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_MS_WH_UP, KC_ASTR, KC_4, KC_5, KC_6, KC_PLUS, KC_EQL, + KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, KC_BTN1, KC_MS_WH_DOWN, KC_SLSH, KC_1, KC_2, KC_3, KC_MINS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_COMM, KC_DOT, KC_NO +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | ~ | \ | [ | ] | - | _ | { | } | | | + | = | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | CTLA | CTLY | CTLZ | CTLX | CTLC | CTLV | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | |DelWrd| | | Home | PgDn | PgUp | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TRNS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TRNS, + KC_GRAVE, KC_TILD, KC_BSLS, KC_LBRC, KC_RBRC, KC_MINS, KC_UNDS, KC_LCBR, KC_RCBR, KC_PIPE, KC_PLUS, KC_EQL, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, LCTL(KC_A), LCTL(KC_Y), LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LCTL(KC_BSPC), KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Fn + * ,-----------------------------------------------------------------------------------. + * |DelWrd| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Caps | F21 | F22 | F23 | F24 | Vol- | Mute | Vol+ | Prev | Play | Next | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_FN] = LAYOUT_planck_grid( + LCTL(KC_BSPC), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, + XXXXXXX, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, XXXXXXX, + KC_CAPS, KC_F21, KC_F22, KC_F23, KC_F24, KC_VOLD, KC_MUTE, KC_VOLU, KC_MRWD, KC_MPLY, KC_MFFD, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * v------------------------RGB CONTROL--------------------v + * ,-----------------------------------------------------------------------------------. + * | | Reset| | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Aud on|Audoff| | |Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Mus on|Musoff| | | CAPS | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, + _______, _______, _______, AU_ON, AU_OFF, _______, _______, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, _______, _______, MU_ON, MU_OFF, _______, _______, KC_CAPS, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + writePinLow(E6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + writePinHigh(E6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_song); } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_gb_song); } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } + return true; +} + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/grant24/readme.md b/keyboards/planck/keymaps/grant24/readme.md new file mode 100644 index 000000000000..d0c25bbccf5a --- /dev/null +++ b/keyboards/planck/keymaps/grant24/readme.md @@ -0,0 +1,108 @@ +# grant24's Planck Rev 6 Layout + + +## A layout centered around typing on Colemak, and gaming on Qwerty. Dvorak and Plover are also there just because. + +#### Lower for symbols, easy coding symbols access on home row, standard num row symbols on top, right-hand use of common Ctrl shortcut keys. +#### Raise for numbers, includes num row and num pad, as well as mouse keys. +#### Adjust layer is a stripped down version of the default mapping. +#### Code layer for Fn keys and media/volume control. + + + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Fn | GUI | Alt |Lower | Spce | Bksp |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + + /* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Fn | Gui | Alt |Lower | Bksp | Spce |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + + /* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Fn | Gui | Alt |Lower | Bksp | Spce |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |M Lft |M Dwn | M Up |M Rght| M UP | * | 4 | 5 | 6 | + | = | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | M5 | M4 | M3 | M2 | M1 | M DN | / | 1 | 2 | 3 | - | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | 0 | , | . | | + * `-----------------------------------------------------------------------------------' + */ + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | ~ | \ | [ | ] | - | _ | { | } | | | + | = | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | CTLA | CTLY | CTLZ | CTLX | CTLC | CTLV | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | |DelWrd| | | Home | PgDn | PgUp | End | + * `-----------------------------------------------------------------------------------' + */ + + /* Fn + * ,-----------------------------------------------------------------------------------. + * |DelWrd| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Caps | F21 | F22 | F23 | F24 | Vol- | Mute | Vol+ | Prev | Play | Next | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + + /* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + + /* Adjust (Lower + Raise) + * v------------------------RGB CONTROL--------------------v + * ,-----------------------------------------------------------------------------------. + * | | Reset| | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Aud on|Audoff| | |Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Mus on|Musoff| | | CAPS | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ diff --git a/keyboards/planck/keymaps/grant24/rules.mk b/keyboards/planck/keymaps/grant24/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/grant24/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/gunp/config.h b/keyboards/planck/keymaps/gunp/config.h new file mode 100644 index 000000000000..a48cd4534196 --- /dev/null +++ b/keyboards/planck/keymaps/gunp/config.h @@ -0,0 +1,27 @@ +/* Copyright 2021 Gun Pinyo + * + * 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 . + */ + +#pragma once + +/* Tapping this number of times holds the key until tapped once again. */ +#define ONESHOT_TAP_TOGGLE 7 +/* Time (in ms) before the one shot key is released */ +#define ONESHOT_TIMEOUT 5000 + +/* Audio */ +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) +#endif diff --git a/keyboards/planck/keymaps/gunp/keymap.c b/keyboards/planck/keymaps/gunp/keymap.c new file mode 100644 index 000000000000..7c2f6c0bd57c --- /dev/null +++ b/keyboards/planck/keymaps/gunp/keymap.c @@ -0,0 +1,307 @@ +/* Copyright 2021 Gun Pinyo + * + * 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 QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + LY_0000, LY_0001, LY_0010, LY_0011, + LY_0100, LY_0101, LY_0110, LY_0111, + LY_1000, LY_1001, LY_1010, LY_1011, + LY_1100, LY_1101, LY_1110, LY_1111, + LY_THAI_A, LY_THAI_B, LY_THAI_C, + LY_SANDBOX, LY_STICK, +}; + +enum planck_keycodes { + MIN_KC = SAFE_RANGE, + FUNC_A, FUNC_B, FUNC_C, FUNC_D, + SANDBOX, STICK, + LTHAI_A, LTHAI_B, LTHAI_C, + LSW0110, LSW1111, LSW0100, + USER_NAME, USER_EMAIL, + MAX_KC, + DYNAMIC_MACRO_RANGE, +}; + +#define KC_L2_0 KC_LSFT +#define KC_L3_0 KC_LCTL +#define KC_L3_1 KC_LALT +#define KC_L3_2 KC_LGUI + +#define KC_R2_1 FUNC_A +#define KC_R2_2 FUNC_B +#define KC_R2_3 FUNC_C +#define KC_R2_4 FUNC_D + +#define KC_R2_5 KC_RSFT +#define KC_R3_0 KC_R2_4 +#define KC_R3_1 KC_SPC + +#define LAYOUT_gunp( k00, k01, k02, k03, k04, k05, \ + k10, k11, k12, k13, k14, k15, \ + k20, k21, k22, k23, k24, k25, \ + k30, k31, k32, k33, k34, k35) \ +LAYOUT_ortho_4x12( \ +k00,k01,k02,k03,k04,k05, LSW0110, KC_LEFT, KC_BSPC, KC_RIGHT,XXXXXXX, XXXXXXX,\ +k10,k11,k12,k13,k14,k15, LSW1111, LTHAI_A, LTHAI_B, LTHAI_C, XXXXXXX, XXXXXXX,\ +k20,k21,k22,k23,k24,k25, LSW0100, KC_R2_1, KC_R2_2, KC_R2_3, KC_R2_4, KC_R2_5,\ +k30,k31,k32,k33,k34,k35, KC_R3_0, KC_R3_1, KC_ENT, KC_RGUI, KC_RALT, KC_RCTL) + +#define UNUSED_LAYER LAYOUT_gunp(\ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,\ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,\ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,\ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX), + +#define F1_F12_LAYER(M) LAYOUT_gunp(\ + S(M(KC_F7 )), S(M(KC_F8 )), M(KC_F7 ), M(KC_F8 ), M(KC_F9 ), S(M(KC_F9 )),\ + S(M(KC_F4 )), S(M(KC_F5 )), M(KC_F4 ), M(KC_F5 ), M(KC_F6 ), S(M(KC_F6 )),\ + S(M(KC_F1 )), S(M(KC_F2 )), M(KC_F1 ), M(KC_F2 ), M(KC_F3 ), S(M(KC_F3 )),\ + S(M(KC_F10)), S(M(KC_F11)), M(KC_F10), M(KC_F11), M(KC_F12), S(M(KC_F12))), + +#define MC(kc) LCTL(kc) +#define MA(kc) LALT(kc) +#define MG(kc) LGUI(kc) +#define MSC(kc) LSFT(LCTL(kc)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[LY_0000] = LAYOUT_ortho_4x12( + KC_PGUP, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_K, KC_TAB, + KC_PGDN, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, STICK, + KC_L2_0, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_M, + KC_R2_1, KC_R2_2, KC_R2_3, KC_UP, KC_R2_5, + KC_L3_0, KC_L3_1, KC_L3_2, KC_ESCAPE, KC_BSPC, KC_ENTER, + KC_R3_0, KC_R3_1, KC_PSCR, KC_LEFT, KC_DOWN, KC_RIGHT +), +[LY_1000] = LAYOUT_gunp( + XXXXXXX, KC_PERC, KC_QUES, KC_EXLM, KC_GRV, XXXXXXX, + XXXXXXX, KC_AT, KC_COMM, KC_DOT, KC_QUOT, KC_EQL, + KC_L2_0, KC_DLR, KC_SCLN, KC_COLN, KC_DQUO, KC_UNDS, + KC_L3_0, KC_L3_1, KC_L3_2, XXXXXXX, XXXXXXX, XXXXXXX +), +[LY_0010] = LAYOUT_gunp( + XXXXXXX, KC_AMPR, KC_PIPE, KC_TILD, KC_CIRC, XXXXXXX, + XXXXXXX, KC_LCBR, KC_LBRC, KC_LPRN, KC_LT, KC_SLSH, + KC_L2_0, KC_RCBR, KC_RBRC, KC_RPRN, KC_GT, KC_BSLS, + KC_L3_0, KC_L3_1, KC_L3_2, XXXXXXX, XXXXXXX, XXXXXXX +), +[LY_1010] = LAYOUT_gunp( + XXXXXXX, KC_HASH, KC_7, KC_8, KC_9, XXXXXXX, + XXXXXXX, KC_ASTR, KC_4, KC_5, KC_6, KC_PLUS, + KC_L2_0, KC_0, KC_1, KC_2, KC_3, KC_MINS, + KC_L3_0, KC_L3_1, KC_L3_2, XXXXXXX, XXXXXXX, XXXXXXX +), +[LY_0100] = LAYOUT_gunp( + XXXXXXX, MC(KC_G), KC_HOME, KC_UP, KC_END, MC(KC_UP), + XXXXXXX, KC_PGUP, KC_LEFT, KC_DOWN, KC_RIGHT, MC(KC_DOWN), + XXXXXXX, KC_PGDN, MC(KC_S), MC(KC_A), MC(KC_Z), MSC(KC_Z), + XXXXXXX, XXXXXXX, MC(KC_LEFT), MC(KC_F), MC(KC_RIGHT), XXXXXXX +), +[LY_1100] = LAYOUT_gunp( + XXXXXXX, MSC(KC_G), S(KC_HOME), S(KC_UP), S(KC_END), MSC(KC_UP), + XXXXXXX, S(KC_PGUP), S(KC_LEFT), S(KC_DOWN), S(KC_RIGHT), MSC(KC_DOWN), + XXXXXXX, S(KC_PGDN), MC(KC_X), MC(KC_C), MC(KC_V), MC(KC_L), + XXXXXXX, XXXXXXX, MSC(KC_LEFT), MC(KC_R), MSC(KC_RIGHT), XXXXXXX +), +[LY_0110] = F1_F12_LAYER() +[LY_1110] = F1_F12_LAYER(MG) + +[LY_0001] = LAYOUT_gunp( + MC(KC_H), MC(KC_0), MSC(KC_PGUP), KC_BRIU, MSC(KC_PGDN), KC_VOLU, + MSC(KC_T), MC(KC_PLUS), MC(KC_PGUP), KC_BRID, MC(KC_PGDN), KC_VOLD, + OSM(MOD_LSFT), MC(KC_MINS), MA(KC_LEFT), MC(KC_T), MA(KC_RIGHT), KC_MUTE, + OSM(MOD_LCTL), OSM(MOD_LALT), OSM(MOD_LGUI), MC(KC_W), KC_DELETE, KC_APP +), +[LY_1101] = LAYOUT_gunp( + SANDBOX, XXXXXXX, AU_TOGG, QK_LOCK, RGB_TOG, QK_BOOT, + KC_WAKE, KC_CAPS, USER_NAME, USER_EMAIL, RGB_MOD, DB_TOGG, + KC_SLEP, KC_NUM, DM_REC1, DM_PLY1, XXXXXXX, EE_CLR, + KC_PWR, KC_SCRL, DM_REC2, DM_PLY2, DM_RSTP, KC_INSERT +), +[LY_1111] = LAYOUT_gunp( + KC_ACL1, KC_ACL0, KC_WH_L, KC_MS_U, KC_WH_R, KC_WH_U, + KC_ACL2, XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, + KC_MPRV, KC_BTN5, KC_MRWD, KC_MPLY, KC_MFFD, KC_BTN3, + KC_MNXT, KC_BTN4, KC_PAUSE, KC_MSTP, KC_BTN1, KC_BTN2 +), +[LY_0111] = UNUSED_LAYER +[LY_1011] = UNUSED_LAYER + +[LY_1001] = UNUSED_LAYER +[LY_0101] = UNUSED_LAYER +[LY_0011] = UNUSED_LAYER + +/* mapping from US QWERTY to TH Kedmanee */ +[LY_THAI_A] = LAYOUT_gunp( + S(KC_G), KC_PIPE, KC_8, KC_COMM, S(KC_A), KC_QUES, + S(KC_I), KC_SCLN, KC_QUOT, KC_O, KC_I, KC_RBRC, + S(KC_P), S(KC_T), KC_M, KC_P, KC_EQL, KC_COLN, + KC_LT, S(KC_S), S(KC_R), KC_GT, KC_R, KC_A +), +[LY_THAI_B] = LAYOUT_gunp( + S(KC_N), S(KC_H), KC_J, KC_H, S(KC_U), S(KC_J), + S(KC_F), KC_C, KC_G, KC_K, KC_Y, KC_T, + KC_DOT, KC_W, KC_B, KC_U, KC_7, KC_N, + KC_1, S(KC_B), S(KC_Y), KC_E, KC_6, KC_CIRC +), +[LY_THAI_C] = LAYOUT_gunp( + KC_4, KC_BSLS, KC_MINS, S(KC_V), S(KC_E), S(KC_D), + KC_5, KC_0, KC_D, KC_V, KC_F, KC_9, + S(KC_L), S(KC_K), KC_L, KC_S, KC_LBRC, KC_X, + S(KC_O), KC_Q, KC_LCBR, S(KC_C), KC_Z, KC_SLSH +), +[LY_SANDBOX] = LAYOUT_ortho_4x12( + KC_LCBR, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_K, KC_RCBR, + KC_LBRC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_RBRC, + KC_LPRN,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_M,KC_COMM,KC_DOT,KC_SCLN,KC_COLN,KC_RPRN, + KC_LT , KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GT +), +[LY_STICK] = UNUSED_LAYER // as a gateway to other persistant layers +}; + +#define NUM_LANGS 2 +#define LANG_ENG 0 +#define LANG_THAI 1 + +uint16_t cur_layer = LY_0000; +uint16_t cur_lang = LANG_ENG; +bool is_layer_persistant = false; + +void change_layer(uint16_t new_layer) { + if(cur_layer != new_layer) { + layer_off(cur_layer); + layer_on(new_layer); + cur_layer = new_layer; + } +} + +void change_lang(uint16_t lang) { + while(lang != cur_lang) { + SEND_STRING(SS_LGUI(" ")); + cur_lang = (cur_lang + 1) % NUM_LANGS; + } +} + +void user_panic(void) { + SEND_STRING("Planck Keyboard: User Panic!"); +} + +void update_env_thai(void) { + if(LY_THAI_A <= cur_layer && cur_layer <= LY_THAI_C) { + change_lang(LANG_THAI); + } else { + change_lang(LANG_ENG); + } +} + +uint16_t get_persistant_layer_from_keycode(uint16_t keycode) { + switch(keycode) { + case FUNC_A: return LY_1000; + case FUNC_B: return LY_1010; + case FUNC_C: return LY_0010; + case FUNC_D: return LY_0000; + case LTHAI_A: return LY_THAI_A; + case LTHAI_B: return LY_THAI_B; + case LTHAI_C: return LY_THAI_C; + case LSW0110: return LY_0110; + case LSW1111: return LY_1111; + case LSW0100: return LY_0100; + } + return 0; // this line is unreachable but be here to make the complier happy +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + if(!is_layer_persistant && FUNC_A <= keycode && keycode <= FUNC_D) { + uint16_t mask = 1 << (3 - (keycode - FUNC_A)); + uint16_t cur_layer_code = cur_layer - LY_0000; + if(!(LY_0000 <= cur_layer && cur_layer <= LY_1111)) + user_panic(); + if(!(cur_layer_code & mask) == record->event.pressed) + change_layer((mask ^ cur_layer_code) + LY_0000); + return false; + } + + if(!(record->event.pressed)) + return !(MIN_KC <= keycode && keycode <= MAX_KC); + + switch(keycode) { + case USER_NAME: + SEND_STRING("Gun Pinyo"); + return false; + + case USER_EMAIL: + SEND_STRING("gunpinyo@gmail.com"); + return false; + + case SANDBOX: + case STICK: + change_layer(keycode == STICK ? LY_STICK : LY_SANDBOX); + change_lang(LANG_ENG); + is_layer_persistant = true; + return false; + + case FUNC_A: case FUNC_B: case FUNC_C: case FUNC_D: + case LTHAI_A: case LTHAI_B: case LTHAI_C: + case LSW0110: case LSW1111: case LSW0100: + if(is_layer_persistant) { + change_layer(get_persistant_layer_from_keycode(keycode)); + update_env_thai(); + // `FUNC_D` resets the layer configuration when `is_layer_persistant` + is_layer_persistant = keycode != FUNC_D; + if(!is_layer_persistant) { + clear_keyboard(); + layer_clear(); + } + } + return false; + } + return true; +} + +#ifdef RGB_MATRIX_ENABLE + bool rgb_matrix_indicators_user(void) { + // `42` is the index of the middle light at the bottom row (in planck light) + // it is disabled because it does not have a cover, hence irritates my eyes + rgb_matrix_set_color(42, 0, 0, 0); + return false; + } +#endif + +#ifdef AUDIO_ENABLE + float tone_startup[][2] = SONG(STARTUP_SOUND); + float tone_goodbye[][2] = SONG(GOODBYE_SOUND); + + float tone_ly_normal[][2] = SONG(QWERTY_SOUND); + float tone_ly_spacial[][2] = SONG(DVORAK_SOUND); + + float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +#endif + +void startup_user(void) { +#ifdef AUDIO_ENABLE + PLAY_SONG(tone_startup); +#endif +} + +void shutdown_user(void) { +#ifdef AUDIO_ENABLE + PLAY_SONG(tone_goodbye); + stop_all_notes(); +#endif +} diff --git a/keyboards/planck/keymaps/gunp/readme.md b/keyboards/planck/keymaps/gunp/readme.md new file mode 100644 index 000000000000..ea20f6ac2259 --- /dev/null +++ b/keyboards/planck/keymaps/gunp/readme.md @@ -0,0 +1,78 @@ +![Cheat sheet of gunp layout for Planck keyboards](https://drive.google.com/uc?export=view&id=1INtnZhzoHpPkZ2kueP1K0Dpr6T1spr4m) + +# gunp layout for Planck keyboards + +* Layout Maintainer: [Gun Pinyo](https://github.com/gunpinyo) + +This is my personal layout for Planck keyboards. Almost all of important +information is already in the picture of the cheat sheet above. There is also a +text-version of this cheat sheet at the end of this readme file. If both of them +are not the same, then please trust the text-version more because the picture is +just a screenshot of the text. + +The base layer is `LY-0000`. Next, we custom keycodes called `FuncA`, `FuncB`, +`FuncC`, and `FuncD` (`FuncX` for short) which will switch to layout `LY-ABCD` +depending on the binary state of each `FuncX` where the corresponded binary +digit is a boolean "keycode `FuncX` is currently being pressed". This mechanism +allows us to access up to 16 different layers, however, only some of them have +been used. A layer matches regex `LY-....` is currently used if and only if the +cheat sheet mentions it. + +Once each of these non-based layers activates (by a combination of `FuncX` +keycodes): + - the left-half (rows 0-3, columns 0-5) will switch according to its + individual keymap on cheat sheet, + - the right-half (rows 0-3, columns 6-11) will switch to the `RIGHT-HALF` + keymap such that keycodes that matches the regex `(L....|Thai[ABC])` are + disabled and (partially) being replaced by `FuncX` keycodes on the same + position of the base layer and keycodes in binary numbers there are + disabled. + +Another keycode in the base layer is `Stick`. When it is press, the rules of +keyboard change into persistent mode. Here, the right-half is exactly the +`RIGHT-HALF` keymap in the cheat sheet. Keycodes in left-half are all no-op +initially and can be changed to other layers by tapping on the corresponded +keycodes `(L....|Thai[ABC])`. To switch back to the normal rules governed by +`FuncX` press a `Relax` keycode. + +Remark: + - Layers `LY-Thai[ABC]` are only accessible via persistent mode. + - This layout doesn't employ any transparent keycode, therefore, empty + keycodes (including dummy keycodes `XXX`) are all no-op. + - Prefixes `S-`, `C-`, `A-`, and `G-` are combinators for `sft-🠜`, `ctl-🠜`, + `alt-🠜`, and `gui-🠜`, respectively. + - All keycodes that starts with a capital letter are custom keycodes. Except + single letters which stand for their alphabet. + - There is a conflict with dynamic macro (QMK's feature) with my layer + switching mechanisms, so I disable it but keep its keycodes there for later + implementation. + +``` + {H| "LY-0000": base-layer -- "`[🠝]` here becomes `FuncD` in other layers" |H} {H| "RIGHT-HALF": "when `Stick` is on" |H} + {8| pgup| Q | W | F | P | G | J | L | U | Y | K | tab |8} {8| L0110| [🠜] |bkspc| [🠞] | XXX | XXX |8} + {8| pgdn| A | R | S | T | D | H | N | E | I | O |Stick|8} {8| L1111|ThaiA|ThaiB|ThaiC| XXX | XXX |8} + {8|sft-🠜| Z | X | C | V | B | M |FuncA|FuncB|FuncC| [🠝] |sft-🠞|8} {8| L0100|L1000|L1010|L0010|Relax|sft-🠞 |8} + {8|ctl-🠜|alt-🠜|gui-🠜| esc |bkspc|enter|FuncD|space|print| [🠜] | [🠟] | [🠞] |8} {8| Relax|space|enter|gui-🠞|alt-🠞|ctl-🠞 |8} + + {H| "LY-0100": "col0 as no-op" |H} {H| "LY-1101" -- "Email: gunpinyo@gmail.com" |H} {x| "LY-0110" -- "gunpinyo" |x} + {8| C-G home [🠝] end C-[🠝] |8} {8| Sandbox XXX AudTog KeyLock RgbTog QmkReset |8} {✜| S-f7 S-f8 f7 f8 f9 S-f9 |✜} + {8| pgup [🠜] [🠟] [🠞] C-[🠟] |8} {8| wake caplock MyName Email RgbMod QmkDebug |8} {✜| S-f4 S-f5 f4 f5 f6 S-f6 |✜} + {8| pgdn C-S C-A C-Z SC-Z |8} {8| sleep numlock DmRec1 DmPlay1 XXX QmkEepRst |8} {✜| S-f1 S-f2 f1 f2 f3 S-f3 |✜} + {8| C-[🠜] C-F C-[🠞] |8} {8| power scrlock DmRec2 DmPlay2 DmStop insert |8} {✜|S-f10 S-f11 f10f11f12 S-f12|✜} + + {8| "LY-1000" |8} {8| "LY-1010" |8} {8| "LY-0010" |8} {H| "LY-1111" - "powered by QMK firmware" |H} + {H| % ? ! ` |H} {H| # 7 8 9 |H} {H| & | ~ ^ |H} {8| msAC1 msAC0 scr-🠜 mov-🠝 scr-🠞 scr-🠝 |8} + {H| @ , . ' = |H} {H| * 4 5 6 + |H} {H| { [ ( < / |H} {8| msAC2 XXX mov-🠜 mov-🠟 mov-🠞 scr-🠟 |8} + {H| $ ; : \" _ |H} {H| 0 1 2 3 - |H} {H| } ] ) > \ |H} {8| mPrev btn-🠝 mRWD mPlay mFFD btn-✜ |8} + {8| mNext btn-🠟 pause mStop btn-🠜 btn-🠞 |8} + 1. evdev pc105 (US: qwerty, TH: kedmanee) 5. "LY-1110" is `G-`+"LY-0110" + 2. `G-space` is used to switch XKB layout 6. "LY-1100" is `S-`+"LY-0100" except [C-S, C-A, C-Z, SC-Z, C-F] which become + 3. when `Stick` is off, layer switchers other than `FuncX` are disabled [C-X, C-C, C-V, C-L, C-R] respectively + 4. ["LY-1000", "LY-1010", "LY-0010"] omit col0 and row3, but they have all `mod-🠜` from the base-layer, the rest are no-op + + {H| "LY-0001" -- "`mod#🠜` is oneshot-mod" |H} {8| "LY-ThaiA" |8} {8| "LY-ThaiB" |8} {8| "LY-ThaiC" |8} + {8| C-H C-0 SC-pgup bri-🠝 SC-pgdn vol-🠝 |8} {H| ฌ ‍‍‍ฅ ‍ค ม ฤ ฦ |H} {H| ์ ‍‍‍‍‍็ ่ ้ ๊ ๋ |H} {H| ภ ‍‍ฃ ‍ข ฮ ‍‍‍ฎ ‍‍ฏ |H} + {8| SC-T C-[+] C-pgup bri-🠟 C-pgdn vol-🠟 |8} {H| ณ ‍ว ‍‍‍‍‍ง ‍น ‍‍ร ‍ล |H} {H| โ ‍แ ‍‍‍‍‍‍‍‍‍‍‍เ ‍‍‍‍‍‍‍‍‍‍‍‍‍า ‍‍‍‍‍‍‍‍‍‍‍‍‍ั ‍‍‍‍‍‍‍‍ะ |H} {H| ถ ‍‍‍‍จ ‍‍‍ก อ ‍‍‍ด ‍‍ต |H} + {8| sft#🠜 C-[-] A-[🠜] C-T A-[🠞] vol-✜ |8} {H| ญ ‍‍ธ ‍‍‍ท ย ช‍‍‍‍‍‍‍‍‍‍‍‍‍ซ |H} {H| ใ ‍‍‍ไ ‍‍‍‍‍‍‍‍‍‍‍‍ิ ‍‍‍‍‍‍ี ‍‍‍‍‍‍‍‍‍‍‍ึ ‍‍‍‍‍ื |H} {H| ศ ‍ษ ‍‍ส ห ‍บ ป |H} + {8| ctl#🠜 alt#🠜 gui#🠜 C-W delete menu |8} {H| ฒ ฆ ฑ ‍‍‍‍‍‍‍‍‍‍ฬ พ‍‍‍‍‍‍‍‍‍‍‍ฟ |H} {H| ‍‍‍‍ๅ ‍‍‍‍‍‍‍ฺ ํ ำ ุ ‍‍‍‍‍‍‍‍‍‍ู |H} {H| ฯ ‍‍ๆ ‍‍‍‍ฐ ฉ ‍‍‍ผ ‍ฝ |H} +``` diff --git a/keyboards/planck/keymaps/gunp/rules.mk b/keyboards/planck/keymaps/gunp/rules.mk new file mode 100644 index 000000000000..40d3ef325486 --- /dev/null +++ b/keyboards/planck/keymaps/gunp/rules.mk @@ -0,0 +1,18 @@ +# Build Options +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if NKRO_ENABLE doesn't work, see here: +# https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = yes # Audio output + +KEY_LOCK_ENABLE = yes +DEBOUNCE_TYPE = sym_defer_pk diff --git a/keyboards/planck/keymaps/handwired_binaryplease/config.h b/keyboards/planck/keymaps/handwired_binaryplease/config.h new file mode 100644 index 000000000000..065bc2d68814 --- /dev/null +++ b/keyboards/planck/keymaps/handwired_binaryplease/config.h @@ -0,0 +1,11 @@ +#pragma once + +#undef MANUFACTURER +#define MANUFACTURER "binaryplease" +#undef PRODUCT +#define PRODUCT "Teensy_Planck" + +#undef MATRIX_ROW_PINS +#define MATRIX_ROW_PINS { D3, D2, D1, D0 } +#undef MATRIX_COL_PINS +#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, B6, B5, B4, D7, D6, D4 } diff --git a/keyboards/planck/keymaps/handwired_binaryplease/keymap.c b/keyboards/planck/keymaps/handwired_binaryplease/keymap.c new file mode 100644 index 000000000000..13917e516d5f --- /dev/null +++ b/keyboards/planck/keymaps/handwired_binaryplease/keymap.c @@ -0,0 +1,306 @@ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +enum planck_layers { + _QWERTY, + _COLEMAK, + /*_DVORAK,*/ + _LOWER, + _RAISE, + /*_PLOVER,*/ + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + /*DVORAK,*/ + /*PLOVER,*/ + LOWER, + RAISE, + BACKLIT + /*EXT_PLV*/ +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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_LCTL, KC_LGUI, _______, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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_LCTL, KC_LGUI, XXXXXXX, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +/*[_DVORAK] = LAYOUT_planck_grid(*/ + /*KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC,*/ + /*KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH,*/ + /*KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT ,*/ + /*KC_LCTL, BACKLIT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT*/ +/*),*/ + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +/*[_PLOVER] = LAYOUT_planck_grid(*/ + /*KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 ,*/ + /*XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,*/ + /*XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,*/ + /*EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX*/ +/*),*/ + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , + _______, _______, _______, AU_ON, AU_OFF, _______, _______, _______, _______, _______, QWERTY, COLEMAK, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + /*case DVORAK:*/ + /*if (record->event.pressed) {*/ + /*#ifdef AUDIO_ENABLE*/ + /*PLAY_SONG(tone_dvorak);*/ + /*#endif*/ + /*persistant_default_layer_set(1UL<<_DVORAK);*/ + /*}*/ + /*return false;*/ + /*break;*/ + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + /*case PLOVER:*/ + /*if (record->event.pressed) {*/ + /*#ifdef AUDIO_ENABLE*/ + /*stop_all_notes();*/ + /*PLAY_SONG(tone_plover);*/ + /*#endif*/ + /*layer_off(_RAISE);*/ + /*layer_off(_LOWER);*/ + /*layer_off(_ADJUST);*/ + /*layer_on(_PLOVER);*/ + /*if (!eeconfig_is_enabled()) {*/ + /*eeconfig_init();*/ + /*}*/ + /*keymap_config.raw = eeconfig_read_keymap();*/ + /*keymap_config.nkro = 1;*/ + /*eeconfig_update_keymap(keymap_config.raw);*/ + /*}*/ + /*return false;*/ + /*break;*/ + /*case EXT_PLV:*/ + /*if (record->event.pressed) {*/ + /*#ifdef AUDIO_ENABLE*/ + /*PLAY_SONG(tone_plover_gb);*/ + /*#endif*/ + /*layer_off(_PLOVER);*/ + /*}*/ + /*return false;*/ + /*break;*/ + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user(void) +{ + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user(void) +{ + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif diff --git a/keyboards/planck/keymaps/handwired_binaryplease/readme.md b/keyboards/planck/keymaps/handwired_binaryplease/readme.md new file mode 100644 index 000000000000..de9680b49851 --- /dev/null +++ b/keyboards/planck/keymaps/handwired_binaryplease/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/handwired_binaryplease/rules.mk b/keyboards/planck/keymaps/handwired_binaryplease/rules.mk new file mode 100644 index 000000000000..459c7bce6c57 --- /dev/null +++ b/keyboards/planck/keymaps/handwired_binaryplease/rules.mk @@ -0,0 +1,4 @@ +CONSOLE_ENABLE = no +NKRO_ENABLE = no +MIDI_ENABLE = yes +AUDIO_ENABLE = no diff --git a/keyboards/planck/keymaps/hiea/common/chord_layout.h b/keyboards/planck/keymaps/hiea/common/chord_layout.h new file mode 100644 index 000000000000..cb1b7f678550 --- /dev/null +++ b/keyboards/planck/keymaps/hiea/common/chord_layout.h @@ -0,0 +1,41 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// .................................................................. Short Cuts + + // .-----------------------------------------------------------------------------------. + // | | | Copy | Paste| | | | | | | | | + // |--------------------------------------------------------------+------+------+------| + // | Undo | Cut | Copy | Paste| | | | | PRIV | PUB | | | + // |-----------------------------------------------------------------------------------| + // | | | Nak | Eot | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | | | | | | f() | | | | | | + // | | | | | | | | f() | | | | | see _PLOVER + // '-----------------------------------------------------------------------------------' + + [_EDIT] = LAYOUT_planck_grid( + _______, _______, TMCOPY, TMPASTE, _______, _______, _______, _______, _______, _______, _______, _______, + UNDO, CUT, COPY, PASTE, _______, _______, _______, _______, TD_PRIV, TD_SEND, _______, _______, + _______, _______, NAK, EOT, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, ___fn__, ___fn__, _______, _______, _______, _______ + ), + +// ................................................................ Adjust Layer + + // ,-----------------------------------------------------------------------------------. + // |Plover| | | | | | | | | | | | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // |Aud on| | | | | | | | | | | | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Reset| | | | | | | | | | | | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | | | | f() | | | | | f() | | | | + // `-----------------------------------------------------------------------------------' + + [_ADJUST] = LAYOUT_planck_grid( + PLOVER, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + AU_ON, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, ___fn__, _______, _______, _______, _______, ___fn__, _______, _______, _______ + ), diff --git a/keyboards/planck/keymaps/hiea/common/init.h b/keyboards/planck/keymaps/hiea/common/init.h new file mode 100644 index 000000000000..6366a19f65eb --- /dev/null +++ b/keyboards/planck/keymaps/hiea/common/init.h @@ -0,0 +1,56 @@ + +// ....................................................................... Audio + +void matrix_init_user(void) +{ +#ifdef STENO_ENABLE + steno_set_mode(STENO_MODE_BOLT); // or STENO_MODE_GEMINI +#endif +#ifdef AUDIO_ENABLE + startup_user(); +#endif +} + +#ifdef AUDIO_ENABLE +#ifdef BACKLIGHT_ENABLE +void led_set_user(uint8_t usb_led) +{ + static uint8_t old_usb_led = 0; + _delay_ms(10); // gets rid of tick + if (!is_playing_notes()) { + if ((usb_led & (1<event.pressed) { + key_timer = timer_read(); + register_code(modifier); + if (modifier2) { + register_code(modifier2); + } + } + else { + unregister_code(modifier); + if (modifier2) { + unregister_code(modifier2); + } + if (timer_elapsed(key_timer) < TAPPING_TERM) { + shift_key(keycode); + } + key_timer = 0; + } +} + +// ................................................................... Mod Masks + +// tap dance persistant mods, see process_record_user() +// keyboard_report->mods (?) appears to be cleared by tap dance +static uint8_t mods = 0; + +void tap_mods(keyrecord_t *record, uint16_t keycode) +{ + if (record->event.pressed) { + mods |= MOD_BIT(keycode); + } + else { + mods &= ~(MOD_BIT(keycode)); + } +} + +// (un)register modifiers +void modifier(void (*f)(uint8_t)) +{ + if (mods & MOD_BIT(KC_LCTL)) { + (*f)(KC_LCTL); + } + if (mods & MOD_BIT(KC_LGUI)) { + (*f)(KC_LGUI); + } + if (mods & MOD_BIT(KC_LALT)) { + (*f)(KC_LALT); + } +} + +// .................................................... Triple Dance Shift/Layer + +static uint8_t dt_shift = 0; + +void double_shift(uint16_t keycode, uint8_t layer) +{ + tap_key (keycode); + if (DT_SHIFT) { + // set_oneshot_mods(MOD_LSFT); + // layer_on(layer); + layer_on (_SHIFT); + set_oneshot_layer(_SHIFT, ONESHOT_START); + dt_shift = 1; + } + else { + layer_on(layer); + } +} + +// tap dance LT (LAYER, KEY) emulation with -> and auto-repeat extensions! +void tap_shift(tap_dance_state_t *state, uint16_t keycode, uint8_t layer) +{ + // double tap plus down + if (state->count > 2) { + // double enter shift + if (keycode == KC_ENT) { + tap_key (keycode); + double_shift(keycode, layer); + } + // repeating keycode + else { + register_code(keycode); + } + } + // tap plus down (or double tap): keycode (one shot) shift + else if (state->count > 1) { + double_shift(keycode, layer); + } + // down: shift + else if (state->pressed) { + layer_on(layer); + } + // tap: keycode + else { + modifier(register_code); + tap_key (keycode); + modifier(unregister_code); + } +} + +void tap_reset(uint16_t keycode, uint8_t layer) +{ + unregister_code(keycode); + if (DT_SHIFT && dt_shift) { + clear_oneshot_layer_state(ONESHOT_PRESSED); + dt_shift = 0; + } + else { + layer_off(layer); + } +} + +// augment pseudo LT (_RSHIFT, KC_ENT) handling below for rapid sequences +void enter(tap_dance_state_t *state, void *user_data) +{ + tap_shift(state, KC_ENT, _RSHIFT); +} + +void enter_reset(tap_dance_state_t *state, void *user_data) +{ + tap_reset(KC_ENT, _RSHIFT); +} + +// augment pseudo LT (_LSHIFT, KC_SPC) handling below for rapid sequences +void space(tap_dance_state_t *state, void *user_data) +{ + tap_shift(state, KC_SPC, _LSHIFT); +} + +void space_reset(tap_dance_state_t *state, void *user_data) +{ + tap_reset(KC_SPC, _LSHIFT); +} + +// ......................................................... Triple Dance Insert + +void double_max(uint8_t count, uint8_t shift, uint16_t keycode) +{ + if (shift) { + shift_key(keycode); + if (count > 1) { + shift_key(keycode); + } + } + else { + tap_key(keycode); + if (count > 1) { + tap_key(keycode); + } + } +} + +void colon(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 2) { + tap_key (KC_SPC); + shift_key(KC_SCLN); + shift_key(KC_SCLN); + tap_key (KC_SPC); + } + else { + double_max(state->count, SHIFT, KC_SCLN); + } + reset_tap_dance(state); +} + +void eql(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 2) { + tap_key(KC_SPC); + tap_key(KC_SLSH); + tap_key(KC_EQL); + tap_key(KC_SPC); + } + else { + double_max(state->count, NOSHIFT, KC_EQL); + } + reset_tap_dance(state); +} + +void greater(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 2) { + tap_key (KC_SPC); + tap_key (KC_MINS); + shift_key(KC_DOT); + tap_key (KC_SPC); + } + else { + double_max(state->count, SHIFT, KC_DOT); + } + reset_tap_dance(state); +} + +void lesser(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 2) { + tap_key (KC_SPC); + shift_key(KC_COMM); + tap_key (KC_MINS); + tap_key (KC_SPC); + } + else { + double_max(state->count, SHIFT, KC_COMM); + } + reset_tap_dance(state); +} + +void tilde(tap_dance_state_t *state, void *user_data) +{ + // double tap plus down: repeating keycode + if (state->count > 2) { + register_code(KC_LSFT); + register_code(KC_GRV); + } + // tap: keycode + else { + shift_key(KC_GRV); + // double tap: unix home directory + if (state->count > 1) { + tap_key(KC_SLSH); + } + } +} + +void tilde_reset(tap_dance_state_t *state, void *user_data) +{ + unregister_code(KC_GRV); + unregister_code(KC_LSFT); +} + +// ............................................................. Tap Dance Pairs + +// tap dance shift rules +#define S_NEVER 0 +#define S_SINGLE 1 +#define S_DOUBLE 2 +#define S_ALWAYS S_SINGLE | S_DOUBLE + +void symbol_pair(uint8_t shift, uint16_t left, uint16_t right) +{ + if (shift & S_DOUBLE) { + shift_key(left); + shift_key(right); + } + else { + tap_key(left); + tap_key(right); + } +} + +#define CLOSE 1 + +// tap dance symbol pairs +void tap_pair(tap_dance_state_t *state, uint8_t shift, uint16_t left, uint16_t right, uint16_t modifier, uint8_t close) +{ + // triple tap: left right with cursor between symbol pair a la vim :-) + if (state->count > 2) { + symbol_pair(shift, left, right); + tap_key (KC_LEFT); + } + // double tap: left right + else if (state->count > 1) { + symbol_pair(shift, left, right); + } + // down: modifier + else if (state->pressed) { + if (modifier) { + register_code(modifier); + } + } + // tap: left (close: right) + else { + if (shift & S_SINGLE) { + shift_key(close ? right : left); + } + else { + tap_key(close ? right : left); + } + } + if (!modifier) { + reset_tap_dance(state); + } +} + +void doublequote(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_QUOT, KC_QUOT, 0, 0); +} + +void grave(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_NEVER, KC_GRV, KC_GRV, 0, 0); +} + +void lbrace(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_NEVER, KC_LBRC, KC_RBRC, 0, 0); +} + +void lcurly(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_LBRC, KC_RBRC, 0, 0); +} + +void lparen(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_9, KC_0, KC_LCTL, 0); +} + +void lparen_reset(tap_dance_state_t *state, void *user_data) +{ + unregister_code(KC_LCTL); +} + +void quote(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_NEVER, KC_QUOT, KC_QUOT, 0, 0); +} + +void rangle(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_COMM, KC_DOT, 0, CLOSE); +} + +void rbrace(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_NEVER, KC_LBRC, KC_RBRC, 0, CLOSE); +} + +void rcurly(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_LBRC, KC_RBRC, 0, CLOSE); +} + +void rparen(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_9, KC_0, 0, CLOSE); +} + +void rparen_reset(tap_dance_state_t *state, void *user_data) +{ + unregister_code(KC_LCTL); +} + +// ............................................................ Tap Dance Insert + +void comma(tap_dance_state_t *state, void *user_data) +{ + tap_key(KC_COMM); + if (state->count > 1) { + tap_key(KC_SPC); + } + reset_tap_dance(state); +} + +void dot(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 1) { + shift_key(KC_COLN); + } + else { + tap_key(KC_DOT); + } + reset_tap_dance(state); +} + +// compile time macro string, see functions/hardware planck script +void private(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 1) { +#ifdef PRIVATE_STRING +#include "private_string.h" +#endif + } + reset_tap_dance(state); +} + +// config.h defined string +void send(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 1) { + SEND_STRING(PUBLIC_STRING); + } + reset_tap_dance(state); +} + +// .......................................................... Tap Dance One Shot + +void caps(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 1) { + tap_key(KC_CAPS); + } + else { + set_oneshot_mods(MOD_LSFT); + register_code (KC_LSFT); // on hold down + } +} + +void caps_reset(tap_dance_state_t *state, void *user_data) +{ + unregister_code(KC_LSFT); +} + +// ................................................................... Tap Dance + +tap_dance_action_t tap_dance_actions[] = { + [_CAPS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, caps, caps_reset) + ,[_COLN] = ACTION_TAP_DANCE_FN (colon) + ,[_COMM] = ACTION_TAP_DANCE_FN (comma) + ,[_DOT] = ACTION_TAP_DANCE_FN (dot) + ,[_DQOT] = ACTION_TAP_DANCE_FN (doublequote) + ,[_ENT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, enter, enter_reset) + ,[_EQL] = ACTION_TAP_DANCE_FN (eql) + ,[_GRV] = ACTION_TAP_DANCE_FN (grave) + ,[_GT] = ACTION_TAP_DANCE_FN (greater) + ,[_LBRC] = ACTION_TAP_DANCE_FN (lbrace) + ,[_LCBR] = ACTION_TAP_DANCE_FN (lcurly) + ,[_LPRN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lparen, lparen_reset) + ,[_LT] = ACTION_TAP_DANCE_FN (lesser) + ,[_PRIV] = ACTION_TAP_DANCE_FN (private) + ,[_QUOT] = ACTION_TAP_DANCE_FN (quote) + ,[_RBRC] = ACTION_TAP_DANCE_FN (rbrace) + ,[_RCBR] = ACTION_TAP_DANCE_FN (rcurly) + ,[_RNGL] = ACTION_TAP_DANCE_FN (rangle) + ,[_RPRN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rparen, rparen_reset) + ,[_SEND] = ACTION_TAP_DANCE_FN (send) + ,[_SPC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, space, space_reset) + ,[_TILD] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tilde, tilde_reset) +}; + +// .............................................................. Dynamic Layers + +#define LEFT 1 +#define RIGHT 2 +static uint8_t thumb = 0; + +// LEFT (KC_SPC, S(KC_BSLS)), RIGHT (KC_LEFT, S(KC_LEFT)) opposite thumb combinations, see process_record_user() +// up, up -> _BASE +// up, down -> _SYMBOL +// down, up -> _NUMBER +// down, down -> _MOUSE // see layer keycodes that raise mouse layer +#define THUMBS_DOWN _MOUSE // layer + +static uint8_t overlayer = 0; + +// left right thumb layer combinations +void thumb_layer(keyrecord_t *record, uint8_t side, uint8_t shift, uint16_t keycode, uint8_t thumb_dn_layer, uint8_t thumb_up_layer) +{ + if (record->event.pressed) { + // layer_on via tap_layer(), see process_record_user() + key_timer = timer_read(); + thumb = thumb | side; + } + else { + layer_off(thumb_dn_layer); + // opposite thumb_layer() thumb may have switched effective layer! + if (overlayer) { + layer_off(overlayer); + overlayer = 0; + } + if (!key_press(shift, keycode)) { + layer_off(THUMBS_DOWN); // both thumbs needed + // opposite thumb down? see left right combination layer table above + if (thumb & (side == LEFT ? RIGHT : LEFT)) { + layer_on(thumb_up_layer); + overlayer = thumb_up_layer; + } + } + clear_mods(); + thumb = thumb & ~side; + key_timer = 0; + } +} + +// #ifdef STENO_ENABLE +// // LT for steno keycode +// void stn_layer(keyrecord_t *record, uint16_t keycode, uint8_t layer) +// { +// if (record->event.pressed) { +// key_timer = timer_read(); +// if (keycode) { +// process_steno(keycode, record); +// } +// layer_on(layer); +// } +// else { +// layer_off(layer); +// if (keycode) { +// if (timer_elapsed(key_timer) < TAPPING_TERM) { +// process_steno(keycode, record); +// } +// else { +// // clear pressed state (request push of updated) process_steno.c and .h +// // steno_clear_state(); +// } +// } +// key_timer = 0; +// } +// } +// #endif + +// LT for S(keycode) +void lt_shift(keyrecord_t *record, uint16_t keycode, uint8_t layer) +{ + if (record->event.pressed) { + key_timer = timer_read(); + layer_on(layer); + } + else { + layer_off(layer); + // for shifted keycodes, hence, LT_SHIFT + key_press(SHIFT, keycode); + clear_mods(); + key_timer = 0; + } +} + +// set layer asap to overcome macro latency errors, notably tap dance and LT usage +// this routine inexplicably (?) sets layer_on() faster than can be done in thumb_layer() +void tap_layer(keyrecord_t *record, uint8_t layer) +{ + if (record->event.pressed) { + layer_on(layer); + } + else { + layer_off(layer); + } +} + +// ..................................................................... Keymaps + +// void persistant_default_layer_set(uint16_t default_layer) +// { +// eeconfig_update_default_layer(default_layer); +// default_layer_set (default_layer); +// } + +void clear_layers(void) +{ + uint8_t layer; + for (layer = 0; layer < _END_LAYERS; layer++) { + layer_off(layer); + } +} + +#ifdef CENTER_TT +static uint16_t tt_keycode = 0; // current TT keycode + +void clear_tt(void) +{ + if (tt_keycode == KC_CAPS) { + tap_key(KC_CAPS); // clear capslock + } + tt_keycode = 0; + clear_layers(); + set_single_persistent_default_layer(_BASE); +} +#endif + +// txbolt plover run state +static uint8_t plover = 0; + +void toggle_plover(uint8_t state) +{ + if (plover != state) { +#ifdef PLOVER_KEYBIND +#include "plover_keybind.h" +#endif + plover = state; + } +} + +void base_layer(void) +{ +#ifdef AUDIO_ENABLE + if (plover) { + PLAY_SONG(song_plover_gb); + } + else { + PLAY_SONG(song_qwerty); + } +#endif + clear_layers(); + set_single_persistent_default_layer(_BASE); + toggle_plover(0); +} + +void steno(keyrecord_t *record) +{ + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(song_plover); +#endif + clear_layers(); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + if (!plover) { + toggle_plover(1); + } + } +} + +void steno_exit(keyrecord_t *record) +{ + if (record->event.pressed) { + base_layer(); + toggle_plover(0); + } +} diff --git a/keyboards/planck/keymaps/hiea/common/number_fkey_layout.h b/keyboards/planck/keymaps/hiea/common/number_fkey_layout.h new file mode 100644 index 000000000000..c3d5c2d874e3 --- /dev/null +++ b/keyboards/planck/keymaps/hiea/common/number_fkey_layout.h @@ -0,0 +1,46 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ......................................................... Number Keypad Layer + + // .-----------------------------------------------------------------------------------. + // | | F | E | D | | | | / | 7 | 8 | 9 | * | + // |-----------------------------------------------------------------------------------| + // | GUI | C | B | A | | | | . | 4 | 5 | 6 | - | + // |-----------------------------------------------------------------------------------| + // | | # | G | \ | | | | , | 1 | 2 | 3 | + | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | 0 | = | | | | + // | | | | f() | | | | = | 0 | | | | + // '-----------------------------------------------------------------------------------' + + [_NUMBER] = LAYOUT_planck_grid( + _______, KC_F, MT_E, KC_D, _______, ___x___, ___x___, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, + OS_GUI, GT_C, AT_B, ST_A, _______, ___x___, ___x___, TD_DOT, KC_4, KC_5, KC_6, KC_MINS, + _______, KC_HASH, SM_G, KC_BSLS, _______, ___x___, ___x___, TD_COMM, KC_1, KC_2, KC_3, KC_PLUS, +#ifdef THUMB_0 + ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___, KC_0, LT_EQL, ___x___, ___x___, ___x___ +#else + ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___, KC_EQL, LT_0, ___x___, ___x___, ___x___ +#endif + ), + +// ............ .................................................. Function Keys + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | F7 | F8 | F9 | F12 | + // |-----------------------------------------------------------------------------------| + // | Ctrl | GUI | Alt | Shift| | | | | F4 | F5 | F6 | F11 | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | F1 | F2 | F3 | F10 | + // |-----------------------------------------------------------------------------------| + // | | | | | | f() | | + | | | | | + // | | | | | f() | | | + | | | | | see _PLOVER + // '-----------------------------------------------------------------------------------' + + [_FNCKEY] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_F7, KC_F8, KC_F9, KC_F12 , + OS_GUI, OS_CTL, OS_ALT, OS_SFT, _______, ___x___, ___x___, _______, KC_F4, KC_F5, KC_F6, KC_F11 , + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_F1, KC_F2, KC_F3, KC_F10 , + _______, _______, _______, _______, ___fn__, ___fn__, _______, KC_PLUS, _______, _______, _______, _______ + ), diff --git a/keyboards/planck/keymaps/hiea/common/plover_keybind.h b/keyboards/planck/keymaps/hiea/common/plover_keybind.h new file mode 100644 index 000000000000..cb4ef92ef849 --- /dev/null +++ b/keyboards/planck/keymaps/hiea/common/plover_keybind.h @@ -0,0 +1,9 @@ + +// simple window manager specific plover keybind hook + +// toggle plover application, see herbstluftwm/config/appbinds +register_code (KC_LGUI); +register_code (KC_LCTL); +tap_key (KC_EQL); +unregister_code(KC_LCTL); +unregister_code(KC_LGUI); diff --git a/keyboards/planck/keymaps/hiea/common/sounds.h b/keyboards/planck/keymaps/hiea/common/sounds.h new file mode 100644 index 000000000000..1bfc7a6da0c9 --- /dev/null +++ b/keyboards/planck/keymaps/hiea/common/sounds.h @@ -0,0 +1,14 @@ + +// ................................................................ Audio Sounds + +#ifdef AUDIO_ENABLE +float song_startup [][2] = SONG(STARTUP_SOUND); +float song_colemak [][2] = SONG(COLEMAK_SOUND); +float song_qwerty [][2] = SONG(QWERTY_SOUND); +float song_plover [][2] = SONG(PLOVER_SOUND); +float song_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float song_caps_on [][2] = SONG(CAPS_LOCK_ON_SOUND); +float song_caps_off [][2] = SONG(CAPS_LOCK_OFF_SOUND); +float music_scale [][2] = SONG(MUSIC_SCALE_SOUND); +float song_goodbye [][2] = SONG(GOODBYE_SOUND); +#endif diff --git a/keyboards/planck/keymaps/hiea/common/steno_layout.h b/keyboards/planck/keymaps/hiea/common/steno_layout.h new file mode 100644 index 000000000000..c1f2b5b24ab7 --- /dev/null +++ b/keyboards/planck/keymaps/hiea/common/steno_layout.h @@ -0,0 +1,39 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ...................................................................... Plover +#ifdef STENO_ENABLE + // ,-----------------------------------------------------------------------------------. + // | # | # | # | # | # | # | # | # | # | # | # | # | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | Base | S | T | P | H | * | * | F | P | L | T | D | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Base | S | K | W | R | * | * | R | B | G | S | Z | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | | A | O | E | U | | + // `-----------------------------------------------------------------------------------' + + [_PLOVER] = LAYOUT_planck_grid( + STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC , + BASE1, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR , + BASE2, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR , + _______, _______, _______, PS_STNA, PS_STNO, _______, _______, PS_STNE, PS_STNU, _______, _______, _______ + ), +#else + // ,-----------------------------------------------------------------------------------. + // | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | Base | S | T | P | H | * | * | F | P | L | T | D | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Base | S | K | W | R | * | * | R | B | G | S | Z | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | | A | O | E | U | | + // `-----------------------------------------------------------------------------------' + + [_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + BASE1, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + BASE2, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + _______, _______, _______, LT_C, LT_V, _______, _______, LT_N, LT_M, _______, _______, _______ + ), +#endif diff --git a/keyboards/planck/keymaps/hiea/common/symbol_guifn_layout.h b/keyboards/planck/keymaps/hiea/common/symbol_guifn_layout.h new file mode 100644 index 000000000000..4a32f71bd9cb --- /dev/null +++ b/keyboards/planck/keymaps/hiea/common/symbol_guifn_layout.h @@ -0,0 +1,40 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ..................................................... Symbol Navigation Layer + + // .-----------------------------------------------------------------------------------. + // | | ~ | * | & | | | | | Home | Up | End | PgUp | + // |-----------------------------------------------------------------------------------| + // | GUI | ^ | % | $ | | | | | Left | Down | Right| PgDn | + // |-----------------------------------------------------------------------------------| + // | | # | @ | ! | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | |Adjust| \ | | f() | | + // '-----------------------------------------------------------------------------------' + + [_SYMBOL] = LAYOUT_planck_grid( + _______, KC_TILD, KC_ASTR, KC_AMPR, _______, ___x___, ___x___, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, + OS_GUI, SM_CIRC, SM_PERC, SM_DLR, _______, ___x___, ___x___, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, + _______, KC_HASH, KC_AT, KC_EXLM, _______, ___x___, ___x___, _______, _______, _______, _______, _______, + ___x___, ___x___, ___x___, ADJUST, LT_BSLS, ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___ + ), + +// ............................................................... Mouse Actions + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | Left | Up | Right| Up | + // |-----------------------------------------------------------------------------------| + // | | Btn3 | Btn2 | Btn1 | | | | | Left | Down | Right| Down | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | | f() | | f() | | + // '-----------------------------------------------------------------------------------' + + [_MOUSE] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_WH_U, + _______, KC_BTN3, KC_BTN2, KC_BTN1, _______, ___x___, ___x___, _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, + _______, _______, _______, _______, _______, ___x___, ___x___, _______, _______, _______, _______, _______, + _______, _______, _______, _______, ___fn__, _______, _______, _______, ___fn__, _______, _______, _______ + ), diff --git a/keyboards/planck/keymaps/hiea/common/tapdance.h b/keyboards/planck/keymaps/hiea/common/tapdance.h new file mode 100644 index 000000000000..d778286bf1ed --- /dev/null +++ b/keyboards/planck/keymaps/hiea/common/tapdance.h @@ -0,0 +1,49 @@ + +// tap dance keys +enum tap_dance { + _CAPS = 0 + ,_COLN + ,_COMM + ,_DOT + ,_DQOT + ,_ENT + ,_EQL + ,_GRV + ,_GT + ,_LBRC + ,_LCBR + ,_LPRN + ,_LT + ,_PRIV + ,_QUOT + ,_RBRC + ,_RCBR + ,_RNGL + ,_RPRN + ,_SEND + ,_SPC + ,_TILD +}; + +#define TD_CAPS TD(_CAPS) +#define TD_COLN TD(_COLN) +#define TD_COMM TD(_COMM) +#define TD_DOT TD(_DOT) +#define TD_DQOT TD(_DQOT) +#define TD_ENT TD(_ENT) +#define TD_EQL TD(_EQL) +#define TD_GRV TD(_GRV) +#define TD_GT TD(_GT) +#define TD_LBRC TD(_LBRC) +#define TD_LCBR TD(_LCBR) +#define TD_LPRN TD(_LPRN) +#define TD_LT TD(_LT) +#define TD_PRIV TD(_PRIV) // compile time macro string, provided in private_string.h +#define TD_QUOT TD(_QUOT) +#define TD_RBRC TD(_RBRC) +#define TD_RCBR TD(_RCBR) +#define TD_RNGL TD(_RNGL) +#define TD_RPRN TD(_RPRN) +#define TD_SEND TD(_SEND) // config.h defined macro string +#define TD_SPC TD(_SPC) // see process_record_user() for extended handling of Spc +#define TD_TILD TD(_TILD) diff --git a/keyboards/planck/keymaps/hiea/common/toggle_layout.h b/keyboards/planck/keymaps/hiea/common/toggle_layout.h new file mode 100644 index 000000000000..ed74f42522d8 --- /dev/null +++ b/keyboards/planck/keymaps/hiea/common/toggle_layout.h @@ -0,0 +1,102 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ......................................................... Number Keypad Layer + + // .-----------------------------------------------------------------------------------. + // | | F | E | D | | | | / | 7 | 8 | 9 | * | + // |-----------------------------------------------------------------------------------| + // | GUI | C | B | A | | | | . | 4 | 5 | 6 | - | + // |-----------------------------------------------------------------------------------| + // | | # | G | \ | | | | , | 1 | 2 | 3 | + | + // |-----------------------------------------------------------------------------------| + // | | | | f() | Space| | | 0 | = | | | | + // | | | | f() | Space| | | = | 0 | | | | + // '-----------------------------------------------------------------------------------' + + [_TTNUMBER] = LAYOUT_planck_grid( + _______, KC_F, MT_E, KC_D, _______, ___x___, ___x___, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, + OS_GUI, GT_C, AT_B, ST_A, _______, ___x___, ___x___, TD_DOT, KC_4, KC_5, KC_6, KC_MINS, + _______, KC_HASH, SM_G, KC_BSLS, _______, ___x___, ___x___, TD_COMM, KC_1, KC_2, KC_3, KC_PLUS, +#ifdef THUMB_0 + _______, _______, _______, TT_ESC, KC_SPC, _______, _______, KC_0, LT_EQL, _______, _______, _______ +#else + _______, _______, _______, TT_ESC, KC_SPC, _______, _______, KC_EQL, LT_0, _______, _______, _______ +#endif + ), + +// ............ .................................................. Function Keys + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | F7 | F8 | F9 | F12 | + // |-----------------------------------------------------------------------------------| + // | GUI | Ctrl | Alt | Shift| | | | | F4 | F5 | F6 | F11 | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | F1 | F2 | F3 | F10 | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | + | | | | | + // '-----------------------------------------------------------------------------------' + + [_TTFNCKEY] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_F7, KC_F8, KC_F9, KC_F12 , + OS_GUI, OS_CTL, OS_ALT, OS_SFT, _______, ___x___, ___x___, _______, KC_F4, KC_F5, KC_F6, KC_F11 , + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_F1, KC_F2, KC_F3, KC_F10 , + _______, _______, _______, TT_ESC, _______, _______, _______, KC_PLUS, _______, _______, _______, _______ + ), + +// ....................................................................... Regex + + // ,-----------------------------------------------------------------------------------. + // | | ~ | { | } | & | | | % | [ | ] | @ | | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | | ^ | < | > | ? | | | | | ( | ) | $ | | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | | : | ! | = | / | | | \ | * | . | # | | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | | | | f() | - | | | + | Space| | | | + // `-----------------------------------------------------------------------------------' + + [_TTREGEX] = LAYOUT_planck_grid( + ___x___, KC_TILD, KC_LCBR, KC_RCBR, KC_AMPR, ___x___, ___x___, KC_PERC, KC_LBRC, KC_RBRC, KC_AT, ___x___, + ___x___, KC_CIRC, KC_LT, KC_GT, KC_QUES, ___x___, ___x___, KC_PIPE, KC_LPRN, KC_RPRN, KC_DLR, ___x___, + ___x___, KC_COLN, KC_EXLM, KC_EQL, KC_SLSH, ___x___, ___x___, KC_BSLS, KC_ASTR, KC_DOT, KC_HASH, ___x___, + _______, _______, _______, TT_ESC, KC_MINS, _______, _______, KC_PLUS, KC_SPC, _______, _______, _______ + ), + +// ............................................................ Navigation Layer + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | Home | Up | End | PgUp | + // |-----------------------------------------------------------------------------------| + // | GUI | Ctrl | Alt | Shift| | | | | Left | Down | Right| PgDn | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | | | | | | + // '-----------------------------------------------------------------------------------' + + [_TTCURSOR] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, + OS_GUI, OS_CTL, OS_ALT, OS_SFT, _______, ___x___, ___x___, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, + _______, _______, _______, _______, _______, ___x___, ___x___, _______, _______, _______, _______, _______, + _______, _______, _______, TT_ESC, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +// ............................................................... Mouse Actions + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | Left | Up | Right| Up | + // |-----------------------------------------------------------------------------------| + // | | Btn3 | Btn2 | Btn1 | | | | | Left | Down | Right| Down | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | | | | | | + // '-----------------------------------------------------------------------------------' + + [_TTMOUSE] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_WH_U, + _______, KC_BTN3, KC_BTN2, KC_BTN1, _______, ___x___, ___x___, _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, + _______, _______, _______, _______, _______, ___x___, ___x___, _______, _______, _______, _______, _______, + _______, _______, _______, TT_ESC, _______, _______, _______, _______, _______, _______, _______, _______ + ), diff --git a/keyboards/planck/keymaps/hiea/config.h b/keyboards/planck/keymaps/hiea/config.h new file mode 100644 index 000000000000..65845fe3e7d6 --- /dev/null +++ b/keyboards/planck/keymaps/hiea/config.h @@ -0,0 +1,46 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// tap dance key press termination interval +#define TAPPING_TERM 250 + +// smooth mouse motion +// #define MOUSEKEY_INTERVAL 20 +// #define MOUSEKEY_DELAY 0 +// #define MOUSEKEY_TIME_TO_MAX 60 +// #define MOUSEKEY_MAX_SPEED 7 +// #define MOUSEKEY_WHEEL_DELAY 0 + +// compile time macro string, see functions/hardware planck script (undefine otherwise) +//#define PRIVATE_STRING + +// compile time macro string, must be in quotes +#define PUBLIC_STRING ":%s/arch=(.*)/arch=('any')\n" + +// thumb key tap-shift() double tap: one shot shift (0) off (1) on +#define DT_SHIFT 1 + +// number layer 0 position KEYPAD_0, THUMB_0 +#define THUMB_0 + +// home block shift symbol clustes defined (no overlays required for extended symbols, undefine otherwise) +#define SHIFT_SYMBOLS + +// center column TT assignments (undefine for OSM chords) +#define CENTER_TT +#define TAPPING_TOGGLE 1 + +// home row modifiers +#define HOME_MODS +// fix dual function timing +#define PERMISSIVE_HOLD + +// layout ADNW*, BEAKL*, COLEKA*, QWERTY (default) +#define DEFAULT + +// sync app with window manager keybind hook defined in plover_keybind.h +#define PLOVER_KEYBIND + +#endif diff --git a/keyboards/planck/keymaps/hiea/hiea.h b/keyboards/planck/keymaps/hiea/hiea.h new file mode 100644 index 000000000000..d396ff79fdd5 --- /dev/null +++ b/keyboards/planck/keymaps/hiea/hiea.h @@ -0,0 +1,63 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// .................................................................. BEAKL HIEA +#ifdef DEFAULT + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | Shift| Caps | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | H | I | E | A | . |Cursor| Mouse| C | T | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | ; | " | K | , | Num | Regex| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Ins | Left | Ent | Bksp | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_Y, KC_O, KC_U, KC_Z, CNTR_TL, CNTR_TR, KC_G, KC_D, KC_N, KC_M, KC_X , + HOME_H, HOME_I, HOME_E, HOME_A, KC_DOT, CNTR_HL, CNTR_HR, KC_C, HOME_T, HOME_R, HOME_S, HOME_W , + KC_J, KC_SCLN, TD_QUOT, KC_K, KC_COMM, CNTR_BL, CNTR_BR, KC_B, KC_P, KC_L, KC_F, KC_V , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_INS, SP_LEFT, TD_ENT, SP_BSPC, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + S(KC_H), S(KC_I), S(KC_E), S(KC_A), KC_DOT, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_R), S(KC_S), S(KC_W), + S(KC_J), KC_SCLN, TD_QUOT, S(KC_K), KC_COMM, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_INS, SP_LEFT, TD_ENT, SP_BSPC, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | [ | ] | Z | Shift| Caps | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | H | ^ | < | > | ~ |Cursor| Mouse| C | T | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | ! | = | ` | Num | Regex| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | ↑Tab | f() | Ins | Left | _ | Del | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), KC_LBRC, KC_RBRC, S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + SM_H, KC_CIRC, TD_LT, TD_GT, TD_TILD, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_R), S(KC_S), S(KC_W), + S(KC_Z), KC_COLN, KC_EXLM, KC_EQL, TD_GRV, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, S_TAB, ___fn__, LT_INS, S_LEFT, KC_UNDS, SP_DEL, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | Shift| Caps | G | { | } | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | H | I | E | A | ? |Cursor| Mouse| | | ( | ) | $ | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | K | / | Num | Regex| \ | * | . | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Tab | - | Ins | Left | f() | Bksp | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), KC_LCBR, KC_RCBR, S(KC_M), S(KC_X), + S(KC_H), S(KC_I), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, KC_PIPE, KC_LPRN, KC_RPRN, KC_DLR, SM_W , + S(KC_J), TD_COLN, TD_DQOT, S(KC_K), KC_SLSH, CNTR_BL, CNTR_BR, KC_BSLS, KC_ASTR, KC_DOT, S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, KC_TAB, KC_MINS, LT_INS, S_LEFT, ___fn__, SP_BSPC, S_DOWN, S_UP, S_RGHT + ), +#endif diff --git a/keyboards/planck/keymaps/hiea/keymap.c b/keyboards/planck/keymaps/hiea/keymap.c new file mode 100644 index 000000000000..eed4954096d5 --- /dev/null +++ b/keyboards/planck/keymaps/hiea/keymap.c @@ -0,0 +1,421 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. +// +// To flash planck firmware +// ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +// Reset keyboard or press hw reset button on base (hole) +// +// cd qmk_firmware/keyboards/planck +// sudo make KEYMAP=sdothum dfu +// +// sudo make clean (good practice before flashing) +// sudo make KEYMAP=sdothum (to compile check) +// +// Package requirements (for arch linux) +// ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +// avr-gcc-atmel +// avr-libc-atmel +// dfu-programmer +// +// Notes +// ▔▔▔▔▔ +// ** E R G O W I D E S P L I T ** Layout +// +// Autocompletion tap dance key pairs (),[],{} are available from the +// number/symbol layer, as well as, numerous (un)shift key values +// +// The navigation pad provides a single hand right thumb activated cluster +// with left hand modifiers +// +// #define PRIVATE_STRING includes private_string.h, a user defined code +// block for the PRIV tap dance e.g. SEND_STRING("secret messape"), +// see function private() +// +// Modifier clusters +// ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +// The num and sym keys together access the navigation pad layer +// +// ,-----------------------------------------------------------------------------------. +// | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| +// `-----------------------------------------------------------------------------------' +// +// Hint +// ▔▔▔▔ +// For sculpted keycaps such as Cherry or OEM profile, reverse the Alt, Num, +// Shift, Shift, Nav, Sym keycaps for more ergonomic thumb orientation and +// actuation +// +// Code +// ▔▔▔▔ +// This source is shamelessly based on the "default" planck layout +// +// #ifdef/#endif block structures are not indented, as syntax highlighting +// in vim is sufficient for identification +// +// c++ commenting style is used throughout +// +// Change history +// ▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +// See http://thedarnedestthing.com/planck%20constant +// See http://thedarnedestthing.com/planck%20done + + + +// === N O T E === +// +// sudo CPATH=/common make ... + + +#include QMK_KEYBOARD_H +#ifdef STENO_ENABLE +#include "keymap_steno.h" +#endif + +extern keymap_config_t keymap_config; + +enum planck_layers { + _BASE = 0 + ,_SHIFT + ,_LSHIFT + ,_RSHIFT + ,_PLOVER + ,_NUMBER + ,_SYMBOL + ,_FNCKEY + ,_MOUSE +#ifdef CENTER_TT + ,_TTNUMBER + ,_TTREGEX + ,_TTFNCKEY + ,_TTCURSOR + ,_TTMOUSE +#endif + ,_EDIT + ,_ADJUST + ,_END_LAYERS +}; + +enum planck_keycodes { + BASE = SAFE_RANGE + ,BASE1 + ,BASE2 + ,PLOVER + ,SM_CIRC // pseudo GUI_T(S(KC_6)) for shifted key-codes, see process_record_user() + ,SM_DLR // pseudo SFT_T(S(KC_4)) for shifted key-codes, see process_record_user() + ,SM_G // pseudo MT (MOD_LALT | MOD_LSFT, S(KC_G)) for shifted key-codes, see process_record_user() + ,SM_H // pseudo MT (MOD_LCTL | MOD_LSFT, S(KC_H)) for shifted key-codes, see process_record_user() + ,SM_PERC // pseudo ALT_T(S(KC_5)) for shifted key-codes, see process_record_user() + ,SM_W // pseudo MT (MOD_LGUI | MOD_LSFT, S(KC_W)) for shifted key-codes, see process_record_user() + ,SL_LEFT // pseudo LT (_MOUSE, S(KC_LEFT)) for shifted key-codes, see process_record_user() + ,SP_DEL // pseudo LT (_MOUSE, KC_DEL) for shifted key-codes, see process_record_user() + ,SL_TAB // pseudo LT (_FNCKEY, S(KC_TAB)) for shifted key-codes, see process_record_user() +#ifdef CENTER_TT + ,TT_ESC +#endif +#ifdef STENO_ENABLE + ,PS_STNA = STN_A + ,PS_STNO = STN_O + ,PS_STNE = STN_E + ,PS_STNU = STN_U +#else + ,LT_C = LT (_NUMBER, KC_C) + ,LT_V = LT (_FNCKEY, KC_V) + ,LT_N = LT (_EDIT, KC_N) + ,LT_M = LT (_SYMBOL, KC_M) +#endif +}; + +// modifier keys +#define AT_B ALT_T(KC_B) +#define AT_DOWN ALT_T(KC_DOWN) +#define CT_RGHT CTL_T(KC_RGHT) +#define GT_C GUI_T(KC_C) +#define GT_UP GUI_T(KC_UP) +#define MT_E MT (MOD_LCTL | MOD_LALT, KC_E) +#define ST_A SFT_T(KC_A) +#ifdef HOME_MODS +#define HOME_H GUI_T(KC_H) +#define HOME_I CTL_T(KC_I) +#define HOME_E ALT_T(KC_E) +#define HOME_A SFT_T(KC_A) +#define HOME_T SFT_T(KC_T) +#define HOME_R ALT_T(KC_R) +#define HOME_S CTL_T(KC_S) +#define HOME_W GUI_T(KC_W) +#else +#define HOME_H KC_H +#define HOME_I KC_I +#define HOME_E KC_E +#define HOME_A KC_A +#define HOME_T KC_T +#define HOME_R KC_R +#define HOME_S KC_S +#define HOME_W KC_W +#endif + +#define S_DOWN S (KC_DOWN) +#define S_LEFT S (KC_LEFT) +#define S_RGHT S (KC_RGHT) +#define S_TAB S (KC_TAB) +#define S_UP S (KC_UP) + +#include "common/tapdance.h" + +// keycodes +#define ___x___ KC_TRNS +#define ___fn__ KC_TRNS +#undef _______ +#define _______ KC_NO + +#define COPY LCTL(KC_C) +#define CUT LCTL(KC_X) +#define EOT LCTL(KC_D) +#define NAK LCTL(KC_U) +#define PASTE LCTL(KC_V) +#define UNDO LCTL(KC_Z) +#define TMCOPY LALT(LCTL(KC_C)) +#define TMPASTE LALT(LCTL(KC_V)) +#define LT_BSLS LT (_MOUSE, KC_BSLS) // see process_record_user() for extended handling +#define LT_BSPC LT (_EDIT, KC_BSPC) +#define SP_LEFT LT (_EDIT, KC_LEFT) +#define LT_ESC LT (_NUMBER, KC_ESC) +#define LT_LEFT LT (_SYMBOL, KC_LEFT) // see process_record_user() for extended handling +#define SP_BSPC LT (_SYMBOL, KC_BSPC) // see process_record_user() for extended handling +#define LT_TAB LT (_FNCKEY, KC_TAB) +#define LT_INS LT (_FNCKEY, KC_INS) +#define ADJUST MO (_ADJUST) +#define OS_ALT OSM (MOD_LALT) +#define OS_CTL OSM (MOD_LCTL) +#define OS_GUI OSM (MOD_LGUI) +#define OS_SFT OSM (MOD_LSFT) + +#ifdef CENTER_TT +#define CNTR_TL TT (_TTFNCKEY) +#define CNTR_TR KC_CAPS +#define CNTR_HL TT (_TTCURSOR) +#define CNTR_HR TT (_TTMOUSE) +#define CNTR_BL TT (_TTNUMBER) +#define CNTR_BR TT (_TTREGEX) +#else +#define CNTR_TL OSM (MOD_LALT | MOD_LCTL) +#define CNTR_TR OSM (MOD_LGUI | MOD_LCTL) +#define CNTR_HL OSM (MOD_LALT | MOD_LSFT) +#define CNTR_HR OSM (MOD_LGUI | MOD_LSFT) +#define CNTR_BL TD (_CAPS) +#define CNTR_BR OSM (MOD_LSFT | MOD_LCTL) +#endif + +#ifdef THUMB_0 +#define LT_EQL LT (_ADJUST, KC_EQL) +#else +#define LT_0 LT (_ADJUST, KC_0) +#endif + +// ........................................................ Default Alpha Layout + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +#include "hiea.h" +#include "common/steno_layout.h" + +// ...................................................... Number / Function Keys + +#include "common/number_fkey_layout.h" + +// ......................................................... Symbol / Navigation + +#include "common/symbol_guifn_layout.h" + +// ............................................................... Toggle Layers + +#ifdef CENTER_TT +#include "common/toggle_layout.h" +#endif + +// ......................................................... Short Cuts / Adjust + +#include "common/chord_layout.h" + +}; + +// ...................................................................... Sounds + +#include "common/sounds.h" + +// ........................................................... User Keycode Trap + +#include "common/keycode_functions.h" + +#define BASE_1 1 +#define BASE_2 2 +#define BASE_12 3 +static uint8_t base_n = 0; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + switch (keycode) { + case BASE1: + if (record->event.pressed) { + base_n = base_n | BASE_1; + if (base_n == BASE_12) { + base_layer(); + } + } + else { + base_n = base_n & ~BASE_1; + } + return false; + case BASE2: + if (record->event.pressed) { + base_n = base_n | BASE_2; + if (base_n == BASE_12) { + base_layer(); + } + } + else { + base_n = base_n & ~BASE_2; + } + return false; + case AT_DOWN: +#ifdef HOME_MODS + case HOME_E: + case HOME_R: +#endif + tap_mods(record, KC_LALT); + break; + case CT_RGHT: +#ifdef HOME_MODS + case HOME_H: + case HOME_W: +#endif + tap_mods(record, KC_LGUI); + break; + case GT_UP: +#ifdef HOME_MODS + case HOME_I: + case HOME_S: +#endif + tap_mods(record, KC_LCTL); + break; +#ifdef HOME_MODS + case HOME_A: + case HOME_T: + tap_mods(record, KC_LSFT); + break; +#endif +#ifdef CENTER_TT + case TT_ESC: + clear_tt(); // exit TT layer + return false; +#endif + case LT_ESC: +#ifdef CENTER_TT + if (tt_keycode != 0) { + clear_tt(); // exit TT layer + return false; + } +#endif + tap_layer(record, _NUMBER); + break; + case LT_LEFT: + case SP_BSPC: + tap_layer(record, _SYMBOL); + // LT (_SYMBOL, KC_LEFT) left right combination layer + thumb_layer(record, RIGHT, 0, 0, _SYMBOL, _LSHIFT); + break; + case OS_ALT: + tap_mods(record, KC_LALT); + break; + case OS_CTL: + tap_mods(record, KC_LCTL); + break; + case OS_GUI: + tap_mods(record, KC_LGUI); + break; + case SM_CIRC: + // GUI_T(S(KC_6)) + mt_shift(record, KC_LGUI, 0, KC_6); + break; + case SM_DLR: + // SFT_T(S(KC_4)) + mt_shift(record, KC_LSFT, 0, KC_4); + break; + case SM_G: + // MT(MOD_LALT | MOD_LSFT, S(KC_G)) + mt_shift(record, KC_LALT, KC_LSFT, KC_G); + break; + case SM_H: + // MT(MOD_LCTL | MOD_LSFT, S(KC_K)) + mt_shift(record, KC_LCTL, KC_LSFT, KC_H); + break; + case SM_W: + // MT(MOD_LGUI | MOD_LSFT, S(KC_W)) + mt_shift(record, KC_LGUI, KC_LSFT, KC_W); + break; + case SM_PERC: + // ALT_T(S(KC_5)) + mt_shift(record, KC_LALT, 0, KC_5); + break; + case LT_BSLS: + tap_layer(record, _MOUSE); + // LT (_MOUSE, KC_BSLS) left right combination layer, see #define LT_BSLS + thumb_layer(record, LEFT, 0, 0, _MOUSE, _SYMBOL); + break; + case SL_LEFT: + tap_layer(record, _MOUSE); + // LT (_MOUSE, S(KC_LEFT)) left right combination layer + thumb_layer(record, RIGHT, SHIFT, KC_LEFT, _MOUSE, _LSHIFT); + break; + case SP_DEL: + tap_layer(record, _MOUSE); + // LT (_MOUSE, S(KC_LEFT)) left right combination layer + thumb_layer(record, RIGHT, NOSHIFT, KC_DEL, _MOUSE, _LSHIFT); + break; + case SL_TAB: + // LT (_FNCKEY, S(KC_TAB)) emulation + lt_shift(record, KC_TAB, _FNCKEY); + break; + case TD_ENT: + tap_layer(record, _RSHIFT); + // LT (_RSHIFT, KC_ENT) emulation, see tap dance enter + break; + case TD_SPC: + tap_layer(record, _LSHIFT); + // LT (_LSHIFT, KC_SPC) left right combination layer, see tap dance TD_SPC + thumb_layer(record, LEFT, 0, 0, _LSHIFT, _SYMBOL); + break; +#ifdef CENTER_TT + case CNTR_TL: + case CNTR_TR: + case CNTR_HL: + case CNTR_HR: + case CNTR_BL: + case CNTR_BR: + if (tt_keycode != keycode && tt_keycode != 0) { + clear_tt(); // return to base layer first if different TT layer selected + } + tt_keycode = keycode; + break; +#endif +// #ifdef STENO_ENABLE +// case PS_STNA: +// stn_layer(record, STN_A, _NUMBER); +// break; +// case PS_STNO: +// stn_layer(record, STN_O, _FNCKEY); +// break; +// case PS_STNE: +// stn_layer(record, STN_E, _EDIT); +// break; +// case PS_STNU: +// stn_layer(record, STN_U, _SYMBOL); +// break; +// #endif + case PLOVER: + steno(record); + return false; + } + return true; +} + +#include "common/init.h" diff --git a/keyboards/planck/keymaps/hiea/qwerty.h b/keyboards/planck/keymaps/hiea/qwerty.h new file mode 100644 index 000000000000..d11d0478b3f4 --- /dev/null +++ b/keyboards/planck/keymaps/hiea/qwerty.h @@ -0,0 +1,64 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ...................................................................... Qwerty +#ifdef QWERTY + // ,-----------------------------------------------------------------------------------. + // | Q | W | E | R | T | ^Alt | ^GUI | Y | U | I | O | P | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | S | D | F | G | ↑Alt | ↑GUI | H | J | K | L | ; | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | X | C | V | B | Caps |^Shift| N | M | , | . | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = { + {KC_Q, KC_W, KC_E, KC_R, KC_T, CNTR_TL, CNTR_TR, KC_Y, KC_U, KC_I, KC_O, KC_P }, + {KC_A, KC_S, KC_D, KC_F, KC_G, CNTR_HL, CNTR_HR, KC_H, KC_J, KC_K, KC_L, KC_SCLN}, + {KC_Z, KC_X, KC_C, KC_V, KC_B, CNTR_BL, CNTR_BR, KC_N, KC_M, KC_COMM, KC_DOT, TD_QUOT}, + {OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT}, + }, + + [_SHIFT] = { + {S(KC_Q), S(KC_W), S(KC_E), S(KC_R), S(KC_T), CNTR_TL, CNTR_TR, S(KC_Y), S(KC_U), S(KC_I), S(KC_O), S(KC_P)}, + {S(KC_A), S(KC_S), S(KC_D), S(KC_F), S(KC_G), CNTR_HL, CNTR_HR, S(KC_H), S(KC_J), S(KC_K), S(KC_L), KC_SCLN}, + {S(KC_Z), S(KC_X), S(KC_C), S(KC_V), S(KC_B), CNTR_BL, CNTR_BR, S(KC_N), S(KC_M), KC_COMM, KC_DOT, TD_QUOT}, + {OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT}, + }, + + // ,-----------------------------------------------------------------------------------. + // | Q | W | E | R | T | ^Alt | ^GUI | Y | U | I | O | P | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | S | D | F | G | ↑Alt | ↑GUI | H | J | K | L | : | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | X | C | V | B | Caps |^Shift| N | M | / | ? | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | - | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = { + {S(KC_Q), S(KC_W), S(KC_E), S(KC_R), S(KC_T), CNTR_TL, CNTR_TR, S(KC_Y), S(KC_U), S(KC_I), S(KC_O), S(KC_P)}, + {S(KC_A), S(KC_S), S(KC_D), S(KC_F), S(KC_G), CNTR_HL, CNTR_HR, S(KC_H), S(KC_J), S(KC_K), S(KC_L), TD_COLN}, + {S(KC_Z), S(KC_X), S(KC_C), S(KC_V), S(KC_B), CNTR_BL, CNTR_BR, S(KC_N), S(KC_M), KC_SLSH, KC_QUES, TD_DQOT}, + {OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_MINS, SL_LEFT, S_DOWN, S_UP, S_RGHT }, + }, + + // ,-----------------------------------------------------------------------------------. + // | Q | W | E | R | T | ^Alt | ^GUI | Y | U | I | O | P | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | S | D | F | G | ↑Alt | ↑GUI | H | J | K | L | : | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | X | C | V | B | Caps |^Shift| N | M | ~ | ` | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | _ | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = { + {S(KC_Q), S(KC_W), S(KC_E), S(KC_R), S(KC_T), CNTR_TL, CNTR_TR, S(KC_Y), S(KC_U), S(KC_I), S(KC_O), S(KC_P)}, + {S(KC_A), S(KC_S), S(KC_D), S(KC_F), S(KC_G), CNTR_HL, CNTR_HR, S(KC_H), S(KC_J), S(KC_K), S(KC_L), TD_COLN}, + {S(KC_Z), S(KC_X), S(KC_C), S(KC_V), S(KC_B), CNTR_BL, CNTR_BR, S(KC_N), S(KC_M), TD_TILD, TD_GRV, TD_DQOT}, + {OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_UNDS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT }, + }, +#endif + diff --git a/keyboards/planck/keymaps/hiea/readme.md b/keyboards/planck/keymaps/hiea/readme.md new file mode 100644 index 000000000000..58f73e3b445a --- /dev/null +++ b/keyboards/planck/keymaps/hiea/readme.md @@ -0,0 +1,10 @@ +# The sdothum extended Default Planck Layout + +- Colemak-DH layout layer with shift/tab key overlays +- Number and symbol/function key layer +- Hexadecimal keypad layer +- Navigation keypad layer +- Dynamic macro layer +- Autocompletion tap key pairs (),[],{} +- Normalized enter and esc key position across keyboard layers +- Extensive use of tap keys diff --git a/keyboards/planck/keymaps/hiea/rules.mk b/keyboards/planck/keymaps/hiea/rules.mk new file mode 100644 index 000000000000..ea9abc2a80df --- /dev/null +++ b/keyboards/planck/keymaps/hiea/rules.mk @@ -0,0 +1,23 @@ +# Build Options: +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically + +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # mouse keys(+4700) +EXTRAKEY_ENABLE = no # audio control and System control(+450) +CONSOLE_ENABLE = no # console for debug(+400) +COMMAND_ENABLE = no # commands for debug and configuration +NKRO_ENABLE = yes # nkey rollover +BACKLIGHT_ENABLE = no # enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # audio output on port C6 +UNICODE_ENABLE = no # unicode +BLUETOOTH_ENABLE = no # enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # enable WS2812 RGB underlight, do not enable this with audio at the same time. +STENO_ENABLE = yes # enable TX Bolt protocol, requires VIRTSER and may not work with mouse keys + +# do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # breathing sleep LED during USB suspend + +TAP_DANCE_ENABLE = yes # enable double tap completion of (),[],{} + diff --git a/keyboards/planck/keymaps/hieax/common/chord_layout.h b/keyboards/planck/keymaps/hieax/common/chord_layout.h new file mode 100644 index 000000000000..cb1b7f678550 --- /dev/null +++ b/keyboards/planck/keymaps/hieax/common/chord_layout.h @@ -0,0 +1,41 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// .................................................................. Short Cuts + + // .-----------------------------------------------------------------------------------. + // | | | Copy | Paste| | | | | | | | | + // |--------------------------------------------------------------+------+------+------| + // | Undo | Cut | Copy | Paste| | | | | PRIV | PUB | | | + // |-----------------------------------------------------------------------------------| + // | | | Nak | Eot | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | | | | | | f() | | | | | | + // | | | | | | | | f() | | | | | see _PLOVER + // '-----------------------------------------------------------------------------------' + + [_EDIT] = LAYOUT_planck_grid( + _______, _______, TMCOPY, TMPASTE, _______, _______, _______, _______, _______, _______, _______, _______, + UNDO, CUT, COPY, PASTE, _______, _______, _______, _______, TD_PRIV, TD_SEND, _______, _______, + _______, _______, NAK, EOT, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, ___fn__, ___fn__, _______, _______, _______, _______ + ), + +// ................................................................ Adjust Layer + + // ,-----------------------------------------------------------------------------------. + // |Plover| | | | | | | | | | | | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // |Aud on| | | | | | | | | | | | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Reset| | | | | | | | | | | | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | | | | f() | | | | | f() | | | | + // `-----------------------------------------------------------------------------------' + + [_ADJUST] = LAYOUT_planck_grid( + PLOVER, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + AU_ON, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, ___fn__, _______, _______, _______, _______, ___fn__, _______, _______, _______ + ), diff --git a/keyboards/planck/keymaps/hieax/common/init.h b/keyboards/planck/keymaps/hieax/common/init.h new file mode 100644 index 000000000000..6366a19f65eb --- /dev/null +++ b/keyboards/planck/keymaps/hieax/common/init.h @@ -0,0 +1,56 @@ + +// ....................................................................... Audio + +void matrix_init_user(void) +{ +#ifdef STENO_ENABLE + steno_set_mode(STENO_MODE_BOLT); // or STENO_MODE_GEMINI +#endif +#ifdef AUDIO_ENABLE + startup_user(); +#endif +} + +#ifdef AUDIO_ENABLE +#ifdef BACKLIGHT_ENABLE +void led_set_user(uint8_t usb_led) +{ + static uint8_t old_usb_led = 0; + _delay_ms(10); // gets rid of tick + if (!is_playing_notes()) { + if ((usb_led & (1<event.pressed) { + key_timer = timer_read(); + register_code(modifier); + if (modifier2) { + register_code(modifier2); + } + } + else { + unregister_code(modifier); + if (modifier2) { + unregister_code(modifier2); + } + if (timer_elapsed(key_timer) < TAPPING_TERM) { + shift_key(keycode); + } + key_timer = 0; + } +} + +// ................................................................... Mod Masks + +// tap dance persistant mods, see process_record_user() +// keyboard_report->mods (?) appears to be cleared by tap dance +static uint8_t mods = 0; + +void tap_mods(keyrecord_t *record, uint16_t keycode) +{ + if (record->event.pressed) { + mods |= MOD_BIT(keycode); + } + else { + mods &= ~(MOD_BIT(keycode)); + } +} + +// (un)register modifiers +void modifier(void (*f)(uint8_t)) +{ + if (mods & MOD_BIT(KC_LCTL)) { + (*f)(KC_LCTL); + } + if (mods & MOD_BIT(KC_LGUI)) { + (*f)(KC_LGUI); + } + if (mods & MOD_BIT(KC_LALT)) { + (*f)(KC_LALT); + } + if (mods & MOD_BIT(KC_LSFT)) { + (*f)(KC_LSFT); + } + if (mods & MOD_BIT(KC_RSFT)) { + (*f)(KC_RSFT); + } +} + +// .................................................... Triple Dance Shift/Layer + +static uint8_t dt_shift = 0; + +void double_shift(uint16_t keycode, uint8_t layer) +{ + tap_key (keycode); + if (DT_SHIFT) { + // set_oneshot_mods(MOD_LSFT); + // layer_on(layer); + layer_on (_SHIFT); + set_oneshot_layer(_SHIFT, ONESHOT_START); + dt_shift = 1; + } + else { + layer_on(layer); + } +} + +// tap dance LT (LAYER, KEY) emulation with -> and auto-repeat extensions! +void tap_shift(tap_dance_state_t *state, uint16_t keycode, uint8_t layer) +{ + // double tap plus down + if (state->count > 2) { + // double enter shift + if (keycode == KC_ENT) { + tap_key (keycode); + double_shift(keycode, layer); + } + // repeating keycode + else { + register_code(keycode); + } + } + // tap plus down (or double tap): keycode (one shot) shift + else if (state->count > 1) { + double_shift(keycode, layer); + } + // down: shift + else if (state->pressed) { + layer_on(layer); + } + // tap: keycode + else { + modifier(register_code); + tap_key (keycode); + modifier(unregister_code); + } +} + +void tap_reset(uint16_t keycode, uint8_t layer) +{ + unregister_code(keycode); + if (DT_SHIFT && dt_shift) { + clear_oneshot_layer_state(ONESHOT_PRESSED); + dt_shift = 0; + } + else { + layer_off(layer); + } +} + +// augment pseudo LT (_RSHIFT, KC_ENT) handling below for rapid sequences +void enter(tap_dance_state_t *state, void *user_data) +{ + tap_shift(state, KC_ENT, _RSHIFT); +} + +void enter_reset(tap_dance_state_t *state, void *user_data) +{ + tap_reset(KC_ENT, _RSHIFT); +} + +// augment pseudo LT (_LSHIFT, KC_SPC) handling below for rapid sequences +void space(tap_dance_state_t *state, void *user_data) +{ + tap_shift(state, KC_SPC, _LSHIFT); +} + +void space_reset(tap_dance_state_t *state, void *user_data) +{ + tap_reset(KC_SPC, _LSHIFT); +} + +// ......................................................... Triple Dance Insert + +void double_max(uint8_t count, uint8_t shift, uint16_t keycode) +{ + if (shift) { + shift_key(keycode); + if (count > 1) { + shift_key(keycode); + } + } + else { + tap_key(keycode); + if (count > 1) { + tap_key(keycode); + } + } +} + +void colon(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 2) { + tap_key (KC_SPC); + shift_key(KC_SCLN); + shift_key(KC_SCLN); + tap_key (KC_SPC); + } + else { + double_max(state->count, SHIFT, KC_SCLN); + } + reset_tap_dance(state); +} + +void eql(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 2) { + tap_key(KC_SPC); + tap_key(KC_SLSH); + tap_key(KC_EQL); + tap_key(KC_SPC); + } + else { + double_max(state->count, NOSHIFT, KC_EQL); + } + reset_tap_dance(state); +} + +void greater(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 2) { + tap_key (KC_SPC); + tap_key (KC_MINS); + shift_key(KC_DOT); + tap_key (KC_SPC); + } + else { + double_max(state->count, SHIFT, KC_DOT); + } + reset_tap_dance(state); +} + +void lesser(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 2) { + tap_key (KC_SPC); + shift_key(KC_COMM); + tap_key (KC_MINS); + tap_key (KC_SPC); + } + else { + double_max(state->count, SHIFT, KC_COMM); + } + reset_tap_dance(state); +} + +void tilde(tap_dance_state_t *state, void *user_data) +{ + // double tap plus down: repeating keycode + if (state->count > 2) { + register_code(KC_LSFT); + register_code(KC_GRV); + } + // tap: keycode + else { + shift_key(KC_GRV); + // double tap: unix home directory + if (state->count > 1) { + tap_key(KC_SLSH); + } + } +} + +void tilde_reset(tap_dance_state_t *state, void *user_data) +{ + unregister_code(KC_GRV); + unregister_code(KC_LSFT); +} + +// ............................................................. Tap Dance Pairs + +// tap dance shift rules +#define S_NEVER 0 +#define S_SINGLE 1 +#define S_DOUBLE 2 +#define S_ALWAYS S_SINGLE | S_DOUBLE + +void symbol_pair(uint8_t shift, uint16_t left, uint16_t right) +{ + if (shift & S_DOUBLE) { + shift_key(left); + shift_key(right); + } + else { + tap_key(left); + tap_key(right); + } +} + +#define CLOSE 1 + +// tap dance symbol pairs +void tap_pair(tap_dance_state_t *state, uint8_t shift, uint16_t left, uint16_t right, uint16_t modifier, uint8_t close) +{ + // triple tap: left right with cursor between symbol pair a la vim :-) + if (state->count > 2) { + symbol_pair(shift, left, right); + tap_key (KC_LEFT); + } + // double tap: left right + else if (state->count > 1) { + symbol_pair(shift, left, right); + } + // down: modifier + else if (state->pressed) { + if (modifier) { + register_code(modifier); + } + } + // tap: left (close: right) + else { + if (shift & S_SINGLE) { + shift_key(close ? right : left); + } + else { + tap_key(close ? right : left); + } + } + if (!modifier) { + reset_tap_dance(state); + } +} + +void doublequote(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_QUOT, KC_QUOT, 0, 0); +} + +void grave(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_NEVER, KC_GRV, KC_GRV, 0, 0); +} + +void lbrace(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_NEVER, KC_LBRC, KC_RBRC, 0, 0); +} + +void lcurly(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_LBRC, KC_RBRC, 0, 0); +} + +void lparen(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_9, KC_0, KC_LCTL, 0); +} + +void lparen_reset(tap_dance_state_t *state, void *user_data) +{ + unregister_code(KC_LCTL); +} + +void quote(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_NEVER, KC_QUOT, KC_QUOT, 0, 0); +} + +void rangle(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_COMM, KC_DOT, 0, CLOSE); +} + +void rbrace(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_NEVER, KC_LBRC, KC_RBRC, 0, CLOSE); +} + +void rcurly(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_LBRC, KC_RBRC, 0, CLOSE); +} + +void rparen(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_9, KC_0, 0, CLOSE); +} + +void rparen_reset(tap_dance_state_t *state, void *user_data) +{ + unregister_code(KC_LCTL); +} + +// ............................................................ Tap Dance Insert + +void comma(tap_dance_state_t *state, void *user_data) +{ + tap_key(KC_COMM); + if (state->count > 1) { + tap_key(KC_SPC); + } + reset_tap_dance(state); +} + +void dot(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 1) { + shift_key(KC_COLN); + } + else { + tap_key(KC_DOT); + } + reset_tap_dance(state); +} + +// compile time macro string, see functions/hardware planck script +void private(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 1) { +#ifdef PRIVATE_STRING +#include "private_string.h" +#endif + } + reset_tap_dance(state); +} + +// config.h defined string +void send(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 1) { + SEND_STRING(PUBLIC_STRING); + } + reset_tap_dance(state); +} + +// .......................................................... Tap Dance One Shot + +void caps(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 1) { + tap_key(KC_CAPS); + } + else { + set_oneshot_mods(MOD_LSFT); + register_code (KC_LSFT); // on hold down + } +} + +void caps_reset(tap_dance_state_t *state, void *user_data) +{ + unregister_code(KC_LSFT); +} + +// ................................................................... Tap Dance + +tap_dance_action_t tap_dance_actions[] = { + [_CAPS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, caps, caps_reset) + ,[_COLN] = ACTION_TAP_DANCE_FN (colon) + ,[_COMM] = ACTION_TAP_DANCE_FN (comma) + ,[_DOT] = ACTION_TAP_DANCE_FN (dot) + ,[_DQOT] = ACTION_TAP_DANCE_FN (doublequote) + ,[_ENT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, enter, enter_reset) + ,[_EQL] = ACTION_TAP_DANCE_FN (eql) + ,[_GRV] = ACTION_TAP_DANCE_FN (grave) + ,[_GT] = ACTION_TAP_DANCE_FN (greater) + ,[_LBRC] = ACTION_TAP_DANCE_FN (lbrace) + ,[_LCBR] = ACTION_TAP_DANCE_FN (lcurly) + ,[_LPRN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lparen, lparen_reset) + ,[_LT] = ACTION_TAP_DANCE_FN (lesser) + ,[_PRIV] = ACTION_TAP_DANCE_FN (private) + ,[_QUOT] = ACTION_TAP_DANCE_FN (quote) + ,[_RBRC] = ACTION_TAP_DANCE_FN (rbrace) + ,[_RCBR] = ACTION_TAP_DANCE_FN (rcurly) + ,[_RNGL] = ACTION_TAP_DANCE_FN (rangle) + ,[_RPRN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rparen, rparen_reset) + ,[_SEND] = ACTION_TAP_DANCE_FN (send) + ,[_SPC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, space, space_reset) + ,[_TILD] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tilde, tilde_reset) +}; + +// .............................................................. Dynamic Layers + +#define LEFT 1 +#define RIGHT 2 +static uint8_t thumb = 0; + +// LEFT (KC_SPC, S(KC_BSLS)), RIGHT (KC_LEFT, S(KC_LEFT)) opposite thumb combinations, see process_record_user() +// up, up -> _BASE +// up, down -> _SYMBOL +// down, up -> _NUMBER +// down, down -> _MOUSE // see layer keycodes that raise mouse layer +#define THUMBS_DOWN _MOUSE // layer + +static uint8_t overlayer = 0; + +// left right thumb layer combinations +void thumb_layer(keyrecord_t *record, uint8_t side, uint8_t shift, uint16_t keycode, uint8_t thumb_dn_layer, uint8_t thumb_up_layer) +{ + if (record->event.pressed) { + // layer_on via tap_layer(), see process_record_user() + key_timer = timer_read(); + thumb = thumb | side; + } + else { + layer_off(thumb_dn_layer); + // opposite thumb_layer() thumb may have switched effective layer! + if (overlayer) { + layer_off(overlayer); + overlayer = 0; + } + if (!key_press(shift, keycode)) { + layer_off(THUMBS_DOWN); // both thumbs needed + // opposite thumb down? see left right combination layer table above + if (thumb & (side == LEFT ? RIGHT : LEFT)) { + layer_on(thumb_up_layer); + overlayer = thumb_up_layer; + } + } + clear_mods(); + thumb = thumb & ~side; + key_timer = 0; + } +} + +// #ifdef STENO_ENABLE +// // LT for steno keycode +// void stn_layer(keyrecord_t *record, uint16_t keycode, uint8_t layer) +// { +// if (record->event.pressed) { +// key_timer = timer_read(); +// if (keycode) { +// process_steno(keycode, record); +// } +// layer_on(layer); +// } +// else { +// layer_off(layer); +// if (keycode) { +// if (timer_elapsed(key_timer) < TAPPING_TERM) { +// process_steno(keycode, record); +// } +// else { +// // clear pressed state (request push of updated) process_steno.c and .h +// // steno_clear_state(); +// } +// } +// key_timer = 0; +// } +// } +// #endif + +// LT macro for nested LT layers +void lt(keyrecord_t *record, uint8_t shift, uint16_t keycode, uint16_t modifier, uint8_t layer) +{ + if (record->event.pressed) { + key_timer = timer_read(); + if (modifier) { + register_code(modifier); + } + layer_on(layer); + } + else { + if (modifier) { + unregister_code(modifier); + } + layer_off(layer); + // for shifted keycodes, hence, LT_SHIFT + key_press(shift, keycode); + clear_mods(); + key_timer = 0; + } +} + +// LT for S(keycode) +void lt_shift(keyrecord_t *record, uint16_t keycode, uint8_t layer) +{ + lt(record, SHIFT, keycode, 0, layer); +} + +// set layer asap to overcome macro latency errors, notably tap dance and LT usage +// this routine inexplicably (?) sets layer_on() faster than can be done in thumb_layer() +void tap_layer(keyrecord_t *record, uint8_t layer) +{ + if (record->event.pressed) { + layer_on(layer); + } + else { + layer_off(layer); + } +} + +// ..................................................................... Keymaps + +// void persistant_default_layer_set(uint16_t default_layer) +// { +// eeconfig_update_default_layer(default_layer); +// default_layer_set (default_layer); +// } + +void clear_layers(void) +{ + uint8_t layer; + for (layer = 0; layer < _END_LAYERS; layer++) { + layer_off(layer); + } +} + +#ifdef HOME_MODS +// home row layer/shift key state, see tap_mods() and keymap.c +#define LSYMBOL MOD_BIT(KC_LSFT) +#define RSYMBOL MOD_BIT(KC_RSFT) + +void home_state(void) { + // if only the shift key, raise the opposite hand symbol layer + if (mods == LSYMBOL) { + layer_on(_LSYMBOL); + } + else if (mods == RSYMBOL) { + layer_on(_RSYMBOL); + } + // or combine modifiers + else if (mods & LSYMBOL) { + register_code(KC_LSFT); + } + else if (mods & RSYMBOL) { + register_code(KC_RSFT); + } +} + +// home row layer/shift +void symbol_shift(keyrecord_t *record, uint16_t keycode) +{ + if (keycode) { + if (record->event.pressed) { + key_timer = timer_read(); + home_state(); + } + else { + // clear layer/shift state + if (keycode == KC_A) { + layer_off(_LSYMBOL); + unregister_code(KC_LSFT); + } + else if (keycode == KC_T) { + layer_off(_RSYMBOL); + unregister_code(KC_RSFT); + } + // no other modifier enabled, issue keycode + if (~mods) { + key_press(NOSHIFT, keycode); + } + key_timer = 0; + } + } + else { + // a non-shift modifier disables symbol layer + layer_off(_LSYMBOL); + layer_off(_RSYMBOL); + // update home layer/shift state + home_state(); + } +} +#endif + +#ifdef CENTER_TT +static uint16_t tt_keycode = 0; // current TT keycode + +void clear_tt(void) +{ + if (tt_keycode == KC_CAPS) { + tap_key(KC_CAPS); // clear capslock + } + tt_keycode = 0; + clear_layers(); + set_single_persistent_default_layer(_BASE); +} +#endif + +// txbolt plover run state +static uint8_t plover = 0; + +void toggle_plover(uint8_t state) +{ + if (plover != state) { +#ifdef PLOVER_KEYBIND +#include "plover_keybind.h" +#endif + plover = state; + } +} + +void base_layer(void) +{ +#ifdef AUDIO_ENABLE + if (plover) { + PLAY_SONG(song_plover_gb); + } + else { + PLAY_SONG(song_qwerty); + } +#endif + clear_layers(); + set_single_persistent_default_layer(_BASE); + toggle_plover(0); +} + +void steno(keyrecord_t *record) +{ + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(song_plover); +#endif + clear_layers(); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + if (!plover) { + toggle_plover(1); + } + } +} + +void steno_exit(keyrecord_t *record) +{ + if (record->event.pressed) { + base_layer(); + toggle_plover(0); + } +} diff --git a/keyboards/planck/keymaps/hieax/common/number_fkey_layout.h b/keyboards/planck/keymaps/hieax/common/number_fkey_layout.h new file mode 100644 index 000000000000..c3d5c2d874e3 --- /dev/null +++ b/keyboards/planck/keymaps/hieax/common/number_fkey_layout.h @@ -0,0 +1,46 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ......................................................... Number Keypad Layer + + // .-----------------------------------------------------------------------------------. + // | | F | E | D | | | | / | 7 | 8 | 9 | * | + // |-----------------------------------------------------------------------------------| + // | GUI | C | B | A | | | | . | 4 | 5 | 6 | - | + // |-----------------------------------------------------------------------------------| + // | | # | G | \ | | | | , | 1 | 2 | 3 | + | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | 0 | = | | | | + // | | | | f() | | | | = | 0 | | | | + // '-----------------------------------------------------------------------------------' + + [_NUMBER] = LAYOUT_planck_grid( + _______, KC_F, MT_E, KC_D, _______, ___x___, ___x___, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, + OS_GUI, GT_C, AT_B, ST_A, _______, ___x___, ___x___, TD_DOT, KC_4, KC_5, KC_6, KC_MINS, + _______, KC_HASH, SM_G, KC_BSLS, _______, ___x___, ___x___, TD_COMM, KC_1, KC_2, KC_3, KC_PLUS, +#ifdef THUMB_0 + ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___, KC_0, LT_EQL, ___x___, ___x___, ___x___ +#else + ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___, KC_EQL, LT_0, ___x___, ___x___, ___x___ +#endif + ), + +// ............ .................................................. Function Keys + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | F7 | F8 | F9 | F12 | + // |-----------------------------------------------------------------------------------| + // | Ctrl | GUI | Alt | Shift| | | | | F4 | F5 | F6 | F11 | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | F1 | F2 | F3 | F10 | + // |-----------------------------------------------------------------------------------| + // | | | | | | f() | | + | | | | | + // | | | | | f() | | | + | | | | | see _PLOVER + // '-----------------------------------------------------------------------------------' + + [_FNCKEY] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_F7, KC_F8, KC_F9, KC_F12 , + OS_GUI, OS_CTL, OS_ALT, OS_SFT, _______, ___x___, ___x___, _______, KC_F4, KC_F5, KC_F6, KC_F11 , + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_F1, KC_F2, KC_F3, KC_F10 , + _______, _______, _______, _______, ___fn__, ___fn__, _______, KC_PLUS, _______, _______, _______, _______ + ), diff --git a/keyboards/planck/keymaps/hieax/common/plover_keybind.h b/keyboards/planck/keymaps/hieax/common/plover_keybind.h new file mode 100644 index 000000000000..cb4ef92ef849 --- /dev/null +++ b/keyboards/planck/keymaps/hieax/common/plover_keybind.h @@ -0,0 +1,9 @@ + +// simple window manager specific plover keybind hook + +// toggle plover application, see herbstluftwm/config/appbinds +register_code (KC_LGUI); +register_code (KC_LCTL); +tap_key (KC_EQL); +unregister_code(KC_LCTL); +unregister_code(KC_LGUI); diff --git a/keyboards/planck/keymaps/hieax/common/sounds.h b/keyboards/planck/keymaps/hieax/common/sounds.h new file mode 100644 index 000000000000..1bfc7a6da0c9 --- /dev/null +++ b/keyboards/planck/keymaps/hieax/common/sounds.h @@ -0,0 +1,14 @@ + +// ................................................................ Audio Sounds + +#ifdef AUDIO_ENABLE +float song_startup [][2] = SONG(STARTUP_SOUND); +float song_colemak [][2] = SONG(COLEMAK_SOUND); +float song_qwerty [][2] = SONG(QWERTY_SOUND); +float song_plover [][2] = SONG(PLOVER_SOUND); +float song_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float song_caps_on [][2] = SONG(CAPS_LOCK_ON_SOUND); +float song_caps_off [][2] = SONG(CAPS_LOCK_OFF_SOUND); +float music_scale [][2] = SONG(MUSIC_SCALE_SOUND); +float song_goodbye [][2] = SONG(GOODBYE_SOUND); +#endif diff --git a/keyboards/planck/keymaps/hieax/common/steno_layout.h b/keyboards/planck/keymaps/hieax/common/steno_layout.h new file mode 100644 index 000000000000..c1f2b5b24ab7 --- /dev/null +++ b/keyboards/planck/keymaps/hieax/common/steno_layout.h @@ -0,0 +1,39 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ...................................................................... Plover +#ifdef STENO_ENABLE + // ,-----------------------------------------------------------------------------------. + // | # | # | # | # | # | # | # | # | # | # | # | # | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | Base | S | T | P | H | * | * | F | P | L | T | D | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Base | S | K | W | R | * | * | R | B | G | S | Z | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | | A | O | E | U | | + // `-----------------------------------------------------------------------------------' + + [_PLOVER] = LAYOUT_planck_grid( + STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC , + BASE1, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR , + BASE2, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR , + _______, _______, _______, PS_STNA, PS_STNO, _______, _______, PS_STNE, PS_STNU, _______, _______, _______ + ), +#else + // ,-----------------------------------------------------------------------------------. + // | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | Base | S | T | P | H | * | * | F | P | L | T | D | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Base | S | K | W | R | * | * | R | B | G | S | Z | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | | A | O | E | U | | + // `-----------------------------------------------------------------------------------' + + [_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + BASE1, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + BASE2, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + _______, _______, _______, LT_C, LT_V, _______, _______, LT_N, LT_M, _______, _______, _______ + ), +#endif diff --git a/keyboards/planck/keymaps/hieax/common/symbol_guifn_layout.h b/keyboards/planck/keymaps/hieax/common/symbol_guifn_layout.h new file mode 100644 index 000000000000..4a32f71bd9cb --- /dev/null +++ b/keyboards/planck/keymaps/hieax/common/symbol_guifn_layout.h @@ -0,0 +1,40 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ..................................................... Symbol Navigation Layer + + // .-----------------------------------------------------------------------------------. + // | | ~ | * | & | | | | | Home | Up | End | PgUp | + // |-----------------------------------------------------------------------------------| + // | GUI | ^ | % | $ | | | | | Left | Down | Right| PgDn | + // |-----------------------------------------------------------------------------------| + // | | # | @ | ! | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | |Adjust| \ | | f() | | + // '-----------------------------------------------------------------------------------' + + [_SYMBOL] = LAYOUT_planck_grid( + _______, KC_TILD, KC_ASTR, KC_AMPR, _______, ___x___, ___x___, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, + OS_GUI, SM_CIRC, SM_PERC, SM_DLR, _______, ___x___, ___x___, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, + _______, KC_HASH, KC_AT, KC_EXLM, _______, ___x___, ___x___, _______, _______, _______, _______, _______, + ___x___, ___x___, ___x___, ADJUST, LT_BSLS, ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___ + ), + +// ............................................................... Mouse Actions + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | Left | Up | Right| Up | + // |-----------------------------------------------------------------------------------| + // | | Btn3 | Btn2 | Btn1 | | | | | Left | Down | Right| Down | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | | f() | | f() | | + // '-----------------------------------------------------------------------------------' + + [_MOUSE] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_WH_U, + _______, KC_BTN3, KC_BTN2, KC_BTN1, _______, ___x___, ___x___, _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, + _______, _______, _______, _______, _______, ___x___, ___x___, _______, _______, _______, _______, _______, + _______, _______, _______, _______, ___fn__, _______, _______, _______, ___fn__, _______, _______, _______ + ), diff --git a/keyboards/planck/keymaps/hieax/common/tapdance.h b/keyboards/planck/keymaps/hieax/common/tapdance.h new file mode 100644 index 000000000000..d778286bf1ed --- /dev/null +++ b/keyboards/planck/keymaps/hieax/common/tapdance.h @@ -0,0 +1,49 @@ + +// tap dance keys +enum tap_dance { + _CAPS = 0 + ,_COLN + ,_COMM + ,_DOT + ,_DQOT + ,_ENT + ,_EQL + ,_GRV + ,_GT + ,_LBRC + ,_LCBR + ,_LPRN + ,_LT + ,_PRIV + ,_QUOT + ,_RBRC + ,_RCBR + ,_RNGL + ,_RPRN + ,_SEND + ,_SPC + ,_TILD +}; + +#define TD_CAPS TD(_CAPS) +#define TD_COLN TD(_COLN) +#define TD_COMM TD(_COMM) +#define TD_DOT TD(_DOT) +#define TD_DQOT TD(_DQOT) +#define TD_ENT TD(_ENT) +#define TD_EQL TD(_EQL) +#define TD_GRV TD(_GRV) +#define TD_GT TD(_GT) +#define TD_LBRC TD(_LBRC) +#define TD_LCBR TD(_LCBR) +#define TD_LPRN TD(_LPRN) +#define TD_LT TD(_LT) +#define TD_PRIV TD(_PRIV) // compile time macro string, provided in private_string.h +#define TD_QUOT TD(_QUOT) +#define TD_RBRC TD(_RBRC) +#define TD_RCBR TD(_RCBR) +#define TD_RNGL TD(_RNGL) +#define TD_RPRN TD(_RPRN) +#define TD_SEND TD(_SEND) // config.h defined macro string +#define TD_SPC TD(_SPC) // see process_record_user() for extended handling of Spc +#define TD_TILD TD(_TILD) diff --git a/keyboards/planck/keymaps/hieax/common/toggle_layout.h b/keyboards/planck/keymaps/hieax/common/toggle_layout.h new file mode 100644 index 000000000000..cf3138d6e338 --- /dev/null +++ b/keyboards/planck/keymaps/hieax/common/toggle_layout.h @@ -0,0 +1,102 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ......................................................... Number Keypad Layer + + // .-----------------------------------------------------------------------------------. + // | | F | E | D | | | | / | 7 | 8 | 9 | * | + // |-----------------------------------------------------------------------------------| + // | GUI | C | B | A | | | | . | 4 | 5 | 6 | - | + // |-----------------------------------------------------------------------------------| + // | | # | G | \ | | | | , | 1 | 2 | 3 | + | + // |-----------------------------------------------------------------------------------| + // | | | | f() | Space| | | 0 | = | | | | + // | | | | f() | Space| | | = | 0 | | | | + // '-----------------------------------------------------------------------------------' + + [_TTNUMBER] = LAYOUT_planck_grid( + _______, KC_F, MT_E, KC_D, _______, ___x___, ___x___, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, + OS_GUI, GT_C, AT_B, ST_A, _______, ___x___, ___x___, TD_DOT, KC_4, KC_5, KC_6, KC_MINS, + _______, KC_HASH, SM_G, KC_BSLS, _______, ___x___, ___x___, TD_COMM, KC_1, KC_2, KC_3, KC_PLUS, +#ifdef THUMB_0 + _______, _______, _______, TT_ESC, KC_SPC, _______, _______, KC_0, LT_EQL, _______, _______, _______ +#else + _______, _______, _______, TT_ESC, KC_SPC, _______, _______, KC_EQL, LT_0, _______, _______, _______ +#endif + ), + +// ............ .................................................. Function Keys + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | F7 | F8 | F9 | F12 | + // |-----------------------------------------------------------------------------------| + // | GUI | Ctrl | Alt | Shift| | | | | F4 | F5 | F6 | F11 | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | F1 | F2 | F3 | F10 | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | + | | | | | + // '-----------------------------------------------------------------------------------' + + [_TTFNCKEY] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_F7, KC_F8, KC_F9, KC_F12 , + OS_GUI, OS_CTL, OS_ALT, OS_SFT, _______, ___x___, ___x___, _______, KC_F4, KC_F5, KC_F6, KC_F11 , + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_F1, KC_F2, KC_F3, KC_F10 , + _______, _______, _______, TT_ESC, _______, _______, _______, KC_PLUS, _______, _______, _______, _______ + ), + +// ....................................................................... Regex + + // ,-----------------------------------------------------------------------------------. + // | | . | * | & | ~ | | | ` | [ | ] | ^ | | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | | < | % | > | ? | | | | | ( | ) | $ | | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | | : | @ | ! | / | | | \ | { | } | # | | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | | | | f() | = | | | + | Space| | | | + // `-----------------------------------------------------------------------------------' + + [_TTREGEX] = LAYOUT_planck_grid( + ___x___, KC_DOT, KC_ASTR, KC_AMPR, KC_TILD, ___x___, ___x___, KC_GRV, KC_LBRC, KC_RBRC, KC_CIRC, ___x___, + ___x___, KC_LT, KC_PERC, KC_GT, KC_QUES, ___x___, ___x___, KC_PIPE, KC_LPRN, KC_RPRN, KC_DLR, ___x___, + ___x___, KC_COLN, KC_AT, KC_EXLM, KC_SLSH, ___x___, ___x___, KC_BSLS, KC_LCBR, KC_RCBR, KC_HASH, ___x___, + _______, _______, _______, TT_ESC, KC_EQL, _______, _______, KC_PLUS, KC_SPC, _______, _______, _______ + ), + +// ............................................................ Navigation Layer + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | Home | Up | End | PgUp | + // |-----------------------------------------------------------------------------------| + // | GUI | Ctrl | Alt | Shift| | | | | Left | Down | Right| PgDn | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | | | | | | + // '-----------------------------------------------------------------------------------' + + [_TTCURSOR] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, + OS_GUI, OS_CTL, OS_ALT, OS_SFT, _______, ___x___, ___x___, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, + _______, _______, _______, _______, _______, ___x___, ___x___, _______, _______, _______, _______, _______, + _______, _______, _______, TT_ESC, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +// ............................................................... Mouse Actions + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | Left | Up | Right| Up | + // |-----------------------------------------------------------------------------------| + // | | Btn3 | Btn2 | Btn1 | | | | | Left | Down | Right| Down | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | | | | | | + // '-----------------------------------------------------------------------------------' + + [_TTMOUSE] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_WH_U, + _______, KC_BTN3, KC_BTN2, KC_BTN1, _______, ___x___, ___x___, _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, + _______, _______, _______, _______, _______, ___x___, ___x___, _______, _______, _______, _______, _______, + _______, _______, _______, TT_ESC, _______, _______, _______, _______, _______, _______, _______, _______ + ), diff --git a/keyboards/planck/keymaps/hieax/config.h b/keyboards/planck/keymaps/hieax/config.h new file mode 100644 index 000000000000..65845fe3e7d6 --- /dev/null +++ b/keyboards/planck/keymaps/hieax/config.h @@ -0,0 +1,46 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// tap dance key press termination interval +#define TAPPING_TERM 250 + +// smooth mouse motion +// #define MOUSEKEY_INTERVAL 20 +// #define MOUSEKEY_DELAY 0 +// #define MOUSEKEY_TIME_TO_MAX 60 +// #define MOUSEKEY_MAX_SPEED 7 +// #define MOUSEKEY_WHEEL_DELAY 0 + +// compile time macro string, see functions/hardware planck script (undefine otherwise) +//#define PRIVATE_STRING + +// compile time macro string, must be in quotes +#define PUBLIC_STRING ":%s/arch=(.*)/arch=('any')\n" + +// thumb key tap-shift() double tap: one shot shift (0) off (1) on +#define DT_SHIFT 1 + +// number layer 0 position KEYPAD_0, THUMB_0 +#define THUMB_0 + +// home block shift symbol clustes defined (no overlays required for extended symbols, undefine otherwise) +#define SHIFT_SYMBOLS + +// center column TT assignments (undefine for OSM chords) +#define CENTER_TT +#define TAPPING_TOGGLE 1 + +// home row modifiers +#define HOME_MODS +// fix dual function timing +#define PERMISSIVE_HOLD + +// layout ADNW*, BEAKL*, COLEKA*, QWERTY (default) +#define DEFAULT + +// sync app with window manager keybind hook defined in plover_keybind.h +#define PLOVER_KEYBIND + +#endif diff --git a/keyboards/planck/keymaps/hieax/hiea.h b/keyboards/planck/keymaps/hieax/hiea.h new file mode 100644 index 000000000000..38077e8eebec --- /dev/null +++ b/keyboards/planck/keymaps/hieax/hiea.h @@ -0,0 +1,99 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// .................................................................. BEAKL HIEA +#ifdef DEFAULT + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | Shift| Caps | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | H | I | E | A | . |Cursor| Mouse| C | T | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | ; | " | K | , | Num | Regex| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Ins | Left | Ent | Bksp | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_Y, KC_O, KC_U, KC_Z, CNTR_TL, CNTR_TR, KC_G, KC_D, KC_N, KC_M, KC_X , + HOME_H, HOME_I, HOME_E, HOME_A, KC_DOT, CNTR_HL, CNTR_HR, KC_C, HOME_T, HOME_R, HOME_S, HOME_W , + KC_J, KC_SCLN, TD_QUOT, KC_K, KC_COMM, CNTR_BL, CNTR_BR, KC_B, KC_P, KC_L, KC_F, KC_V , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_INS, SP_LEFT, TD_ENT, SP_BSPC, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + S(KC_H), S(KC_I), S(KC_E), S(KC_A), KC_DOT, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_R), S(KC_S), S(KC_W), + S(KC_J), KC_SCLN, TD_QUOT, S(KC_K), KC_COMM, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_INS, SP_LEFT, TD_ENT, SP_BSPC, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | Shift| Caps | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | H | I | E | A | ? |Cursor| Mouse| C | T | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | K | / | Num | Regex| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | ↑Tab | f() | Ins | Left | _ | Del | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + S(KC_H), S(KC_I), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_R), S(KC_S), S(KC_W), + S(KC_J), TD_COLN, TD_DQOT, S(KC_K), KC_SLSH, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, S_TAB, ___fn__, LT_INS, S_LEFT, KC_UNDS, SP_DEL, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | Shift| Caps | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | H | I | E | A | ? |Cursor| Mouse| C | T | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | K | / | Num | Regex| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Tab | - | Ins | Left | f() | Bksp | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + S(KC_H), S(KC_I), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_R), S(KC_S), S(KC_W), + S(KC_J), TD_COLN, TD_DQOT, S(KC_K), KC_SLSH, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, KC_TAB, KC_MINS, LT_INS, S_LEFT, ___fn__, SP_BSPC, S_DOWN, S_UP, S_RGHT + ), +#ifdef HOME_MODS + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | Fn | Caps | ` | [ | ] | ^ | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | H | I | E | f() | ? |Cursor| Mouse| | | ( | ) | $ | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | K | / | Num | Regex| \ | { | } | # | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Ins | Left | + | Space| Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSYMBOL] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, TD_GRV, KC_LBRC, KC_RBRC, KC_CIRC, S(KC_X), + HOME_H, HOME_I, HOME_E, ___fn__, KC_QUES, CNTR_HL, CNTR_HR, KC_PIPE, KC_LPRN, KC_RPRN, KC_DLR, S(KC_W), + S(KC_J), TD_COLN, TD_DQOT, S(KC_K), KC_SLSH, CNTR_BL, CNTR_BR, KC_BSLS, KC_LCBR, KC_RCBR, KC_HASH, S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_INS, SP_LEFT, KC_PLUS, SL_SPC, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | . | * | & | ~ | Fn | Caps | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | H | < | % | > | ? |Cursor| Mouse| C | f() | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | @ | ! | / | Num | Regex| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | ↑Tab | = | Ins | Left | Ent | Bksp | Down | Up | Right| + // | | ↑Tab | = | Ent | Bksp | | + // `-----------------------------------------------------------------------------------' + + [_RSYMBOL] = LAYOUT_planck_grid( + S(KC_Q), KC_DOT, KC_ASTR, KC_AMPR, TD_TILD, CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + S(KC_H), TD_LT, KC_PERC, TD_GT, KC_QUES, CNTR_HL, CNTR_HR, S(KC_C), ___fn__, HOME_R, HOME_S, HOME_W , + S(KC_J), TD_COLN, KC_AT, KC_EXLM, KC_SLSH, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, S_TAB, TD_EQL, LT_INS, SP_LEFT, TD_ENT, LT_BSPC, AT_DOWN, GT_UP, CT_RGHT + ), +#endif +#endif diff --git a/keyboards/planck/keymaps/hieax/keymap.c b/keyboards/planck/keymaps/hieax/keymap.c new file mode 100644 index 000000000000..80de85b884e9 --- /dev/null +++ b/keyboards/planck/keymaps/hieax/keymap.c @@ -0,0 +1,438 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. +// +// To flash planck firmware +// ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +// Reset keyboard or press hw reset button on base (hole) +// +// cd qmk_firmware/keyboards/planck +// sudo make KEYMAP=sdothum dfu +// +// sudo make clean (good practice before flashing) +// sudo make KEYMAP=sdothum (to compile check) +// +// Package requirements (for arch linux) +// ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +// avr-gcc-atmel +// avr-libc-atmel +// dfu-programmer +// +// Notes +// ▔▔▔▔▔ +// ** E R G O W I D E S P L I T ** Layout +// +// Autocompletion tap dance key pairs (),[],{} are available from the +// number/symbol layer, as well as, numerous (un)shift key values +// +// The navigation pad provides a single hand right thumb activated cluster +// with left hand modifiers +// +// #define PRIVATE_STRING includes private_string.h, a user defined code +// block for the PRIV tap dance e.g. SEND_STRING("secret messape"), +// see function private() +// +// Modifier clusters +// ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +// The num and sym keys together access the navigation pad layer +// +// ,-----------------------------------------------------------------------------------. +// | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| +// `-----------------------------------------------------------------------------------' +// +// Hint +// ▔▔▔▔ +// For sculpted keycaps such as Cherry or OEM profile, reverse the Alt, Num, +// Shift, Shift, Nav, Sym keycaps for more ergonomic thumb orientation and +// actuation +// +// Code +// ▔▔▔▔ +// This source is shamelessly based on the "default" planck layout +// +// #ifdef/#endif block structures are not indented, as syntax highlighting +// in vim is sufficient for identification +// +// c++ commenting style is used throughout +// +// Change history +// ▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +// See http://thedarnedestthing.com/planck%20constant +// See http://thedarnedestthing.com/planck%20done + + + +// === N O T E === +// +// sudo CPATH=/common make ... + + +#include QMK_KEYBOARD_H +#ifdef STENO_ENABLE +#include "keymap_steno.h" +#endif + +extern keymap_config_t keymap_config; + +enum planck_layers { + _BASE = 0 + ,_SHIFT + ,_LSHIFT + ,_RSHIFT + ,_LSYMBOL + ,_RSYMBOL + ,_PLOVER + ,_NUMBER + ,_SYMBOL + ,_FNCKEY + ,_MOUSE + ,_EDIT + ,_ADJUST +#ifdef CENTER_TT + ,_TTNUMBER + ,_TTREGEX + ,_TTFNCKEY + ,_TTCURSOR + ,_TTMOUSE +#endif + ,_END_LAYERS +}; + +enum planck_keycodes { + BASE = SAFE_RANGE + ,BASE1 + ,BASE2 + ,PLOVER + ,SM_CIRC // pseudo GUI_T(S(KC_6)) for shifted key-codes, see process_record_user() + ,SM_DLR // pseudo SFT_T(S(KC_4)) for shifted key-codes, see process_record_user() + ,SM_G // pseudo MT (MOD_LALT | MOD_LSFT, S(KC_G)) for shifted key-codes, see process_record_user() + ,SM_H // pseudo MT (MOD_LCTL | MOD_LSFT, S(KC_H)) for shifted key-codes, see process_record_user() + ,SM_PERC // pseudo ALT_T(S(KC_5)) for shifted key-codes, see process_record_user() + ,SM_W // pseudo MT (MOD_LGUI | MOD_LSFT, S(KC_W)) for shifted key-codes, see process_record_user() + ,SL_LEFT // pseudo LT (_MOUSE, S(KC_LEFT)) for shifted key-codes, see process_record_user() + ,SP_DEL // pseudo LT (_MOUSE, KC_DEL) for shifted key-codes, see process_record_user() + ,SL_TAB // pseudo LT (_FNCKEY, S(KC_TAB)) for shifted key-codes, see process_record_user() + ,SL_SPC // pseudo LT (S(_SYMBOL), KC_SPC) for home row shifted GUIFN +#ifdef HOME_MODS + ,HOME_A // pseudo SFT_T(KC_A) + ,HOME_T // pseudo SFT_T(KC_T) +#endif +#ifdef CENTER_TT + ,TT_ESC +#endif +#ifdef STENO_ENABLE + ,PS_STNA = STN_A + ,PS_STNO = STN_O + ,PS_STNE = STN_E + ,PS_STNU = STN_U +#else + ,LT_C = LT (_NUMBER, KC_C) + ,LT_V = LT (_FNCKEY, KC_V) + ,LT_N = LT (_EDIT, KC_N) + ,LT_M = LT (_SYMBOL, KC_M) +#endif +}; + +// modifier keys +#define AT_B ALT_T(KC_B) +#define AT_DOWN ALT_T(KC_DOWN) +#define CT_RGHT CTL_T(KC_RGHT) +#define GT_C GUI_T(KC_C) +#define GT_UP GUI_T(KC_UP) +#define MT_E MT (MOD_LCTL | MOD_LALT, KC_E) +#define ST_A SFT_T(KC_A) +#ifdef HOME_MODS +#define HOME_H GUI_T(KC_H) +#define HOME_I CTL_T(KC_I) +#define HOME_E ALT_T(KC_E) +#define HOME_R ALT_T(KC_R) +#define HOME_S CTL_T(KC_S) +#define HOME_W GUI_T(KC_W) +#else +#define HOME_H KC_H +#define HOME_I KC_I +#define HOME_E KC_E +#define HOME_A KC_A +#define HOME_T KC_T +#define HOME_R KC_R +#define HOME_S KC_S +#define HOME_W KC_W +#endif + +#define S_DOWN S (KC_DOWN) +#define S_LEFT S (KC_LEFT) +#define S_RGHT S (KC_RGHT) +#define S_TAB S (KC_TAB) +#define S_UP S (KC_UP) + +#include "common/tapdance.h" + +// keycodes +#define ___x___ KC_TRNS +#define ___fn__ KC_TRNS +#undef _______ +#define _______ KC_NO + +#define COPY LCTL(KC_C) +#define CUT LCTL(KC_X) +#define EOT LCTL(KC_D) +#define NAK LCTL(KC_U) +#define PASTE LCTL(KC_V) +#define UNDO LCTL(KC_Z) +#define TMCOPY LALT(LCTL(KC_C)) +#define TMPASTE LALT(LCTL(KC_V)) +#define LT_BSLS LT (_MOUSE, KC_BSLS) // see process_record_user() for extended handling +#define LT_BSPC LT (_EDIT, KC_BSPC) +#define SP_LEFT LT (_EDIT, KC_LEFT) +#define LT_ESC LT (_NUMBER, KC_ESC) +#define LT_LEFT LT (_SYMBOL, KC_LEFT) // see process_record_user() for extended handling +#define SP_BSPC LT (_SYMBOL, KC_BSPC) // see process_record_user() for extended handling +#define LT_TAB LT (_FNCKEY, KC_TAB) +#define LT_INS LT (_FNCKEY, KC_INS) +#define ADJUST MO (_ADJUST) +#define OS_ALT OSM (MOD_LALT) +#define OS_CTL OSM (MOD_LCTL) +#define OS_GUI OSM (MOD_LGUI) +#define OS_SFT OSM (MOD_LSFT) + +#ifdef CENTER_TT +#define CNTR_TL TT (_TTFNCKEY) +#define CNTR_TR KC_CAPS +#define CNTR_HL TT (_TTCURSOR) +#define CNTR_HR TT (_TTMOUSE) +#define CNTR_BL TT (_TTNUMBER) +#define CNTR_BR TT (_TTREGEX) +#else +#define CNTR_TL OSM (MOD_LALT | MOD_LCTL) +#define CNTR_TR OSM (MOD_LGUI | MOD_LCTL) +#define CNTR_HL OSM (MOD_LALT | MOD_LSFT) +#define CNTR_HR OSM (MOD_LGUI | MOD_LSFT) +#define CNTR_BL TD (_CAPS) +#define CNTR_BR OSM (MOD_LSFT | MOD_LCTL) +#endif + +// LT can only reference layers 0-15 +#ifdef THUMB_0 +#define LT_EQL LT (_ADJUST, KC_EQL) +#else +#define LT_0 LT (_ADJUST, KC_0) +#endif + +// ........................................................ Default Alpha Layout + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +#include "hiea.h" +#include "common/steno_layout.h" + +// ...................................................... Number / Function Keys + +#include "common/number_fkey_layout.h" + +// ......................................................... Symbol / Navigation + +#include "common/symbol_guifn_layout.h" + +// ............................................................... Toggle Layers + +#ifdef CENTER_TT +#include "common/toggle_layout.h" +#endif + +// ......................................................... Short Cuts / Adjust + +#include "common/chord_layout.h" + +}; + +// ...................................................................... Sounds + +#include "common/sounds.h" + +// ........................................................... User Keycode Trap + +#include "common/keycode_functions.h" + +#define BASE_1 1 +#define BASE_2 2 +#define BASE_12 3 +static uint8_t base_n = 0; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + switch (keycode) { + case BASE1: + if (record->event.pressed) { + base_n = base_n | BASE_1; + if (base_n == BASE_12) { + base_layer(); + } + } + else { + base_n = base_n & ~BASE_1; + } + return false; + case BASE2: + if (record->event.pressed) { + base_n = base_n | BASE_2; + if (base_n == BASE_12) { + base_layer(); + } + } + else { + base_n = base_n & ~BASE_2; + } + return false; +#ifdef HOME_MODS + case HOME_E: + case HOME_R: + tap_mods(record, KC_LALT); + symbol_shift(record, 0); + break; + case HOME_H: + case HOME_W: + tap_mods(record, KC_LGUI); + symbol_shift(record, 0); + break; + case HOME_I: + case HOME_S: + tap_mods(record, KC_LCTL); + symbol_shift(record, 0); + break; + case HOME_A: + tap_mods(record, KC_LSFT); + symbol_shift(record, KC_A); + break; + case HOME_T: + tap_mods(record, KC_RSFT); + symbol_shift(record, KC_T); + break; +#else + case AT_DOWN: + tap_mods(record, KC_LALT); + break; + case CT_RGHT: + tap_mods(record, KC_LGUI); + break; + case GT_UP: + tap_mods(record, KC_LCTL); + break; +#endif + case SL_SPC: + lt(record, NOSHIFT, KC_SPC, KC_LSFT, _SYMBOL); + break; +#ifdef CENTER_TT + case TT_ESC: + clear_tt(); // exit TT layer + return false; +#endif + case LT_ESC: +#ifdef CENTER_TT + if (tt_keycode != 0) { + clear_tt(); // exit TT layer + return false; + } +#endif + tap_layer(record, _NUMBER); + break; + case LT_LEFT: + case SP_BSPC: + tap_layer(record, _SYMBOL); + // LT (_SYMBOL, KC_LEFT) left right combination layer + thumb_layer(record, RIGHT, 0, 0, _SYMBOL, _LSHIFT); + break; + case OS_ALT: + tap_mods(record, KC_LALT); + break; + case OS_CTL: + tap_mods(record, KC_LCTL); + break; + case OS_GUI: + tap_mods(record, KC_LGUI); + break; + case SM_CIRC: + // GUI_T(S(KC_6)) + mt_shift(record, KC_LGUI, 0, KC_6); + break; + case SM_DLR: + // SFT_T(S(KC_4)) + mt_shift(record, KC_LSFT, 0, KC_4); + break; + case SM_G: + // MT(MOD_LALT | MOD_LSFT, S(KC_G)) + mt_shift(record, KC_LALT, KC_LSFT, KC_G); + break; + case SM_H: + // MT(MOD_LCTL | MOD_LSFT, S(KC_K)) + mt_shift(record, KC_LCTL, KC_LSFT, KC_H); + break; + case SM_W: + // MT(MOD_LGUI | MOD_LSFT, S(KC_W)) + mt_shift(record, KC_LGUI, KC_LSFT, KC_W); + break; + case SM_PERC: + // ALT_T(S(KC_5)) + mt_shift(record, KC_LALT, 0, KC_5); + break; + case LT_BSLS: + tap_layer(record, _MOUSE); + // LT (_MOUSE, KC_BSLS) left right combination layer, see #define LT_BSLS + thumb_layer(record, LEFT, 0, 0, _MOUSE, _SYMBOL); + break; + case SL_LEFT: + tap_layer(record, _MOUSE); + // LT (_MOUSE, S(KC_LEFT)) left right combination layer + thumb_layer(record, RIGHT, SHIFT, KC_LEFT, _MOUSE, _LSHIFT); + break; + case SP_DEL: + tap_layer(record, _MOUSE); + // LT (_MOUSE, S(KC_LEFT)) left right combination layer + thumb_layer(record, RIGHT, NOSHIFT, KC_DEL, _MOUSE, _LSHIFT); + break; + case SL_TAB: + // LT (_FNCKEY, S(KC_TAB)) emulation + lt_shift(record, KC_TAB, _FNCKEY); + break; + case TD_ENT: + tap_layer(record, _RSHIFT); + // LT (_RSHIFT, KC_ENT) emulation, see tap dance enter + break; + case TD_SPC: + tap_layer(record, _LSHIFT); + // LT (_LSHIFT, KC_SPC) left right combination layer, see tap dance TD_SPC + thumb_layer(record, LEFT, 0, 0, _LSHIFT, _SYMBOL); + break; +#ifdef CENTER_TT + case CNTR_TL: + case CNTR_TR: + case CNTR_HL: + case CNTR_HR: + case CNTR_BL: + case CNTR_BR: + if (tt_keycode != keycode && tt_keycode != 0) { + clear_tt(); // return to base layer first if different TT layer selected + } + tt_keycode = keycode; + break; +#endif +// #ifdef STENO_ENABLE +// case PS_STNA: +// stn_layer(record, STN_A, _NUMBER); +// break; +// case PS_STNO: +// stn_layer(record, STN_O, _FNCKEY); +// break; +// case PS_STNE: +// stn_layer(record, STN_E, _EDIT); +// break; +// case PS_STNU: +// stn_layer(record, STN_U, _SYMBOL); +// break; +// #endif + case PLOVER: + steno(record); + return false; + } + return true; +} + +#include "common/init.h" diff --git a/keyboards/planck/keymaps/hieax/readme.md b/keyboards/planck/keymaps/hieax/readme.md new file mode 100644 index 000000000000..58f73e3b445a --- /dev/null +++ b/keyboards/planck/keymaps/hieax/readme.md @@ -0,0 +1,10 @@ +# The sdothum extended Default Planck Layout + +- Colemak-DH layout layer with shift/tab key overlays +- Number and symbol/function key layer +- Hexadecimal keypad layer +- Navigation keypad layer +- Dynamic macro layer +- Autocompletion tap key pairs (),[],{} +- Normalized enter and esc key position across keyboard layers +- Extensive use of tap keys diff --git a/keyboards/planck/keymaps/hieax/rules.mk b/keyboards/planck/keymaps/hieax/rules.mk new file mode 100644 index 000000000000..ea9abc2a80df --- /dev/null +++ b/keyboards/planck/keymaps/hieax/rules.mk @@ -0,0 +1,23 @@ +# Build Options: +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically + +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # mouse keys(+4700) +EXTRAKEY_ENABLE = no # audio control and System control(+450) +CONSOLE_ENABLE = no # console for debug(+400) +COMMAND_ENABLE = no # commands for debug and configuration +NKRO_ENABLE = yes # nkey rollover +BACKLIGHT_ENABLE = no # enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # audio output on port C6 +UNICODE_ENABLE = no # unicode +BLUETOOTH_ENABLE = no # enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # enable WS2812 RGB underlight, do not enable this with audio at the same time. +STENO_ENABLE = yes # enable TX Bolt protocol, requires VIRTSER and may not work with mouse keys + +# do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # breathing sleep LED during USB suspend + +TAP_DANCE_ENABLE = yes # enable double tap completion of (),[],{} + diff --git a/keyboards/planck/keymaps/hvp/config.h b/keyboards/planck/keymaps/hvp/config.h new file mode 100644 index 000000000000..472320ed682a --- /dev/null +++ b/keyboards/planck/keymaps/hvp/config.h @@ -0,0 +1,35 @@ +#pragma once +#define TAPPING_TERM 150 +#define PERMISSIVE_HOLD + +#ifdef AUDIO_ENABLE +# define STARTUP_SONG SONG(PLANCK_SOUND) +// #define STARTUP_SONG SONG(NO_SOUND) + +# define DEFAULT_LAYER_SONGS \ + { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND) } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/hvp/keymap.c b/keyboards/planck/keymaps/hvp/keymap.c new file mode 100644 index 000000000000..bd0c2cadecf3 --- /dev/null +++ b/keyboards/planck/keymaps/hvp/keymap.c @@ -0,0 +1,186 @@ +/* Copyright 2015-2017 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 . + */ +#include "hvp.c" +#include QMK_KEYBOARD_H +#include "muse.h" + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _NAVI, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE +}; + +#define _QWERTY 0 +#define _RAISE 1 +#define _LOWER 2 +#define _NAVI 3 +#define _ADJUST 5 + +#define LT3_ESC LT(3, KC_ESC) +#define LT4_TAB LT(5, KC_TAB) + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = LAYOUT_planck_grid( + LT4_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT3_ESC, KC_A, KC_S, KC_D, LT(3,KC_F), KC_G, KC_H, KC_J, KC_K, KC_L, TD(TD1), TD(TD2), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, TD(TD3), SC_SENT, + KC_LCTL, KC_APP, KC_LGUI, KC_LALT, MO(2), KC_SPC, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +[_RAISE] = LAYOUT_planck_grid( /* Right */ + 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_DEL, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +[_LOWER] = LAYOUT_planck_grid( /* Left */ + KC_TILDE, KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR, KC_PERCENT, KC_CIRCUMFLEX, KC_AMPERSAND, KC_ASTERISK, KC_LEFT_PAREN, KC_RIGHT_PAREN, KC_BSPC, + KC_DEL, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSLS, + _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_TILD, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +[_NAVI] = LAYOUT_planck_grid( /* Esc */ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, _______, _______, D_NAVI, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, KC_PSCR, + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, + _______, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPLY, KC_MSTP, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT +), + +[_ADJUST] = LAYOUT_planck_grid( /* Tab */ + _______, _______, AG_NORM, AG_SWAP, _______, _______, _______, KC_7, KC_8, KC_9, KC_0, _______, + _______, _______, MU_NEXT, AU_ON, AU_OFF, _______, _______, KC_4, KC_5, KC_6, _______, _______, + KC_PSCR, AU_PREV, AU_NEXT, MU_ON, MU_OFF, _______, _______, KC_0, KC_1, KC_2, KC_3, _______, + QK_BOOT, _______, _______, _______, MI_ON, MI_OFF, _______, _______, _______, _______, _______, DB_TOGG +)}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_song); } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_gb_song); } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } + return true; +} + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/hvp/readme.md b/keyboards/planck/keymaps/hvp/readme.md new file mode 100644 index 000000000000..cb58d85785e6 --- /dev/null +++ b/keyboards/planck/keymaps/hvp/readme.md @@ -0,0 +1,10 @@ +Keyboard: Planck rev6 +Keys: 40% (12x4) ortholinear keyboard +Layout: Swedish characters on main layer using tap dance. Built for Eurkey keyboard layout. +Flash instructions: Flash using avrdude, will req the hvp user space to compile. + +> make planck/rev6:hvp:dfu-util + +Links: +Github - https://github.com/qmk/qmk_firmware/tree/master/keyboards/planck +Eurkey layout - https://eurkey.steffen.bruentjen.eu/ diff --git a/keyboards/planck/keymaps/hvp/rules.mk b/keyboards/planck/keymaps/hvp/rules.mk new file mode 100644 index 000000000000..896115f718fb --- /dev/null +++ b/keyboards/planck/keymaps/hvp/rules.mk @@ -0,0 +1,4 @@ +SRC += muse.c + +RGBLIGHT_ENABLE = no +TAP_DANCE_ENABLE = yes \ No newline at end of file diff --git a/keyboards/planck/keymaps/impossible/config.h b/keyboards/planck/keymaps/impossible/config.h new file mode 100644 index 000000000000..2bebf48a1ca9 --- /dev/null +++ b/keyboards/planck/keymaps/impossible/config.h @@ -0,0 +1,26 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/impossible/keymap.c b/keyboards/planck/keymaps/impossible/keymap.c new file mode 100644 index 000000000000..9145ad79aae6 --- /dev/null +++ b/keyboards/planck/keymaps/impossible/keymap.c @@ -0,0 +1,231 @@ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +#define _WORKMAN 0 +#define _FN 1 +#define _QWERTY 2 +#define _QW_FN 3 +#define _PLOVER 4 +#define _ADJ 5 + +enum planck_keycodes { + WORKMAN = SAFE_RANGE, + QWERTY, + PLOVER +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Workman Alpha-numeric + * ,-----------------------------------------------------------------------------------------------. + * | Q | D | R | W | B | F | U | P | J | 7 | 8 | 9 | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | A | S | H | T | G | N | E | O | I | 4 | 5 | 6 | + * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------| + * | Z | X | M | C | V | L | Y | K | Up | 1 | 2 | 3 | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * |Alt/Tab|Gui/Esc| , |CTL/Bsp| Fn/Ent|SFT/SPC| . | Left | Down | Right | 0 |Adj/Ent| + * `-----------------------------------------------------------------------------------------------' + */ + +[_WORKMAN] = LAYOUT_planck_grid( + KC_Q, KC_D, KC_R, KC_W, KC_B, KC_F, KC_U, KC_P, KC_J, KC_KP_7, KC_KP_8, KC_KP_9, + KC_A, KC_S, KC_H, KC_T, KC_G, KC_N, KC_E, KC_O, KC_I, KC_KP_4, KC_KP_5, KC_KP_6, + KC_Z, KC_X, KC_M, KC_C, KC_V, KC_L, KC_Y, KC_K, KC_UP, KC_KP_1, KC_KP_2, KC_KP_3, + ALT_T(KC_TAB), GUI_T(KC_ESC), KC_COMM, CTL_T(KC_BSPC), LT(_FN, KC_ENT), SFT_T(KC_SPC), KC_DOT, KC_LEFT, KC_DOWN, KC_RGHT, KC_KP_0, LT(_ADJ, KC_ENT) +), + +/* FN-key held (Workman) + * ,-----------------------------------------------------------------------------------------------. + * | ! | @ | # | $ | % | ^ | & | * | F12 | F7 | F8 | F9 | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | Tab | [ | ] | - | Del | ' | ( | ) | F11 | F4 | F5 | F6 | + * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------| + * | Menu | | | = | \ | / | | | PgUp | F1 | F2 | F3 | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * |Alt/Tab| Gui | ~ |CTL/Bsp| Fn/Ent|SFT/Spc| ; | Home | PgDn | End | F10 |Adj/Ent| + * `-----------------------------------------------------------------------------------------------' + */ + +[_FN] = LAYOUT_planck_grid( + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_F12, KC_F7, KC_F8, KC_F9, + KC_TAB, KC_LBRC, KC_RBRC, KC_MINUS, KC_DELETE, KC_QUOT, KC_LPRN, KC_RPRN, KC_F11, KC_F4, KC_F5, KC_F6, + KC_MENU, _______, _______, KC_EQUAL, KC_BSLS, KC_SLSH, XXXXXXX, XXXXXXX, KC_PGUP, KC_F1, KC_F2, KC_F3, + _______, KC_LGUI, KC_GRAVE, _______, _______, _______, KC_SCLN, KC_HOME, KC_PGDN, KC_END, KC_F10, _______ +), + +/* Qwerty + * ,-----------------------------------------------------------------------------------------------. + * |Gui/Esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |-------+-------+-------+-------+-------+---------------+-------+-------+-------+-------+-------| + * | Ctrl | Q | W | E | R | T | Y | U | I | O | P | / | + * |-------+-------+-------+-------+-------+---------------+-------+-------+-------+-------+-------| + * | Shift | A | S | D | F | G | H | J | K | L | ; | " | + * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------| + * |Alt/Tab| Z | X | C | V | Fn/SPC| B | N | M | , | . |Adj/Ent| + * `-----------------------------------------------------------------------------------------------' + */ + +[_QWERTY] = LAYOUT_planck_grid( + GUI_T(KC_ESC), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_LCTL, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT, + KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + ALT_T(KC_TAB), KC_Z, KC_X, KC_C, KC_V, LT(_QW_FN, KC_SPC), KC_B, KC_N, KC_M, KC_COMM, KC_DOT, LT(_ADJ, KC_ENT) +), + +/* FN-key held (Qwerty) + * ,-----------------------------------------------------------------------------------------------. + * | Gui | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | Ctrl | ~ | [ | PgUp | ] | | | - | Up | = | | F12 | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | Shift | Tab | Home | PgDn | End | Del | | Left | Down | Right | | | + * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------| + * |Alt/Tab| | | | | Fn/Spc| | | | | Menu |Adj/Ent| + * `-----------------------------------------------------------------------------------------------' + */ + +[_QW_FN] = LAYOUT_planck_grid( + KC_LGUI, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, KC_GRAVE, KC_LBRC, KC_PGUP, KC_RBRC, XXXXXXX, XXXXXXX, KC_MINS, KC_UP, KC_EQUAL, XXXXXXX, KC_F12, + _______, KC_TAB, KC_HOME, KC_PGDN, KC_END, KC_DELETE, XXXXXXX, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, _______, _______, _______, KC_MENU, _______ +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------------------. + * | S | T | P | H | * | F | P | L | T | D | | | + * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------| + * | S | K | W | R | * | R | B | G | S | Z | | | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | # | # | # | # | | # | # | # | # | # | | | + * |-------+-------+-------+-------+-------+---------------+-------+-------+-------+-------+-------| + * | | | A | O | | E | U | | | | |Adj/Ent| + * `-----------------------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_U, KC_I, KC_O, KC_P, KC_LBRC, XXXXXXX, XXXXXXX, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, XXXXXXX, + KC_1, KC_1, KC_1, KC_1, XXXXXXX, KC_1, KC_1, KC_1, KC_1, KC_1, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LT(_ADJ, KC_ENT) +), + +/* Adjust + * ,-----------------------------------------------------------------------------------------------. + * | | | | | | | | | Insert| PrtSc | Pause | QK_BOOT | + * |-------+-------+-------+-------+-------+---------------+-------+-------+-------+-------+-------| + * | | | | | | | | CapLk |Voice +| Audio |MIDIoff| | + * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------| + * | | | | | | | | ScrLk |Voice -| Music |MIDI on| | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | | | | | | | | Numlk |Workman| Qwerty| Plover|Adj/Ent| + * `-----------------------------------------------------------------------------------------------' + */ + +[_ADJ] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_PSCR, KC_PAUSE, QK_BOOT, + _______, _______, _______, _______, _______, _______, _______, KC_CAPS, AU_NEXT, AU_TOGG, MI_OFF, _______, + _______, _______, _______, _______, _______, _______, _______, KC_SCRL, AU_PREV, MU_TOGG, MI_ON, _______, + _______, _______, _______, _______, _______, _______, _______, KC_NUM, WORKMAN, QWERTY, PLOVER, _______ +) + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); + +float tone_workman[][2] = SONG(QWERTY_SOUND); +float tone_qwerty[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); + +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +#endif + + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case WORKMAN: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_workman); + #endif + persistent_default_layer_set(1UL<<_WORKMAN); + } + return false; + break; + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_plover); + #endif + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + persistent_default_layer_set(1UL<<_PLOVER); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user(void) +{ + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user(void) +{ + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif diff --git a/keyboards/planck/keymaps/impossible/readme.md b/keyboards/planck/keymaps/impossible/readme.md new file mode 100644 index 000000000000..02c719197e99 --- /dev/null +++ b/keyboards/planck/keymaps/impossible/readme.md @@ -0,0 +1,73 @@ +# The Impossible Layout + +The Impossible Layout is named such because it manages to fit in both a numpad and an inverted-T arrow cluster into the same layer as the alpha keys. + +## Main layout + +The Impossible Layout places the middle column of the alphas onto where the punctuation keys were, moving he most used punctuation to be accessed by the thumbs. Because removing the middle columns fits with the Workman layout's philosopy, Workman is used as the basis for the layout. This means the layout should be very easy to learn for Workman users, and reasonable for Colemak users. Other space gains are made by combining keys that are only ever chorded with other non symbol keys (with function-layer alternatives where needed). + +### Alpha-numeric layer + +| | | | | | | | | | | | | +|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:| +| Q | D | R | W | B | F | U | P | J | 7 | 8 | 9 | +| A | S | H | T | G | N | E | O | I | 4 | 5 | 6 | +| Z | X | M | C | V | L | Y | K | Up | 1 | 2 | 3 | +|Alt/Tab|Gui/Esc| , |CTL/Bsp| Fn/Ent|SFT/SPC| . | Left | Down | Right | 0 |Adj/Ent| + +### Function layer + +| | | | | | | | | | | | | +|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:| +| ! | @ | # | $ | % | ^ | & | * | F12 | F7 | F8 | F9 | +| Tab | [ | ] | - | Del | ' | ( | ) | F11 | F4 | F5 | F6 | +| Menu | | | = | \ | / | | | PgUp | F1 | F2 | F3 | +|Alt/Tab| Gui | ~ |CTL/Bsp| Fn/Ent|SFT/Spc| ; | Home | PgDn | End | F10 |Adj/Ent| + +## Qwerty + +The Qwerty layer, mostly intended for gaming use, makes use of the doubled chorded/non-symbolic keys to obtain use of the entire alpha-numeric typing area. + +### Qwerty layer + +| | | | | | | | | | | | | +|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:| +|Gui/Esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | +| Ctrl | Q | W | E | R | T | Y | U | I | O | P | / | +| Shift | A | S | D | F | G | H | J | K | L | ; | " | +|Alt/Tab| Z | X | C | V | Fn/SPC| B | N | M | , | . |Adj/Ent| + +### Qwerty Fn Layer + +| | | | | | | | | | | | | +|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:| +| Gui | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | +| Ctrl | ~ | [ | PgUp | ] | | | - | Up | = | | F12 | +| Shift | Tab | Home | PgDn | End | Del | | Left | Down | Right | | | +|Alt/Tab| | | | | Fn/Spc| | | | | Menu |Adj/Ent| + +## Stenography + +The Steno/Plover layer moves the number row below the regular keys, providing a much more comfortable placement for the thumb keys. Using this layout will require a slightly different dictionary to account for different keys being adjacent to the number row. + +### Steno Layer + +| | | | | | | | | | | | | +|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:| +| S | T | P | H | * | F | P | L | T | D | | | +| S | K | W | R | * | R | B | G | S | Z | | | +| # | # | # | # | | # | # | # | # | # | | | +| | | A | O | | E | U | | | | |Adj/Ent| + +## Adjustments and Options + +In order to switch between layouts and change other keyboard settings, an adjustment layer is accessible from the same position over any layout. + +### Adjustment Layer + +| | | | | | | | | | | | | +|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:| +| | | | | | | | | Insert| PrtSc | Pause | RESET | +| | | | | | | | CapLk |Voice +| Audio |MIDIoff| | +| | | | | | | | ScrLk |Voice -| Music |MIDI on| | +| | | | | | | | Numlk |Workman| Qwerty| Plover|Adj/Ent| diff --git a/keyboards/planck/keymaps/impossible/rules.mk b/keyboards/planck/keymaps/impossible/rules.mk new file mode 100644 index 000000000000..10de3bfc0359 --- /dev/null +++ b/keyboards/planck/keymaps/impossible/rules.mk @@ -0,0 +1,19 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/planck/keymaps/inkwell/config.h b/keyboards/planck/keymaps/inkwell/config.h new file mode 100644 index 000000000000..0396720dff5b --- /dev/null +++ b/keyboards/planck/keymaps/inkwell/config.h @@ -0,0 +1,50 @@ +/* Copyright 2021 Kevin Hartley + * + * 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 10 +#define MOUSEKEY_MAX_SPEED 12 diff --git a/keyboards/planck/keymaps/inkwell/keymap.c b/keyboards/planck/keymaps/inkwell/keymap.c new file mode 100644 index 000000000000..9ff91f84c19a --- /dev/null +++ b/keyboards/planck/keymaps/inkwell/keymap.c @@ -0,0 +1,182 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ECDR | Ctrl | Alt | GUI |Space |Lower |Raise |Space | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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, + RSFT_T(KC_MPLY), KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, LOWER, RAISE, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * v-------NUM PAD------v + * ,-----------------------------------------------------------------------------------. + * | ` | ! | @ | # | * | / | 7 | 8 | 9 | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | $ | % | ^ | + | - | 4 | 5 | 6 | [ | ] | = | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Shift | & | ? | : | ~ | . | 1 | 2 | 3 | < | > |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ECDR | Ctrl | Alt | GUI |Space |Lower |Raise | 0 | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_ASTR, KC_PSLS, KC_7, KC_8, KC_9, KC_LPRN, KC_RPRN, KC_BSPC, + KC_ESC, KC_DLR, KC_PERC, KC_CIRC, KC_PLUS, KC_MINS, KC_4, KC_5, KC_6, KC_LBRC, KC_RBRC, KC_PEQL, + KC_LSFT, KC_AMPR, KC_QUES, KC_COLN, KC_TILD, KC_DOT, KC_1, KC_2, KC_3, KC_LABK, KC_RABK, KC_ENT, + RSFT_T(KC_MPLY), KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, LOWER, RAISE, KC_0, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * |SLEEP | BR- | BR+ | << | PLAY | >> | MUTE | VOL- | VOL+ | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | " | \ | [ | ] | = | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Shift | F7 | F8 | F9 | F10 | F11 | F12 | ? | : | < | > |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ECDR | Ctrl | Alt | GUI |Space |Lower |Raise |Space | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_SLEP, KC_BRID, KC_BRIU, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_LPRN, KC_RPRN, KC_BSPC, + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_DQT, KC_BSLS, KC_LBRC, KC_RBRC, KC_PEQL, + KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_QUES, KC_COLN, KC_LABK, KC_RABK, KC_ENT, + RSFT_T(KC_MPLY), KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, LOWER, RAISE, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Adjust (Lower + Raise) + * v--------MOUSE CONTROL------v + * ,-----------------------------------------------------------------------------------. + * |Reset | | | | | | |MSE-1 |MSE-2 |MSE-S0|MSE-S1| Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | CALC | MAIL | MDIA |Debug | | |MSE-L |MSE-D |MSE-U |MSE-R |RGB-TG| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Shift | | | | | | | | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ECDR | Ctrl | Alt | GUI |Space |Lower |Raise |Space | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + QK_BOOT, _______, _______, _______, _______, _______, _______, KC_BTN1, KC_MS_BTN2, KC_ACL1, KC_ACL2, KC_BSPC , + _______, KC_CALC, KC_MAIL, KC_MSEL, DB_TOGG, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, RGB_TOG, + KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT, + RSFT_T(KC_MPLY), KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, LOWER, RAISE, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (IS_LAYER_ON(_RAISE)) { + if (get_mods() & MOD_BIT(KC_RSFT)) { + // ZOOM + // Store which mods are held + uint8_t mod_state = get_mods(); + // Ignore all shift keys + del_mods(MOD_MASK_SHIFT); + if (clockwise) { + tap_code16(LGUI(KC_PPLS)); + } else { + tap_code16(LGUI(KC_PMNS)); + } + // Add back shift keys + set_mods(mod_state); + } else if (get_mods() & MOD_BIT(KC_LSFT)) { + // SCROLL X + uint8_t mod_state = get_mods(); + del_mods(MOD_MASK_SHIFT); + if (clockwise) { + tap_code16(KC_WH_L); + } else { + tap_code16(KC_WH_R); + } + set_mods(mod_state); + } else { + // SCROLL Y + if (clockwise) { + tap_code(KC_WH_U); + } else { + tap_code(KC_WH_D); + } + } + } else { + if (get_mods() & MOD_BIT(KC_RSFT)) { + // ZOOM + uint8_t mod_state = get_mods(); + del_mods(MOD_MASK_SHIFT); + if (clockwise) { + tap_code16(LGUI(KC_PPLS)); + } else { + tap_code16(LGUI(KC_PMNS)); + } + set_mods(mod_state); + } else if (get_mods() & MOD_BIT(KC_LSFT)) { + // BRIGHTNESS + uint8_t mod_state = get_mods(); + del_mods(MOD_MASK_SHIFT); + if (clockwise) { + tap_code16(KC_PAUSE); + } else { + tap_code16(KC_SCROLL_LOCK); + } + set_mods(mod_state); + } else { + // VOLUME + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + } + return true; +} diff --git a/keyboards/planck/keymaps/inkwell/readme.md b/keyboards/planck/keymaps/inkwell/readme.md new file mode 100644 index 000000000000..8a158783c6ec --- /dev/null +++ b/keyboards/planck/keymaps/inkwell/readme.md @@ -0,0 +1,19 @@ +# The Inkwell Planck Layout + +*/ +Plank keymap with Base, Lower, Raise, and Adjust layers, and 1 encoder. + +Features: +- Number Pad +- Symbol Pad +- Function Pad +- Programming utilities: ()[]{}<> +- Mouse Control +- Encoder: + - Volume (default turn) + - Brightness (shift+turn) + - Scroll Y(RSE+turn) + - Scroll X (RSE+shift+turn) + - Zoom (push+turn) + - Play/Pause (double click) +/* diff --git a/keyboards/planck/keymaps/inkwell/rules.mk b/keyboards/planck/keymaps/inkwell/rules.mk new file mode 100644 index 000000000000..afd8d7a8c6cf --- /dev/null +++ b/keyboards/planck/keymaps/inkwell/rules.mk @@ -0,0 +1,3 @@ +SRC += muse.c +ENCODER_ENABLE = yes +EXTRAKEY_ENABLE = yes diff --git a/keyboards/planck/keymaps/ishtob/config.h b/keyboards/planck/keymaps/ishtob/config.h new file mode 100755 index 000000000000..688607634c89 --- /dev/null +++ b/keyboards/planck/keymaps/ishtob/config.h @@ -0,0 +1,34 @@ + +#ifndef USERSPACE_CONFIG_H +#define USERSPACE_CONFIG_H + +#ifdef AUDIO_ENABLE + +// #define STARTUP_SONG SONG(E1M1_DOOM) +// #define GOODBYE_SONG SONG(SONIC_RING) +/* #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND), \ + } +*/ +//audio clicky + #define AUDIO_CLICKY + // to enable clicky on startup + //#define AUDIO_CLICKY_ON + #define AUDIO_CLICKY_FREQ_RANDOMNESS 1.0f + + +#endif + +#define FORCE_NKRO + +#define LEADER_TIMEOUT 300 + +#undef DEBOUNCE +#define DEBOUNCE 0 + +//skip usb startup check +//#define NO_USB_STARTUP_CHECK + + +#endif diff --git a/keyboards/planck/keymaps/ishtob/keymap.c b/keyboards/planck/keymaps/ishtob/keymap.c new file mode 100644 index 000000000000..75c581de192c --- /dev/null +++ b/keyboards/planck/keymaps/ishtob/keymap.c @@ -0,0 +1,344 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "ishtob.h" + +extern keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + ,-----------------------------------------------------------------------------------. + * |Tab/FN| Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | LCtl | A | S | D | F | G | H | J | K | L | ; |Ctl/Et| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | - | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | Caps | Alt | GUI |Lower | Space |Raise |NumLay| RAlt | Men | Del | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12_wrapper( + LT_FN(KC_TAB), _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, + KC_LCTL, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, CTL_ENT, + KC_LSFT, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, LT_RAI(KC_MINS), + KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O |Ctl/Et| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / | - | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12_wrapper( + LT_FN(KC_TAB), _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSPC, + KC_LCTL, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, KC_ENT, + KC_LSFT, _________________COLEMAK_L3________________, _________________COLEMAK_R3________________, LT_RAI(KC_MINS), + KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S |Ctl/Et| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_ortho_4x12_wrapper( + LT_FN(KC_TAB), _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSPC, + KC_LCTL, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, KC_ENT, + KC_LSFT, _________________DVORAK_L3_________________, _________________DVORAK_R3_________________, LT_RAI(KC_MINS), + KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ~ | \ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | [ | ] | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12_wrapper( + ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_GRV, KC_BSLS, + _______, __________________LONG_FUNC_LEFT___________________, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_PIPE, + _______, __________________LONG_FUNC_RIGHT__________________,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | * | \ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | A | Up | D | | Vol+ | 4 | 5 | 6 | + | : | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Lt | Dn | Rt | Mute | Vol- | 1 | 2 | 3 | Up | / | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | 0 | | Left | Down | Right| NumLk| + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12_wrapper( + ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_PLUS, KC_BSLS, + _______, KC_A, KC_UP, KC_D, KC_PSCR, KC_VOLU, KC_4, KC_5, KC_6, KC_PAST, KC_COLN, KC_QUOT, + _______, KC_LEFT, KC_DOWN, KC_RIGHT,KC_MUTE, KC_VOLD, KC_1, KC_2, KC_3, KC_UP, KC_SLSH, _______, + _______, _______, _______, _______, _______, KC_SPC, KC_0, _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NUM +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_ortho_4x12_wrapper( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* FN layer on Esc key + * ,-----------------------------------------------------------------------------------. + * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | + | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | = | [ | ] | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | { | } |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_FNLAYER] = LAYOUT_ortho_4x12_wrapper( + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PLUS, + _______, __________________LONG_FUNC_LEFT___________________, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT, + _______, __________________LONG_FUNC_RIGHT__________________,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Num Layer + * ,-----------------------------------------------------------------------------------. + * | | Q | Up | 4 | | | 7 | 8 | 9 | - | + | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Lt | Dn | Rt | | | 4 | 5 | 6 | * | : | ENT | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Z | X | C | V | | 1 | 2 | 3 | . | / | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | 0 | . | Exit | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_NUMLAY] = LAYOUT_ortho_4x12_wrapper( + _______, KC_Q, KC_UP, KC_H, XXXXXXX, XXXXXXX, KC_P7, KC_P8, KC_P9, KC_MINS, KC_PLUS, KC_BSPC, + _______, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, XXXXXXX, KC_P4, KC_P5, KC_P6, KC_PAST, KC_COLN, KC_ENT, + _______, KC_Z, KC_X, KC_C, KC_V, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_PDOT, KC_PSLS, _______, + _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, _______, _______, KC_NUM, KC_MPLY +), + +/* Mouse Layer (semi-col) + * ,-----------------------------------------------------------------------------------. + * | ACCL0| ACCL1| ACCL2|Email |Email2| Home | Wh_Up| WHL_L| M_Up | WHL_R|PASS| Meta | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | |RT Q6H| End | Wh_Dn| M_Lft| M_Dn | M_Rt | | DayRn| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | BTN2 | BTN3 | BTN4 | BTN5 | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | BTN1 | | | | Citx | | + * `-----------------------------------------------------------------------------------' + */ + +[_MOUSECURSOR] = LAYOUT_ortho_4x12_wrapper( + KC_ACL0, KC_ACL1, KC_ACL2, M_EMAIL,M_EMAIL2, KC_HOME, KC_PGUP, KC_WH_L, KC_MS_U, KC_WH_R, P_MPASS, P_META, + _______, XXXXXXX, XXXXXXX, XXXXXXX, O_RTQ6H, KC_END , KC_PGDN, KC_MS_L, KC_MS_D, KC_MS_R, _______, O_DAYRN, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______, + _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, P_CITRIX, O_AUTODC +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | Reset|RGB TG|RGB ST|RGBH -|RGBH +|RGBS -|RGBS +|RGBV -|RGBV +| | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff| | | | | BL + |BL ST |BL TG | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12_wrapper( + DFU, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, KC_DEL, + _______, MAGIC_TOGGLE_NKRO, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, BL_DOWN,BL_UP, BL_STEP, BL_TOGG, + _______, _______, _______, _______, _______, _______, _______, _______, CK_RST, CK_DOWN, CK_UP, CK_TOGG +) + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +// Helper Functions +void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; + + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(tone_plover); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_plover_gb); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +void matrix_init_keymap(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user(void) +{ + #ifdef RGB_MATRIX_ENABLE + rgblight_mode(RGB_MATRIX_CYCLE_ALL); + #endif //RGB_matrix + wait_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user(void) +{ + PLAY_SONG(tone_goodbye); + wait_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif + diff --git a/keyboards/planck/keymaps/ishtob/readme.md b/keyboards/planck/keymaps/ishtob/readme.md new file mode 100644 index 000000000000..108b9ee0c3e9 --- /dev/null +++ b/keyboards/planck/keymaps/ishtob/readme.md @@ -0,0 +1,16 @@ +![Planck Layout Image](https://i.imgur.com/yKewjWW.jpg) + +#Ishtob's personal planck layout + +This is the default layout used with my planck light, though the rest of the keymap could also be used for the full sized planck or let's split. + + +Main difference with the default layout: + +* Tab take the upper left key, made into a Tap layer to access the symbols from the number row + +* Esc moved to lower corner + +* Capslock is on the base layer as it is used quite often with my work's software + +* Numbers layer on lower is positioned to resemble a numpad with 5 taking the location of J for the homing bump and easier entry diff --git a/keyboards/planck/keymaps/ishtob/rules.mk b/keyboards/planck/keymaps/ishtob/rules.mk new file mode 100644 index 000000000000..62ed57bb93b2 --- /dev/null +++ b/keyboards/planck/keymaps/ishtob/rules.mk @@ -0,0 +1,18 @@ +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +CUSTOM_MATRIX = yes # Custom matrix file +AUDIO_ENABLE = yes +ENCODER_ENABLE = yes + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/jasperla/config.h b/keyboards/planck/keymaps/jasperla/config.h new file mode 100644 index 000000000000..dc2a7369b4d2 --- /dev/null +++ b/keyboards/planck/keymaps/jasperla/config.h @@ -0,0 +1,10 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) +#endif + +/* + * MIDI options + */ +#define MIDI_BASIC diff --git a/keyboards/planck/keymaps/jasperla/keymap.c b/keyboards/planck/keymaps/jasperla/keymap.c new file mode 100644 index 000000000000..06f43b74108d --- /dev/null +++ b/keyboards/planck/keymaps/jasperla/keymap.c @@ -0,0 +1,136 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _POINTER, + _ADJUST +}; + +#define QWERTY 0 + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define PT MO(_POINTER) + +/* ALT+F12 is mapped (in software) to lock the user's display */ +#define LOCK LALT(KC_F12) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | | LGUI | Alt |Lower | SPC | Enter|Raise |Point.| | LOCK | Ctrl | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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_RSFT, + KC_LCTL, _______, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, PT, _______, LOCK, KC_RCTL +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | INS |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Pointers + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | Up | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | Left | Down | Right| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_POINTER] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, PT, _______, _______, _______ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, _______, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} diff --git a/keyboards/planck/keymaps/jasperla/readme.md b/keyboards/planck/keymaps/jasperla/readme.md new file mode 100644 index 000000000000..381667c73a38 --- /dev/null +++ b/keyboards/planck/keymaps/jasperla/readme.md @@ -0,0 +1,7 @@ +# jasperla's keymap for Planck + +Slightly adjusted from the default keymap: +- map the arrow keys to IJKL on a separate "pointers" layer +- return key is next to the space key, and an RSHIFT is mapped + to where return used to be +- removed the dvorak, colemak and plover layers diff --git a/keyboards/planck/keymaps/jasperla/rules.mk b/keyboards/planck/keymaps/jasperla/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/jasperla/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/jcorrado/keymap.c b/keyboards/planck/keymaps/jcorrado/keymap.c new file mode 100644 index 000000000000..35ca76d5176e --- /dev/null +++ b/keyboards/planck/keymaps/jcorrado/keymap.c @@ -0,0 +1,115 @@ +/* Copyright 2015-2017 Jack Humbert + * Copyright 2018 Jereme Corrado + * + * 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 QMK_KEYBOARD_H + +enum { + _QWERTY = 0, + _NUM, + _SYM_L, + _SYM_R +}; + +#define LMOD_0 LT(_SYM_L, KC_TAB) /* Tab, hold: Sym layer */ +#define LMOD_1 LT(_NUM, KC_ESC) /* Esc, hold: Num layer */ +#define LMOD_2 LSFT_T(KC_CAPS) /* Caps Lock, hold: Left Shift */ + +#define RMOD_0 LT(_SYM_R, KC_BSPC) /* Backspace, hold: Sym layer */ +#define RMOD_1 LT(_NUM, KC_QUOT) /* Quote, hold: Nu layer */ +#define RMOD_2 RSFT_T(KC_ENT) /* Enter, hold: Right Shift */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Tab/ | Q | W | E | R | T | Y | U | I | O | P | BacSp/ | + * | Sym | | | | | | | | | | | Sym | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Esc/ | A | S | D | F | G | H | J | K | L | : | " | + * | Num | | | | | | | | | | ; | '/Num | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | CapLk/ | Z | X | C | V | B | N | M | < | > | ? | Shift/ | + * | Shift | | | | | | | | , | . | / | Enter | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Toggle | ~ | {pipe} | Alt | Ctrl | Space | Space | Ctrl | Alt | { | } | | + * | Num | ` | \ | | | | | | | [ | ] | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + */ + +[_QWERTY] = LAYOUT_planck_grid( + LMOD_0, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, RMOD_0, + LMOD_1, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, RMOD_1, + LMOD_2, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RMOD_2, + _______, KC_GRV, KC_BSLS, KC_LALT, KC_LCTL, KC_SPC, KC_SPC, KC_RCTL, KC_RALT, KC_LBRC, KC_RBRC, _______ +), + + +/* + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | = | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | Left | Down | Up | Right | | | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | Home | PgDown | PgUp | End | | | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + */ + +[_NUM] = LAYOUT_planck_grid( + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + + +/* + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | + | ! | @ | # | $ | % | ^ | & | * | ( | ) | _ | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | | | | | | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + */ + +[_SYM_L] = LAYOUT_planck_grid( + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, _______, _______, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_SYM_R] = LAYOUT_planck_grid( + KC_PLUS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, _______, _______, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; diff --git a/keyboards/planck/keymaps/jcorrado/readme.md b/keyboards/planck/keymaps/jcorrado/readme.md new file mode 100644 index 000000000000..3a600dea1688 --- /dev/null +++ b/keyboards/planck/keymaps/jcorrado/readme.md @@ -0,0 +1,9 @@ +# jcorrado Planck keymap + +A keymap for the Planck modeled after the way I remap my Kinesis +Advantage keyboards. + +The layout is designed to minimize awkward contortions: all modifier and +layer-activation combinations can be performed with either hand's thumb +and pinky. This leaves the other hand free to complete commands +comfortably. diff --git a/keyboards/planck/keymaps/jdelkins/config.h b/keyboards/planck/keymaps/jdelkins/config.h new file mode 100644 index 000000000000..67ebf4695581 --- /dev/null +++ b/keyboards/planck/keymaps/jdelkins/config.h @@ -0,0 +1,61 @@ + /* Copyright 2020 Joel Elkins + * + * 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +#define AUTO_SHIFT_TIMEOUT 160 +#define AUTO_SHIFT_REPEAT +#define RGBLIGHT_LAYERS +#define LEADER_TIMEOUT 400 +#define LEADER_PER_KEY_TIMING +#define USB_MAX_POWER_CONSUMPTION 100 diff --git a/keyboards/planck/keymaps/jdelkins/keymap.c b/keyboards/planck/keymaps/jdelkins/keymap.c new file mode 100644 index 000000000000..ecb49da40687 --- /dev/null +++ b/keyboards/planck/keymaps/jdelkins/keymap.c @@ -0,0 +1,506 @@ +/* Copyright 2015-2017 Jack Humbert + * Portions Copyright 2020 Joel Elkins + * + * 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 "jdelkins.h" +#include "muse.h" + +#ifdef LAYOUT +#undef LAYOUT +#endif +#define LAYOUT LAYOUT_planck_2x2u + +uint16_t bspc_timer; + +enum { + MY_BSPC = USER_SAFE_RANGE, + BACKLIT, +}; + +// recycle unused layers defined in my userspace +#define _RAISE _FUNC +#define _LOWER _SECRETS + +#define KP MO(_KP) +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +int ctl_state = 0; + +void ctl_finished(tap_dance_state_t *state, void *user_data) { + ctl_state = cur_dance(state); + switch (ctl_state) { + case SINGLE_TAP: leader_start(); break; + case SINGLE_HOLD: register_code(KC_LCTL); break; + case DOUBLE_TAP: tap_code(KC_RCTL); break; + case DOUBLE_HOLD: register_code(KC_RCTL); break; + case TRIPLE_TAP: tap_code(KC_RCTL); tap_code(KC_RCTL); break; + case TRIPLE_HOLD: tap_code(KC_RCTL); register_code(KC_RCTL); break; + } +} + +void ctl_reset(tap_dance_state_t *state, void *user_data) { + switch (ctl_state) { + case SINGLE_HOLD: unregister_code(KC_LCTL); break; + case DOUBLE_HOLD: + case TRIPLE_HOLD: unregister_code(KC_RCTL); break; + } + ctl_state = 0; +} + +void g_finished(tap_dance_state_t *state, void *user_data) { + switch (cur_dance(state)) { + case SINGLE_TAP: + tap_code16(C(KC_END)); + break; + case DOUBLE_TAP: + tap_code16(C(KC_HOME)); + break; + } +} + +int kp_state = 0; + +void kp_finished(tap_dance_state_t *state, void *user_data) { + kp_state = hold_cur_dance(state); + switch (kp_state) { + case SINGLE_HOLD: layer_on(_KP); break; + case DOUBLE_HOLD: layer_on(_RPT); break; + } +} + +void kp_reset(tap_dance_state_t *state, void *user_data) { + switch (kp_state) { + case SINGLE_HOLD: layer_off(_KP); break; + case DOUBLE_HOLD: layer_off(_RPT); break; + } + kp_state = 0; +} + +enum { + TD_LDCTL, + TD_G, + TD_KP +}; + +tap_dance_action_t tap_dance_actions[] = { + [TD_LDCTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctl_finished, ctl_reset), + [TD_G] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, g_finished, NULL), + [TD_KP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, kp_finished, kp_reset), +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | ` | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Gui | Alt |Keypad| Bksp | Space | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_GRV, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + TD(TD_LDCTL), MO(_ADJUST), MY_GUI, MY_ALT, MY_BSPC, MY_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Same as _QWERTY but disable wutoshift */ +[_RPT] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_GAME] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_NO, KC_LALT, RAISE, KC_SPC, KC_SPC, _______, _______, _______, _______ +), + +[_RAISE] = LAYOUT( + KC_ESC, _______, FW_WRD, KB_EOL, TG(_RPT), _______, KB_COPY, KC_PGUP, _______, KC_LPRN, KC_RPRN, KC_MINS, + KC_RCTL, KB_BOL, _______, KC_PGDN, _______, TD(TD_G), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, KC_BSLS, + _______, _______, KC_DEL, KC_CAPS, KB_PASTE, BK_WRD, _______, _______, _______, _______, _______, MY_CALC, + KC_RCTL, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +[_KP] = LAYOUT( + KC_ESC, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_F14, KC_7, KC_8, KC_9, KC_MINS, KC_EQL, + _______, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, XXXXXXX, KC_4, KC_5, KC_6, KC_ASTR, _______, + KC_NUM, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, KC_SLSH, _______, + _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_PLUS, KC_END +), + +[_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LCBR, KC_RCBR, KC_EQL, + _______, _______, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, _______, _______, _______, KC_LBRC, KC_RBRC, KC_PIPE, + _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, _______, _______, _______, KC_HOME, KC_END, KC_MPLY, + _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT +), + +[_ADJUST] = LAYOUT( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL, + KC_RCTL, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, TG(_KP), KC_BRID, KC_BRIU, KC_MUTE, + _______, RGB_TOG, KB_MAKE, KB_FLSH, KB_VRSN, KB_BOOT, _______, TG_SYS, _______, _______, _______, KC_MPLY, + KC_RCTL, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT +) + +/* [_ADJUST] = LAYOUT( */ +/* _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , */ +/* _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, */ +/* _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, */ +/* _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ */ +/* ) */ + +}; + +/* plwnck rev6 RGB layout: + * ---------------------------------- + * | 6 5 4 3 | + * | 0 | + * | 7 8 1 2 | + * ---------------------------------- + */ + +const rgblight_segment_t PROGMEM rpt_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {1, 2, HSV_PINK}, + {7, 2, HSV_PINK} +); + +const rgblight_segment_t PROGMEM game_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {2, 2, HSV_RED}, + {6, 2, HSV_RED} +); + +const rgblight_segment_t PROGMEM raise_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {3, 4, HSV_GREEN} +); + +const rgblight_segment_t PROGMEM kp_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {1, 8, HSV_ORANGE} +); + +const rgblight_segment_t PROGMEM lower_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {3, 4, HSV_BLUE} +); + +const rgblight_segment_t PROGMEM adjust_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {1, 8, HSV_BLUE} +); + +const rgblight_segment_t PROGMEM capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {1, 1, HSV_WHITE}, + {8, 1, HSV_WHITE} +); + +const rgblight_segment_t PROGMEM numlock_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {6, 2, HSV_PURPLE} +); + +enum rgb_layer_index { + L_RPT, + L_GAME, + L_RAISE, + L_KP, + L_LOWER, + L_ADJUST, + L_CAPSLOCK, + L_NUMLOCK +}; + +const rgblight_segment_t * const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( + [L_RPT] = rpt_layer, + [L_GAME] = game_layer, + [L_RAISE] = raise_layer, + [L_KP] = kp_layer, + [L_LOWER] = lower_layer, + [L_ADJUST] = adjust_layer, + [L_CAPSLOCK] = capslock_layer, + [L_NUMLOCK] = numlock_layer +); + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_keymap(layer_state_t state) { + rgblight_set_layer_state(L_RPT, layer_state_cmp(state, _RPT)); + rgblight_set_layer_state(L_GAME, layer_state_cmp(state, _GAME)); + rgblight_set_layer_state(L_RAISE, layer_state_cmp(state, _RAISE)); + rgblight_set_layer_state(L_KP, layer_state_cmp(state, _KP)); + rgblight_set_layer_state(L_LOWER, layer_state_cmp(state, _LOWER)); + rgblight_set_layer_state(L_ADJUST, layer_state_cmp(state, _ADJUST)); + rgblight_set_layer_state(L_CAPSLOCK, CAPSLOCK_ON); + rgblight_set_layer_state(L_NUMLOCK, NUMLOCK_ON && layer_state_cmp(state, _KP)); + if (layer_state_cmp(state, _GAME) || layer_state_cmp(state, _RPT)) + autoshift_disable(); + else + autoshift_enable(); + return update_tri_layer_state(state, _KP, _RAISE, _LOWER); +} + +bool led_update_user(led_t led_state) { + rgblight_set_layer_state(L_CAPSLOCK, led_state.caps_lock); + rgblight_set_layer_state(L_NUMLOCK, led_state.num_lock && layer_state_is(_KP)); + return true; +} + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + bool rc = true; + static bool bspc_del = false; + static bool bspc_initiated_func = false; + + switch (keycode) { + case MY_BSPC: + if (record->event.pressed) { + if (IS_LAYER_ON(_KP)) { + // special case: if _KP was turned on by another key, + // treat this as KC_DEL and don't do anything else + bspc_del = true; + register_code(KC_DEL); + return false; + } else { + bspc_timer = timer_read(); + bspc_initiated_func = true; + layer_on(_KP); + } + } else { + if (bspc_del) { + // special case: if _KP was turned on by another key, + // treat this as KC_DEL and don't do anything else + unregister_code(KC_DEL); + bspc_del = false; + return false; + } + + if (bspc_initiated_func) { + layer_off(_KP); + bspc_initiated_func = false; + } + + if (bspc_timer > 0) { + // here the key was pressed and released before the timer + // expired, so treat as a backspace tap and pretend we + // never activated _KP + bspc_timer = 0; + tap_code(KC_BSPC); + } else { + // the timer went off, so KC_BSPC was registered in + // matrix_scan_keymap. unregister it now + unregister_code(KC_BSPC); + } + } + return false; // special case, return now without resetting timer + // other paths should set rc and break + break; + + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); +#ifdef BACKLIGHT_ENABLE + backlight_step(); +#endif + } else { + unregister_code(KC_RSFT); + } + rc = false; + break; + } + + bspc_timer = 0; + return rc; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_song); } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_gb_song); } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } + return true; +} + +void keyboard_post_init_keymap(void) { + rgblight_layers = my_rgb_layers; + bspc_timer = 0; +} + +void leader_end_user(void) { + if (leader_sequence_one_key(KC_K)) { + layer_invert(_KP); + } + if (leader_sequence_one_key(KC_G)) { + layer_invert(_GAME); + } + if (leader_sequence_one_key(KC_KP_5)) { + layer_invert(_KP); + } + if (leader_sequence_one_key(KC_5)) { + layer_invert(_KP); + } + if (leader_sequence_two_keys(KC_SCLN, KC_1)) { + send_secret_string(0); + } + if (leader_sequence_two_keys(KC_SCLN, KC_2)) { + send_secret_string(1); + } + if (leader_sequence_two_keys(KC_SCLN, KC_3)) { + send_secret_string(2); + } + if (leader_sequence_two_keys(KC_SCLN, KC_4)) { + send_secret_string(3); + } + if (leader_sequence_two_keys(KC_SCLN, KC_5)) { + send_secret_string(4); + } + if (leader_sequence_two_keys(KC_SCLN, KC_6)) { + send_secret_string(5); + } + if (leader_sequence_two_keys(KC_SCLN, KC_M)) { + send_secret_string(0); + } + if (leader_sequence_two_keys(KC_SCLN, KC_COMM)) { + send_secret_string(1); + } + if (leader_sequence_two_keys(KC_SCLN, KC_DOT)) { + send_secret_string(2); + } + if (leader_sequence_two_keys(KC_SCLN, KC_J)) { + send_secret_string(3); + } + if (leader_sequence_two_keys(KC_SCLN, KC_K)) { + send_secret_string(4); + } + if (leader_sequence_two_keys(KC_SCLN, KC_L)) { + send_secret_string(5); + } + if (leader_sequence_one_key(KC_C)) { + tap_code16(C(KC_C)); + } + // neovim: terminal escape + if (leader_sequence_one_key(KC_QUOT)) { + tap_code16(C(KC_BSLS)); + tap_code16(C(KC_N)); + } +} + +void matrix_scan_keymap(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif + // if MY_BSPC is held down too long, pretend like it wasn't and start + // pressing backspace + if (bspc_timer > 0 && timer_elapsed(bspc_timer) > LEADER_TIMEOUT) { + layer_off(_KP); + bspc_timer = 0; + register_code(KC_BSPC); + } +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/jdelkins/readme.md b/keyboards/planck/keymaps/jdelkins/readme.md new file mode 100644 index 000000000000..5149c7668d23 --- /dev/null +++ b/keyboards/planck/keymaps/jdelkins/readme.md @@ -0,0 +1,13 @@ +# jdelkins layout + +Features: + +- 2x2u layout with the split spaces both operating as layer keys +- No top row numbers; rely on a keypad layer +- My typical leader setup for toggling modes, accessing secrets, etc. + + +# TODO + +- Add/improve audio features +- Fix \_ADJUST layer - there's a bunch of junk on there that needs cleanng up. diff --git a/keyboards/planck/keymaps/jdelkins/rules.mk b/keyboards/planck/keymaps/jdelkins/rules.mk new file mode 100644 index 000000000000..f17e67c234d7 --- /dev/null +++ b/keyboards/planck/keymaps/jdelkins/rules.mk @@ -0,0 +1,4 @@ +SRC += muse.c +LEADER_ENABLE = yes +TAP_DANCE_ENABLE = yes +AUTO_SHIFT_ENABLE = yes diff --git a/keyboards/planck/keymaps/jeremy-dev/keymap.c b/keyboards/planck/keymaps/jeremy-dev/keymap.c new file mode 100644 index 000000000000..787bdd23c1b7 --- /dev/null +++ b/keyboards/planck/keymaps/jeremy-dev/keymap.c @@ -0,0 +1,177 @@ +// This is the personal keymap of Jeremy Cowgar (@jcowgar). It is written for the programmer. + +// Configuration options + +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +enum my_layers { + ALPH = 0, + NUMS, + CURS, + SYMB, + FKEY +}; + +// Each macro gets a name for readability. +enum my_keycodes { + MY_ABVE = SAFE_RANGE, + MY_BELW, + MY_TERM, + MY_DEQL, // /= + MY_MEQL, // *= + MY_SEQL, // -= + MY_PEQL, // += + MY_NEQL, // != + MY_LTGT, // <> + MY_DPIP, // || + MY_DAMP, // && +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [ALPH] = LAYOUT_planck_grid( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_LPRN, KC_RPRN, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_LCBR, KC_RCBR, KC_N, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH), + CTL_T(KC_TAB), OSL(FKEY), OSL(NUMS), OSL(SYMB), KC_SPC, ALT_T(KC_BSPC), GUI_T(KC_DEL), KC_ENT, OSL(SYMB), OSL(CURS), TG(CURS), CTL_T(KC_ESC) + ), + [NUMS] = LAYOUT_planck_grid( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_COMM, KC_7, KC_8, KC_9, KC_SLSH, + KC_LSFT, KC_LGUI, KC_LALT, KC_LCTL, KC_NO, KC_TRNS, KC_TRNS, KC_LPRN, KC_4, KC_5, KC_6, KC_ASTR, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_RPRN, KC_1, KC_2, KC_3, KC_MINS, + KC_NO, KC_NO, KC_TRNS, TG(NUMS), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_DOT, KC_EQL, KC_PLUS + ), + [CURS] = LAYOUT_planck_grid( + KC_MPLY, KC_BSPC, KC_UP, KC_DEL, KC_PGUP, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_TRNS, KC_TRNS, KC_NO, KC_LCTL, KC_LALT, KC_LGUI, KC_LSFT, + KC_VOLD, KC_NO, MY_ABVE, MY_TERM, KC_NO, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_LSFT, + KC_MUTE, KC_NO, MY_BELW, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_NO + ), + [SYMB] = LAYOUT_planck_grid( + MY_DEQL, MY_MEQL, MY_SEQL, MY_PEQL, MY_NEQL, KC_NO, KC_NO, MY_LTGT, KC_LABK, KC_RABK, KC_COLN, KC_DLR, + KC_SLSH, KC_ASTR, KC_MINS, KC_PLUS, KC_EQL, KC_NO, KC_PIPE, MY_DPIP, KC_GRV, KC_QUOT, KC_DQUO, KC_HASH, + KC_BSLS, KC_CIRC, KC_PERC, KC_UNDS, KC_NO, KC_NO, KC_AMPR, MY_DAMP, KC_TILD, KC_AT, KC_EXLM, KC_QUES, + KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO + ), + [FKEY] = LAYOUT_planck_grid( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F9, KC_F10, KC_F11, KC_F12, + KC_LSFT, KC_LGUI, KC_LALT, KC_LCTL, KC_NO, KC_NO, KC_NO, KC_NO, KC_F5, KC_F6, KC_F7, KC_F8, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, + KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + ) +}; + +void press_key(uint16_t key) { + register_code(key); + unregister_code(key); +} + +void press_two_keys(uint16_t key1, uint16_t key2) { + register_code(key1); + register_code(key2); + unregister_code(key2); + unregister_code(key1); +} + +void press_three_keys(uint16_t key1, uint16_t key2, uint16_t key3) { + register_code(key1); + register_code(key2); + register_code(key3); + unregister_code(key3); + unregister_code(key2); + unregister_code(key1); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case MY_BELW: + if (record->event.pressed) { + press_two_keys(KC_LGUI, KC_RGHT); + press_key(KC_ENT); + } + + return false; + + case MY_ABVE: + if (record->event.pressed) { + press_two_keys(KC_LGUI, KC_LEFT); + press_key(KC_ENT); + press_key(KC_UP); + } + + return false; + + case MY_TERM: + if (record->event.pressed) { + press_three_keys(KC_LGUI, KC_LSFT, KC_ENT); + } + + return false; + + case MY_DEQL: // /= + if (record->event.pressed) { + press_key(KC_SLSH); + press_key(KC_EQL); + } + + return false; + + case MY_MEQL: // *= + if (record->event.pressed) { + press_two_keys(KC_LSFT, KC_ASTR); + press_key(KC_EQL); + } + + return false; + + case MY_SEQL: // -= + if (record->event.pressed) { + press_key(KC_MINS); + press_key(KC_EQL); + } + + return false; + + case MY_PEQL: // += + if (record->event.pressed) { + press_two_keys(KC_LSFT, KC_PLUS); + press_key(KC_EQL); + } + + return false; + + case MY_NEQL: // != + if (record->event.pressed) { + press_two_keys(KC_LSFT, KC_EXLM); + press_key(KC_EQL); + } + + return false; + + case MY_LTGT: // <> + if (record->event.pressed) { + press_two_keys(KC_LSFT, KC_LABK); + press_two_keys(KC_LSFT, KC_RABK); + } + + return false; + + case MY_DPIP: // || + if (record->event.pressed) { + press_two_keys(KC_LSFT, KC_PIPE); + press_two_keys(KC_LSFT, KC_PIPE); + } + + return false; + + case MY_DAMP: // && + if (record->event.pressed) { + press_two_keys(KC_LSFT, KC_AMPR); + press_two_keys(KC_LSFT, KC_AMPR); + } + + return false; + } + + return true; +} diff --git a/keyboards/planck/keymaps/jeremy-dev/readme.md b/keyboards/planck/keymaps/jeremy-dev/readme.md new file mode 100644 index 000000000000..b6a402d698c7 --- /dev/null +++ b/keyboards/planck/keymaps/jeremy-dev/readme.md @@ -0,0 +1,85 @@ +Jeremy Cowgar's Planck Keymap +============================= + +I am a programmer by trade and suffer from the beginning stages of RSI. As a programmer, I use letters, symbols and cursor navigation most often. To prevent strange finger gymnastics, I wrote a script to rank which non-letter characters occurred in my primary source projects most often and then placed these characters in the easiest to reach locations, within reason and for me. I made heavy use of momentary layer toggling. + +Layers +------ + +The key mapping is made up of 5 layers: Letters, Symbols, Navigation, Numbers, and Function Keys. + +The layout can be viewed visually at: + +http://www.keyboard-layout-editor.com/#/gists/319474e5e2d199e583371ed1d2aec316 + +* Purple buttons are dual function keys. +* Green buttons are layer momentary toggle keys. +* Red buttons are layer persistent toggle keys. + +The keys have multiple symbols: + +* Upper left: standard layer, the letter layer +* Upper right: function layer +* Lower left: navigation layer +* Lower right: symbol layer + +The symbols in the layout editor are not entirely clear. + +The Z and ? keys double as shift keys. Hold for a shift, tap for a Z or ? + +The bottom row from left to right: + +* Tab when pressed, Control when held. It also is the volume mute key when in the "Navigation" layer +* Function layer momentary toggle +* Number layer momentary toggle +* Symbol layer momentary toggle. When in the "Number" layer, this key also makes the "Number" layer sticky for using the 10 key for quite a bit of entry +* Space +* Backspace when tapped, Option when held +* Delete when tapped, Command when held +* Return +* Symbol layer momentary toggle. When in the "Number" layer, key also is the zero key. +* Navigation layer momentary toggle +* Navigation layer toggle. This was included for when you are browsing a website, document or otherwise wish to stay in navigation mode. When in the "Number" layer, the key is the = symbol +* Escape when pressed, Control when held. When in the "Number" layer, the key is the + symbol + +General Notes +------------- + +The letter layer is separated by 2 center rows of keys. This spreads the hands out a little further which helps not twist the wrists as much. The 2 center rows are [], (), [], and Ctrl and Alt keys. + +The symbol layer keys are accessed by the thumbs. They are the closest to the thumbs, instead of the number toggle, because in my code I found I used symbols much more often than numbers. There are two symbol layer keys because the symbols spread across the right and left half of the keyboard. Thus, some symbols are easier hit with the left hand modifier or right hand modifier. + +The number layer key is only accessible by the left thumb because all of the number keys are on the right side of the keyboard. When in the number layer, you can press the key to the right to make that layer sticky when you are going to do a lot of number entry. + +The function layer key is only accessible by the left thumb because all of the function keys are on the right side of the keyboard. + +The navigation layer key is only accessible by the right thumb because all of the navigation keys are on the left side of the keyboard. You can press the key to the right of the navigation layer to make the navigation layer sticky when you are doing a lot of navigation, reading a web page for example. + +When using the number or navigation layers, the same hand that accesses the momentary layer toggle key also has the 4 primary modifiers under their home row. + +* Pointer finger is control +* Middle finger is option +* Ring finger is command +* Pinky finger is shift + +This is so you can easily press Cmd+Shift+F4 or when navigating, select text or words of text by pressing Shift+Control, for example. + +Some keys are duplicated. For example, () are available in easy to reach locations while in the Number layer because they are often used in math. + +The symbol layer has additional helpers for programming including a single keys that enter /=, \*=, -=, +=, !=, <>, ||, and &&. It also includes three special Return keys on the left: + +* Up CR which moves the cursor up, to the end of the line and then presses CR +* Down CR which moves the cursor to the end of the line and then presses CR +* Right ; which moves the cursor to the end of the line and presses ; for C styled languages, such as JavaScript which is a primary language I use + +Word of Warning +--------------- + +I have been using the keymap for some time now and believe it to be a good keymap. There are a few things through the week that I wonder if it would have been better if this key were moved to that location. + +This keymap may change for further optimization. + +Please Give Feedback! +--------------------- + +I am very interested in your feedback. Send me a message here on GitHub, r/jcowgar or @jcowgar. diff --git a/keyboards/planck/keymaps/jetpacktuxedo/config.h b/keyboards/planck/keymaps/jetpacktuxedo/config.h new file mode 100644 index 000000000000..c3c4a682cf81 --- /dev/null +++ b/keyboards/planck/keymaps/jetpacktuxedo/config.h @@ -0,0 +1,31 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + #define AUDIO_CLICKY +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/jetpacktuxedo/keymap.c b/keyboards/planck/keymaps/jetpacktuxedo/keymap.c new file mode 100644 index 000000000000..443164aba44b --- /dev/null +++ b/keyboards/planck/keymaps/jetpacktuxedo/keymap.c @@ -0,0 +1,303 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + PLOVER, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | Up |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Brite | Ctrl | Alt | GUI |Lower | Space |Raise | / | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + QK_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSFT, + RGB_TOG, KC_LCTL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | _ | + | " | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | { | } | PgUp | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | Home | PgDn | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + _______, _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_DQUO, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_LCBR, KC_RCBR, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, KC_HOME, KC_PGDN, KC_END +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | - | = | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | [ | ] | PgUp | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | \ | Home | PgDn | End | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_QUOT, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_BSLS, KC_HOME, KC_PGDN, KC_END +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | Exit | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + EXT_PLV, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + XXXXXXX, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | |Plover| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, QK_BOOT, + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 20; + +extern float clicky_rand; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (is_clicky_on()) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + clicky_rand += 0.5f; + } else { + clicky_rand -= 0.5f; + } + } else { + if (clockwise) { + clicky_freq_up(); + } else { + clicky_freq_down(); + } + } + } else if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + register_code(KC_RGHT); + unregister_code(KC_RGHT); + } else { + register_code(KC_LEFT); + unregister_code(KC_LEFT); + } + } else { + if (clockwise) { + register_code(KC_DOWN); + unregister_code(KC_DOWN); + } else { + register_code(KC_UP); + unregister_code(KC_UP); + } + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + break; + case 3: + if (active) { + clicky_on(); + } else { + clicky_off(); + } + } + return true; +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/jetpacktuxedo/rules.mk b/keyboards/planck/keymaps/jetpacktuxedo/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/jetpacktuxedo/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/jhenahan/config.h b/keyboards/planck/keymaps/jhenahan/config.h new file mode 100644 index 000000000000..67c09548fcfd --- /dev/null +++ b/keyboards/planck/keymaps/jhenahan/config.h @@ -0,0 +1,30 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#define FORCE_NKRO +#undef WORKMAN_SOUND +#define WORKMAN_SOUND COLEMAK_SOUND + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif diff --git a/keyboards/planck/keymaps/jhenahan/keymap.c b/keyboards/planck/keymaps/jhenahan/keymap.c new file mode 100644 index 000000000000..21c489922da4 --- /dev/null +++ b/keyboards/planck/keymaps/jhenahan/keymap.c @@ -0,0 +1,303 @@ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _WORKMAN 0 +#define _DEAD 1 +#define _QWERTY 2 +#define _LOWER 3 +#define _RAISE 4 +#define _PLOVER 5 +#define _ADJUST 16 + +enum planck_keycodes { + WORKMAN = SAFE_RANGE, + DEAD, + QWERTY, + LOWER, + RAISE, + PLOVER, + EXT_PLV, + TOG_PLV +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + +/* Workman + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | D | R | W | B | J | F | U | P | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | H | T | G | Y | N | E | O | I | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | M | C | V | K | L | Dead | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_WORKMAN] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSPC, + MT(MOD_LCTL,KC_ESC), KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, DEAD, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Workman Dead Layer + * ,-----------------------------------------------------------------------------------. + * | | % | & | ? | + | @ | $ | _ | [ | ] | ! | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | / | ( | = | 0 | { | } | 1 | * | ) | - | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | 6 | 7 | 8 | 9 | | | \ | 2 | 3 | 4 | 5 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | < | ~ | ` | , | # | ^ | > | | | + * `-----------------------------------------------------------------------------------' + */ +[_DEAD] = LAYOUT_planck_grid( + XXXXXXX, KC_PERC, KC_AMPR, KC_QUES, KC_PLUS, KC_AT, KC_DLR, KC_UNDS, KC_LBRC, KC_RBRC, KC_EXLM, XXXXXXX, + XXXXXXX, KC_SLSH, KC_LPRN, KC_EQL, KC_0, KC_LCBR, KC_RCBR, KC_1, KC_ASTR, KC_RPRN, KC_MINS, XXXXXXX, + XXXXXXX, KC_6, KC_7, KC_8, KC_9, KC_PIPE, KC_BSLS, KC_2, KC_3, KC_4, KC_5, XXXXXXX, + XXXXXXX, XXXXXXX, KC_LT, KC_TILD, KC_GRV, KC_COMM, KC_COMM, KC_HASH, KC_CIRC, KC_GT, XXXXXXX, XXXXXXX +), + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | Vol+ |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Prev | Next | Vol- | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS), _______, KC_VOLU, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, KC_MPLY +), + +/* Raise - KWM Interaction + * ,-----------------------------------------------------------------------------------. + * |Restrt| |TgSplt|Flotng|Parent|FlScrn|InsMrk| InsW | InsS | InsN | InsE | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Mark |Rotate|Prefix| Term | BSP |SwpMrk|SwapW |SwapS |SwapN |SwapE | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |MarkW |MarkS |MarkN |MarkE |Monocl|Float |FocusW|FocusS|FocusN|FocusE| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + LCAG(KC_Q), XXXXXXX, LCAG(KC_S), LCAG(KC_W), LCAG(KC_D), LCAG(KC_F), LCTL(S(KC_X)), LCTL(S(KC_H)), LCTL(S(KC_J)), LCTL(S(KC_K)), LCTL(S(KC_L)), XXXXXXX, + XXXXXXX, LCAG(KC_M), LGUI(LCTL(KC_R)), LCAG(KC_DOT), LCAG(KC_T), LGUI(LCTL(KC_A)), LCTL(LALT(KC_M)), LCTL(LALT(KC_H)), LCTL(LALT(KC_J)), LCTL(LALT(KC_K)), LCTL(LALT(KC_L)), XXXXXXX, + _______, LCAG(KC_H), LCAG(KC_J), LCAG(KC_K), LCAG(KC_L), LGUI(LCTL(KC_S)), LGUI(LCTL(KC_D)), LGUI(LALT(KC_H)), LGUI(LALT(KC_J)), LGUI(LALT(KC_K)), LGUI(LALT(KC_L)), _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |TogOut| S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSPC, + TOG_PLV, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_M, KC_C, XXXXXXX, XXXXXXX, KC_L, KC_COMM, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Workmn|Plover| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, WORKMAN, PLOVER, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_workman[][2] = SONG(WORKMAN_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case WORKMAN: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_workman); + #endif + persistent_default_layer_set(1UL<<_WORKMAN); + } + return false; + break; + case DEAD: + if (record->event.pressed) { + layer_on(_DEAD); + set_oneshot_layer(_DEAD, ONESHOT_START); + clear_oneshot_layer_state(ONESHOT_PRESSED); + } + return false; + break; + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(tone_plover); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_plover_gb); + #endif + layer_off(_PLOVER); + } + return false; + break; + case TOG_PLV: + if (record->event.pressed) { + register_code(KC_R); + register_code(KC_W); + register_code(KC_T); + register_code(KC_C); + register_code(KC_P); + register_code(KC_O); + clear_keyboard(); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user(void) +{ + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user(void) +{ + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif diff --git a/keyboards/planck/keymaps/jhenahan/readme.md b/keyboards/planck/keymaps/jhenahan/readme.md new file mode 100644 index 000000000000..a80506fc9dfa --- /dev/null +++ b/keyboards/planck/keymaps/jhenahan/readme.md @@ -0,0 +1,41 @@ +# jhenahan's layout + +## Layout + +The base layer is based on the +[Workman Dead](https://github.com/ojbucao/Workman/tree/master/mac) layout. The +primary interaction layer is a slightly modified Workman layout with a 'dead' +key on the third row under the middle finger. The dead key activates a layer of +special characters. + +## [Layers](http://www.keyboard-layout-editor.com/#/gists/2b875f7d5d76fe4408c0a5b3bd76ddae) +### Function Layer + +This is very slightly modified from the default, mainly just to rearrange the media keys. + +### [KWM](https://github.com/koekeishiya/kwm) Interaction Layer + +`kwm` is a tiling window manager for OS X. The keys defined in my keymap +correspond to the settings I use in +[my `kwmrc` file](https://github.com/jhenahan/dotfiles/blob/master/kwm/kwmrc). + +### QWERTY + +Just in case. + +### [Plover](http://www.openstenoproject.org/plover/) + +This layout functions exactly as a Workman layout unless you're running the Plover +application. Includes a key for toggling Plover while it's running. + +Add this in the appropriate section of your `plover.cfg` to allow this altered layout: + +``` ini +[System: English Stenotype] +keymap[keyboard] = [["#", ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "="]], ["S-", ["q", "a"]], ["T-", ["d"]], ["K-", ["s"]], ["P-", ["r"]], ["W-", ["h"]], ["H-", ["w"]], ["R-", ["t"]], ["A-", ["m"]], ["O-", ["c"]], ["*", ["y", "g", "j", "b"]], ["-E", ["l"]], ["-U", [","]], ["-F", ["f"]], ["-R", ["n"]], ["-P", ["u"]], ["-B", ["e"]], ["-L", ["p"]], ["-G", ["o"]], ["-T", [";"]], ["-S", ["i"]], ["-D", ["BackSpace"]], ["-Z", ["'"]], ["no-op", ["\\", "]", "x", ".", "/"]], ["arpeggiate", ["space"]]] +``` + +### Adjust Layer + +This layer is only slightly modified from the default to remove Dvorak and +Colemak and replace them with Workman. diff --git a/keyboards/planck/keymaps/jhenahan/rules.mk b/keyboards/planck/keymaps/jhenahan/rules.mk new file mode 100644 index 000000000000..23ce0b2fb43b --- /dev/null +++ b/keyboards/planck/keymaps/jhenahan/rules.mk @@ -0,0 +1,19 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/planck/keymaps/jimmysjolund/config.h b/keyboards/planck/keymaps/jimmysjolund/config.h new file mode 100644 index 000000000000..5606510d4981 --- /dev/null +++ b/keyboards/planck/keymaps/jimmysjolund/config.h @@ -0,0 +1,49 @@ +/* Copyright 2021 Jimmy Sjölund + * + * 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/jimmysjolund/keymap.c b/keyboards/planck/keymaps/jimmysjolund/keymap.c new file mode 100644 index 000000000000..02766bb125e7 --- /dev/null +++ b/keyboards/planck/keymaps/jimmysjolund/keymap.c @@ -0,0 +1,369 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty - Original + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +/* Qwerty - jimmysjolund 2022-09-17 + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |Lower | Z | X | C | V | B | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Raise |Ctrl+ | GUI |Shift |Bksp/ |Lower |Enter |Space |AltGr | Alt | Left |Right | + * | | Alt | | | Ctrl | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + LOWER, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + RAISE, LCTL(KC_LALT), KC_LGUI, KC_LSFT, LCTL_T(KC_BSPC), LOWER, KC_ENT, KC_SPC, KC_ALGR, KC_LALT, KC_LEFT, KC_RGHT +), + +/* Colemak Original + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +/* Colemak jimmysjolund + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |Lower | Z | X | C | V | B | K | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Raise |Ctrl+ | GUI |Shift |Bksp/ |Lower |Enter |Space |AltGr | Alt | Left |Right | + * | | Alt | | | Ctrl | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + LOWER, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + RAISE, LCTL(KC_LALT), KC_LGUI, KC_LSFT, LCTL_T(KC_BSPC), LOWER, KC_ENT, KC_SPC, KC_ALGR, KC_LALT, KC_LEFT, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower - Jimmy Sjölund 2022-09-19 + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | + | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | \ | : | ; | - | [ | ] | _ | , | . | / | ? | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + 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_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PLUS, + KC_PIPE, KC_BSLS, KC_COLN, KC_SCLN, KC_MINS, KC_LBRC, KC_RBRC, KC_UNDS, KC_COMM, KC_DOT, KC_SLSH, KC_QUES, + _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return false; +} + +bool dip_update_user(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } + return false; +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/jimmysjolund/readme.md b/keyboards/planck/keymaps/jimmysjolund/readme.md new file mode 100644 index 000000000000..de9680b49851 --- /dev/null +++ b/keyboards/planck/keymaps/jimmysjolund/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/jimmysjolund/rules.mk b/keyboards/planck/keymaps/jimmysjolund/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/jimmysjolund/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/jirgn/assets/layout.json b/keyboards/planck/keymaps/jirgn/assets/layout.json new file mode 100644 index 000000000000..d5fc6f26a95d --- /dev/null +++ b/keyboards/planck/keymaps/jirgn/assets/layout.json @@ -0,0 +1,168 @@ +[ + { + "switchMount": "cherry", + "switchBrand": "cherry", + "switchType": "MX1A-C1xx", + "pcb": true, + "css": ".keylabel2 {\n color: #61ba5d !important;\n}\n.keylabel6 {\n color: #fa7a5f !important;\n}\n.keylabel8 {\n color: #7ab7f7 !important;\n}\n.keylabel7 {\n color: #999 !important;\n}" + }, + [ + { + "fa": [ + 0, + 2, + 0, + 2 + ] + }, + "\n~\n\n`\n\n\n\n\n\nTab", + { + "sm": "cherry", + "sb": "cherry", + "st": "MX1A-C1xx" + }, + "\n!\n\n1\n\n\n\n\n\nQ", + { + "sm": "", + "sb": "", + "st": "" + }, + "\n@\n\n2\n\n\n\n\n\nW", + "\n#\n\n3\n\n\n\n\n\nE", + "\n$\n\n4\n\n\n\n\n\nR", + "\n%\n\n5\n\n\n\n\n\nT", + "\n^\n\n6\n\n\n\n\n\nY", + "\n&\n\n7\n\n\n\n\n\nU", + "\n*\n\n8\n\n\n\n\n\nI", + "\n(\n\n9\n\n\n\n\n\nO", + "\n)\n\n0\n\n\n\n\n\nP", + { + "a": 7 + }, + "" + ], + [ + { + "c": "#b8b8b8", + "a": 5 + }, + "\n\n\n\nCtrl\n\n", + { + "c": "#61ba5d", + "a": 4 + }, + "\n¡\n\nF1\nNav\n\n\n\n\nA", + { + "c": "#cccccc", + "fa": [ + 0, + 2, + 1, + 2, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + }, + "\n™\nHome\nF2\n\n\n\n\n\nS", + "\n€\nPg Up\nF3\n\n\n\n\n\nD", + "\n¢\nPg Dn\nF4\n\n\n\n\n\nF", + "\n∞\nEnd\nF5\n\n\n\n\n\nG", + { + "fa": [ + 0, + 2, + 2, + 2, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + }, + "\n§\n←\nF6\n\n\n\n\n\nH", + "\n_\n↓\n-\n\n\n\n\n\nJ", + "\n+\n↑\n=\n\n\n\n\n\nK", + "\n{\n→\n[\n\n\n\n\n\nL", + { + "c": "#61ba5d", + "fa": [ + 0, + 2, + 2, + 2, + 0, + 0, + 0, + 2 + ] + }, + "\n}\n\n]\nNav\n\n\n:\n\n;", + { + "c": "#cccccc" + }, + "\n|\n\n\\\n\n\n\n\"\n\n'" + ], + [ + { + "c": "#b8b8b8", + "a": 7 + }, + "Shift", + { + "c": "#cccccc", + "a": 4 + }, + "\n\n\nF7\n\n\n\n\n\nZ", + "\n\n\nF8\n\n\n\n\n\nX", + "\n\n\nF9\n\n\n\n\n\nC", + "\n\n\nF10\n\n\n\n\n\nV", + "\n\n\nF11\n\n\n\n\n\nB", + "\n\n\nF12\n\n\n\n\n\nN", + "\n~\n\n#\n\n\n\n\n\nM", + "\n|\n\n/\n\n\n\n<\n\n,", + { + "a": 6 + }, + "\n\n>\n\n\n\n\n\n.", + "\n\n?\n\n\n\n\n\n/", + { + "c": "#b8b8b8", + "a": 7 + }, + "\n\n\n\nShift" + ], + [ + "", + "Hyper", + "", + "", + { + "c": "#fa7a5f" + }, + "⇓", + { + "c": "#cccccc", + "w": 2 + }, + "", + { + "c": "#7ab7f7" + }, + "⇑", + { + "c": "#b8b8b8" + }, + "", + "", + "Hyper", + "" + ] +] \ No newline at end of file diff --git a/keyboards/planck/keymaps/jirgn/config.h b/keyboards/planck/keymaps/jirgn/config.h new file mode 100644 index 000000000000..59bf4aa2a3ea --- /dev/null +++ b/keyboards/planck/keymaps/jirgn/config.h @@ -0,0 +1,39 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/jirgn/keymap.c b/keyboards/planck/keymaps/jirgn/keymap.c new file mode 100644 index 000000000000..1bfb1e5e9df4 --- /dev/null +++ b/keyboards/planck/keymaps/jirgn/keymap.c @@ -0,0 +1,219 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST, + _NAVIGATION +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + PLOVER, + LOWER, + RAISE, + EXT_PLV +}; + +// keycode aliases +#define ___x___ KC_NO +#define KC_EUR LALT(S(KC_2)) +#define KC_SEC LALT(KC_6) +#define CTL_DEL CTL_T(KC_DEL) +#define NAV_SCLN LT(_NAVIGATION, KC_SCLN) +#define NAV_A LT(_NAVIGATION, KC_A) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * Tab for Esc--| Ctrl | A Nav| S | D | F | G | H | J | K | L | ; Nav| Ctrl |--Tab for " + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | Shift|--Tab for Enter + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Hyper| Alt | Super| Lower| Space | Raise| Super| ALt | Hyper| | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + CTL_T(KC_ESC), NAV_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NAV_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, SFT_T(KC_ENT), + ___x___, KC_HYPR, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LGUI, KC_LALT, KC_HYPR, ___x___ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * Tab to Del---| Ctrl | ¡ | ™ | € | ¢ | ∞ | § | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, 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, + CTL_DEL, LALT(KC_1), LALT(KC_2), KC_EUR, LALT(KC_4), LALT(KC_5), LALT(KC_6), KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, S(KC_NUHS), S(KC_NUBS), _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * Tab to Del---| Ctrl | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + CTL_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Navigation + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | HOME | PGUP | PGDN | END | LEFT | DOWN | UP | RIGHT| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_NAVIGATION] = LAYOUT_planck_grid( + ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, + _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END , KC_LEFT, KC_DOWN, KC_UP , KC_RIGHT, _______, ___x___, + _______, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, _______, + ___x___, _______, _______, _______, ___x___, ___x___, ___x___, ___x___, _______, _______, _______, ___x___ +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + ___x___, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + ___x___, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, ___x___, ___x___, KC_C, KC_V, ___x___, ___x___, KC_N, KC_M, ___x___, ___x___, ___x___ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Plover| | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, PLOVER, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; break; + } + return true; +} diff --git a/keyboards/planck/keymaps/jirgn/readme.md b/keyboards/planck/keymaps/jirgn/readme.md new file mode 100644 index 000000000000..afc93d4572ff --- /dev/null +++ b/keyboards/planck/keymaps/jirgn/readme.md @@ -0,0 +1,5 @@ +# Jirgns Planck Layout + +This layout was designed with [Layout Designer](http://www.keyboard-layout-editor.com/#/) + +[Permalink to Layout](http://www.keyboard-layout-editor.com/##@_switchMount=cherry&switchBrand=cherry&switchType=MX1A-C1xx&pcb:true&css=.keylabel2%20%7B%0A%20%20%20%20color%2F:%20%2361ba5d%20!important%2F%3B%0A%7D%0A.keylabel6%20%7B%0A%20%20%20%20color%2F:%20%23fa7a5f%20!important%2F%3B%0A%7D%0A.keylabel8%20%7B%0A%20%20%20%20color%2F:%20%237ab7f7%20!important%2F%3B%0A%7D%0A.keylabel7%20%7B%0A%20%20%20%20color%2F:%20%23999%20!important%2F%3B%0A%7D%3B&@_fa@:0&:2&:0&:2%3B%3B&=%0A~%0A%0A%60%0A%0A%0A%0A%0A%0ATab&_sm=cherry&sb=cherry&st=MX1A-C1xx%3B&=%0A!%0A%0A1%0A%0A%0A%0A%0A%0AQ&=%0A%2F@%0A%0A2%0A%0A%0A%0A%0A%0AW&=%0A%23%0A%0A3%0A%0A%0A%0A%0A%0AE&=%0A$%0A%0A4%0A%0A%0A%0A%0A%0AR&=%0A%25%0A%0A5%0A%0A%0A%0A%0A%0AT&=%0A%5E%0A%0A6%0A%0A%0A%0A%0A%0AY&=%0A%2F&%0A%0A7%0A%0A%0A%0A%0A%0AU&=%0A*%0A%0A8%0A%0A%0A%0A%0A%0AI&=%0A(%0A%0A9%0A%0A%0A%0A%0A%0AO&=%0A)%0A%0A0%0A%0A%0A%0A%0A%0AP&_a:7%3B&=%3Ci%20class%2F='mss%20mss-Unicode-BackSpace-DeleteLeft-Big-2'%3E%3C%2F%2Fi%3E%3B&@_c=%23b8b8b8&a:5%3B&=%0A%3Ci%20class%2F='mss%20mss-Unicode-DeleteRight-Big-2'%3E%3C%2F%2Fi%3E%0A%0A%0ACtrl%0A%0A%3Ci%20class%2F='mss%20mss-Unicode-Escape-3'%3E%3C%2F%2Fi%3E&_c=%2361ba5d&a:4%3B&=%0A¡%0A%0AF1%0ANav%0A%0A%0A%0A%0AA&_c=%23cccccc&fa@:0&:2&:1&:2%3B%3B&=%0A™%0AHome%0AF2%0A%0A%0A%0A%0A%0AS&=%0A€%0APg%20Up%0AF3%0A%0A%0A%0A%0A%0AD&=%0A¢%0APg%20Dn%0AF4%0A%0A%0A%0A%0A%0AF&=%0A∞%0AEnd%0AF5%0A%0A%0A%0A%0A%0AG&_f2:2%3B&=%0A§%0A←%0AF6%0A%0A%0A%0A%0A%0AH&_f2:2%3B&=%0A%2F_%0A↓%0A-%0A%0A%0A%0A%0A%0AJ&_f2:2%3B&=%0A+%0A↑%0A%2F=%0A%0A%0A%0A%0A%0AK&_f2:2%3B&=%0A%7B%0A→%0A%5B%0A%0A%0A%0A%0A%0AL&_c=%2361ba5d&fa@:0&:2&:2&:2&:0&:2&:2&:2%3B%3B&=%0A%7D%0A%0A%5D%0ANav%0A%0A%0A%2F:%0A%0A%2F%3B&_c=%23cccccc%3B&=%0A%7C%0A%0A%5C%0A%0A%0A%0A%22%0A%0A'%3B&@_c=%23b8b8b8&a:7%3B&=Shift&_c=%23cccccc&a:4%3B&=%0A%0A%0AF7%0A%0A%0A%0A%0A%0AZ&=%0A%0A%0AF8%0A%0A%0A%0A%0A%0AX&=%0A%0A%0AF9%0A%0A%0A%0A%0A%0AC&=%0A%0A%0AF10%0A%0A%0A%0A%0A%0AV&=%0A%0A%0AF11%0A%0A%0A%0A%0A%0AB&=%0A%0A%0AF12%0A%0A%0A%0A%0A%0AN&=%0A~%0A%0A%23%0A%0A%0A%0A%0A%0AM&=%0A%7C%0A%0A%2F%2F%0A%0A%0A%0A%3C%0A%0A,&_a:6%3B&=%0A%0A%3E%0A%0A%0A%0A%0A%0A.&=%0A%0A%3F%0A%0A%0A%0A%0A%0A%2F%2F&_c=%23b8b8b8&a:7%3B&=%3Ci%20class%2F='kb%20kb-Return-2'%3E%3C%2F%2Fi%3E%0A%0A%0A%0AShift%3B&@=&=Hyper&=%3Ci%20class%2F='mss%20mss-Unicode-Option-3'%3E%3C%2F%2Fi%3E&=%3Ci%20class%2F='mss%20mss-Unicode-Command-3'%3E%3C%2F%2Fi%3E&_c=%23fa7a5f%3B&=%2F&dArr%2F%3B&_c=%23cccccc&w:2%3B&=&_c=%237ab7f7%3B&=%2F&uArr%2F%3B&_c=%23b8b8b8%3B&=%3Ci%20class%2F='mss%20mss-Unicode-Command-3'%3E%3C%2F%2Fi%3E&=%3Ci%20class%2F='mss%20mss-Unicode-Option-3'%3E%3C%2F%2Fi%3E&=Hyper&=) diff --git a/keyboards/planck/keymaps/johannes/keymap.c b/keyboards/planck/keymaps/johannes/keymap.c new file mode 100644 index 000000000000..c1fdd11244c1 --- /dev/null +++ b/keyboards/planck/keymaps/johannes/keymap.c @@ -0,0 +1,87 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +#define QWERTY 0 +#define LOWER 1 +#define RAISE 2 +#define FUNCTION 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Ctrl | Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | alt |play/p| super|shift | Space|Raise | lower| alt | altgr| |fn | + * `-----------------------------------------------------------------------------------' + */ +[QWERTY] = LAYOUT_planck_grid( + 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_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + _______, KC_LALT, LT(FUNCTION, KC_MPLY), KC_LGUI, KC_LSFT, KC_SPC, MO(RAISE), MO(LOWER), KC_LALT, KC_RALT, XXXXXXX, MO(FUNCTION) +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | { | } | + | | | Å | Ä | Ö | _ | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | \ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + _______, _______, KC_LCBR, KC_RCBR, KC_PLUS, _______, _______, RALT(KC_W), RALT(KC_Q), RALT(KC_P), KC_UNDS, _______, + _______, _______, _______, _______, _______, _______, _______,_______, _______,_______, KC_BSLS, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | [ | ] | = | | left| down| up | right| - | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, _______, KC_LBRC, KC_RBRC, KC_EQL, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_MINS, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Fn + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 ' + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | prev | vol.d| vo.up| next | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | mute | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | CAPS | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[FUNCTION] = LAYOUT_planck_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, _______, _______, _______, _______, _______, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_MEDIA_NEXT_TRACK, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_AUDIO_MUTE, _______, _______, _______, _______, + _______, _______, _______, _______, KC_CAPS, _______, _______, _______, _______, _______, _______, _______ +), + +}; diff --git a/keyboards/planck/keymaps/johannes/readme.md b/keyboards/planck/keymaps/johannes/readme.md new file mode 100644 index 000000000000..c9c7e3080887 --- /dev/null +++ b/keyboards/planck/keymaps/johannes/readme.md @@ -0,0 +1,6 @@ +# Planck layout for Swedish programmer +I.e. easy access to special keys and åäö. + +![layout](https://i.imgur.com/74wHmDh.png) + +[KBLE link](http://www.keyboard-layout-editor.com/#/gists/dc01cc2225899308a05ba3ef0031548b) diff --git a/keyboards/planck/keymaps/johannes/rules.mk b/keyboards/planck/keymaps/johannes/rules.mk new file mode 100644 index 000000000000..e3a405f494e9 --- /dev/null +++ b/keyboards/planck/keymaps/johannes/rules.mk @@ -0,0 +1,22 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/jweickm/config.h b/keyboards/planck/keymaps/jweickm/config.h new file mode 100644 index 000000000000..2b7a3b02d678 --- /dev/null +++ b/keyboards/planck/keymaps/jweickm/config.h @@ -0,0 +1,68 @@ +/* + * Copyright 2018 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 . + */ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND), \ + SONG(WORKMAN_SOUND), \ + SONG(PLOVER_SOUND), \ + SONG(STARTUP_SOUND), \ + SONG(PREONIC_SOUND), \ + SONG(GOODBYE_SOUND), \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +// settings for HOME ROW MODS +#define TAPPING_TERM 160 // 200 ms is the default value +#define TAPPING_TERM_PER_KEY +//#define PERMISSIVE_HOLD +#define QUICK_TAP_TERM_PER_KEY + +// settings for LEADER key +#define LEADER_PER_KEY_TIMING +#define LEADER_TIMEOUT 250 +#define LEADER_NO_TIMEOUT + +#define RGBLIGHT_SLEEP // RGB lighting will switch off when the host goes to sleep +#define RGBLIGHT_LAYERS diff --git a/keyboards/planck/keymaps/jweickm/keymap.c b/keyboards/planck/keymaps/jweickm/keymap.c new file mode 100644 index 000000000000..b206b8511e14 --- /dev/null +++ b/keyboards/planck/keymaps/jweickm/keymap.c @@ -0,0 +1,1126 @@ +/* Copyright 2015-2017 Jack Humbert + * Copyright 2021 Jakob Weickmann + * + 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 QMK_KEYBOARD_H +#include "muse.h" + +enum planck_layers { + _HRWIDECOLEMAK, + _HRWIDECOLEMAK_DE, + _GAMING, + _WIDECOLEMAK, + _LOWER, + _RAISE, + _LOWER_DE, + _RAISE_DE, + _ADJUST, + _NAV, + _VIM, + _NUM, + _MOUSE, +}; + +enum planck_keycodes { HRWIDECOLEMAK = SAFE_RANGE, GAMING, WIDECOLEMAK, TG_COLEMAK, VIM_O, VIM_V, KC_SVD_BD, KC_SVU_BU, KC_TAB_MPLY, ALT_TAB, CTL_TAB, DE_ae, DE_oe, DE_ue, DE_AE, DE_OE, DE_SZ, DE_EGRAVE, DE_EAIGU, KC_CURRENCY, KC_DE_SWITCH, LANG_SWITCH, DE_SLSH_QUST, DE_QUOT, DE_SCLN, DE_BSLS, M_ESCM, M_RGUI_SCLN, DE_DOT_RAB, DE_COMM_LAB }; + +// Tap Dance declarations +enum tap_dance_codes { + TD_PRN, // round brackets (parentheses) + TD_PRN_DE, // round brackets (parentheses) + TD_BRC, // square brackets + TD_BRC_DE, // square brackets + TD_CBR, // curly brackets + TD_CBR_DE, // curly brackets + TD_VIM_GG // single tap to scroll down, double tap to scroll up +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* _HRWIDECOLEMAK + * ,-----------------------------------------------------------------------------------. + * | G-Q | A-W | S-F | C-P |_Num-B|Vol/B+|_Num-J| C-L | S-U | A-Y | G-/ | ü | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | A | R | S | T | G | TAB | M | N | E | I | O | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |_Mo-Z | X | C | D | V |Vol/B-| K | H | , | . |_Mo-/ | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |C-CAPS| LEAD | BSPC |_L-ESC| LSFT | _Nav-SPC |_R-ENT|S-DEL | RALT |_Mo <-|_Mo ->| + * `-----------------------------------------------------------------------------------' + */ + [_HRWIDECOLEMAK] = LAYOUT_planck_grid( + LGUI_T(KC_Q), LALT_T(KC_W), LSFT_T(KC_F), LCTL_T(KC_P), LT(_NUM, KC_B), KC_SVU_BU, LT(_NUM, KC_J), RCTL_T(KC_L), RSFT_T(KC_U), LALT_T(KC_Y), RGUI_T(KC_SCLN), DE_ue, + KC_A, KC_R, KC_S, KC_T, KC_G, KC_TAB, KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + LT(_MOUSE, KC_Z), KC_X, KC_C, KC_D, KC_V, KC_SVD_BD, KC_K, KC_H, KC_COMM, KC_DOT, LT(_MOUSE, KC_SLSH), KC_BSLS, + LCTL_T(KC_CAPS), QK_LEAD, KC_BSPC, LT(_LOWER, KC_ESC), OSM(MOD_LSFT), LT(_NAV, KC_SPC), LT(_NAV, KC_SPC), LT(_RAISE, KC_ENT), RSFT_T(KC_DEL), KC_RALT, LT(_MOUSE, KC_LEFT), LT(_MOUSE, KC_RIGHT) + ), + + /* _HRWIDECOLEMAK_DE + * same as above, when the PC is set to German layout + * ,-----------------------------------------------------------------------------------. + * | G-Q | A-W | S-F | C-P |_Num-B|Vol/B+|_Num-J| C-L | S-U | A-Y | G-/ | ü | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | A | R | S | T | G | TAB | M | N | E | I | O | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |_Mo-Z | X | C | D | V |Vol/B-| K | H | , | . |_Mo-/ | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |C-CAPS| LEAD | BSPC |_L-ESC| LSFT | _Nav-SPC |_R-ENT|S-DEL | RALT |_Mo <-|_Mo ->| + * `-----------------------------------------------------------------------------------' + */ + [_HRWIDECOLEMAK_DE] = LAYOUT_planck_grid( + LGUI_T(KC_Q), LALT_T(KC_W), LSFT_T(KC_F), LCTL_T(KC_P), LT(_NUM, KC_B), KC_SVU_BU, LT(_NUM, KC_J), RCTL_T(KC_L), RSFT_T(KC_U), LALT_T(KC_Z), M_RGUI_SCLN, KC_LBRC, + KC_A, KC_R, KC_S, KC_T, KC_G, KC_TAB, KC_M, KC_N, KC_E, KC_I, KC_O, DE_QUOT, + LT(_MOUSE, KC_Y), KC_X, KC_C, KC_D, KC_V, KC_SVD_BD, KC_K, KC_H, DE_COMM_LAB, DE_DOT_RAB, DE_SLSH_QUST, DE_BSLS, + LCTL_T(KC_CAPS), QK_LEAD, KC_BSPC, LT(_LOWER_DE, KC_ESC), OSM(MOD_LSFT), LT(_NAV, KC_SPC), LT(_NAV, KC_SPC), LT(_RAISE_DE, KC_ENT), RSFT_T(KC_DEL), KC_RALT, LT(_MOUSE, KC_LEFT), LT(_MOUSE, KC_RIGHT) + ), + + /* _GAMING + * ,-----------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | F5 | F8 | F9 |Vol/B+| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | TAB | Q | W | E | R | T | Y | U | I | O | P |Vol/B-| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | LSFT | A | S | D | F | G | H | J | Z | M | ; |_CM-EN| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | LCTL | C | B | X | LALT | SPACE | ENT | RALT | ____ | ____ | !GAME| + * `-----------------------------------------------------------------------------------' + */ + [_GAMING] = LAYOUT_planck_grid( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_F5, KC_F8, KC_F9, KC_VOLU, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_VOLD, + KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_Z, KC_M, KC_SCLN, TG_COLEMAK, + KC_LCTL, KC_C, KC_B, KC_X, KC_LALT, KC_SPC, KC_SPC, KC_ENT, KC_RALT, KC_TRNS, KC_TRNS, GAMING + ), + + /* WIDECOLEMAK + * no mod taps + * ,-----------------------------------------------------------------------------------. + * | Q | W | F | P | B |Vol/B+| J | L | U | Y | / | Ü | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | A | R | S | T | G | TAB | M | N | E | I | O | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Z | X | C | D | V |Vol/B-| K | H | , | . | / |!CM-EN| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |C-CAPS|G-TAB |MN-ESC|_L-BSP| LSFT | _NAV-SPC |_R-ENT|S-DEL |C-TAB |_Mo <-|_Mo ->| + * `-----------------------------------------------------------------------------------' + */ + [_WIDECOLEMAK] = LAYOUT_planck_grid( + KC_Q, KC_W, KC_F, KC_P, KC_B, KC_SVU_BU, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, DE_ue, + KC_A, KC_R, KC_S, KC_T, KC_G, KC_TAB_MPLY, KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_Z, KC_X, KC_C, KC_D, KC_V, KC_SVD_BD, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, TG_COLEMAK, + LCTL_T(KC_CAPS), LGUI_T(KC_TAB), M_ESCM, LT(_LOWER_DE, KC_BSPC), OSM(MOD_LSFT), LT(_NAV, KC_SPC), LT(_NAV, KC_SPC), LT(_RAISE, KC_ENT), RSFT_T(KC_DEL), KC_LALT, LT(_MOUSE, KC_LEFT), LT(_MOUSE, KC_RIGHT) + ), + + /* _LOWER + * ,-----------------------------------------------------------------------------------. + * | ! | @ | # | $ | % | ~ | ^ | & | * | ( | ) | Ö | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | F1 | F2 | F3 | F4 | F5 | F6 | ß | _ | + | { | } | Ä | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | F7 | F8 | F9 | F10 | F11 | F12 | MPLY | / | \ | | | € | è | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |!MOUSE| ____ | ____ | ____ | ____ | ____ | ____ | Vol- | Vol+ | ↓ | ↑ | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_planck_grid( + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_TILD, KC_CIRC, KC_AMPR, KC_ASTR, TD(TD_PRN), KC_RPRN, DE_OE, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_SZ, KC_UNDS, KC_PLUS, TD(TD_CBR), KC_RCBR, DE_AE, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPLY, KC_SLSH, KC_NUBS, LSFT(KC_NUBS), KC_CURRENCY, DE_EGRAVE, + TG(_MOUSE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_DOWN, KC_UP + ), + + /* _LOWER_DE + * ,-----------------------------------------------------------------------------------. + * | ! | @ | # | $ | % | ~ | ^ | & | * | ( | ) | Ö | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | F1 | F2 | F3 | F4 | F5 | F6 | ß | _ | + | { | } | Ä | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | F7 | F8 | F9 | F10 | F11 | F12 | MPLY | / | \ | | | € | ` | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |!MOUSE| ____ | ____ | ____ | ____ | ____ | ____ | Vol- | Vol+ | ↓ | ↑ | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER_DE] = LAYOUT_planck_grid( + KC_EXLM, RALT(KC_Q), KC_BSLS, KC_DLR, KC_PERC, RALT(KC_RBRC), KC_GRV, KC_CIRC, KC_RCBR, TD(TD_PRN_DE), KC_LPRN, LSFT(KC_SCLN), + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, LSFT(KC_SLSH), KC_RBRC, TD(TD_CBR_DE), RALT(KC_0), LSFT(KC_QUOT), + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPLY, LSFT(KC_7), RALT(KC_MINS), RALT(KC_NUBS), KC_CURRENCY, KC_PLUS, + TG(_MOUSE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_DOWN, KC_UP + ), + + /* _RAISE + * ,-----------------------------------------------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | ` | 6 | 7 | 8 | 9 | 0 | ö | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | F1 | F2 | F3 | F4 | F5 | F6 | ß | - | = | [ | ] | ä | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | F7 | F8 | F9 | F10 | F11 | F12 | MPLY | \ | , | . | / | é | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |!MOUSE| ____ | ____ | BSPC | ____ | ____ | ____ | |<< | >>| | ↓ | ↑ | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_planck_grid( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_GRV, KC_6, KC_7, KC_8, KC_9, KC_0, DE_oe, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_SZ, KC_MINS, KC_EQL, TD(TD_BRC), KC_RBRC, DE_ae, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPLY, KC_BSLS, KC_COMM, KC_DOT, KC_SLSH, DE_EAIGU, + TG(_MOUSE), KC_TRNS, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_DOWN, KC_UP + ), + + /* _RAISE_DE + * ,-----------------------------------------------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | ` | 6 | 7 | 8 | 9 | 0 | ö | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | F1 | F2 | F3 | F4 | F5 | F6 | ß | - | = | [ | ] | ä | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | F7 | F8 | F9 | F10 | F11 | F12 | MPLY | \ | , | . | / | ´ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |!MOUSE| ____ | ____ | BSPC | ____ | ____ | ____ | |<< | >>| | ↓ | ↑ | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE_DE] = LAYOUT_planck_grid( + KC_1, KC_2, KC_3, KC_4, KC_5, LSFT(KC_GRV), KC_6, KC_7, KC_8, KC_9, KC_0, KC_SCLN, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_SLSH, LSFT(KC_0), TD(TD_BRC_DE), RALT(KC_9), KC_QUOT, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPLY, RALT(KC_MINS), KC_COMM, KC_DOT, DE_SLSH_QUST, KC_EQL, + TG(_MOUSE), KC_TRNS, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_DOWN, KC_UP + ), + + /* _ADJUST + * ,-----------------------------------------------------------------------------------. + * | A-SFT| Boot | Debug|RGBTOG|RGBMOD|RGBHUI|RGBHUD|RGBSAI|RGBSAD|RGBVAI|RGBVAD| DE_SW| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | A-GRV|EEPRST|MUNEXT| AU_ON|AU_OFF|AGNORM|AGSWAP|!HRWCM| !WCM | A-GRV| !LANG| !GAME| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ____ |AU_REV|AUNEXT| MU_ON|MU_OFF| MI_ON|MI_OFF| Vol- | MPLY | Vol+ | ____ | ____ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |EEPRST| + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT_planck_grid( + LALT(KC_LSFT), QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DE_SWITCH, + LALT(KC_GRV), EE_CLR, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, HRWIDECOLEMAK, WIDECOLEMAK, LALT(KC_GRV), LANG_SWITCH, GAMING, + KC_TRNS, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, KC_SVD_BD, KC_MPLY, KC_SVU_BU, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, EE_CLR + ), + + /* _NAV + * ,-----------------------------------------------------------------------------------. + * |A(TAB)| C(->)| !LANG|A(GRV)| C(<-)| >>| | HOME | -> | PGUP | COPY | PASTE| DE_SW| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |C(TAB)| TAB | ESC | ENT |VIM_GG| MPLY | <- | ↓ | ↑ | -> | END | VIM_O| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | LSFT | XXXX |S(DEL)| CAPS | VIM_V| MUTE | HOME | PGDN | LSFT | RFST | C(F) | C(F) | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | XXXX | XXXX | ____ | BSPC | ____ | ____ | ENT | DEL | ____ | ____ | DE_SW| + * `-----------------------------------------------------------------------------------' + */ + [_NAV] = LAYOUT_planck_grid( + ALT_TAB, LCTL(KC_RGHT), LANG_SWITCH, LALT(KC_GRV), LCTL(KC_LEFT), KC_MNXT, KC_HOME, KC_RIGHT, KC_PGUP, LCTL(KC_INS), LSFT(KC_INS), KC_DE_SWITCH, + CTL_TAB, KC_TAB, KC_ESC, KC_ENT, TD(TD_VIM_GG), KC_MPLY, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_END, VIM_O, + KC_LSFT, KC_NO, LSFT(KC_DEL), KC_CAPS, VIM_V, KC_MUTE, KC_HOME, KC_PGDN, KC_LSFT, KC_RSFT, LCTL(KC_F), LCTL(KC_F), + KC_NO, KC_NO, KC_TRNS, KC_BSPC, KC_TRNS, LT(_NAV, KC_SPC), LT(_NAV, KC_SPC), KC_ENT, KC_DEL, KC_TRNS, KC_TRNS, KC_DE_SWITCH + ), + + /* _VIM + * ,-----------------------------------------------------------------------------------. + * |A(TAB)| C(->)| !LANG|A(GRV)| C(<-)| >>| | HOME | -> | PGUP | COPY | PASTE| DE_SW| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |C(TAB)| TAB | ESC | ENT |VIM_GG| MPLY | <- | ↓ | ↑ | -> | END | VIM_O| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | LSFT | XXXX |S(DEL)| CAPS | VIM_V| MUTE | HOME | PGDN | LSFT | RFST | C(F) | C(F) | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | XXXX | XXXX | !VIM | BSPC | ____ | ____ | ENT | DEL | ____ | ↓ | ↑ | + * `-----------------------------------------------------------------------------------' + */ + [_VIM] = LAYOUT_planck_grid( + ALT_TAB, LCTL(KC_RGHT), LANG_SWITCH, LALT(KC_GRV), LCTL(KC_LEFT), KC_MNXT, KC_HOME, KC_RIGHT, KC_PGUP, LCTL(KC_INS), LSFT(KC_INS), KC_DE_SWITCH, + CTL_TAB, KC_TAB, KC_ESC, KC_ENT, TD(TD_VIM_GG), KC_MPLY, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_END, VIM_O, + KC_LSFT, KC_NO, LSFT(KC_DEL), KC_CAPS, VIM_V, KC_MUTE, KC_HOME, KC_PGDN, KC_LSFT, KC_RSFT, LCTL(KC_F), LCTL(KC_F), + KC_NO, KC_NO, TG(_VIM), KC_BSPC, KC_TRNS, LT(_NAV, KC_SPC), LT(_NAV, KC_SPC), KC_ENT, KC_DEL, KC_TRNS, KC_DOWN, KC_UP + ), + + /* _NUM + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | |<< |NUMLCK| >>| | 7 | 8 | 9 | - | ____ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | F5 | F6 | F7 | F8 | Vol+ | MPLY | * | 4 | 5 | 6 | + | . | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | F9 | F10 | F11 | F12 | Vol- | MUTE | = | 1 | 2 | 3 | / | , | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ____ | ____ | ____ | ____ | ____ | ____ | 0 | . | , | = | ____ | + * `-----------------------------------------------------------------------------------' + */ + [_NUM] = LAYOUT_planck_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_MPRV, KC_NUM, KC_MNXT, KC_P7, KC_P8, KC_P9, KC_MINS, KC_TRNS, + KC_F5, KC_F6, KC_F7, KC_F8, KC_VOLU, KC_MPLY, KC_ASTR, KC_P4, KC_P5, KC_P6, KC_PLUS, KC_DOT, + KC_F9, KC_F10, KC_F11, KC_F12, KC_VOLD, KC_MUTE, KC_EQL, KC_P1, KC_P2, KC_P3, KC_SLSH, KC_COMM, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P0, KC_DOT, KC_COMM, KC_EQL, KC_TRNS + ), + + /* _MOUSE + * ,-----------------------------------------------------------------------------------. + * | XXXX | XXXX | MBTN4| MBTN5| XXXX | Bri+ | XXXX | MWHL↑|MAUS↑ | MWHL↑| XXXX | XXXX | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | XXXX | MBTN3| MBTN2| MBTN1| XXXX | MPLY | XXXX |MAUS<-|MAUS↓ |MAUS->| XXXX | XXXX | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | F9 | XXXX | XXXX | XXXX | XXXX | Bri- | XXXX | MWHL↓| XXXX | XXXX | ____ | XXXX | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |!MOUSE| XXXX | XXXX | ____ | XXXX | MAUS_ACCEL2 | ____ | XXXX | XXXX | ↓ | ↑ | + * `-----------------------------------------------------------------------------------' + */ + [_MOUSE] = LAYOUT_planck_grid( + KC_NO, KC_NO, KC_BTN4, KC_BTN5, KC_NO, KC_BRIU, KC_NO, KC_WH_U, KC_MS_U, KC_WH_U, KC_NO, KC_NO, + KC_NO, KC_BTN3, KC_BTN2, KC_BTN1, KC_NO, KC_MPLY, KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_NO, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_BRID, KC_NO, KC_WH_D, KC_NO, KC_NO, KC_TRNS, KC_NO, + TG(_MOUSE), KC_NO, KC_NO, KC_TRNS, KC_NO, KC_ACL2, KC_ACL2, KC_TRNS, KC_NO, KC_NO, KC_DOWN, KC_UP + ) + +}; + +// define the tap dance functions +void dance_prn(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + tap_code16(KC_LPRN); + } else { + tap_code16(KC_LPRN); + tap_code16(KC_RPRN); + tap_code(KC_LEFT); + } +} +void dance_brc(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + tap_code(KC_LBRC); + } else { + tap_code(KC_LBRC); + tap_code(KC_RBRC); + tap_code(KC_LEFT); + } +} +void dance_cbr(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + tap_code16(KC_LCBR); + } else { + tap_code16(KC_LCBR); + tap_code16(KC_RCBR); + tap_code(KC_LEFT); + } +} +void dance_prn_de(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + tap_code16(KC_ASTR); + } else { + tap_code16(KC_ASTR); + tap_code16(KC_LPRN); + tap_code(KC_LEFT); + } +} +void dance_brc_de(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + tap_code16(RALT(KC_8)); + } else { + tap_code16(RALT(KC_8)); + tap_code16(RALT(KC_9)); + tap_code(KC_LEFT); + } +} +void dance_cbr_de(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + tap_code16(RALT(KC_7)); + } else { + tap_code16(RALT(KC_7)); + tap_code16(RALT(KC_0)); + tap_code(KC_LEFT); + } +} +void vim_gg(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + tap_code16(LCTL(KC_END)); + } else { + tap_code16(LCTL(KC_HOME)); + } +} + +tap_dance_action_t tap_dance_actions[] = { + // declare tap dance actions here + [TD_PRN] = ACTION_TAP_DANCE_FN(dance_prn), [TD_BRC] = ACTION_TAP_DANCE_FN(dance_brc), [TD_CBR] = ACTION_TAP_DANCE_FN(dance_cbr), [TD_PRN_DE] = ACTION_TAP_DANCE_FN(dance_prn_de), [TD_BRC_DE] = ACTION_TAP_DANCE_FN(dance_brc_de), [TD_CBR_DE] = ACTION_TAP_DANCE_FN(dance_cbr_de), [TD_VIM_GG] = ACTION_TAP_DANCE_FN(vim_gg)}; + +float thumb_factor = 0.95; +float index_factor = 1.1; +float middle_factor = 1.2; +float ring_factor = 1.25; +float pinky_factor = 1.15; +float td_factor = 1.4; + +// define the per_key_tapping_term +uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // thumb keys + case RSFT_T(KC_DEL): + return TAPPING_TERM * thumb_factor; + case RCTL_T(KC_TAB): + return TAPPING_TERM * thumb_factor; + case LT(_NAV, KC_LEFT): + return TAPPING_TERM * thumb_factor; + case LT(_NAV, KC_RIGHT): + return TAPPING_TERM * thumb_factor; + case LT(_LOWER, KC_BSPC): + return TAPPING_TERM * thumb_factor; + case LT(_LOWER_DE, KC_BSPC): + return TAPPING_TERM * thumb_factor; + case LT(_RAISE, KC_ENT): + return TAPPING_TERM * thumb_factor; + case LT(_RAISE_DE, KC_ENT): + return TAPPING_TERM * thumb_factor; + case LT(_NAV, KC_SPC): + return TAPPING_TERM * 1.0; + case LALT_T(KC_ESC): + return TAPPING_TERM * thumb_factor; + + // index finger keys + case LCTL_T(KC_P): + return TAPPING_TERM * index_factor; + case RCTL_T(KC_L): + return TAPPING_TERM * (index_factor + 0.1); + case LT(_NUM, KC_B): + return TAPPING_TERM * (index_factor + 0.1); + case LT(_NUM, KC_J): + return TAPPING_TERM * index_factor; + + // middle finger keys + case LSFT_T(KC_F): + return TAPPING_TERM * middle_factor; + case RSFT_T(KC_U): + return TAPPING_TERM * middle_factor; + + // ring finger keys + case LALT_T(KC_W): + return TAPPING_TERM * ring_factor; + case LALT_T(KC_Y): + return TAPPING_TERM * ring_factor; + case LGUI_T(KC_TAB): + return TAPPING_TERM * ring_factor; + + // pinky keys + case LGUI_T(KC_Q): + return TAPPING_TERM * pinky_factor; + case RGUI_T(KC_SCLN): + return TAPPING_TERM * pinky_factor; + case RGUI_T(KC_LBRC): + return TAPPING_TERM * pinky_factor; + case LT(_MOUSE, KC_Z): + return TAPPING_TERM * pinky_factor; + case LT(_MOUSE, KC_SLSH): + return TAPPING_TERM * pinky_factor; + case LCTL_T(KC_CAPS): + return TAPPING_TERM * pinky_factor; + + // tap-dance actions + case TD(TD_PRN): + return TAPPING_TERM * td_factor; + case TD(TD_BRC): + return TAPPING_TERM * td_factor; + case TD(TD_CBR): + return TAPPING_TERM * td_factor; + case TD(TD_PRN_DE): + return TAPPING_TERM * td_factor; + case TD(TD_BRC_DE): + return TAPPING_TERM * td_factor; + case TD(TD_CBR_DE): + return TAPPING_TERM * td_factor; + case TD(TD_VIM_GG): + return TAPPING_TERM * td_factor; + + default: + return TAPPING_TERM; + } +} + +// alt tab function setup +bool is_alt_tab_active = false; +bool is_ctl_tab_active = false; +bool de_layout_active = false; + +static uint16_t key_timer; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case WIDECOLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_WIDECOLEMAK); + } + return false; + break; + case HRWIDECOLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_HRWIDECOLEMAK); + } + return false; + break; + case GAMING: + if (record->event.pressed) { + layer_invert(_GAMING); + } + return false; + break; + case TG_COLEMAK: + if (record->event.pressed) { + tap_code(KC_ENT); + layer_invert(_WIDECOLEMAK); + } + return false; + break; + case VIM_O: + if (record->event.pressed) { + tap_code(KC_END); + tap_code(KC_ENT); + } + return false; + break; + case VIM_V: + if (record->event.pressed) { + if (get_mods() & MOD_MASK_SHIFT) { + clear_mods(); + } else { + register_mods(MOD_LSFT); + } + } + return false; + break; + case KC_SVU_BU: // increase backlight when pressing shift and vol up + if (record->event.pressed) { + if (get_mods() & MOD_MASK_SHIFT) { + register_code(KC_BRIU); + } else if (get_mods() & MOD_MASK_CTRL) { + register_code(KC_MNXT); + } else { + register_code(KC_VOLU); + } + } else { + unregister_code(KC_BRIU); + unregister_code(KC_MNXT); + unregister_code(KC_VOLU); + } + return false; + case KC_SVD_BD: // decrease backlight when pressing shift and vol up + if (record->event.pressed) { + if (get_mods() & MOD_MASK_SHIFT) { + register_code(KC_BRID); + } else if (get_mods() & MOD_MASK_CTRL) { + register_code(KC_MPRV); + } else { + register_code(KC_VOLD); + } + } else { + unregister_code(KC_BRID); + unregister_code(KC_MPRV); + unregister_code(KC_VOLD); + } + return false; + case KC_TAB_MPLY: // press tab or play/pause when ctrl is pressed + if (record->event.pressed) { + if (get_mods() & MOD_MASK_CTRL) { + register_code(KC_MPLY); + } else { + register_code(KC_TAB); + } + } else { + unregister_code(KC_MPLY); + unregister_code(KC_TAB); + } + return false; + case ALT_TAB: + if (record->event.pressed) { + if (!is_alt_tab_active) { + is_alt_tab_active = true; + add_mods(MOD_BIT(KC_LALT)); + } + register_code(KC_TAB); + } else { + unregister_code(KC_TAB); + } + break; + case CTL_TAB: + if (record->event.pressed) { + if (!is_ctl_tab_active) { + is_ctl_tab_active = true; + add_mods(MOD_BIT(KC_LCTL)); + } + register_code(KC_TAB); + } else { + unregister_code(KC_TAB); + } + break; + // the next case allows us to use alt_tab without a timer + case LT(_NAV, KC_SPC): + if (record->event.pressed) { + } else { + unregister_mods(MOD_LALT); + unregister_mods(MOD_LCTL); + is_alt_tab_active = false; + is_ctl_tab_active = false; + } + break; + case DE_ae: + if (record->event.pressed) { + uint8_t temp_mods = get_mods(); + if ((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) { + clear_oneshot_mods(); + clear_mods(); + add_mods(MOD_BIT(KC_LALT)); + tap_code(KC_P0); + tap_code(KC_P1); + tap_code(KC_P9); + tap_code(KC_P6); // Ä + } else { + clear_mods(); + add_mods(MOD_BIT(KC_LALT)); + tap_code(KC_P0); + tap_code(KC_P2); + tap_code(KC_P2); + tap_code(KC_P8); // ä + } + unregister_mods(MOD_LALT); + set_mods(temp_mods); + } + return false; + break; + case DE_AE: + if (record->event.pressed) { + uint8_t temp_mods = get_mods() | get_oneshot_mods(); + clear_oneshot_mods(); + clear_mods(); + add_mods(MOD_BIT(KC_LALT)); + tap_code(KC_P0); + tap_code(KC_P1); + tap_code(KC_P9); + tap_code(KC_P6); // Ä + unregister_mods(MOD_LALT); + set_mods(temp_mods); + } + return false; + break; + case DE_oe: + if (record->event.pressed) { + uint8_t temp_mods = get_mods(); + if ((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) { + clear_oneshot_mods(); + clear_mods(); + add_mods(MOD_BIT(KC_LALT)); + tap_code(KC_P0); + tap_code(KC_P2); + tap_code(KC_P1); + tap_code(KC_P4); // Ö + } else { + clear_mods(); + add_mods(MOD_BIT(KC_LALT)); + tap_code(KC_P0); + tap_code(KC_P2); + tap_code(KC_P4); + tap_code(KC_P6); // ö + } + unregister_mods(MOD_LALT); + set_mods(temp_mods); + } + return false; + break; + case DE_OE: + if (record->event.pressed) { + uint8_t temp_mods = get_mods() | get_oneshot_mods(); + clear_oneshot_mods(); + clear_mods(); + add_mods(MOD_BIT(KC_LALT)); + tap_code(KC_P0); + tap_code(KC_P2); + tap_code(KC_P1); + tap_code(KC_P4); // Ö + unregister_mods(MOD_LALT); + set_mods(temp_mods); + } + return false; + break; + case DE_ue: + if (record->event.pressed) { + uint8_t temp_mods = get_mods(); + if ((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) { + clear_oneshot_mods(); + clear_mods(); + add_mods(MOD_BIT(KC_LALT)); + tap_code(KC_P0); + tap_code(KC_P2); + tap_code(KC_P2); + tap_code(KC_P0); // Ü + } else { + clear_mods(); + add_mods(MOD_BIT(KC_LALT)); + tap_code(KC_P0); + tap_code(KC_P2); + tap_code(KC_P5); + tap_code(KC_P2); // ü + } + unregister_mods(MOD_LALT); + set_mods(temp_mods); + } + return false; + break; + case KC_DE_SWITCH: + if (record->event.pressed) { + if (de_layout_active) { + de_layout_active = false; // deactivate German overlay + set_single_persistent_default_layer(_HRWIDECOLEMAK); + } else { + de_layout_active = true; // activate German overlay + set_single_persistent_default_layer(_HRWIDECOLEMAK_DE); + } + return false; + } + break; + case LANG_SWITCH: + if (record->event.pressed) { + register_mods(MOD_LALT); + register_code(KC_LSFT); + if (de_layout_active) { + de_layout_active = false; // deactivate German overlay + set_single_persistent_default_layer(_HRWIDECOLEMAK); + } else { + de_layout_active = true; // activate German overlay + set_single_persistent_default_layer(_HRWIDECOLEMAK_DE); + } + } else { + unregister_code(KC_LSFT); + unregister_mods(MOD_LALT); + } + return false; + case DE_SZ: + if (record->event.pressed) { + uint8_t temp_mods = get_mods(); + if ((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) { + clear_oneshot_mods(); + clear_mods(); + add_mods(MOD_BIT(KC_LALT)); + tap_code(KC_P0); + tap_code(KC_P1); + tap_code(KC_P7); + tap_code(KC_P6); // ° + } else { + clear_mods(); + add_mods(MOD_BIT(KC_LALT)); + tap_code(KC_P0); + tap_code(KC_P2); + tap_code(KC_P2); + tap_code(KC_P3); // ß + } + unregister_mods(MOD_LALT); + set_mods(temp_mods); + } + return false; + break; + case DE_EGRAVE: + if (record->event.pressed) { + uint8_t temp_mods = get_mods(); + if ((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) { + clear_oneshot_mods(); + clear_mods(); + add_mods(MOD_BIT(KC_LALT)); + tap_code(KC_P0); + tap_code(KC_P2); + tap_code(KC_P0); + tap_code(KC_P0); // È + } else { + clear_mods(); + add_mods(MOD_BIT(KC_LALT)); + tap_code(KC_P0); + tap_code(KC_P2); + tap_code(KC_P3); + tap_code(KC_P2); // è + } + unregister_mods(MOD_LALT); + set_mods(temp_mods); + } + return false; + break; + case DE_EAIGU: + if (record->event.pressed) { + uint8_t temp_mods = get_mods(); + if ((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) { + clear_oneshot_mods(); + clear_mods(); + add_mods(MOD_BIT(KC_LALT)); + tap_code(KC_P0); + tap_code(KC_P2); + tap_code(KC_P0); + tap_code(KC_P1); // É + } else { + clear_mods(); + add_mods(MOD_BIT(KC_LALT)); + tap_code(KC_P0); + tap_code(KC_P2); + tap_code(KC_P3); + tap_code(KC_P3); // é + } + unregister_mods(MOD_LALT); + set_mods(temp_mods); + } + return false; + break; + case KC_CURRENCY: + if (record->event.pressed) { + uint8_t temp_mods = get_mods(); + if ((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) { + clear_oneshot_mods(); + clear_mods(); + add_mods(MOD_BIT(KC_LALT)); + tap_code(KC_P1); + tap_code(KC_P5); + tap_code(KC_P7); // ¥ + } else { + clear_mods(); + add_mods(MOD_BIT(KC_LALT)); + tap_code(KC_P0); + tap_code(KC_P1); + tap_code(KC_P2); + tap_code(KC_P8); // € + } + unregister_mods(MOD_LALT); + set_mods(temp_mods); + } + return false; + break; + case DE_SLSH_QUST: + if (record->event.pressed) { + key_timer = timer_read(); + layer_on(_MOUSE); + } else { + if (timer_elapsed(key_timer) < (TAPPING_TERM * pinky_factor)) { + layer_off(_MOUSE); + uint8_t temp_mods = get_mods() | get_oneshot_mods(); + if (temp_mods & MOD_MASK_SHIFT) { + tap_code(KC_MINS); // ? + } else { + tap_code16(KC_AMPR); // / + } + } else { + layer_off(_MOUSE); + } + } + return false; + break; + case DE_QUOT: + if (record->event.pressed) { + uint8_t temp_mods = get_mods() | get_oneshot_mods(); + if (temp_mods & MOD_MASK_SHIFT) { + register_code(KC_2); // \" + } else { + register_code16(KC_PIPE); // /' + } + } else { + unregister_code(KC_2); + unregister_code16(KC_PIPE); + } + return true; + case DE_DOT_RAB: + if (record->event.pressed) { + uint8_t temp_mods = get_mods() | get_oneshot_mods(); + if (temp_mods & MOD_MASK_SHIFT) { + register_code16(LSFT(KC_NUBS)); // > right angle bracket + } else { + register_code(KC_DOT); // . + } + } else { + unregister_code16(LSFT(KC_NUBS)); + unregister_code(KC_DOT); + } + return true; + case DE_COMM_LAB: + if (record->event.pressed) { + uint8_t temp_mods = get_mods() | get_oneshot_mods(); + if (temp_mods & MOD_MASK_SHIFT) { + clear_mods(); + clear_oneshot_mods(); + register_code16(KC_NUBS); // < left angle bracket + set_mods(temp_mods); + } else { + register_code(KC_COMM); // , + } + } else { + unregister_code16(KC_NUBS); + unregister_code(KC_COMM); + } + return true; + case DE_SCLN: + if (record->event.pressed) { + uint8_t temp_mods = get_mods() | get_oneshot_mods(); + if (temp_mods & MOD_MASK_SHIFT) { + tap_code(KC_DOT); // ; + } else { + add_mods(MOD_BIT(KC_LSFT)); + tap_code(KC_COMM); // : + del_mods(MOD_BIT(KC_LSFT)); + } + return false; + } + break; + case DE_BSLS: + if (record->event.pressed) { + uint8_t temp_mods = get_mods() | get_oneshot_mods(); + clear_mods(); + clear_oneshot_mods(); + add_mods(MOD_BIT(KC_RALT)); + if (temp_mods & MOD_MASK_SHIFT) { + register_code(KC_NUBS); // | Pipe + } else { + register_code(KC_MINS); // Backslash + } + set_mods(temp_mods); + } else { + unregister_code(KC_NUBS); + unregister_code(KC_MINS); + } + return true; + // switch multiplexing for escape, short tap for escape, long press for context menu + case M_ESCM: + if (record->event.pressed) { + key_timer = timer_read(); + } else { + if (timer_elapsed(key_timer) > TAPPING_TERM) { + tap_code(KC_APP); + } else { + tap_code(KC_ESC); + } + } + return false; + case M_RGUI_SCLN: + if (record->event.pressed) { + key_timer = timer_read(); + add_mods(MOD_BIT(KC_RGUI)); + } else { + del_mods(MOD_BIT(KC_RGUI)); + if (timer_elapsed(key_timer) < (TAPPING_TERM * pinky_factor)) { + uint8_t temp_mods = get_mods() | get_oneshot_mods(); + if (temp_mods & MOD_MASK_SHIFT) { + tap_code(KC_DOT); // ; + } else { + add_mods(MOD_BIT(KC_LSFT)); + tap_code(KC_COMM); // : + del_mods(MOD_BIT(KC_LSFT)); + } + } else { + tap_code(KC_RGUI); + } + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo += 1; + } else { + muse_tempo -= 1; + } + } + } else { + if (clockwise) { +#ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); +#else + tap_code(KC_PGDN); +#endif + } else { +#ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); +#else + tap_code(KC_PGUP); +#endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { + if (active) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } + return true; +} + +void leader_end_user(void) { + if (leader_sequence_one_key(KC_F)) { + // Anything you can do in a macro. + SEND_STRING("QMK is awesome."); + } + if (leader_sequence_two_keys(KC_D, KC_D)) { + SEND_STRING(SS_LCTL("a") SS_LCTL("c")); + } + if (leader_sequence_three_keys(KC_D, KC_D, KC_S)) { + SEND_STRING("https://start.duckduckgo.com\n"); + } + if (leader_sequence_two_keys(KC_A, KC_S)) { + register_code(KC_LGUI); + register_code(KC_S); + unregister_code(KC_S); + unregister_code(KC_LGUI); + } +} + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} + +uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LSFT_T(KC_S): + return 0; + case RSFT_T(KC_E): + return 0; + case LSFT_T(KC_D): + return 0; + case RSFT_T(KC_K): + return 0; + case LSFT_T(KC_F): + return 0; + case RSFT_T(KC_U): + return 0; + case LT(_RAISE, KC_ENT): + return 0; + case LT(_RAISE_DE, KC_ENT): + return 0; + case LT(_LOWER, KC_BSPC): + return 0; + case LT(_LOWER_DE, KC_BSPC): + return 0; + default: + return QUICK_TAP_TERM; + } +} + +// Set RGB to change with layer changes +#define HSV_DARKORANGE 10, 255, 255 +#define HSV_DARKPINK 150, 100, 255 +#define HSV_GRASS 57, 255, 255 +#define HSV_OCEAN 148, 255, 255 + +// Light LEDs 1 to 9 in darkorange when HRCOLEMAK is active +const rgblight_segment_t PROGMEM my_layer0_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 10, HSV_DARKORANGE}); +// Light LEDs 1 to 9 in green when HRWIDECOLEMAK is active +const rgblight_segment_t PROGMEM my_layer1_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 10, HSV_OCEAN}); +// Light LEDs 1 to 9 in darkorange when de_layout_active is true +const rgblight_segment_t PROGMEM my_layer2_layer[] = RGBLIGHT_LAYER_SEGMENTS({3, 4, HSV_DARKORANGE}, {0, 3, HSV_OCEAN}, {8, 3, HSV_OCEAN}); +// Light LEDs 1 to 9 in red when GAMING layer is active +const rgblight_segment_t PROGMEM my_layer3_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 10, HSV_RED}); +// Light LEDs 1 to 9 in white when WIDECOLEMAK is active +const rgblight_segment_t PROGMEM my_layer4_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 10, HSV_WHITE}); +// Light bottom LEDs in purple when ADJUST layer is active +const rgblight_segment_t PROGMEM my_layer5_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 2, HSV_MAGENTA}, {7, 3, HSV_MAGENTA}); +// Light bottom LEDs in red when caps lock is active. Hard to ignore! +const rgblight_segment_t PROGMEM my_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 3, HSV_GRASS}, {7, 3, HSV_GRASS}); +// Light LEDs 1 to 9 in white when NAVIGATION is active +const rgblight_segment_t PROGMEM my_nav_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 10, HSV_WHITE}); + +// Now define the array of layers. Later layers take precedence +const rgblight_segment_t *const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(my_layer0_layer, // hrcolemak + my_layer1_layer, // hrwidecolemak + my_layer2_layer, // de_layout + my_layer3_layer, // gaming + my_layer4_layer, // widecolemak + my_layer5_layer, // adjust + my_nav_layer, // nav + my_capslock_layer // capslock +); + +void keyboard_post_init_user(void) { + // Enable the LED layers + rgblight_layers = my_rgb_layers; +} + +bool led_update_user(led_t led_state) { + rgblight_set_layer_state(7, led_state.caps_lock); + return true; +} + +layer_state_t layer_state_set_user(layer_state_t state) { + rgblight_set_layer_state(3, layer_state_cmp(state, _GAMING)); + rgblight_set_layer_state(4, layer_state_cmp(state, _WIDECOLEMAK)); + if ((layer_state_cmp(state, _LOWER) && layer_state_cmp(state, _RAISE)) || (layer_state_cmp(state, _LOWER_DE) && layer_state_cmp(state, _RAISE_DE))) { + return state | (1UL << _ADJUST); + } else { + return state & ~(1UL << _ADJUST); + } + // state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); + rgblight_set_layer_state(5, layer_state_cmp(state, _ADJUST)); + // return state; +} + +layer_state_t default_layer_state_set_user(layer_state_t state) { + rgblight_set_layer_state(4, layer_state_cmp(state, _WIDECOLEMAK)); + rgblight_set_layer_state(1, layer_state_cmp(state, _HRWIDECOLEMAK)); + rgblight_set_layer_state(2, layer_state_cmp(state, _HRWIDECOLEMAK_DE)); + return state; +} diff --git a/keyboards/planck/keymaps/jweickm/readme.md b/keyboards/planck/keymaps/jweickm/readme.md new file mode 100644 index 000000000000..dd34822b4216 --- /dev/null +++ b/keyboards/planck/keymaps/jweickm/readme.md @@ -0,0 +1,154 @@ +# Semi-wide German/English MIT Planck Layout +Added keymap for my planck MIT. +It has a German and an English switching mode, so that it works the exact same with both OS languages. +It is a semi-wide layout, with the left hand all the way to the edge, and with one extra column in the middle used for media controls. +Home row mods implemented in the top row with individual tapping_terms for different fingers. +Mouse layer accessible through the pinkies. +Navigation layer on space. + +``` +/* _HRWIDECOLEMAK +* ,-----------------------------------------------------------------------------------. +* | G-Q | A-W | S-F | C-P |_Num-B|Vol/B+|_Num-J| C-L | S-U | A-Y | G-/ | ü | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | A | R | S | T | G | TAB | M | N | E | I | O | ' | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* |_Mo-Z | X | C | D | V |Vol/B-| K | H | , | . |_Mo-/ | \ | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* |C-CAPS| LEAD |MN-ESC|_L-BSP| LSFT | _Nav-SPC |_R-ENT|S-DEL | RALT |_Mo <-|_Mo ->| +* `-----------------------------------------------------------------------------------' +*/ +/* _HRWIDECOLEMAK_DE +* same as above, when the PC is set to German layout +* ,-----------------------------------------------------------------------------------. +* | G-Q | A-W | S-F | C-P |_Num-B|Vol/B+|_Num-J| C-L | S-U | A-Y | G-/ | ü | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | A | R | S | T | G | TAB | M | N | E | I | O | ' | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* |_Mo-Z | X | C | D | V |Vol/B-| K | H | , | . |_Mo-/ | \ | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* |C-CAPS| LEAD |MN-ESC|_L-BSP| LSFT | _Nav-SPC |_R-ENT|S-DEL | RALT |_Mo <-|_Mo ->| +* `-----------------------------------------------------------------------------------' +*/ +/* _GAMING +* ,-----------------------------------------------------------------------------------. +* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | F5 | F8 | F9 |Vol/B+| +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | TAB | Q | W | E | R | T | Y | U | I | O | P |Vol/B-| +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | LSFT | A | S | D | F | G | H | J | Z | M | ; |_CM-EN| +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | LCTL | C | B | X | LALT | SPACE | ENT | RALT | ____ | ____ | !GAME| +* `-----------------------------------------------------------------------------------' +*/ +/* WIDECOLEMAK +* no mod taps +* ,-----------------------------------------------------------------------------------. +* | Q | W | F | P | B |Vol/B+| J | L | U | Y | / | Ü | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | A | R | S | T | G | TAB | M | N | E | I | O | ' | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | Z | X | C | D | V |Vol/B-| K | H | , | . | / |!CM-EN| +* |------+------+------+------+------+------+------+------+------+------+------+------| +* |C-CAPS|G-TAB |MN-ESC|_L-BSP| LSFT | _NAV-SPC |_R-ENT|S-DEL |C-TAB |_Mo <-|_Mo ->| +* `-----------------------------------------------------------------------------------' +*/ +/* _LOWER +* ,-----------------------------------------------------------------------------------. +* | ! | @ | # | $ | % | ~ | ^ | & | * | ( | ) | Ö | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | F1 | F2 | F3 | F4 | F5 | F6 | ß | _ | + | { | } | Ä | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | F7 | F8 | F9 | F10 | F11 | F12 | MPLY | / | \ | | | € | è | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* |!MOUSE| ____ | ____ | ____ | ____ | ____ | ____ | Vol- | Vol+ | ↓ | ↑ | +* `-----------------------------------------------------------------------------------' +*/ +/* _LOWER_DE +* ,-----------------------------------------------------------------------------------. +* | ! | @ | # | $ | % | ~ | ^ | & | * | ( | ) | Ö | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | F1 | F2 | F3 | F4 | F5 | F6 | ß | _ | + | { | } | Ä | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | F7 | F8 | F9 | F10 | F11 | F12 | MPLY | / | \ | | | € | ` | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* |!MOUSE| ____ | ____ | ____ | ____ | ____ | ____ | Vol- | Vol+ | ↓ | ↑ | +* `-----------------------------------------------------------------------------------' +*/ +/* _RAISE +* ,-----------------------------------------------------------------------------------. +* | 1 | 2 | 3 | 4 | 5 | ` | 6 | 7 | 8 | 9 | 0 | ö | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | F1 | F2 | F3 | F4 | F5 | F6 | ß | - | = | [ | ] | ä | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | F7 | F8 | F9 | F10 | F11 | F12 | MPLY | \ | , | . | / | é | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* |!MOUSE| ____ | ____ | BSPC | ____ | ____ | ____ | |<< | >>| | ↓ | ↑ | +* `-----------------------------------------------------------------------------------' +*/ +/* _RAISE_DE +* ,-----------------------------------------------------------------------------------. +* | 1 | 2 | 3 | 4 | 5 | ` | 6 | 7 | 8 | 9 | 0 | ö | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | F1 | F2 | F3 | F4 | F5 | F6 | ß | - | = | [ | ] | ä | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | F7 | F8 | F9 | F10 | F11 | F12 | MPLY | \ | , | . | / | ´ | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* |!MOUSE| ____ | ____ | BSPC | ____ | ____ | ____ | |<< | >>| | ↓ | ↑ | +* `-----------------------------------------------------------------------------------' +*/ +/* _ADJUST +* ,-----------------------------------------------------------------------------------. +* | A-SFT| RESET| Debug|RGBTOG|RGBMOD|RGBHUI|RGBHUD|RGBSAI|RGBSAD|RGBVAI|RGBVAD| DE_SW| +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | A-GRV|EEPRST|MUNEXT| AU_ON|AU_OFF|AGNORM|AGSWAP|!HRWCM| !WCM | A-GRV| !LANG| !GAME| +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | ____ |AUPREV|AUNEXT| MU_ON|MU_OFF| MI_ON|MI_OFF| Vol- | MPLY | Vol+ | ____ | ____ | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |EEPRST| +* `-----------------------------------------------------------------------------------' +*/ +/* _NAV +* ,-----------------------------------------------------------------------------------. +* |A(TAB)| C(->)| !LANG|A(GRV)| C(<-)| >>| | HOME | -> | PGUP | COPY | PASTE| DE_SW| +* |------+------+------+------+------+------+------+------+------+------+------+------| +* |C(TAB)| TAB | ESC | ENT |VIM_GG| MPLY | <- | ↓ | ↑ | -> | END | VIM_O| +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | LSFT | XXXX |S(DEL)| CAPS | VIM_V| MUTE | HOME | PGDN | LSFT | RFST | C(F) | C(F) | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | XXXX | XXXX | ____ | BSPC | ____ | ____ | ENT | DEL | ____ | ____ | DE_SW| +* `-----------------------------------------------------------------------------------' +*/ +/* _VIM +* ,-----------------------------------------------------------------------------------. +* |A(TAB)| C(->)| !LANG|A(GRV)| C(<-)| >>| | HOME | -> | PGUP | COPY | PASTE| DE_SW| +* |------+------+------+------+------+------+------+------+------+------+------+------| +* |C(TAB)| TAB | ESC | ENT |VIM_GG| MPLY | <- | ↓ | ↑ | -> | END | VIM_O| +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | LSFT | XXXX |S(DEL)| CAPS | VIM_V| MUTE | HOME | PGDN | LSFT | RFST | C(F) | C(F) | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | XXXX | XXXX | !VIM | BSPC | ____ | ____ | ENT | DEL | ____ | ↓ | ↑ | +* `-----------------------------------------------------------------------------------' +*/ +/* _NUM +* ,-----------------------------------------------------------------------------------. +* | F1 | F2 | F3 | F4 | |<< |NUMLCK| >>| | 7 | 8 | 9 | - | ____ | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | F5 | F6 | F7 | F8 | Vol+ | MPLY | * | 4 | 5 | 6 | + | . | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | F9 | F10 | F11 | F12 | Vol- | MUTE | = | 1 | 2 | 3 | / | , | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | ____ | ____ | ____ | ____ | ____ | ____ | 0 | . | , | = | ____ | +* `-----------------------------------------------------------------------------------' +*/ +/* _MOUSE +* ,-----------------------------------------------------------------------------------. +* | XXXX | XXXX | MBTN4| MBTN5| XXXX | Bri+ | XXXX | MWHL↑|MAUS↑ | MWHL↑| XXXX | XXXX | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | XXXX | MBTN3| MBTN2| MBTN1| XXXX | MPLY | XXXX |MAUS<-|MAUS↓ |MAUS->| XXXX | XXXX | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | F9 | XXXX | XXXX | XXXX | XXXX | Bri- | XXXX | MWHL↓| XXXX | XXXX | ____ | XXXX | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* |!MOUSE| XXXX | XXXX | ____ | XXXX | MAUS_ACCEL2 | ____ | XXXX | XXXX | ↓ | ↑ | +* `-----------------------------------------------------------------------------------' + */ diff --git a/keyboards/planck/keymaps/jweickm/rules.mk b/keyboards/planck/keymaps/jweickm/rules.mk new file mode 100644 index 000000000000..067ac4768c9d --- /dev/null +++ b/keyboards/planck/keymaps/jweickm/rules.mk @@ -0,0 +1,5 @@ +CONSOLE_ENABLE = no # Console for debug +LEADER_ENABLE = yes +TAP_DANCE_ENABLE = yes # enable tap dance functionality + +SRC += muse.c diff --git a/keyboards/planck/keymaps/kanbara/config.h b/keyboards/planck/keymaps/kanbara/config.h new file mode 100644 index 000000000000..b701b9b40dff --- /dev/null +++ b/keyboards/planck/keymaps/kanbara/config.h @@ -0,0 +1,31 @@ +/* Copyright 2021 Jay Morrow + * + * 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE + #ifdef TEMPO_DEFAULT + #undef TEMPO_DEFAULT + #define TEMPO_DEFAULT 80 + #endif + + #define STARTUP_SONG SONG(MAJOR_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND), \ + SONG(WORKMAN_SOUND) \ + } +#endif diff --git a/keyboards/planck/keymaps/kanbara/keymap.c b/keyboards/planck/keymaps/kanbara/keymap.c new file mode 100644 index 000000000000..c3574ca45733 --- /dev/null +++ b/keyboards/planck/keymaps/kanbara/keymap.c @@ -0,0 +1,199 @@ +/* Copyright 2021 Jay Morrow + * + * 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 QMK_KEYBOARD_H + +enum planck_layers { + _QWERTY, + _COLEMAK, + _LEAGUE, + _LOWER, + _RAISE, + _ADJUST, + _LRAISE, +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + LEAGUE, +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define ADJUST MO(_ADJUST) +#define LRAISE MO(_LRAISE) + +#define KC_LQ LCTL(KC_Q) +#define KC_LW LCTL(KC_W) +#define KC_LE LCTL(KC_E) +#define KC_LR LCTL(KC_R) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Adjst| Ctrl | Alt | GUI | SPC | Lower| Raise| Enter| Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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_RSFT, + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, LOWER, RAISE, KC_ENT, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Adjst| Ctrl | Alt | GUI | SPC | Lower| Raise| Enter| Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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_RSFT, + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, LOWER, RAISE, KC_ENT, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* League + * ,-----------------------------------------------------------------------------------. + * | Tab | 1 | 2 | 3 | 4 | 5 | 6 | 7 | | | | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | Q | W | E | R | G | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | P | B | S | D | F | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| | | | | Spc | Raise| | Ent | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LEAGUE] = LAYOUT_planck_grid( + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_G, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_P, KC_B, KC_S, KC_D, KC_F, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + ADJUST, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, LRAISE, XXXXXXX, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ` | | _ | + | \ | { | } | | 7 | 8 | 9 | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ~ | | _ | = | | | [ | ] | | 4 | 5 | 6 | * | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | ( | ) | | 1 | 2 | 3 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | 0 | , | . | + | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_GRV, XXXXXXX, KC_MINS, KC_PLUS, KC_BSLS, KC_LCBR, KC_RCBR, XXXXXXX, KC_7, KC_8, KC_9, KC_SLSH, + KC_TILD, XXXXXXX, KC_UNDS, KC_EQL, KC_PIPE, KC_LBRC, KC_RBRC, XXXXXXX, KC_4, KC_5, KC_6, KC_ASTR, + _______, _______, _______, _______, _______, KC_LPRN, KC_RPRN, XXXXXXX, KC_1, KC_2, KC_3, KC_MINS, + _______, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_COMM, KC_DOT, KC_PLUS +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | Home | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | ! | @ | # | $ | % | ^ | & | * | | | PgUp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | Vol- | BR- | BR+ | Vol+ | | | | PgDn | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | End | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_HOME, + KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, _______, _______, KC_PGUP, + _______, _______, _______, _______, KC_VOLD, KC_BRMD, KC_BRMU, KC_VOLU, _______, _______, _______, KC_PGDN, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END +), + +/* Adjust + * ,-----------------------------------------------------------------------------------. + * |Reset |Debug | | | | | | | | | |Qwerty| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | |Colmk | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | |League| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, QWERTY, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, COLEMAK, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LEAGUE, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* League Raise + * ,-----------------------------------------------------------------------------------. + * | | F2 | F3 | F4 | F5 | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Ctrl-Q|Ctrl-W|Ctrl-E|Ctrl-R| | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LRAISE] = LAYOUT_planck_grid( + _______, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LQ, KC_LW, KC_LE, KC_LR, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + + +}; + +// set the default layer in ROM so that we preserve state across power transitions +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case LEAGUE: + if (record->event.pressed) { + set_single_persistent_default_layer(_LEAGUE); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/kanbara/readme.md b/keyboards/planck/keymaps/kanbara/readme.md new file mode 100644 index 000000000000..de32a84d2981 --- /dev/null +++ b/keyboards/planck/keymaps/kanbara/readme.md @@ -0,0 +1,118 @@ +kanbara's layout +======================= +This layout contains a Colemak and Qwerty mode (for easier pair programming with colleagues) +as well as a mode specifically to play League of Legends, as the normal mode does not provide +for accessible enough numbers and function keys + + +## Base Layers (Qwerty/Colemak/League) +After lots of tweaking, I've found that putting brackets in the middle is easier for +programming, and having a separate numpad input is quite handy. + +- Contains split `space` and `enter` +- Designed for macOS +- Keeps the `Tab`/`Esc` swap which I quite like +- Note the removal of evil caps lock + +### Qwerty +``` +,-----------------------------------------------------------------------------------. +| Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Esc | A | S | D | F | G | H | J | K | L | ; | " | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Shift| Z | X | C | V | B | N | M | , | . | / |Enter | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Adjst| Ctrl | Alt | GUI | SPC | Lower| Raise| Enter| Left | Down | Up |Right | +`-----------------------------------------------------------------------------------' +``` + +### Colemak +``` +,-----------------------------------------------------------------------------------. +| Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Esc | A | R | S | T | D | H | N | E | I | O | " | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Shift| Z | X | C | V | B | K | M | , | . | / |Enter | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Adjst| Ctrl | Alt | GUI | SPC | Lower| Raise| Enter| Left | Down | Up |Right | +`-----------------------------------------------------------------------------------' +``` + +### League + +- Has it's own raise just for F-keys and Ctrl+{Q,W,E,R} as a hold toggle +- Just the base keys needed for the game + the adjust and backspace + +``` +,-----------------------------------------------------------------------------------. +| Tab | 1 | 2 | 3 | 4 | 5 | 6 | 7 | | | | Bksp | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Esc | Q | W | E | R | G | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| P | B | S | D | F | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +|Adjust| | | | | Spc | Raise| | Ent | | | | +`-----------------------------------------------------------------------------------' +``` + +#### Raise +``` +,-----------------------------------------------------------------------------------. +| | F2 | F3 | F4 | F5 | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| |Ctrl-Q|Ctrl-W|Ctrl-E|Ctrl-R| | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | | +`-----------------------------------------------------------------------------------' +``` + +## Lower Layer (Programming symbols + numpad) +I've put a numpad on the right side, and brackets in the middle. I found that putting +the shifted equivalents of `-`, `+`, `\` and `~` are quite convenient to type with one hand + +``` +,-----------------------------------------------------------------------------------. +| ` | | _ | + | \ | { | } | | 7 | 8 | 9 | / | +|------+------+------+------+------+------+------+------+------+------+------+------| +| ~ | | _ | = | | | [ | ] | | 4 | 5 | 6 | * | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | ( | ) | | 1 | 2 | 3 | - | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | 0 | , | . | + | +`-----------------------------------------------------------------------------------' +``` + +## Raise Layer (Function keys + shifted numbers) +Here are the Function keys, as well as shifted 1-9 in order, and some nav and OS keys + +``` +,-----------------------------------------------------------------------------------. +| ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | Home | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Del | ! | @ | # | $ | % | ^ | & | * | | | PgUp | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | Vol- | BR- | BR+ | Vol+ | | | | PgDn | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | End | +`-----------------------------------------------------------------------------------' +``` + +## Adjust Layer +Contains reset, debug and the layer on the right which are set in EEPROM across power +transitions + +``` +,-----------------------------------------------------------------------------------. +|Reset |Debug | | | | | | | | | |Qwerty| +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | |Colmk | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | |League| +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | | +`-----------------------------------------------------------------------------------' +``` diff --git a/keyboards/planck/keymaps/kanbara/rules.mk b/keyboards/planck/keymaps/kanbara/rules.mk new file mode 100644 index 000000000000..1286dbfa86e9 --- /dev/null +++ b/keyboards/planck/keymaps/kanbara/rules.mk @@ -0,0 +1,9 @@ +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = no +COMMAND_ENABLE = yes +NKRO_ENABLE = yes +BACKLIGHT_ENABLE = no +AUDIO_ENABLE = yes +RGBLIGHT_ENABLE = no diff --git a/keyboards/planck/keymaps/kelorean/config.h b/keyboards/planck/keymaps/kelorean/config.h new file mode 100644 index 000000000000..8b6773ed0944 --- /dev/null +++ b/keyboards/planck/keymaps/kelorean/config.h @@ -0,0 +1,38 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif diff --git a/keyboards/planck/keymaps/kelorean/keymap.c b/keyboards/planck/keymaps/kelorean/keymap.c new file mode 100644 index 000000000000..0091a10f9bc9 --- /dev/null +++ b/keyboards/planck/keymaps/kelorean/keymap.c @@ -0,0 +1,263 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Esc | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Bksp | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Sft/En| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Brite| Alt | GUI |Lower | Space |Raise | Left | Up | Down |Ctr/Rt| + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ESC, + 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), + KC_LCTL, BACKLIT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, CTL_T(KC_RGHT) +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Esc | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Bksp | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |Sft/Es| Z | X | C | V | B | K | M | , | . | / |Sft/En| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Brite| Alt | GUI |Lower | Space |Raise | Left | Up | Down |Ctr/Rt| + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_ESC, + KC_BSPC, 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, SFT_T(KC_ENT), + KC_LCTL, BACKLIT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, CTL_T(KC_RGHT) +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Esc | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Bksp | A | O | E | U | I | D | H | T | N | S | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |Sft/Es| ; | Q | J | K | X | B | M | W | V | Z |Sft/En| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Brite| Alt | GUI |Lower | Space |Raise | Left | Up | Down |Ctr/Rt| + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_ESC, + KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_QUOT, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_ENT), + KC_LCTL, BACKLIT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, CTL_T(KC_RGHT) +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + PORTE &= ~(1<<6); + } else { + unregister_code(KC_RSFT); + PORTE |= (1<<6); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/kelorean/readme.md b/keyboards/planck/keymaps/kelorean/readme.md new file mode 100644 index 000000000000..fd1f3517083d --- /dev/null +++ b/keyboards/planck/keymaps/kelorean/readme.md @@ -0,0 +1 @@ +# The Default Planck Layout \ No newline at end of file diff --git a/keyboards/planck/keymaps/kifinnsson/config.h b/keyboards/planck/keymaps/kifinnsson/config.h new file mode 100644 index 000000000000..9020d2b9f882 --- /dev/null +++ b/keyboards/planck/keymaps/kifinnsson/config.h @@ -0,0 +1,36 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/kifinnsson/keymap.c b/keyboards/planck/keymaps/kifinnsson/keymap.c new file mode 100644 index 000000000000..5f6ff8873169 --- /dev/null +++ b/keyboards/planck/keymaps/kifinnsson/keymap.c @@ -0,0 +1,573 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +bool is_lgui_active = false; +uint16_t lgui_timer = 0; + + +enum planck_layers { _COLEMAK, _LOWER, _RAISE, _EXTEND, _MACRO, _ADJUST }; + +enum planck_keycodes { + KI_BSPC = SAFE_RANGE, + KI_COMM, + KI_DOT, + KI_ESC, + KI_QUOT, + KI_SCLN, + KI_SLSH, + KI_TAB, + KI_A, + KI_B, + KI_C, + KI_D, + KI_E, + KI_F, + KI_G, + KI_H, + KI_I, + KI_J, + KI_K, + KI_L, + KI_M, + KI_N, + KI_O, + KI_P, + KI_Q, + KI_R, + KI_S, + KI_T, + KI_U, + KI_V, + KI_W, + KI_X, + KI_Y, + KI_Z, + KI_WLFT, + KI_WRGT, + KI_WUP, + KI_WDN + }; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define MACROS MO(_MACRO) +#define EXTEND MO(_EXTEND) +#define SPC_LOW LT(_LOWER, KC_SPC) +#define SPC_RAI LT(_RAISE, KC_SPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Colemak + * ,------------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------+-------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+-------+-------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+-------+-------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower |SPC_LOW|SPC_RAI|Raise | Left | Down | Up |Right | + * `-------------------------------------------------------------------------------------' + */ + [_COLEMAK] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + EXTEND, 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, + MACROS, KC_LCTL, KC_LALT, KC_LGUI, LOWER, SPC_LOW, SPC_RAI, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |XXXXXX|XXXXXX| Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |XXXXXX|XXXXXX|Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_planck_grid( + 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_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + + /* Extend + * ,-----------------------------------------------------------------------------------. + * | | Esc | WH_U | WBAK | WFWD | MS_U | PgUp | Home | Up | End | Del | Esc | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Alt | WH_D |Shift | Ctrl | MS_D | PgDn | Left | Down |Right | Bksp | Menu | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | WH_L | Undo | Cut | Copy |Paste |MS_B_1|MS_B_2|MS_B_3| MS_L | MS_R | WH_R | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_EXTEND] = LAYOUT_planck_grid( + _______, KC_ESC, KC_WH_U, KC_WBAK, KC_WFWD, KC_MS_U, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_DEL, KC_ESC, + _______, KC_LALT, KC_WH_D, KC_LSFT, KC_LCTL, KC_MS_D, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSPC, KC_APP, + KC_WH_L, KC_UNDO, KC_CUT, KC_COPY, KC_PSTE, KC_BTN1, KC_BTN2, KC_BTN3, KC_MS_L, KC_MS_R, KC_WH_R, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Macros + * ,--------------------------------------------------------------------------------------. + * |KI_TAB| KI_Q | KI_W | KI_F | KI_P | KI_G | KI_J | KI_L | KI_U | KI_Y |KI_SCLN|KI_BSPC| + * |------+------+------+------+------+------+------+------+-------+------+-------+-------| + * |KI_ESC| KI_A | KI_R | KI_S | KI_T | KI_D | KI_H | KI_N | KI_E | KI_I | KI_O |KI_QUOT| + * |------+------+------+------+------+------+------+------+-------+------+-------+-------| + * | | KI_Z | KI_X | KI_C | KI_V | KI_B | KI_K | KI_M |KI_COMM|KI_DOT|KI_SLSH| | + * |------+------+------+------+------+------+------+------+-------+------+-------+-------| + * | | | | | | | | |KI_WLFT|KI_WDN|KI_WUP |KI_WGRT| + * `--------------------------------------------------------------------------------------' + */ + [_MACRO] = LAYOUT_planck_grid( + KI_TAB, KI_Q, KI_W, KI_F, KI_P, KI_G, KI_J, KI_L, KI_U, KI_Y, KI_SCLN, KI_BSPC, + KI_ESC, KI_A, KI_R, KI_S, KI_T, KI_D, KI_H, KI_N, KI_E, KI_I, KI_O, KI_QUOT, + _______, KI_Z, KI_X, KI_C, KI_V, KI_B, KI_K, KI_M, KI_COMM, KI_DOT, KI_SLSH, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KI_WLFT, KI_WDN, KI_WUP, KI_WRGT + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| Debug| | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | |AGnorm|AGswap| |Colemk| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) + }; + +layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); } + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) + // + // Non-Alpha Macros + // + // 'Backspace' Macro + case KI_BSPC: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED Backspace"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'Comma' Macro + case KI_COMM: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED Comma"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'Dot' Macro + case KI_DOT: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED Dot"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'Escape' Macro + case KI_ESC: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED Escape"); + } else { + } + // 'Quote' Macro + case KI_QUOT: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED Quote"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'Semicolon' Macro + case KI_SCLN: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED Semicolon"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'Slash' Macro + case KI_SLSH: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED Slash"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'Tab' Macro + case KI_TAB: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED Tab"); + } else { + } + return false; // Skip all further processing of this key + break; + // + // Alpha Macros + // + // 'A' Macro + case KI_A: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED A"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'B' Macro + case KI_B: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED B"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'C' Macro + case KI_C: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED C"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'D' Macro + case KI_D: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED D"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'E' Macro + case KI_E: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED E"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'F' Macro + case KI_F: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED F"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'G' Macro + case KI_G: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED G"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'H' Macro + case KI_H: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED H"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'I' Macro + case KI_I: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED I"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'J' Macro + case KI_J: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED J"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'K' Macro + case KI_K: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED K"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'L' Macro + case KI_L: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED L"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'M' Macro + case KI_M: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED M"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'N' Macro + case KI_N: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED N"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'O' Macro + case KI_O: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED O"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'P' Macro + case KI_P: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED P"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'Q' Macro + case KI_Q: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED Q"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'R' Macro + case KI_R: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED R"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'S' Macro + case KI_S: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED S"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'T' Macro + case KI_T: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED T"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'U' Macro + case KI_U: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED U"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'V' Macro + case KI_V: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED V"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'W' Macro + case KI_W: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED W"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'X' Macro + case KI_X: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED X"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'Y' Macro + case KI_Y: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED Y"); + } else { + } + return false; // Skip all further processing of this key + break; + // 'Z' Macro + case KI_Z: + if (record->event.pressed) { + // Reserved for future use + //SEND_STRING("RESERVED Z"); + } else { + } + return false; // Skip all further processing of this key + break; + // + // Arrow key macros + // + // Windows Win+Left tap to move window without resetting KC_LGUI + // Additional code is in matrix_scan_user() + case KI_WLFT: + if (record->event.pressed) { + if (!is_lgui_active) { + is_lgui_active = true; + register_code(KC_LGUI); + } + lgui_timer = timer_read(); + tap_code(KC_LEFT); + } else { + } + return false; // Skip all further processing of this key + break; + // Windows Win+Right tap to move window without resetting KC_LGUI + // Additional code is in matrix_scan_user() + case KI_WRGT: + if (record->event.pressed) { + if (!is_lgui_active) { + is_lgui_active = true; + register_code(KC_LGUI); + } + lgui_timer = timer_read(); + tap_code(KC_RIGHT); + } else { + } + return false; // Skip all further processing of this key + break; + // Windows Win+Up tap to move window without resetting KC_LGUI + // Additional code is in matrix_scan_user() + case KI_WUP: + if (record->event.pressed) { + if (!is_lgui_active) { + is_lgui_active = true; + register_code(KC_LGUI); + } + lgui_timer = timer_read(); + tap_code(KC_UP); + } else { + } + return false; // Skip all further processing of this key + break; + // Windows Win+Down tap to move window without resetting KC_LGUI + // Additional code is in matrix_scan_user() + case KI_WDN: + if (record->event.pressed) { + if (!is_lgui_active) { + is_lgui_active = true; + register_code(KC_LGUI); + } + lgui_timer = timer_read(); + tap_code(KC_DOWN); + } else { + } + return false; // Skip all further processing of this key + break; + default: + return true; // Process all other keycodes normally + break; + } + return true; +} + +void matrix_scan_user(void) { + // Check if KC_LGUI is active in KI_WLFT, KI_WRGT, KI_WUP + if (is_lgui_active) { + if (timer_elapsed(lgui_timer) > 1000) { + unregister_code(KC_LGUI); + is_lgui_active = false; + } + } +} diff --git a/keyboards/planck/keymaps/kifinnsson/readme.md b/keyboards/planck/keymaps/kifinnsson/readme.md new file mode 100644 index 000000000000..1a6c86e2a8a5 --- /dev/null +++ b/keyboards/planck/keymaps/kifinnsson/readme.md @@ -0,0 +1 @@ +# kifinnsson's planck layout diff --git a/keyboards/planck/keymaps/kifinnsson/rules.mk b/keyboards/planck/keymaps/kifinnsson/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/kifinnsson/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/kloki/config.h b/keyboards/planck/keymaps/kloki/config.h new file mode 100644 index 000000000000..6166fea4a779 --- /dev/null +++ b/keyboards/planck/keymaps/kloki/config.h @@ -0,0 +1,34 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 diff --git a/keyboards/planck/keymaps/kloki/keymap.c b/keyboards/planck/keymaps/kloki/keymap.c new file mode 100644 index 000000000000..9ba40f318b49 --- /dev/null +++ b/keyboards/planck/keymaps/kloki/keymap.c @@ -0,0 +1,147 @@ +#include QMK_KEYBOARD_H +extern keymap_config_t keymap_config; + +enum planck_layers { + _WORKMAN, + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + WORKMAN = SAFE_RANGE, + QWERTY, + LOWER, + RAISE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Workman + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | D | R | W | B | J | F | U | P | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ct/E | A | S | H | T | G | Y | N | E | O | I |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | M | C | V | K | L | , | . | / | " ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | GUI | Alt | Alt | [ | ] | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_WORKMAN] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSPC , + CTL_T(KC_ESC), KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_ENT , + KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT , + KC_LGUI, KC_LALT, KC_LBRC, KC_RBRC, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + + +[_QWERTY] = LAYOUT_planck_grid( + _______, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + _______, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT , + _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, + _______, _______, _______, _______, _______,_______,_______,_______,_______,_______, _______, _______ +), + +/* LOWER + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_BTN1, KC_MS_U, KC_BTN2, _______, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* RAISE + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | { | } | * | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | # | $ | ( | ) | ` | - | _ | + | = | \ | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | % | ^ | [ | ] | ~ | & | < | > | Home | End | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_ASTR, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL , + KC_DEL, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_MINS, KC_UNDS, KC_PLUS, KC_EQL, KC_BSLS, _______, + _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_AMPR, KC_LABK, KC_RABK, KC_HOME, KC_END, KC_PIPE, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + + + + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | T | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff| | |Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, _______, _______, QWERTY, WORKMAN, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) +}; + + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case WORKMAN: + if (record->event.pressed) { + set_single_persistent_default_layer(_WORKMAN); + } + return false; + break; + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/kloki/readme.md b/keyboards/planck/keymaps/kloki/readme.md new file mode 100644 index 000000000000..9b3ec3e00e4f --- /dev/null +++ b/keyboards/planck/keymaps/kloki/readme.md @@ -0,0 +1,4 @@ +# Kloki's planck layout + +Pretty much default with added workman layout. Removed stuff I dont use and rearanged the modifiers a bit. + diff --git a/keyboards/planck/keymaps/kloki/rules.mk b/keyboards/planck/keymaps/kloki/rules.mk new file mode 100644 index 000000000000..4f9189130345 --- /dev/null +++ b/keyboards/planck/keymaps/kloki/rules.mk @@ -0,0 +1,2 @@ +MOUSEKEY_ENABLE = yes +NKRO_ENABLE = no diff --git a/keyboards/planck/keymaps/kmontag42/config.h b/keyboards/planck/keymaps/kmontag42/config.h new file mode 100644 index 000000000000..59bf4aa2a3ea --- /dev/null +++ b/keyboards/planck/keymaps/kmontag42/config.h @@ -0,0 +1,39 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/kmontag42/keymap.c b/keyboards/planck/keymaps/kmontag42/keymap.c new file mode 100644 index 000000000000..51e7149ce618 --- /dev/null +++ b/keyboards/planck/keymaps/kmontag42/keymap.c @@ -0,0 +1,209 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,--------------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |---------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |---------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift/( | Z | X | C | V | B | N | M | , | . | / |Enter | + * |---------+------+------+------+------+------+------+------+------+------+------+------| + * | GUI | Ctrl | Alt | ) |Lower | Space |Raise | Left | Down | Up |Right | + * `--------------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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, + SC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_LGUI, KC_LCTL, KC_LALT, KC_RPRN, LOWER, QK_LEAD, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/kmontag42/readme.md b/keyboards/planck/keymaps/kmontag42/readme.md new file mode 100644 index 000000000000..61bcef4be414 --- /dev/null +++ b/keyboards/planck/keymaps/kmontag42/readme.md @@ -0,0 +1,10 @@ +# KMontag42's Planck Layout + +[![Built with Spacemacs](https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg)](http://spacemacs.org) + +## Additional Notes +This layout is WIP as I continute to tinker with my Planck, expect more updates here soon. + +## Notable features +* Split spacebar used leader key +* Space cadet style parens diff --git a/keyboards/planck/keymaps/kmontag42/rules.mk b/keyboards/planck/keymaps/kmontag42/rules.mk new file mode 100644 index 000000000000..5712a735d1e5 --- /dev/null +++ b/keyboards/planck/keymaps/kmontag42/rules.mk @@ -0,0 +1,3 @@ +UNICODE_ENABLE = yes +LEADER_ENABLE = yes + diff --git a/keyboards/planck/keymaps/komidore64/config.h b/keyboards/planck/keymaps/komidore64/config.h new file mode 100644 index 000000000000..d1afe52f2409 --- /dev/null +++ b/keyboards/planck/keymaps/komidore64/config.h @@ -0,0 +1,27 @@ +/* + * Copyright 2022 M. Adam Price + * + * 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 3 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 . + */ + + +// QMK configuration ///////// +#define TAPPING_TERM 400 +#define PERMISSIVE_HOLD +////////////////////////////// + +// k64 keymap configuration // +#define KEYMAP_REVISION "11" +#define VER_NEWLINE_WAIT 200 // in milliseconds +////////////////////////////// diff --git a/keyboards/planck/keymaps/komidore64/keymap.c b/keyboards/planck/keymaps/komidore64/keymap.c new file mode 100644 index 000000000000..6897f6c81ad3 --- /dev/null +++ b/keyboards/planck/keymaps/komidore64/keymap.c @@ -0,0 +1,66 @@ +/* + * Copyright 2022 M. Adam Price + * + * 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 3 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 QMK_KEYBOARD_H + +#include "version.h" + +enum custom_keycodes { + VER_STR = SAFE_RANGE, +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case VER_STR: + if (record->event.pressed) { + SEND_STRING("# qmk " QMK_VERSION "\n"); + wait_ms(VER_NEWLINE_WAIT); + SEND_STRING("# " QMK_KEYBOARD "/" QMK_KEYMAP " version " KEYMAP_REVISION "\n"); + wait_ms(VER_NEWLINE_WAIT); + SEND_STRING("# built on: " QMK_BUILDDATE "\n"); + } + break; + } + return true; +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_planck_1x2uC( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LCTL_T(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, RSFT_T(KC_ENT), + XXXXXXX, KC_ALGR, KC_LGUI, KC_LALT, MO(1), KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + [1] = LAYOUT_planck_1x2uC( + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_INS, _______, _______, _______, _______, _______, MO(3), KC_HOME, KC_PGDN, KC_PGUP, KC_END + ), + [2] = LAYOUT_planck_1x2uC( + KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_INS, _______, _______, _______, MO(3), _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END + ), + [3] = LAYOUT_planck_1x2uC( + QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPLY, KC_DEL, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, XXXXXXX, XXXXXXX, + KC_CAPS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, VER_STR, + _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ) +}; diff --git a/keyboards/planck/keymaps/komidore64/readme.md b/keyboards/planck/keymaps/komidore64/readme.md new file mode 100644 index 000000000000..85b632530f5d --- /dev/null +++ b/keyboards/planck/keymaps/komidore64/readme.md @@ -0,0 +1,10 @@ +# komidore64 OLKB Plank rev6 + +The fanciest change in this keymap compared to the default is I've added a +version string output command. + +``` +# qmk 0.7.151-13-ga942ac +# planck/rev6/komidore64 version 11 +# built on: 2020-02-12-12:21:46 +``` diff --git a/keyboards/planck/keymaps/kuatsure/config.h b/keyboards/planck/keymaps/kuatsure/config.h new file mode 100644 index 000000000000..8d832285bcd7 --- /dev/null +++ b/keyboards/planck/keymaps/kuatsure/config.h @@ -0,0 +1,33 @@ +/* Copyright 2020 kuatsure + * + * 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define GAME_SOUND DVORAK_SOUND + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(GAME_SOUND) \ + } +#endif + +#define MIDI_BASIC + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/kuatsure/keymap.c b/keyboards/planck/keymaps/kuatsure/keymap.c new file mode 100644 index 000000000000..db78f1138ee1 --- /dev/null +++ b/keyboards/planck/keymaps/kuatsure/keymap.c @@ -0,0 +1,318 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" +#include "kuatsure.h" + +#define LAYOUT_planck_grid_wrapper(...) LAYOUT_planck_grid(__VA_ARGS__) + +enum planck_layers { + _QWERTY, + _GAME, + _GAME_LOWER, + _GAME_RAISE, + _MOUSE, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = USER_SAFE_RANGE, + GAME, +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define MOUSE TG(_MOUSE) +#define G_LOWER MO(_GAME_LOWER) +#define G_RAISE MO(_GAME_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab/M| Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc/C| A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | Ent | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Mute | Ldr | Alt | GUI |Lower | RSE | SPC | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid_wrapper( + KT_MTAB, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, + KT_CESC, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, + KT_LSFT, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_ENT, + KC_MPLY, QK_LEAD, KC_LALT, KC_LGUI, LOWER, RAISE, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | | ! | & | Up | | ` | | { | } | _ | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Del | Left | Down | Right| ~ | = | ( | ) | + | : | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | VolD | Prev | Play | Next | VolU | - | [ | ] | | ? |Mouse | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Home | PgDn | PgUp | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid_wrapper( + _______, KC_EXLM, KC_AMPR, KC_UP, _______, KC_GRV, _______, ____CRBRACES____, KC_UNDS, _______, KC_PIPE, + _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TILD, KC_EQL, _____PARENS_____, KC_PLUS, KC_COLN, KC_DQT , + _______, KC_VOLD, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLU, KC_MINS, ___SQBRACKETS___, _______, KC_QUES, MOUSE , + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | | F9 | F10 | F11 | F12 | | * | 7 | 8 | 9 | 0 | \ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F5 | F6 | F7 | F8 | | = | 4 | 5 | 6 | + | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | | - | 1 | 2 | 3 | / | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | 0 | 0 | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid_wrapper( + _______, ____________FUNCTION_3____________, _______, KC_ASTR, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + _______, ____________FUNCTION_2____________, _______, KC_EQL, KC_4, KC_5, KC_6, KC_PLUS, _______, + _______, ____________FUNCTION_1____________, _______, KC_MINS, KC_1, KC_2, KC_3, KC_SLASH, _______, + _______, _______, _______, _______, _______, _______, _______, KC_0, KC_0, _______, _______, _______ +), + +/* Mouse + * ,-----------------------------------------------------------------------------------. + * | | | Btn1 | mUP | Btn2 | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | mLEFT| mDWN | mRGHT| | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | Btn3 | Btn4 | Btn5 | | | | | | |Mouse | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_MOUSE] = LAYOUT_planck_grid_wrapper( + _______, _______, KC_BTN1, KC_MS_U, KC_BTN2, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______, _______, _______, _______, _______, MOUSE , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | MAKE | FLSH | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Boot | Debug| | |Aud on|AudOff| Game |Mouse | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | VRSN | | |MusMod|Mus on|MusOff| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid_wrapper( + _______, KB_MAKE, KB_FLSH, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, QK_BOOT, DB_TOGG, _______, _______, AU_ON, AU_OFF, GAME, MOUSE, _______, _______, _______, + _______, KB_VRSN, _______, _______, MU_NEXT, MU_ON, MU_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Game + * + * Mostly transparent, but wanted to disable gui key. + * Also give a key to get back to qwerty layout. + * + * Disabling the `Controlled ESC` key is also plus. + * Think BDO / Monster Hunter / D2 + * + * ,-----------------------------------------------------------------------------------. + * | Tab | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | | | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shft | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Qwerty| F14 | Spc | gLWR | gRSE | ESC | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_GAME] = LAYOUT_planck_grid_wrapper( + KC_TAB, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LCTL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, QWERTY, KC_F14, KC_SPC, G_LOWER, G_RAISE, KC_ESC, KC_ESC, _______, _______, _______, _______ +), + +/* Game Lower + * ,-----------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | ` | | F9 | F10 | F11 | F12 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | 5 | 6 | 7 | 8 | | | F5 | F6 | F7 | F8 | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | 9 | 0 | - | = | | | F1 | F2 | F3 | F4 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_GAME_LOWER] = LAYOUT_planck_grid_wrapper( + _______, KC_1, KC_2, KC_3, KC_4, KC_GRV, _______, ____________FUNCTION_3____________, _______, + _______, KC_5, KC_6, KC_7, KC_8, _______, _______, ____________FUNCTION_2____________, _______, + _______, KC_9, KC_0, KC_MINS, KC_EQL, _______, _______, ____________FUNCTION_1____________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Game Raise + * ,-----------------------------------------------------------------------------------. + * | | p7 | p8 | p9 | p0 | ` | | F9 | F10 | F11 | F12 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | p4 | p5 | p6 | p+ | | | F5 | F6 | F7 | F8 | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | p1 | p2 | p3 | pE | | | F1 | F2 | F3 | F4 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_GAME_RAISE] = LAYOUT_planck_grid_wrapper( + _______, KC_P7, KC_P8, KC_P9, KC_P0, KC_GRV, _______, ____________FUNCTION_3____________, _______, + _______, KC_P4, KC_P5, KC_P6, KC_PPLS, _______, _______, ____________FUNCTION_2____________, _______, + _______, KC_P1, KC_P2, KC_P3, KC_PENT, _______, _______, ____________FUNCTION_1____________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + + case GAME: + if (record->event.pressed) { + set_single_persistent_default_layer(_GAME); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + if (IS_LAYER_ON(_MOUSE)) { + tap_code(KC_MS_WH_UP); + } else { + tap_code(KC_VOLU); + } + } else { + if (IS_LAYER_ON(_MOUSE)) { + tap_code(KC_MS_WH_DOWN); + } else { + tap_code(KC_VOLD); + } + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_keymap(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/kuatsure/readme.md b/keyboards/planck/keymaps/kuatsure/readme.md new file mode 100644 index 000000000000..b1e5c642308b --- /dev/null +++ b/keyboards/planck/keymaps/kuatsure/readme.md @@ -0,0 +1 @@ +# The kuatsure Planck layout - largely based on the Preonic's & Keyboard Paradise V60's layout diff --git a/keyboards/planck/keymaps/kuatsure/rules.mk b/keyboards/planck/keymaps/kuatsure/rules.mk new file mode 100644 index 000000000000..f9fba61d3ebf --- /dev/null +++ b/keyboards/planck/keymaps/kuatsure/rules.mk @@ -0,0 +1,6 @@ +SRC += muse.c + +BACKLIGHT_ENABLE = no +LEADER_ENABLE = yes +ENCODER_ENABLE = yes +MOUSEKEY_ENABLE = yes diff --git a/keyboards/planck/keymaps/kyle/keymap.c b/keyboards/planck/keymaps/kyle/keymap.c new file mode 100644 index 000000000000..896dfe939776 --- /dev/null +++ b/keyboards/planck/keymaps/kyle/keymap.c @@ -0,0 +1,29 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_planck_grid( /* Qwerty */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_RCTL, KC_LCTL, KC_LALT, KC_LGUI, MO(3), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + // Space is repeated to accommadate for both spacebar wiring positions +), +[1] = LAYOUT_planck_grid( /* Colemak */ + KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + DF(0), KC_LCTL, KC_LALT, KC_LGUI, MO(3), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), +[2] = LAYOUT_planck_grid( /* 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, DF(0), DF(1), 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, MO(2), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), +[3] = LAYOUT_planck_grid( /* 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, DF(0), DF(1), LSFT(RSFT(KC_PAUSE)), LSFT(RSFT(KC_D)), KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS), + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, + BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, MO(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +) +}; diff --git a/keyboards/planck/keymaps/kyle/rules.mk b/keyboards/planck/keymaps/kyle/rules.mk new file mode 100644 index 000000000000..d86b02fd1ce4 --- /dev/null +++ b/keyboards/planck/keymaps/kyle/rules.mk @@ -0,0 +1,22 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/lae3/keymap.c b/keyboards/planck/keymaps/lae3/keymap.c new file mode 100644 index 000000000000..7b6175d5437b --- /dev/null +++ b/keyboards/planck/keymaps/lae3/keymap.c @@ -0,0 +1,253 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum planck_layers { + _QWERTY, + _ARROW, + _NUMPAD, + _MOVEMENT, + _LOWER, + _RAISE, + _ADJUST +}; + +#define _MV _MOVEMENT + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + ARROW, + NUMPAD, + LOWER, + RAISE, +}; + +#define KC_MUP KC_MS_UP +#define KC_MDN KC_MS_DOWN +#define KC_MLFT KC_MS_LEFT +#define KC_MRGT KC_MS_RIGHT +#define KC_MB1 KC_MS_BTN1 +#define KC_MB2 KC_MS_BTN2 +#define KC_MB3 KC_MS_BTN3 +#define KC_MB4 KC_MS_BTN4 +#define KC_MB5 KC_MS_BTN5 +#define KC_MWUP KC_MS_WH_UP +#define KC_MWDN KC_MS_WH_DOWN + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Shift | Z | X | C | V | B | N | M | , | . | / |Shift | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | GUI | Alt | Move |Lower | Space |Raise | Move | Alt | GUI | Ctrl | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT , + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, MO(_MV), LOWER, KC_SPC, KC_SPC, RAISE, MO(_MV), KC_RALT, KC_RGUI, KC_RCTL + ), + + /* Arrow + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | Up | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | Left | Down | Right| + * `-----------------------------------------------------------------------------------' + */ + [_ARROW] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Numpad + * ,-----------------------------------------------------------------------------------. + * | | | | | | |NumLck| 7 | 8 | 9 | / | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | |Enter | 4 | 5 | 6 | * | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | 3 | 2 | 1 | - | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | 0 | . | + | | + * `-----------------------------------------------------------------------------------' + */ + [_NUMPAD] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, KC_NUM, KC_P7, KC_P8, KC_P9, KC_PSLS, _______, + _______, _______, _______, _______, _______, _______, KC_PENT, KC_P4, KC_P5, KC_P6, KC_PAST, _______, + _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PMNS, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PPLS, _______ + ), + + /* Movement + * ,-----------------------------------------------------------------------------------. + * | |MsBut2|Ms Up |MsBut1|MsWhUp| | Home | PgDn | PgUp | End | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Ms Lft|Ms Dn |Ms Rgt|MsWhDn| | Left | Down | Up | Right| | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_MOVEMENT] = LAYOUT_planck_grid( + _______, KC_MB2, KC_MUP, KC_MB1, KC_MWUP, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, + _______, KC_MLFT, KC_MDN, KC_MRGT, KC_MWDN, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | - | = | Del | End | PgDn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Caps | 6 | 7 | 8 | 9 | 0 | [ | ] | \ | ' | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | | | F5 | F6 | F7 | F8 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_DEL, KC_END, KC_PGDN, _______, + KC_CAPS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSLS, KC_QUOT, XXXXXXX, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | _ | + | Ins | Home | PgUp | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Caps | ^ | & | * | ( | ) | { | } | | | " | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F9 | F10 | F11 | F12 | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_INS, KC_HOME, KC_PGUP, _______, + KC_CAPS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_LCBR, KC_RCBR, KC_PIPE, KC_DQUO, XXXXXXX, _______, + _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * |Reset | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Bcklgt| Mute |Vol Dn|Vol Up| | |Qwerty|Arrow |Numpad| | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT_planck_grid( + QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, BL_STEP, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, QWERTY, ARROW, NUMPAD, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); + +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + update_tri_layer(_LOWER, _RAISE, _ADJUST); + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + update_tri_layer(_LOWER, _RAISE, _ADJUST); + return false; + case QWERTY: + if (record->event.pressed) { + layer_off(_ARROW); + layer_off(_NUMPAD); + } + return false; + case ARROW: + if (record->event.pressed) { + layer_off(_NUMPAD); + layer_on(_ARROW); + } + return false; + case NUMPAD: + if (record->event.pressed) { + layer_off(_ARROW); + layer_on(_NUMPAD); + } + return false; + } + return true; +} + +void matrix_init_user(void) +{ +#ifdef AUDIO_ENABLE + startup_user(); +#endif +} + +#ifdef AUDIO_ENABLE + +void startup_user(void) +{ + _delay_ms(100); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user(void) +{ + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif diff --git a/keyboards/planck/keymaps/lae3/readme.md b/keyboards/planck/keymaps/lae3/readme.md new file mode 100644 index 000000000000..57a2f38ddc7f --- /dev/null +++ b/keyboards/planck/keymaps/lae3/readme.md @@ -0,0 +1,111 @@ +# Lae3 +_Keymap based around mode-switching for extended functionality_ + +## Base Layout + + ┌-----------------------------------------------------------------------------------┐ + | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Tab | A | S | D | F | G | H | J | K | L | ; |Enter | + |------+------+------+------+------+------+------+------+------+------+------+------| + |Shift | Z | X | C | V | B | N | M | , | . | / |Shift | + |------+------+------+------+------+-------------+------+------+------+------+------| + | Ctrl | GUI | Alt | Move |Lower | Space |Raise | Move | Alt | GUI | Ctrl | + └-----------------------------------------------------------------------------------┘ + +This is more similar to a standard keyboard layout than the standard planck +layout, but I have found that this is better for programming, especially for +editor shortcuts. + +## Lower Layer + + ┌-----------------------------------------------------------------------------------┐ + | ` | 1 | 2 | 3 | 4 | 5 | - | = | Del | End | PgDn | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Caps | 6 | 7 | 8 | 9 | 0 | [ | ] | \ | ' | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | F1 | F2 | F3 | F4 | | | F5 | F6 | F7 | F8 | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | | | | | | | | | | | | + └-----------------------------------------------------------------------------------┘ + +All the numbers are on one hand so that they can all be easily accessed when +playing games. The punctuation was placed in a way that is as similar as +possible the qwerty punctuation layout on a standard keyboard. + +## Raise Layer + + ┌-----------------------------------------------------------------------------------┐ + | ~ | ! | @ | # | $ | % | _ | + | Ins | Home | PgUp | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Caps | ^ | & | * | ( | ) | { | } | | | " | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | F9 | F10 | F11 | F12 | | | | | | | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | | | | | | | | | | | | + └-----------------------------------------------------------------------------------┘ + +This layer with the exception of the function and control keys is effectively +the lower layer in combination with the shift key, like on the standard planck +layout. + +## Movement Layer + + ┌-----------------------------------------------------------------------------------┐ + | |MsBut2|Ms Up |MsBut1|MsWhUp| | Home | PgDn | PgUp | End | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | |Ms Lft|Ms Dn |Ms Rgt|MsWhDn| | Left | Down | Up | Right| | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | | | | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | | | | | | | | | | | | + └-----------------------------------------------------------------------------------┘ + +Layer for simplifying movement. + +## Meta Layer + + ┌-----------------------------------------------------------------------------------┐ + |Reset | | | | | | | | | | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | |Bcklgt| Mute |Vol Dn|Vol Up| | |Qwerty|Arrow |Numpad| | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | | | | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | | | | | | | | | | | | + └-----------------------------------------------------------------------------------┘ + +This Layer is activated when pressing both the Lower and Raise keys. The Arrow +and Numpad keys each activate a layer between the base layer and the Movement +layer. The Qwerty key disables both of the layers leaving just the base layer +active. + +## Arrow Layer + + ┌-----------------------------------------------------------------------------------┐ + | | | | | | | | | | | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | | | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | | | Up | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | | | | | | | | | Left | Down | Right| + └-----------------------------------------------------------------------------------┘ + +Replaces the bottom right of the keyboard with arrow keys for games like The +Binding of Isaac. + +## Numpad Layer + + ┌-----------------------------------------------------------------------------------┐ + | | | | | | |NumLck| 7 | 8 | 9 | / | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | |Enter | 4 | 5 | 6 | * | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | 3 | 2 | 1 | - | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | | | | | | | | 0 | . | + | | + └-----------------------------------------------------------------------------------┘ + +Replaces the majority of the right side of the keyboard with a numpad because +why not? diff --git a/keyboards/planck/keymaps/lae3/rules.mk b/keyboards/planck/keymaps/lae3/rules.mk new file mode 100644 index 000000000000..2e02b0dd7560 --- /dev/null +++ b/keyboards/planck/keymaps/lae3/rules.mk @@ -0,0 +1,20 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/leo/keymap.c b/keyboards/planck/keymaps/leo/keymap.c new file mode 100644 index 000000000000..5a4a720fffa2 --- /dev/null +++ b/keyboards/planck/keymaps/leo/keymap.c @@ -0,0 +1,28 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_planck_grid( /* BASE */ + KC_ESC, KC_LBRC, KC_QUOT, KC_SCLN, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT, + KC_LSFT, KC_DOT, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_COMM, + KC_LCTL, KC_LALT, KC_LGUI, MO(4), MO(3), KC_SPC, KC_SPC, MO(2), MO(4), KC_RGUI, KC_RALT, KC_RCTL +), +[2] = LAYOUT_planck_grid( /* RAISE */ + RALT(KC_RBRC), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, S(KC_RBRC), + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +), +[3] = LAYOUT_planck_grid( /* LOWER */ + S(KC_EQL),S(KC_1),S(KC_2),S(KC_3),RALT(KC_5),S(KC_5), S(KC_6), S(KC_7),RALT(KC_7),RALT(KC_0),S(KC_0), KC_MINS, + KC_TRNS,RALT(KC_2),S(KC_SLSH),KC_NUBS,S(KC_NUBS),RALT(KC_MINS),RALT(KC_NUBS), KC_NUHS, S(KC_8), S(KC_9), S(KC_MINS), KC_SLSH, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RALT(KC_8), RALT(KC_9), KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +), +[4] = LAYOUT_planck_grid( /* META */ + KC_TRNS, KC_HOME, KC_UP, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_UP, KC_END, KC_TRNS, KC_DEL, + KC_TRNS, KC_RGHT, KC_DOWN, KC_LEFT, KC_PGUP, KC_TRNS, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_TRNS, KC_PGDN, KC_TRNS, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +) +}; diff --git a/keyboards/planck/keymaps/leo/rules.mk b/keyboards/planck/keymaps/leo/rules.mk new file mode 100644 index 000000000000..10de3bfc0359 --- /dev/null +++ b/keyboards/planck/keymaps/leo/rules.mk @@ -0,0 +1,19 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/planck/keymaps/lindgrenj6/config.h b/keyboards/planck/keymaps/lindgrenj6/config.h new file mode 100644 index 000000000000..4fcdb0fc7a77 --- /dev/null +++ b/keyboards/planck/keymaps/lindgrenj6/config.h @@ -0,0 +1,51 @@ +/* Copyright 2015-2021 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE +# define STARTUP_SONG SONG(PLANCK_SOUND) +// #define STARTUP_SONG SONG(NO_SOUND) + +# define DEFAULT_LAYER_SONGS \ + { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND) } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +#define TAPPING_TERM 160 diff --git a/keyboards/planck/keymaps/lindgrenj6/keymap.c b/keyboards/planck/keymaps/lindgrenj6/keymap.c new file mode 100644 index 000000000000..94353e324836 --- /dev/null +++ b/keyboards/planck/keymaps/lindgrenj6/keymap.c @@ -0,0 +1,220 @@ +/* Copyright 2015-2021 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 . + */ + +#include QMK_KEYBOARD_H + +enum planck_layers { + _BASE, + _LOWER, + _RAISE, + _ADJUST, + _NUMPAD, + _EXTRA, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, LT(_BASE, KC_MINUS), + MT(MOD_LCTL, KC_ESCAPE), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SEMICOLON, KC_QUOTE, + KC_LSFT, MT(MOD_LCTL|MOD_LSFT ,KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_INSERT, + LT(_EXTRA, KC_GRAVE), TG(_NUMPAD), KC_LGUI, KC_LALT, LT(_LOWER, KC_BSPC), KC_SPACE, KC_SPACE, LT(_RAISE, KC_ENTER), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT + ), + + [_LOWER] = LAYOUT_planck_grid( + KC_TILDE, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, LT(KC_LBRC, KC_7), LT(KC_RBRC, KC_8), KC_MINUS, KC_UNDS, LT(KC_PGUP, KC_HOME), + _______, _______, _______, _______, _______, _______, KC_PIPE, KC_LCBR, KC_RCBR, KC_PLUS, KC_EQUAL, LT(KC_PGDN, KC_END), + _______, _______, _______, _______, _______, _______, _______, KC_LPRN, KC_RPRN, _______, KC_BSLS, KC_DELETE, + _______, _______, _______, _______, _______, _______, _______, _______, C(S(KC_LEFT)), C(KC_MINUS), C(S(KC_PLUS)), C(S(KC_RIGHT)) + ), + + [_RAISE] = LAYOUT_planck_grid( + KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, LGUI(KC_PGUP), + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, _______, _______, _______, _______, LGUI(KC_PGDN), + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, _______, _______, _______, KC_BSLS, _______, + _______, _______, _______, _______, _______, KC_PSCR, KC_PSCR, _______, _______, _______, _______, KC_MPLY + ), + + [_ADJUST] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, AU_ON, AU_OFF, AU_TOGG, RGB_SPI, _______, RGB_TOG, RGB_VAI, RGB_HUI, KC_BRIGHTNESS_UP, QK_BOOT, + _______, _______, MU_ON, MU_OFF, MU_TOGG, RGB_SPD, _______, RGB_MOD, RGB_VAD, RGB_HUD, KC_BRIGHTNESS_DOWN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_NUMPAD] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, KC_CALCULATOR, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_MINUS, KC_KP_SLASH, + _______, _______, _______, _______, _______, _______, _______, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_PLUS, KC_KP_ASTERISK, + _______, _______, _______, _______, _______, _______, _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, _______, + _______, _______, _______, _______, _______, _______, _______, KC_KP_0, _______, KC_KP_DOT, KC_KP_ENTER, _______ + ), + + [_EXTRA] = LAYOUT_planck_grid( + G(KC_L), KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, + _______, _______, KC_LCTL, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, LT(_EXTRA, KC_MPLY) + ), + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case(LT(_BASE,KC_MINUS)): + if (record->tap.count && record->event.pressed) { + return true; + } else if(record->event.pressed) { + tap_code(KC_BSLS); + return false; + } + break; + + case(LT(KC_LBRC, KC_7)): + if (record->tap.count && record->event.pressed) { + tap_code(KC_LBRC); + return false; + } else if(record->event.pressed) { + tap_code16(KC_AMPERSAND); + return false; + } + break; + + case(LT(KC_RBRC, KC_8)): + if (record->tap.count && record->event.pressed) { + tap_code(KC_RBRC); + return false; + } else if(record->event.pressed) { + tap_code16(KC_ASTERISK); + return false; + } + break; + + case(LT(KC_PGUP, KC_HOME)): + if (record->tap.count && record->event.pressed) { + tap_code(KC_PGUP); + return false; + } else if(record->event.pressed) { + tap_code(KC_HOME); + return false; + } + break; + + case(LT(KC_PGDN, KC_END)): + if (record->tap.count && record->event.pressed) { + tap_code(KC_PGDN); + return false; + } else if(record->event.pressed) { + tap_code(KC_END); + return false; + } + break; + + case(LT(_EXTRA, KC_MPLY)): + if (record->tap.count == 2 && record->event.pressed) { + tap_code(KC_MNXT); + return false; + } else if(record->event.pressed) { + tap_code(KC_MPLY); + return false; + } + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_song); } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_gb_song); } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + muse_mode = false; + } + return true; +} + +void matrix_scan_user(void) { +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case LT(_RAISE, KC_ENTER): + case LT(_LOWER, KC_BSPC): + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/lindgrenj6/rules.mk b/keyboards/planck/keymaps/lindgrenj6/rules.mk new file mode 100644 index 000000000000..7aa6b2130f02 --- /dev/null +++ b/keyboards/planck/keymaps/lindgrenj6/rules.mk @@ -0,0 +1,5 @@ +ifeq ($(strip $(AUDIO_ENABLE)), yes) + SRC += muse.c +endif + +TRI_LAYER_ENABLE = yes diff --git a/keyboards/planck/keymaps/lja83/config.h b/keyboards/planck/keymaps/lja83/config.h new file mode 100644 index 000000000000..b0c34f5c02cb --- /dev/null +++ b/keyboards/planck/keymaps/lja83/config.h @@ -0,0 +1,25 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/lja83/keymap.c b/keyboards/planck/keymaps/lja83/keymap.c new file mode 100644 index 000000000000..33e8f93e96ae --- /dev/null +++ b/keyboards/planck/keymaps/lja83/keymap.c @@ -0,0 +1,363 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST, + _NAV, +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define NAV MO(_NAV) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// clang-format off +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LCTL_T(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, RSFT_T(KC_ENT), + BACKLIT, KC_LCTL, KC_LGUI, KC_LALT, LOWER, LT(_NAV, KC_SPC), KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * v------------------------RGB CONTROL--------------------v + * ,-----------------------------------------------------------------------------------. + * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | |MUSmod|Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_NAV] = LAYOUT_planck_grid( + XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_UP, XXXXXXX, KC_MS_WH_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_WH_DOWN, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_BTN1, KC_MS_BTN3, KC_MS_BTN2, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +) +}; +// clang-format on + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + writePinLow(E6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + writePinHigh(E6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_song); } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_gb_song); } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } + return true; +} + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/lja83/readme.md b/keyboards/planck/keymaps/lja83/readme.md new file mode 100644 index 000000000000..3650ae446b1a --- /dev/null +++ b/keyboards/planck/keymaps/lja83/readme.md @@ -0,0 +1,2 @@ +# LJA83 Planck Layout + diff --git a/keyboards/planck/keymaps/lja83/rules.mk b/keyboards/planck/keymaps/lja83/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/lja83/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/mason/keymap.c b/keyboards/planck/keymaps/mason/keymap.c new file mode 100644 index 000000000000..59966451aa5f --- /dev/null +++ b/keyboards/planck/keymaps/mason/keymap.c @@ -0,0 +1,114 @@ +#include QMK_KEYBOARD_H + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + LOWER, + RAISE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | H | J | K | L | ;: | '" | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | ,< | .> | /? |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Caps | Esc | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_CAPS, KC_ESC, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | ~ | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_planck_grid( + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_GRV), S(KC_BSLS), _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Ins | Home | PgUp | Pscr | Slck | Paus | - | = | [ | ] | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Del | End | PgDn | Nlck | | | ` | \ | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_planck_grid( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, KC_SCRL, KC_PAUS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, + _______, KC_DEL, KC_END, KC_PGDN, KC_NUM, _______, _______, KC_GRV, KC_BSLS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | |BLtogg|BLstep| | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |RGBtog|RGBhui|RGBhud|RGBmod|RGBsai|RGBsad| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, KC_PWR, + _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_HUI, RGB_HUD, RGB_MOD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/masoncowen/keymap.c b/keyboards/planck/keymaps/masoncowen/keymap.c new file mode 100644 index 000000000000..9a0377a4cafc --- /dev/null +++ b/keyboards/planck/keymaps/masoncowen/keymap.c @@ -0,0 +1,59 @@ +/* Copyright 2021 masoncowen + * + * 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 QMK_KEYBOARD_H + + +enum planck_layers { + _ZWFP, + _NUMNAV +}; + +enum planck_keycodes { + ZWFP = SAFE_RANGE, + NUMNAV +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_ZWFP] = LAYOUT_planck_grid( + KC_Z , KC_W , KC_F , KC_P , KC_Q , KC_NO , KC_NO , KC_J , KC_L , KC_U , KC_Y , OSL(_NUMNAV) , + KC_A , KC_R , KC_S , KC_T , KC_G , KC_NO , KC_NO , KC_M , KC_N , KC_E , KC_I , KC_O , + KC_X , KC_V , KC_C , KC_D , KC_B , KC_NO , KC_NO , KC_K , KC_H , KC_DOT , KC_COMM , KC_SCLN , + KC_NO , KC_NO , KC_ESC , KC_SPC , OSM(MOD_LCTL) , KC_NO , KC_NO , KC_BSPC , OSM(MOD_LSFT) , OSM(MOD_LALT) , KC_NO , KC_NO +), + +//TRANSPARENT keys are to be decided on +[_NUMNAV] = LAYOUT_planck_grid( + KC_PPLS , KC_4 , KC_5 , KC_6 , KC_PAST , KC_NO , KC_NO , KC_BSLS , KC_HOME , KC_PGDN , KC_PGUP , KC_END , + KC_0 , KC_1 , KC_2 , KC_3 , KC_PENT , KC_NO , KC_NO , KC_NUHS , KC_LEFT , KC_DOWN , KC_UP , KC_RIGHT , + KC_PMNS , KC_7 , KC_8 , KC_9 , KC_PSLS , KC_NO , KC_NO , KC_QUOT , , _______ , _______ , _______ , + KC_NO , KC_NO , _______ , _______ , _______ , KC_NO , KC_NO , _______ , _______ , _______ , KC_NO , KC_NO +) + +}; + +const key_override_t delete_key_override = ko_make_basic(MOD_MASK_SHIFT, KC_BSPC, KC_DEL); +const key_override_t enter_key_override = ko_make_basic(MOD_MASK_SHIFT, KC_ESC, KC_ENTER); +const key_override_t tab_key_override = ko_make_basic(MOD_MASK_SHIFT, KC_SPC, KC_TAB); + +const key_override_t **key_overrides = (const key_override_t *[]){ + &delete_key_override, + &enter_key_override, + &tab_key_override, + NULL +}; diff --git a/keyboards/planck/keymaps/masoncowen/readme.md b/keyboards/planck/keymaps/masoncowen/readme.md new file mode 100644 index 000000000000..073cbe73b369 --- /dev/null +++ b/keyboards/planck/keymaps/masoncowen/readme.md @@ -0,0 +1,46 @@ +# ZWFP Layout Notes +## About + +ZWFP is a layout largely based on Colemak Mod-DH. +The layout rotates the QZXVB keys for the following reasons: +* XCV are brought together. + * One design goal of colemak was to keep ZXCV close together as they are commonly uses control shortcuts. + * Mod-dh moved D to where the V key was as that position was too ergonomic for an infrequent letter like V. + * XCV benefit more from being together are Cut-Copy-Paste are more related than Undo (which Z commonly represents). +* B is returned to its QWERTY position. + * This was an unintentional benefit. + * The original rotation of QZXV moved Q to a better position than B despite being was less frequent. + * This is based off the grid on [the colemak mod-dh page](https://colemakmods.github.io/mod-dh/model.html). + * This needs more testing, and may be reverted as despite the above mentioned grid, the current Q position feels easier than the current B position. +* Based off [the layout analyser](https://colemakmods.github.io/mod-dh/analyze.html) its slightly better. +* I like being different. + +## Todo +* Work out punctuation locations. +* Figure out what the thumb cluster is doing. + * I've somewhat settled on left home-row (centre) thumb key is space and right is shift OSL. +* Maybe a deadkey instead of using shift-/alt- key overrides? +* [Repeat key](https://www.jonashietala.se/blog/2021/09/05/t-34-0/) +* Move Home, End, PgDn and PgUp to a kc/ko/dk with the arrow keys. + +### Keys still to add +* A reset key, cba with finding small pokey things to use at the back. +* Shifted numbers \(not including $^\*\) +* Dedicated Pipe | +* Dedicated Underscore \(\_\) +* Backslash \(\\\) and shifted \(Don't forget to use NOUS\) +* Square brackets \(\[ \]\) and shifted +* Dedicated question mark +* Backtick (`) and shifted +* Function keys 1-12 + +#### Obscure keys to add just for completeness +* Normal Minus and Equals \(Don't know if they are needed or not \) +* Function keys 13-24 +* Capslock \(Not sure if multi-tapping OSL actually counts as a caps lock for shift\) +* Numlock, Scrolllock and the Locking lock keys +* Keypad characters +* Command Keys in general +* International Keys +* Right Modifiers +* Windows keys for either side diff --git a/keyboards/planck/keymaps/masoncowen/rules.mk b/keyboards/planck/keymaps/masoncowen/rules.mk new file mode 100644 index 000000000000..90c9b36df0c7 --- /dev/null +++ b/keyboards/planck/keymaps/masoncowen/rules.mk @@ -0,0 +1 @@ +KEY_OVERRIDE_ENABLE = yes diff --git a/keyboards/planck/keymaps/matrixman/keymap.c b/keyboards/planck/keymaps/matrixman/keymap.c new file mode 100644 index 000000000000..ad4844116ec8 --- /dev/null +++ b/keyboards/planck/keymaps/matrixman/keymap.c @@ -0,0 +1,54 @@ +#include QMK_KEYBOARD_H + +// http://www.keyboard-layout-editor.com/#/gists/eb0696806831fc0d93c9 + +#define _PROSE 0 +#define _SYMB_L 1 +#define _SYMB_R 2 +#define _NAV_L 3 +#define _NAV_R 4 +#define _NAV_ALT 5 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_PROSE] = LAYOUT_planck_grid( + LT(_NAV_L,KC_Q), KC_W, KC_E, KC_R, KC_T, KC_DELETE, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, LT(_NAV_R,KC_P) + ,KC_A, KC_S, KC_D, KC_F, KC_G, CTL_T(KC_ESC), CTL_T(KC_SCLN), KC_H, KC_J, KC_K, KC_L, KC_QUOT + ,SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALT_T(KC_TAB), ALT_T(KC_INS), KC_N, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH) + ,KC_LCTL, KC_LGUI, LM(_NAV_ALT, MOD_LALT), KC_TAB, LT(_SYMB_L, KC_ESC), KC_LSFT, KC_LSFT, LT(_SYMB_R,KC_SPC), KC_BSPC, LM(_NAV_ALT, MOD_LALT), KC_RCTL, KC_ENT +), + // accessed via the left symb-layer key, includes a semicolon where the right symb-layer key was +[_SYMB_L] = LAYOUT_planck_grid( + KC_GRV, KC_TILD, KC_ASTR, KC_AMPR, KC_SLSH, LSFT(KC_COMM), LSFT(KC_DOT), KC_BSLS, KC_7, KC_8, KC_9, KC_PIPE + ,KC_UNDS, KC_CIRC, KC_PERC, KC_DLR, KC_LPRN, KC_LBRC, KC_RBRC, KC_RPRN, KC_4, KC_5, KC_6, KC_MINS + ,KC_EQL , KC_HASH, KC_AT, KC_EXLM, KC_LCBR, KC_TRNS, KC_TRNS, KC_RCBR, KC_1, KC_2, KC_3, KC_PLUS + ,LSFT(KC_QUOT), KC_TRNS, KC_COMM, LSFT(KC_SLSH), KC_TRNS, KC_TRNS, KC_TRNS, KC_SCLN, KC_0, KC_DOT, KC_DOT, KC_TRNS +), + // accessed via the right symb-layer key, includes a colon where the left symb-layer key was +[_SYMB_R] = LAYOUT_planck_grid( + KC_GRV, KC_TILD, KC_ASTR, KC_AMPR, KC_SLSH, LSFT(KC_COMM), LSFT(KC_DOT), KC_BSLS, KC_7, KC_8, KC_9, KC_PIPE + ,KC_UNDS, KC_CIRC, KC_PERC, KC_DLR, KC_LPRN, KC_LBRC, KC_RBRC, KC_RPRN, KC_4, KC_5, KC_6, KC_MINS + ,KC_EQL , KC_HASH, KC_AT, KC_EXLM, KC_LCBR, KC_TRNS, KC_TRNS, KC_RCBR, KC_1, KC_2, KC_3, KC_PLUS + ,LSFT(KC_QUOT), KC_TRNS, KC_COMM, LSFT(KC_SLSH), KC_COLN, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_DOT, KC_TRNS, KC_TRNS +), + // accessed via the left nav-layer key, includes a F10 where the right nav-layer key was +[_NAV_L] = LAYOUT_planck_grid( + KC_TRNS, KC_F2, KC_F3, KC_F4, KC_F5, QK_BOOT, BL_STEP, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 + ,KC_BTN1, KC_MS_L, KC_MS_U, KC_MS_D, KC_MS_R, KC_PSCR, KC_PAUSE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_F11 + ,KC_BTN2, KC_BTN4, KC_MS_WH_UP,KC_MS_WH_DOWN, KC_BTN5, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_F12 + ,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +), + // accessed via the right nav-layer key, includes a F1 where the left nav-layer key was +[_NAV_R] = LAYOUT_planck_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, QK_BOOT, BL_STEP, KC_F6, KC_F7, KC_F8, KC_F9, KC_TRNS + ,KC_BTN1, KC_MS_L, KC_MS_U, KC_MS_D, KC_MS_R, KC_PSCR, KC_PAUSE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_F11 + ,KC_BTN2, KC_BTN4, KC_MS_WH_UP,KC_MS_WH_DOWN, KC_BTN5, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_F12 + ,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +), + // accessed via the lower alt keys, moves tab and delete to make alt+tab and ctrl+alt+del feel more standard +[_NAV_ALT] = LAYOUT_planck_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, QK_BOOT, BL_STEP, KC_F6, KC_F7, KC_F8, KC_F9, KC_DELETE + ,KC_TAB, KC_MS_L, KC_MS_U, KC_MS_D, KC_MS_R, KC_PSCR, KC_PAUSE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_F11 + ,KC_BTN2, KC_BTN4, KC_MS_WH_UP,KC_MS_WH_DOWN, KC_BTN5, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_F12 + ,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +) +}; diff --git a/keyboards/planck/keymaps/matrixman/readme.md b/keyboards/planck/keymaps/matrixman/readme.md new file mode 100644 index 000000000000..1f72d732216f --- /dev/null +++ b/keyboards/planck/keymaps/matrixman/readme.md @@ -0,0 +1,100 @@ +The Matrixman Ergodox / Split-Planck Keyboard Layout +==================================================== + +### The problem + +These layouts were designed to give my aching pinkeys a break + +### The Design + + - Pinkeys do less: + - Left q, a, z, `, _, =, [Shift], [F1] [Click], [Right Click] + - Right p, ', /, |, -, +, [Shift], [F10], [F11], [F12] + - Index fingers do more: + - Left: r, f, v, t, g, b, &, $, !, /, (, {, <, [, [Ctrl], [Tab], [Alt], [PrintScr] + - Right: u, j, m, y, h, n, 7, 4, 1, \, ), }, >, ], ;, [Ctrl], [Insert], [Alt], [Pause] + - Thumbs do more: + - Left: [Esc], :, [Shift], [Tab] + - Right: [Space], ;, [Shift], [Backspace] + - Palm Presses too: + - Left: [Ctrl], " + - Right: [Ctrl, [Enter] + +### The Plan + +I keep an Ergodox at home and at work, and when I'm mobile, I carry a planck. +These keymaps are designed to minimize the difficulty of switching between the two. + +### Other features + +- 10-key at home row for right hand +- "Matching" symbols use same finger on opposite hand: <> [] {} /\ () 1! 2@ 3# 4$ 5% 6^ 7& 8* -_ += +- Supports vim-like (hjkl) movements: + - mouse movement and scrolling + - arrow keys and nav keys (home, end, pg up, pg down) +- All non-modal keys mapped (all keys from a typical 105 key keyboard except caps, num, and scroll lock) + +The Planck Layout +----------------- + +For a picture, see here: http://www.keyboard-layout-editor.com/#/gists/eb0696806831fc0d93c9 + +### Prose Layer + + qwert▓▓yuiop + asdfg▓;hjkl' + zxcvb▓▓nm,./ + ▓▓▓▓▓▓▓ ▓▓▓▓ + +### Symbol Layer + + `~*&/<>\789| + _^%$([])456- + =#@!{▓▓}123+ + "▓,?:▓▓;0▓.▓ + +### Nav Layer + + FKEYF▓▓KEYFK + mouse▓▓arowE + scrol▓▓seekY + ▓▓▓▓▓▓▓▓▓▓▓▓ + + +The Ergodox Layout +------------------ + +For a picture, see here: http://www.keyboard-layout-editor.com/#/gists/9be130e4c9b503317619 + +Wherever the Ergodox has keys that the Planck doesn't, whichever key would be expected on a typical 105 key is in that place + +### Prose Layer + +▓▓▓▓▓▓▓ ▓▓▓▓▓▓ +▓qwert▓ ▓yuiop\ +▓asdfg▓ ;hjkl;' +▓zxcvb nm,./▓ +▓▓▓▓▓▓ ▓▓▓▓▓▓ + ▓▓ ▓▓ + ▓▓▓ ▓ ▓ + +### Symbol Layer + +▓▓▓▓▓▓ ▓▓▓▓▓▓ +▓`~*&/< >\789|\ +▓_^%$([ ])456-▓ +▓=#@!{ }123+▓ +"▓▓▓▓▓▓ 0▓.▓▓ + ▓▓ ▓▓ + ?:▓ ▓;. + + +### Nav Layer + +▓▓▓▓▓▓▓ ▓▓▓▓▓▓ +▓FKEYF▓ ▓KEYFK▓ +▓mouse▓ arowE▓ +▓scrol seekY▓ +▓▓▓▓▓▓ ▓▓▓▓▓▓ + ▓▓ ▓▓ + ▓▓▓ ▓▓▓ diff --git a/keyboards/planck/keymaps/mattly/config.h b/keyboards/planck/keymaps/mattly/config.h new file mode 100644 index 000000000000..31c47c85b4c5 --- /dev/null +++ b/keyboards/planck/keymaps/mattly/config.h @@ -0,0 +1,39 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +#define PERMISSIVE_HOLD +#define TAPPING_TOGGLE 2 +#define TAPPING_TERM 200 diff --git a/keyboards/planck/keymaps/mattly/keymap.c b/keyboards/planck/keymaps/mattly/keymap.c new file mode 100644 index 000000000000..7d6245a1e690 --- /dev/null +++ b/keyboards/planck/keymaps/mattly/keymap.c @@ -0,0 +1,34 @@ +#include QMK_KEYBOARD_H +#include "mattly.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_planck_grid( + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_SCLN, + KC_CAPS, A_CTRL, S_ALT, D_GUI, F_SHFT, KC_G, KC_H, J_SHFT, K_GUI, L_ALT, MINSCTL, KC_QUOT, + XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + XXXXXXX, NAVLOCK, XXXXXXX, ESC_HYP, BSP_NUM, ENT_SFT, SPC_SFT, TAB_SYM, DEL_WRP, XXXXXXX, SYMLOCK, XXXXXXX + ), + + [_SYMBOL] = LAYOUT_planck_grid( + _______, KC_AMPR, KC_GRV, KC_TILD, KC_LBRC, KC_RBRC, KC_LABK, KC_RABK, KC_PLUS, KC_ASTR, XXXXXXX, _______, + _______, KC_DLR, KC_PERC, KC_EQL, KC_LPRN, KC_RPRN, KC_SCLN, KC_COLN, KC_EXLM, KC_AT, KC_UNDS, _______, + _______, XXXXXXX, KC_CIRC, KC_HASH, KC_LCBR, KC_RCBR, KC_QUOT, KC_DQUO, KC_PIPE, KC_BSLS, KC_QUES, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +[_NAVNUM] = LAYOUT_planck_grid( + _______, XXXXXXX, BWORD, KC_UP, FWORD, KC_PGUP, KC_DOT, KC_7, KC_8, KC_9, KC_PLUS, KC_ASTR, + _______, KC_ENT, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_0, KC_4, KC_5, KC_6, KC_MINS, KC_SLSH, + _______, KC_BSPC, KC_HOME, KC_TAB, KC_END, KC_DEL, KC_COMM, KC_1, KC_2, KC_3, KC_EQL, KC_PERC, + _______, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_COLN, KC_DLR, _______ +), + +[_FUNCT] = LAYOUT_planck_grid( + QK_BOOT, XALLWIN, XPRVSPC, NWIN, XNXTSPC, XDESKTP, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10, KC_F13, + DB_TOGG, XNOTIFY, PTAB, PWIN, NTAB, NAVBACK, NAVFWD, KC_F4, KC_F5, KC_F6, KC_F11, KC_F14, + KC_MUTE, KC_VOLD, KC_VOLU, KC_MRWD, KC_MFFD, KC_MPLY, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F12, KC_F15, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) +}; + + diff --git a/keyboards/planck/keymaps/mattly/readme.md b/keyboards/planck/keymaps/mattly/readme.md new file mode 100644 index 000000000000..4e8c7f17c6b5 --- /dev/null +++ b/keyboards/planck/keymaps/mattly/readme.md @@ -0,0 +1 @@ +See my readme in [users/mattly](../../../../../users/mattly/readme.md) \ No newline at end of file diff --git a/keyboards/planck/keymaps/mattly/rules.mk b/keyboards/planck/keymaps/mattly/rules.mk new file mode 100644 index 000000000000..7210cf34f0d0 --- /dev/null +++ b/keyboards/planck/keymaps/mattly/rules.mk @@ -0,0 +1,2 @@ +AUDIO_ENABLE = yes +SRC += muse.c diff --git a/keyboards/planck/keymaps/max/keymap.c b/keyboards/planck/keymaps/max/keymap.c new file mode 100644 index 000000000000..d947b6a1a0d1 --- /dev/null +++ b/keyboards/planck/keymaps/max/keymap.c @@ -0,0 +1,29 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_planck_grid( /* Qwerty */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT , + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, + KC_LCTL, BL_STEP, KC_LALT, KC_LGUI, MO(3), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + // Space is repeated to accommadate for both spacebar wiring positions +), +[1] = LAYOUT_planck_grid( /* Colemak */ + KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT , + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, + KC_LCTL, BL_STEP, KC_LALT, KC_LGUI, MO(3), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), +[2] = LAYOUT_planck_grid( /* 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, DF(0), DF(1), QK_BOOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_TRNS, + KC_TRNS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_BSLS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(2), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), +[3] = LAYOUT_planck_grid( /* 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, DF(0), DF(1), QK_BOOT, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), KC_TRNS, + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, S(KC_BSLS), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +) +}; diff --git a/keyboards/planck/keymaps/max/rules.mk b/keyboards/planck/keymaps/max/rules.mk new file mode 100644 index 000000000000..d86b02fd1ce4 --- /dev/null +++ b/keyboards/planck/keymaps/max/rules.mk @@ -0,0 +1,22 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/mgalisa/config.h b/keyboards/planck/keymaps/mgalisa/config.h new file mode 100644 index 000000000000..9020d2b9f882 --- /dev/null +++ b/keyboards/planck/keymaps/mgalisa/config.h @@ -0,0 +1,36 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/mgalisa/keymap.c b/keyboards/planck/keymaps/mgalisa/keymap.c new file mode 100644 index 000000000000..8816bf40909e --- /dev/null +++ b/keyboards/planck/keymaps/mgalisa/keymap.c @@ -0,0 +1,404 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _EMOJI, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV, + AUTO_SQ, + AUTO_PA, + AUTO_CB, + SHRUG, + F4R +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT(_EMOJI,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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + LT(_EMOJI,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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + LT(_EMOJI,KC_ESC), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +/* [_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), */ + +/* Raise - new + * ,-----------------------------------------------------------------------------------. + * | ` | F1 | F2 | F3 | F4 | {} | 7 | 8 | 9 | - | * | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F5 | F6 | F7 | F8 | () | 4 | 5 | 6 | + | / | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F9 | F10 | F11 | F12 | [] | 1 | 2 | 3 |Vol - |Vol + | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | 0 | | Home |Pg Dn |Pg Up | End | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, AUTO_CB, KC_7, KC_8, KC_9, KC_MINS, KC_ASTR, KC_BSPC, + KC_DEL, KC_F5, KC_F6, KC_F7, KC_F8, AUTO_PA, KC_4, KC_5, KC_6, KC_PLUS, KC_SLSH, KC_BSLS, + _______, KC_F9, KC_F10, KC_F11, KC_F12, AUTO_SQ, KC_1, KC_2, KC_3, KC_PGUP, KC_VOLU, _______, + _______, _______, _______, _______, _______, KC_0, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +[_EMOJI] = LAYOUT_planck_grid( + _______, _______, _______, F4R, _______, _______, _______, _______, _______, _______, _______, _______, + KC_TRNS, _______, _______, SHRUG, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + case AUTO_SQ: + if (record->event.pressed) { + SEND_STRING("[]SS_TAP(X_LEFT)"); + } + return false; + break; + case AUTO_CB: + if (record->event.pressed) { + SEND_STRING("{}SS_TAP(X_LEFT)"); + } + return false; + break; + case AUTO_PA: + if (record->event.pressed) { + SEND_STRING("()SS_TAP(X_LEFT)"); + } + return false; + break; + case SHRUG: + if (record->event.pressed) { + SEND_STRING("/shrugSS_TAP(X_ENT)"); + } + return false; + break; + case F4R: + if (record->event.pressed) { + SEND_STRING(":f-for-respects:"); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/mgalisa/readme.md b/keyboards/planck/keymaps/mgalisa/readme.md new file mode 100644 index 000000000000..9d5b596016d2 --- /dev/null +++ b/keyboards/planck/keymaps/mgalisa/readme.md @@ -0,0 +1,15 @@ +# @mgalisa's Planck keymap + +A minor (so far) update to the default keymap. Probably more to come. + +## Raise layer + +![Raise layer](https://i.imgur.com/n0f4275.png) + +* Moved F-keys and number keys into 4x3 and 3x3 grid patterns for pseudo-numpad like effect +* Added macros to the middle column that insert bracket/brace/paren pairs and moves the cursor inbetween +* Minor adjustments + +## Emoji layer + +Activate by holding the Esc key from QWERTY/Dvorak/Colemak. Holds macros primarily for annoying coworkers via Slack. diff --git a/keyboards/planck/keymaps/mgalisa/rules.mk b/keyboards/planck/keymaps/mgalisa/rules.mk new file mode 100644 index 000000000000..2afe59043855 --- /dev/null +++ b/keyboards/planck/keymaps/mgalisa/rules.mk @@ -0,0 +1,6 @@ +SRC += muse.c +EXTRAKEY_ENABLE = yes +# RGBLIGHT_ENABLE = yes +## I bought the WS2812s... +## just need the main branch to be updated. +# Uncomment to make build fail. diff --git a/keyboards/planck/keymaps/mikethetiger/config.h b/keyboards/planck/keymaps/mikethetiger/config.h new file mode 100644 index 000000000000..9020d2b9f882 --- /dev/null +++ b/keyboards/planck/keymaps/mikethetiger/config.h @@ -0,0 +1,36 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/mikethetiger/keymap.c b/keyboards/planck/keymaps/mikethetiger/keymap.c new file mode 100644 index 000000000000..c0964f1deee6 --- /dev/null +++ b/keyboards/planck/keymaps/mikethetiger/keymap.c @@ -0,0 +1,348 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_DOWN); + unregister_code(KC_MS_WH_DOWN); + #else + register_code(KC_PGDN); + unregister_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_UP); + unregister_code(KC_MS_WH_UP); + #else + register_code(KC_PGUP); + unregister_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } + return true; +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/mikethetiger/readme.md b/keyboards/planck/keymaps/mikethetiger/readme.md new file mode 100644 index 000000000000..ed039529658b --- /dev/null +++ b/keyboards/planck/keymaps/mikethetiger/readme.md @@ -0,0 +1,2 @@ +# mikethetiger Planck Layout + diff --git a/keyboards/planck/keymaps/mikethetiger/rules.mk b/keyboards/planck/keymaps/mikethetiger/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/mikethetiger/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/mitch/config.h b/keyboards/planck/keymaps/mitch/config.h new file mode 100644 index 000000000000..bb7989d90d82 --- /dev/null +++ b/keyboards/planck/keymaps/mitch/config.h @@ -0,0 +1,5 @@ +#include "../../config.h" + +// for the broken board +#undef MATRIX_COL_PINS +#define MATRIX_COL_PINS { F1, F0, B0, B2, F4, F5, F6, F7, D4, D6, B4, D7 } diff --git a/keyboards/planck/keymaps/mitch/keymap.c b/keyboards/planck/keymaps/mitch/keymap.c new file mode 100644 index 000000000000..814a28deb8b3 --- /dev/null +++ b/keyboards/planck/keymaps/mitch/keymap.c @@ -0,0 +1,66 @@ +#include QMK_KEYBOARD_H + +#define QWERTY 0 +#define LOWER 1 +#define RAISE 2 + +// In MacOS, switch between windows within an application +#define GUI_GRV LGUI(KC_GRV) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctl | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | Del | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_RSFT, KC_ENT) , + KC_ESC, KC_DEL, KC_LALT, KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | GUIGR| | | | | | | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | | Mute | Vol- | Vol+ | | Bksp | $ | % | ^ | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | ! | @ | # | \ |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | Enter | | | PgUp | PgUn | | + * `-----------------------------------------------------------------------------------' + */ +[LOWER] = LAYOUT_planck_grid( + GUI_GRV, _______, _______, _______, _______, _______, _______, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, KC_BSPC, KC_DLR, KC_PERC, KC_CIRC, KC_PIPE, KC_PIPE, + _______, _______, _______, _______, _______, _______, _______, KC_EXLM, KC_AT, KC_HASH, KC_BSLS, KC_ENT, + _______, _______, _______, _______, _______, KC_ENT, KC_ENT, _______, _______, KC_PGDN, KC_PGUP, _______ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | ` | ~ | ( | ) | | | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | [ | ] | { | } | | | 4 | 5 | 6 | | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | - | _ | = | + | | | 1 | 2 | 3 | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | Enter | | | | | | + * `-----------------------------------------------------------------------------------' + */ + +[RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_GRV, KC_TILD, KC_LPRN, KC_RPRN, _______, _______, KC_7, KC_8, KC_9, KC_0, _______, + _______, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______, _______, KC_4, KC_5, KC_6, _______, KC_BSLS, + _______, KC_MINS, KC_UNDS, KC_EQL, KC_PLUS, _______, _______, KC_1, KC_2, KC_3, _______, KC_ENT, + _______, _______, _______, _______, _______, KC_ENT, KC_ENT, _______, _______, KC_PGDN, KC_PGUP, _______ +) +}; diff --git a/keyboards/planck/keymaps/mitch/readme.md b/keyboards/planck/keymaps/mitch/readme.md new file mode 100644 index 000000000000..9ed1133ef9c3 --- /dev/null +++ b/keyboards/planck/keymaps/mitch/readme.md @@ -0,0 +1,22 @@ +## Flashing Keyboard + +1. Install `dfu` tools: + + brew tap osx-cross/avr + brew install avr-libc + brew install dfu-programmer + +2. Move to this directory. +3. Hit the reset button on the keyboard. +4. run `make dfu`. + +## The Keymap + +This keymap is designed for a rev3 Planck Keyboard. + +The default layer is QWERTY. The raise layer has a ten key on the right +and common programming punctuation on the left. The lower layer provides the +rest of the symbols, mostly mapped with the ten key numbers. + +The normal right shift key uses the `MT` macro to trigger Enter on tap and right +shift when held. diff --git a/keyboards/planck/keymaps/mitch/rules.mk b/keyboards/planck/keymaps/mitch/rules.mk new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/keyboards/planck/keymaps/mjt/config.h b/keyboards/planck/keymaps/mjt/config.h new file mode 100644 index 000000000000..f6362935e96a --- /dev/null +++ b/keyboards/planck/keymaps/mjt/config.h @@ -0,0 +1,30 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +// #define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// fix iPhone power adapter issue + +#define USB_MAX_POWER_CONSUMPTION 50 + +#endif diff --git a/keyboards/planck/keymaps/mjt/keymap.c b/keyboards/planck/keymaps/mjt/keymap.c new file mode 100644 index 000000000000..e927627e1f70 --- /dev/null +++ b/keyboards/planck/keymaps/mjt/keymap.c @@ -0,0 +1,274 @@ +// This is MJT's bastardization of the planck and minivan defaults + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST, + _DYN +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV, + MACSLEEP, + DYNAMIC_MACRO_RANGE, +}; + +#include "dynamic_macro.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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, SFT_T(KC_ENT) , + MO(_DYN), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Dn |Pg Up | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Home |Pg Dn |Pg Up | End | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGDN, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | |Pause |PR SC | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| |Sleep |Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |TogLED| | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, KC_PSCR, KC_DEL , + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, MACSLEEP,PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + BACKLIT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +[_DYN] = LAYOUT_planck_grid( + _______ , _______, _______, _______, _______, _______, _______, _______, _______, DM_REC1, DM_REC2, _______ , + _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______ , _______, _______, _______, _______, _______, _______, _______, _______, DM_PLY1, DM_PLY2, _______ +) + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dyn_macro_rec[][2] = SONG(DVORAK_SOUND); +float tone_dyn_macro_play[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + uint16_t macro_kc = (keycode == MO(_DYN) ? DM_RSTP : keycode); + if (!process_record_dynamic_macro(macro_kc, record)) { + return false; + } + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(tone_plover); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_plover_gb); + #endif + layer_off(_PLOVER); + } + return false; + break; + case MACSLEEP: + if (record->event.pressed) { + // ACTION_MODS_KEY(MOD_LCTL | MOD_LSFT, KC_PWR); + register_code(KC_RSFT); + register_code(KC_RCTL); + register_code(KC_PWR); + unregister_code(KC_PWR); + unregister_code(KC_RCTL); + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user(void) +{ + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user(void) +{ + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif diff --git a/keyboards/planck/keymaps/mjt/readme.md b/keyboards/planck/keymaps/mjt/readme.md new file mode 100644 index 000000000000..ce4d90f21706 --- /dev/null +++ b/keyboards/planck/keymaps/mjt/readme.md @@ -0,0 +1,22 @@ +# Mike's Plancklike Planck + +- Music/Audio +- Dynamic Macros +- Media Keys +- Works with iPhone Camera Adapter + +## Layers + +Qwerty for letters and mods. + +Raise and Lower are mostly default with a few tweaks. + +Adjust layer is tough to get to so it is only for keyboard configuration stuff. + +## Dynamic Macros + +Hold TAB key, then press ";" to record macro 1 and "'" to record macro 2. + +When you are done recording, press TAB again. + +For playback of macros, TAB+"," plays macro 1 and TAB+","plays macro 2. diff --git a/keyboards/planck/keymaps/mjtnumsym/config.h b/keyboards/planck/keymaps/mjtnumsym/config.h new file mode 100644 index 000000000000..f6362935e96a --- /dev/null +++ b/keyboards/planck/keymaps/mjtnumsym/config.h @@ -0,0 +1,30 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +// #define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// fix iPhone power adapter issue + +#define USB_MAX_POWER_CONSUMPTION 50 + +#endif diff --git a/keyboards/planck/keymaps/mjtnumsym/keymap.c b/keyboards/planck/keymaps/mjtnumsym/keymap.c new file mode 100644 index 000000000000..3fa05ad1789c --- /dev/null +++ b/keyboards/planck/keymaps/mjtnumsym/keymap.c @@ -0,0 +1,273 @@ +// This is MJT's bastardization of the planck and minivan defaults + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +enum planck_layers { + _QWERTY, + _FKEYS, + _NUMSYM, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + PLOVER, + FKEYS, + NUMSYM, + BACKLIT, + EXT_PLV, + MACSLEEP, + DYNAMIC_MACRO_RANGE, +}; + +#include "dynamic_macro.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |FKEYS | Space |NUMSYM | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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, SFT_T(KC_ENT) , + KC_LCTL, KC_LCTL, KC_LALT, KC_LGUI, FKEYS, KC_SPC, KC_SPC, NUMSYM, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* FKEYS + * ,-----------------------------------------------------------------------------------. + * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F11 | F12 | F13 | F14 | F15 | | |Sleep | | Rec1 | Rec2 | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | Mac1 | Mac2 | | Stop | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_FKEYS] = LAYOUT_planck_grid( + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + KC_DEL, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F6, _______, _______, MACSLEEP, DM_REC1, DM_REC2, + _______, _______, _______, _______, _______, _______, _______, _______, DM_PLY1, DM_PLY2, _______, DM_RSTP, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* NUMSYM + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | _ | + | { | } | | | - | = | [ | ] | \ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Home |Pg Dn |Pg Up | End | + * `-----------------------------------------------------------------------------------' + */ +[_NUMSYM] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______,KC_UNDS, KC_PLUS,KC_LCBR, KC_RCBR, KC_PIPE, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (FKEYS + NUMSYM) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | |Pause |PR SC | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| |Sleep |Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |TogLED| | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, KC_PSCR, KC_DEL , + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, MACSLEEP,PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + BACKLIT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) /*, +[_DYN] = LAYOUT_planck_grid( + _______ , _______, _______, _______, _______, _______, _______, _______, _______, DM_REC1, DM_REC2, _______ , + _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______ , _______, _______, _______, _______, _______, _______, _______, _______, DM_PLY1, DM_PLY2, _______ +)*/ + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dyn_macro_rec[][2] = SONG(DVORAK_SOUND); +float tone_dyn_macro_play[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + uint16_t macro_kc = (keycode == FKEYS ? DM_RSTP : keycode); + if (!process_record_dynamic_macro(macro_kc, record)) { + return false; + } + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case FKEYS: + if (record->event.pressed) { + layer_on(_FKEYS); + update_tri_layer(_FKEYS, _NUMSYM, _ADJUST); + } else { + layer_off(_FKEYS); + update_tri_layer(_FKEYS, _NUMSYM, _ADJUST); + } + return false; + break; + case NUMSYM: + if (record->event.pressed) { + layer_on(_NUMSYM); + update_tri_layer(_FKEYS, _NUMSYM, _ADJUST); + } else { + layer_off(_NUMSYM); + update_tri_layer(_FKEYS, _NUMSYM, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(tone_plover); + #endif + layer_off(_NUMSYM); + layer_off(_FKEYS); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_plover_gb); + #endif + layer_off(_PLOVER); + } + return false; + break; + case MACSLEEP: + if (record->event.pressed) { + // ACTION_MODS_KEY(MOD_LCTL | MOD_LSFT, KC_PWR); + register_code(KC_RSFT); + register_code(KC_RCTL); + register_code(KC_PWR); + unregister_code(KC_PWR); + unregister_code(KC_RCTL); + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user(void) +{ + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user(void) +{ + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif diff --git a/keyboards/planck/keymaps/mjtnumsym/readme.md b/keyboards/planck/keymaps/mjtnumsym/readme.md new file mode 100644 index 000000000000..ba6d05144ca0 --- /dev/null +++ b/keyboards/planck/keymaps/mjtnumsym/readme.md @@ -0,0 +1,26 @@ +# Mike's Rethought Planck + +- Music/Audio +- Dynamic Macros +- Media Keys +- Works with iPhone Camera Adapter + +## Layers + +Qwerty for letters and mods. + +Numsym for all numbers and symbols used in typing. Follows a similar approach to +planck but puts both on the same layer eschewing the F-keys. + +Fkeys layer is for the seldom used stuff like F-keys and some additional features +such as dynamic macros, media keys, and a sleep shortcut for OS X. + +Adjust layer is mainly for keyboard configuration stuff. + +## Dynamic Macros + +Hold TAB key, then press ";" to record macro 1 and "'" to record macro 2. + +When you are done recording, press TAB again. + +For playback of macros, TAB+"," plays macro 1 and TAB+","plays macro 2. diff --git a/keyboards/planck/keymaps/mjuma/config.h b/keyboards/planck/keymaps/mjuma/config.h new file mode 100644 index 000000000000..f399fa0c23d7 --- /dev/null +++ b/keyboards/planck/keymaps/mjuma/config.h @@ -0,0 +1,28 @@ +/* Copyright 2017-2021 M Juma + * + * 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define TAPPING_TERM 200 diff --git a/keyboards/planck/keymaps/mjuma/keymap.c b/keyboards/planck/keymaps/mjuma/keymap.c new file mode 100644 index 000000000000..c5faeb438595 --- /dev/null +++ b/keyboards/planck/keymaps/mjuma/keymap.c @@ -0,0 +1,232 @@ +/* Copyright 2017-2021 M Juma + * + * 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 QMK_KEYBOARD_H +#include "muse.h" + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _GAMING, + _ADJUST, + _FN, + _SPACE_FN +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + GAMING +}; + +enum taps { + TD_SHIFT_CAPS = 0 +}; + +tap_dance_action_t tap_dance_actions[] = { + [TD_SHIFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) +}; + +// Fillers to make layering more clear +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define FN MO(_FN) +#define SPACE_FN LT(_SPACE_FN, KC_SPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | GEsc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | FN | GUI | Alt |Lower | Space FN |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + QK_GESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + TD(TD_SHIFT_CAPS), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_RSFT, KC_ENT), + KC_LCTL, FN, KC_LALT, KC_LGUI, LOWER, SPACE_FN, SPACE_FN, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | * | 4 | 5 | 6 | - | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | / | 1 | 2 | 3 | + |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | Space | | 0 | . | = | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_PAST, KC_4, KC_5, KC_6, KC_PMNS, KC_BSLS, + _______, _______, _______, _______, _______, _______, KC_PSLS, KC_1, KC_2, KC_3, KC_PPLS, MT(MOD_LSFT, KC_ENT), + _______, _______, _______, _______, _______, KC_SPC, KC_SPC, _______, KC_0, KC_PDOT, KC_PEQL, _______ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | / | { | [ | ] | } | \ | - | = | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | _ | + |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | Space | | Home | PgDn | PgUp | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + _______, _______, _______, KC_SLSH, KC_LCBR, KC_LBRC, KC_RBRC, KC_RCBR, KC_BSLS, KC_MINS, KC_EQL, KC_PIPE, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, MT(MOD_LSFT, KC_ENT), + _______, _______, _______, _______, _______, KC_SPC, KC_SPC, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* fn + * ,-----------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F11 | F12 | F13 | F14 | F15 | |INSERT| Home | PgUp | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | |DELETE| End | PgDn | | Enter| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | Space | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_FN] = LAYOUT_planck_grid( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, + _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, _______, KC_INS, KC_HOME, KC_PGUP, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_DEL, KC_END, KC_PGDN, _______, MT(MOD_LSFT, KC_ENT), + _______, _______, _______, _______, _______, KC_SPC, KC_SPC, _______, _______, _______, _______, _______ +), + +/* Space fn + * ,------------------------------------------------------------------------------------. + * |PRNT SC| | UP | | | | | | | | | | + * |-------+------+------+------+------+-------------+------+------+------+------+------| + * | | LEFT | DOWN | RIGHT| | | LEFT | DOWN | UP | RIGHT| | | + * |-------+------+------+------+------+------|------+------+------+------+------+------| + * | |ALT+1 |ALT+2 |ALT+3 |ALT+4 |ALT+5 |ALT+6 |ALT+7 |ALT+8 |ALT+9 |ALT+10| | + * |-------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | |VOLDWN| |VOL UP| PREV | MUTE |PLY/PS| NEXT | + * `------------------------------------------------------------------------------------' + */ +[_SPACE_FN] = LAYOUT_planck_grid( + KC_PSCR, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, + _______, LALT(KC_1), LALT(KC_2), LALT(KC_3), LALT(KC_4), LALT(KC_5), LALT(KC_6), LALT(KC_7), LALT(KC_8), LALT(KC_9), LALT(KC_0), _______, + _______, _______, _______, _______, KC_VOLD, _______, _______, KC_VOLU, KC_MPRV, KC_MUTE, KC_MPLY, KC_MNXT +), + +/* Gaming Layer + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | FN | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_GAMING] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + QK_GESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + TD(TD_SHIFT_CAPS), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_RSFT, KC_ENT), + KC_LCTL, FN, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Boot |Debug | | | | |DMREC1|DMREC2| | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | |GAMING| | | | | |DMPLY1|DMPLY2|Audoff|Aud on| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | |DMRSTP| |Musoff|Mus on|MusMod| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |AG_TOG| | | | |Voice-|Voice+| | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, _______, _______, _______, _______, DM_REC1, DM_REC2, _______, _______, _______, + _______, TG(_GAMING), ___, _______, _______, _______, _______, DM_PLY1, DM_PLY2, AU_OFF, AU_ON, _______, + _______, _______, _______, _______, _______, _______, _______, DM_RSTP, _______, MU_OFF, MU_ON, MU_NEXT, + _______, _______, _______, AG_TOGG, _______, _______, _______, _______, _______, AU_PREV, AU_NEXT, _______ +) + +}; + +/* Layer Change Code + * Runs everytime the layer gets changed + */ +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } + return true; +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +/* Controls which keycodes are processed when in music mode + * Return: false if key should be honored in music mode + */ +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/mjuma/readme.md b/keyboards/planck/keymaps/mjuma/readme.md new file mode 100644 index 000000000000..ee1299b878f7 --- /dev/null +++ b/keyboards/planck/keymaps/mjuma/readme.md @@ -0,0 +1,183 @@ +# M Juma Planck Layout + +## Layers + +```ascii +Keymap: 32 Layers Layer: action code matrix +----------------- --------------------- +stack of layers array_of_action_code[row][column] + ____________ precedence _______________________ + / / | high / ESC / F1 / F2 / F3 .... + 31 /___________// | /-----/-----/-----/----- + 30 /___________// | / TAB / Q / W / E .... + 29 /___________/ | /-----/-----/-----/----- + : _:_:_:_:_:__ | : /LCtrl/ A / S / D .... + : / : : : : : / | : / : : : : + 2 /___________// | 2 `-------------------------- + 1 /___________// | 1 `-------------------------- + 0 /___________/ V low 0 `-------------------------- +``` + +### Qwerty + +```ascii +,-----------------------------------------------------------------------------------. +| Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| GEsc | A | S | D | F | G | H | J | K | L | ; | " | +|------+------+------+------+------+------|------+------+------+------+------+------| +| Shift| Z | X | C | V | B | N | M | , | . | / |Enter | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Ctrl | FN | GUI | Alt |Lower | Space FN |Raise | Left | Down | Up |Right | +`-----------------------------------------------------------------------------------' +``` + +#### Qwerty Layer Features + +- [Grave Escape](https://docs.qmk.fm/#/feature_grave_esc) +- [Tap Dance](https://docs.qmk.fm/#/feature_tap_dance) Left Shift + - Tap => Shift + - Double Tap => Capslock +- [Mod-Tap](https://docs.qmk.fm/#/mod_tap) Enter + - Tap => Enter + - Hold => Right Shift +- [Layer Toggle](https://docs.qmk.fm/#/feature_layers) Space + - Tap => Space + - Hold => Activate ***Space Function*** Layer + +### Raise + +```ascii +,-----------------------------------------------------------------------------------. +| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | | | | | | * | 4 | 5 | 6 | - | \ | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | | | | | | / | 1 | 2 | 3 | + |Enter | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | Space | | 0 | . | = | | +`-----------------------------------------------------------------------------------' +``` + +### Lower + +```ascii +,-----------------------------------------------------------------------------------. +| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | | | / | { | [ | ] | } | \ | - | = | | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | | | | | | | | | _ | + |Enter | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | Space | | Home | PgDn | PgUp | End | +`-----------------------------------------------------------------------------------' +``` + +### Function + +```ascii +,-----------------------------------------------------------------------------------. +| | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | Del | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | F11 | F12 | F13 | F14 | F15 | |INSERT| Home | PgUp | | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | | | | | | |DELETE| End | PgDn | | Enter| +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | Space | | | | | | +`-----------------------------------------------------------------------------------' +``` + +### Space Function + +```ascii +,------------------------------------------------------------------------------------. +|PRNT SC| | UP | | | | | | | | | | +|-------+------+------+------+------+-------------+------+------+------+------+------| +| | LEFT | DOWN | RIGHT| | | LEFT | DOWN | UP | RIGHT| | | +|-------+------+------+------+------+------|------+------+------+------+------+------| +| |ALT+1 |ALT+2 |ALT+3 |ALT+4 |ALT+5 |ALT+6 |ALT+7 |ALT+8 |ALT+9 |ALT+10| | +|-------+------+------+------+------+------+------+------+------+------+------+------| +| | | | |VOLDWN| |VOL UP| PREV | MUTE |PLY/PS| NEXT | +`------------------------------------------------------------------------------------' +``` + +### Gaming + +```ascii +,-----------------------------------------------------------------------------------. +| Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Esc | A | S | D | F | G | H | J | K | L | ; | " | +|------+------+------+------+------+------|------+------+------+------+------+------| +| Shift| Z | X | C | V | B | N | M | , | . | / |Enter | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Ctrl | FN | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right | +`-----------------------------------------------------------------------------------' +``` + +### Adjust (Lower + Raise) + +```ascii +,-----------------------------------------------------------------------------------. +| |RESET |Debug | | | | |DMREC1|DMREC2| | | | +|------+------+------+------+------+-------------+------+------+------+------+------| +| |GAMING| | | | | |DMPLY1|DMPLY2|Audoff|Aud on| | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | | | | | | |DMRSTP| |Musoff|Mus on|MusMod| +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | |AG_TOG| | | | |Voice-|Voice+| | +`-----------------------------------------------------------------------------------' +``` + +#### Adjust Layer Features + +```text +RESET: Put the keyboard into bootloader mode for flashing +Debug: Toggle debug mode +EE_CLR: Reinitializes the keyboard’s EEPROM (persistent memory) + +AG_TOG: Toggle Alt and GUI swap on both sides (Mac) + +DM_REC1: Start recording Macro 1 +DM_REC2: Start recording Macro 2 +DM_PLY1: Replay Macro 1 +DM_PLY2: Replay Macro 2 +DM_RSTP: Finish the macro that is currently being recorded. + +AU_ON: Audio mode on +AU_OFF: Audio mode off +AU_TOGG: Toggles Audio mode +MU_ON: Turn music mode on +MU_OFF: Turn music mode off +MU_TOGG: Toggle music mode +MU_NEXT: Cycle through the music modes: + CHROMATIC_MODE: Chromatic scale, row changes the octave + GUITAR_MODE: Chromatic scale, but the row changes the string (+5 st) + VIOLIN_MODE: Chromatic scale, but the row changes the string (+7 st) + MAJOR_MODE: Major scale + +In Music Mode: + LCTL: start a recording + LALT: stop recording/stop playing + LGUI: play recording + KC_UP: speed-up playback + KC_DOWN: slow-down playback +``` + +## Compilation + +Use the docker image to compile this keyboard layout by running the following from the root of the repo: + +```sh +util/docker_build.sh planck/rev6:mjuma +``` + +## Flashing + +Flashing on linux can be done through the docker image + +```sh +sudo util/docker_build.sh planck/rev6:mjuma:flash +``` + +or on Windows using the [QMK Toolbox](https://github.com/qmk/qmk_toolbox) diff --git a/keyboards/planck/keymaps/mjuma/rules.mk b/keyboards/planck/keymaps/mjuma/rules.mk new file mode 100644 index 000000000000..60f314e82bd2 --- /dev/null +++ b/keyboards/planck/keymaps/mjuma/rules.mk @@ -0,0 +1,3 @@ +SRC += muse.c +DYNAMIC_MACRO_ENABLE = yes +TAP_DANCE_ENABLE = yes diff --git a/keyboards/planck/keymaps/mnil/config.h b/keyboards/planck/keymaps/mnil/config.h new file mode 100644 index 000000000000..2dc8e19be651 --- /dev/null +++ b/keyboards/planck/keymaps/mnil/config.h @@ -0,0 +1,23 @@ +/* Copyright 2021 Mats Nilsson + * + * 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE +# define STARTUP_SONG SONG(NO_SOUND) +#endif + +#define MIDI_BASIC diff --git a/keyboards/planck/keymaps/mnil/keymap.c b/keyboards/planck/keymaps/mnil/keymap.c new file mode 100644 index 000000000000..5aa85340bde5 --- /dev/null +++ b/keyboards/planck/keymaps/mnil/keymap.c @@ -0,0 +1,60 @@ +/* Copyright 2021 Mats Nilsson + * + * 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 "mnil.h" + +layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _SYMBOLS, _NAVIGATION, _NUMPAD); } + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_COLEMAK] = LAYOUT_planck_2x2u( + KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, TD(OAA), KC_BSPC, + KC_TAB, TD(AAE), KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, KC_NO, + KC_LSFT, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, SE_MINS, KC_NO , + KC_LCTL, KC_NO, KC_LGUI, SFT_TAB, _NAV_SPC, _SYM_ENT, CTL_BSPC,ALT_DEL, KC_NO, KC_LGUI +), + +[_QWERTY] = LAYOUT_planck_2x2u( + KC_TRNS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, SE_ARNG, + KC_TRNS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SE_ODIA, SE_ADIA, + KC_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +), + +[_SYMBOLS] = LAYOUT_planck_2x2u( + KC_TRNS, KC_NO, SE_PIPE, SE_LBRC, SE_RBRC, KC_NO, S(KC_5), SE_QUES, SE_AT, SE_EQL, SE_DLR, KC_BSPC, + KC_TRNS, SE_LCBR, SE_RCBR, SE_LPRN, SE_RPRN, KC_NO, SE_PLUS, S(KC_1), S(KC_2), S(KC_3), SE_AMPR, KC_QUOT, + KC_TRNS, M_TILD, M_CIRC, SE_LABK, SE_RABK, KC_NO, SE_QUOT, SE_SLSH, SE_BSLS, SE_ASTR, M_BTCK, KC_ENT, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +), + +[_NAVIGATION] = LAYOUT_planck_2x2u( + KC_TRNS, KC_NO, CUT, COPY, PASTE, AUTOFILL,KC_NO, KC_HOME, KC_WH_D, KC_WH_U, KC_END, KC_NO, + KC_TRNS, KC_ACL0, KC_ACL1, KC_BTN2, KC_BTN1, KC_LCTL, KC_WH_L, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_WH_R, + KC_TRNS, KC_ACL2, KC_BTN4, KC_BTN3, KC_BTN5, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_LCTL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +), + +[_NUMPAD] = LAYOUT_planck_2x2u( + KC_TRNS, QUIT, WIN, MVWSL, MVWSR, CRYWS, TERM, KC_7, KC_8, KC_9, KC_COMM, QK_BOOT, + KC_TRNS, CS_TAB, C_TAB, PRVWS, NXTWS, I3MOD, OPEN, KC_4, KC_5, KC_6, KC_0, KC_NO, + KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, MOVWS, BROWSER, KC_1, KC_2, KC_3, KC_DOT, KC_NO, + QWE_COL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +), + +}; +// clang-format on diff --git a/keyboards/planck/keymaps/mnil/readme.md b/keyboards/planck/keymaps/mnil/readme.md new file mode 100644 index 000000000000..43c9409614b5 --- /dev/null +++ b/keyboards/planck/keymaps/mnil/readme.md @@ -0,0 +1,2 @@ +# mnil's planck keymap +Read my user settings [here](../../../../users/mnil/readme.md) for more details. diff --git a/keyboards/planck/keymaps/motform/config.h b/keyboards/planck/keymaps/motform/config.h new file mode 100644 index 000000000000..6f70f09beec2 --- /dev/null +++ b/keyboards/planck/keymaps/motform/config.h @@ -0,0 +1 @@ +#pragma once diff --git a/keyboards/planck/keymaps/motform/keymap.c b/keyboards/planck/keymaps/motform/keymap.c new file mode 100644 index 000000000000..54d472d7f107 --- /dev/null +++ b/keyboards/planck/keymaps/motform/keymap.c @@ -0,0 +1,121 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "keymap_swedish.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _COLEMAK, + _LOWER, + _RAISE, + _ADJUST +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +/* These definitions can be removed once keymap_swe is properly vetted against MacOS */ +#define SE_DLR_MAC_V ALGR(LALT(KC_4)) +#define SE_AT_MAC_V ALGR(LALT(KC_2)) + +/* Esc when pressed, ctrl when used as a modifier */ +#define KC_ECTL MT(MOD_LCTL, KC_ESC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Colemak_se + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | Ö | Å | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ECTR | A | R | S | T | D | H | N | E | I | O | Ä | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | SCSHE| Z | X | C | V | B | K | M | , | . | - |SCSHE | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | esc | CTRL | Alt | CMD |Lower |Space |Bksp |Raise | CMD | RALT | HYPER| MEH | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid +( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, SE_ODIA, SE_ARNG, + KC_ECTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, SE_ADIA, + SC_SENT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, SE_MINS, SC_SENT, + KC_ESC, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_BSPC, RAISE, KC_RGUI, KC_RALT, KC_HYPR, KC_MEH + ), + +/* Lower +* ,-----------------------------------------------------------------------------------. +* | | PIPE | ' | @ | & | | DOWN | | RIGHT| ` | ´ | ~ | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | | ! | " | # | ? | % | LEFT | / | \ | = | + | * | +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | | | | [ | ] | | UP | { | } | | | | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | | | | | | | DEL | | Next | Vol- | Vol+ | Play | +* `-----------------------------------------------------------------------------------' +*/ +[_LOWER] = LAYOUT_planck_grid +( + _______, SE_LCBR, SE_QUOT, SE_AT_MAC_V, SE_AMPR, _______, KC_DOWN, KC_NO, KC_RGHT, SE_GRV, SE_GRV, SE_TILD, + _______, KC_EXLM, SE_DQUO, KC_HASH, SE_QUES, KC_PERC, KC_LEFT, SE_SLSH, S(SE_LCBR), SE_EQL, KC_PPLS, KC_PAST, + _______, KC_NO, KC_NO, SE_LBRC, SE_RBRC, KC_NO, KC_UP, S(SE_LBRC), S(SE_RBRC), KC_NO, KC_NO, _______, + _______, _______, _______, _______, _______, _______, KC_DEL, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + +/* Raise +* ,-----------------------------------------------------------------------------------. +* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | ^ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | $ | +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | | | | < | > | | | ( | ) |Pg Up |Pg Dn | | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | | | | | | | | Next | Vol- | Vol+ | Play | +* `-----------------------------------------------------------------------------------' +*/ +[_RAISE] = LAYOUT_planck_grid +( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + SE_CIRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, SE_DLR_MAC_V, + _______, KC_NO, KC_NO, SE_SECT, SE_HALF, KC_NO, KC_NO, SE_LPRN, SE_RPRN, KC_PGUP, KC_PGDN, KC_NO, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| Debug| | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid +( + _______, QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) + +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} diff --git a/keyboards/planck/keymaps/motform/readme.md b/keyboards/planck/keymaps/motform/readme.md new file mode 100644 index 000000000000..d9bda61219e0 --- /dev/null +++ b/keyboards/planck/keymaps/motform/readme.md @@ -0,0 +1,10 @@ +# Motform Planck Layout + +This layout is based off the [colemak-se](github.com/motform/colemak-se) +layout and features many tweaks to make working with Emacs and +evil-mode more ergonomic. As with the colemak layout itself, the idea +is to concentrate as much movement as possible to the home row. + +To properly use the layout in Emacs, set Super to LGUI and Meta to RGUI. +Unless you are running a permutation of the MacOS Swedish QWERTY-layout, +modifiers will probably not work. diff --git a/keyboards/planck/keymaps/msiu/config.h b/keyboards/planck/keymaps/msiu/config.h new file mode 100644 index 000000000000..86550ac5c0c2 --- /dev/null +++ b/keyboards/planck/keymaps/msiu/config.h @@ -0,0 +1,37 @@ +#pragma once + + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/msiu/keymap.c b/keyboards/planck/keymaps/msiu/keymap.c new file mode 100644 index 000000000000..6e5301bcfd8e --- /dev/null +++ b/keyboards/planck/keymaps/msiu/keymap.c @@ -0,0 +1,210 @@ +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _DVORAK, + _LOWER, + _RAISE, + _NUMB, + _FUNC, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + DVORAK, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = LAYOUT_planck_grid( + LT(_NUMB, KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LCTL_T(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_LCTL, KC_HYPR, KC_LALT, KC_LGUI, LOWER, MO(_FUNC), KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +[_DVORAK] = LAYOUT_planck_grid( + _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______, + _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + _______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE, + _______, _______, _______, _______, _______, _______, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT +), + +[_RAISE] = LAYOUT_planck_grid( + 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_4, KC_5, KC_6, KC_PLUS, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_7, KC_8, KC_9, KC_MINS, KC_F11, KC_F12, KC_PGDN, KC_PGUP, KC_HOME, KC_END , KC_MUTE, + _______, _______, _______, _______, _______, _______, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT +), + +[_ADJUST] = LAYOUT_planck_grid( + _______, _______, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, DVORAK, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT +), + +[_FUNC] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, KC_PSCR, _______, + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_NUMB] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, KC_BSPC, + _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_0, KC_0, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } + return true; +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/msiu/readme.md b/keyboards/planck/keymaps/msiu/readme.md new file mode 100644 index 000000000000..de9680b49851 --- /dev/null +++ b/keyboards/planck/keymaps/msiu/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/msiu/rules.mk b/keyboards/planck/keymaps/msiu/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/msiu/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/muppetjones/.clang-format b/keyboards/planck/keymaps/muppetjones/.clang-format new file mode 100644 index 000000000000..df3dbd17b4ca --- /dev/null +++ b/keyboards/planck/keymaps/muppetjones/.clang-format @@ -0,0 +1,26 @@ +--- +BasedOnStyle: Google +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: 'true' +AlignConsecutiveDeclarations: 'true' +AlignOperands: 'true' +AllowAllParametersOfDeclarationOnNextLine: 'false' +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: 'false' +BinPackArguments: 'true' +BinPackParameters: 'true' +ColumnLimit: '160' +IndentCaseLabels: 'true' +IndentPPDirectives: AfterHash +IndentWidth: '4' +MaxEmptyLinesToKeep: '1' +PointerAlignment: Right +SortIncludes: 'false' +SpaceBeforeAssignmentOperators: 'true' +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: 'false' +TabWidth: '4' +UseTab: Never + +... diff --git a/keyboards/planck/keymaps/muppetjones/config.h b/keyboards/planck/keymaps/muppetjones/config.h new file mode 100644 index 000000000000..88331e71f616 --- /dev/null +++ b/keyboards/planck/keymaps/muppetjones/config.h @@ -0,0 +1,53 @@ + /* Copyright 2020 Stephen Bush + * + * 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. + */ +#pragma once + +#ifdef AUDIO_ENABLE +# define STARTUP_SONG SONG(PLANCK_SOUND) +// #define STARTUP_SONG SONG(NO_SOUND) + +# define DEFAULT_LAYER_SONGS \ + { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND) } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* + * Other options + */ + +// Enable lighting layers +#define RGBLIGHT_LAYERS +#define RGBLIGHT_SLEEP + +// Change "hold" time (default is 200 ms) +#define TAPPING_TERM 200 + +// Enable rapid switch from tap to hold, disables double tap hold auto-repeat. +#define QUICK_TAP_TERM 0 diff --git a/keyboards/planck/keymaps/muppetjones/keymap.c b/keyboards/planck/keymaps/muppetjones/keymap.c new file mode 100644 index 000000000000..a5609e571120 --- /dev/null +++ b/keyboards/planck/keymaps/muppetjones/keymap.c @@ -0,0 +1,403 @@ +/* Copyright 2020 Stephen Bush + * + * 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 . + */ + +/* + * qmk compile -kb planck/rev6 -km muppetjones + */ + +#include QMK_KEYBOARD_H +#include "muse.h" +#include "muppetjones.h" + +#define LAYOUT_planck_wrapper(...) LAYOUT_planck_grid(__VA_ARGS__) + +/* Extend layers from muppetjones.h + _CLMK_DH = 0, + _QWERTY + _MOUSE, + _LOWER, + _RAISE, + _NAV, + _ADJUST, + */ +enum planck_layers { + _PLOVER = _ADJUST + 1, +}; + +enum planck_keycodes { + PLOVER = SAFE_RANGE, + BACKLIT, + EXT_PLV, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // clang-format off + +/* Colemak DH II + * ,-----------------------------------------------------------------------------------. + * | Q | W | F | P | B | Del | Bksp | J | L | U | Y | ; | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | A | R | S | T | G | | " | M | N | E | I | O | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Z | X | C | D | V SFT| Enter| Tab | K | H | , | . | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt |HY_ESC|Lower | Space |Raise |HY_ESC| Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_CLMK_DH] = LAYOUT_planck_wrapper( + __COLEMAK_MOD_DH_L1________________________, KC_DEL, KC_BSPC, __COLEMAK_MOD_DH_R1_W_QUOT_________________, + __COLEMAK_MOD_DH_L2_W_GACS_________________, CW_TOGG, KC_QUOT, __COLEMAK_MOD_DH_R2_W_SCAG_________________, + __COLEMAK_MOD_DH_L3_W_SFTV_________________, KC_ENT, KC_TAB, __COLEMAK_MOD_DH_R3________________________, + TD_LAYR, XXXXXXX, XXXXXXX, HY_ESC, LOW_ENT, KC_BSPC, KC_BSPC, RAI_SPC, HY_ESC, KC_BSPC, XXXXXXX, XXXXXXX +), + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_wrapper( + __QWERTY_L1________________________________, _______, _______, __QWERTY_R1________________________________, + __QWERTY_L2________________________________, _______, _______, __QWERTY_R2________________________________, + __QWERTY_L3________________________________, _______, _______, __QWERTY_R3________________________________, + __BLANK____________________________________, _______, _______, __BLANK____________________________________ +), + +/* MOUSE + * No encoders. Just an empty layer. + */ +[_MOUSE] = LAYOUT_planck_wrapper( + __BLANK____________________________________, _______, _______, __BLANK____________________________________, + __BLANK____________________________________, _______, _______, __BLANK____________________________________, + __BLANK____________________________________, _______, _______, __BLANK____________________________________, + __BLANK____________________________________, _______, _______, __BLANK____________________________________ +), + +// /* Colemak DH +// * ,-----------------------------------------------------------------------------------. +// * | Tab | Q | W | F | P | B | J | L | U | Y | ; | Bksp | +// * |------+------+------+------+------+------+------+------+------+------+------+------| +// * | Esc | A | R | S | T | G | M | N | E | I | O | " | +// * |------+------+------+------+------+------+------+------+------+------+------+------| +// * | Shift| Z | X | C | D | V | K | H | , | . | / |Enter | +// * |------+------+------+------+------+------+------+------+------+------+------+------| +// * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | +// * `-----------------------------------------------------------------------------------' +// */ +// [_CLMK_DH] = LAYOUT_planck_grid( +// KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, +// HY_ESC, HOME_A, HOME_R, HOME_S, HOME_T, KC_G, KC_M, HOME_N, HOME_E, HOME_I, HOME_O, KC_QUOT, +// KC_LSFT, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, SC_SENT, +// KC_LCTL, NUMPD, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX +// ), +/* Lower (numpad, symbols) + * ,-----------------------------------------------------------------------------------. + * | | | ( | ) | ~ | | | | 7 & | 8 * | 9 ( | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | { | } | ` | | | - _ | 4 $ | 5 % | 6 ^ | * | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | [ | ] | | | | = + | 1 ! | 2 @ | 3 # | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | Space | | 0 | . | | | + * `-----------------------------------------------------------------------------------' + * 21.02.22: Removed F keys. + * 21.03.28: Completely revamped to contain 10-key numpad and symbols. + */ +[_LOWER] = LAYOUT_planck_wrapper( + __SYMBOLS_L1_______________________________, _______, _______, __NUMPAD_R1________________________________, + __SYMBOLS_L2_______________________________, _______, _______, __NUMPAD_R2________________________________, + __SYMBOLS_L3_______________________________, _______, _______, __NUMPAD_R3________________________________, + _______, _______, _______, _______, _______, _______, _______, __NUMPAD_R4________________________________ +), + +/* Raise +* ,-----------------------------------------------------------------------------------. +* | ` | | | | | | | Pg Up| HOME | | END | | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | GUI | ALT | CTL | SFT | | | | Pg Dn| LEFT | DOWN | UP |RIGHT | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | | | | | | | | | | | | | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | | | | | | | | Next | Vol- | Vol+ | Play | +* `-----------------------------------------------------------------------------------' +* 21.02.22: Removed F keys and replaced with useful programming keys. +*/ +[_RAISE] = LAYOUT_planck_wrapper( + XXXXXXX, XXXXXXX, KC_LPRN, KC_RPRN, XXXXXXX, _______, _______, __NAV_R1___________________________________, + KC_LGUI, KC_LALT, HR_LBRC, HR_RBRC, KC_MINS, _______, _______, __NAV_R2___________________________________, + XXXXXXX, XXXXXXX, KC_LCBR, KC_RCBR, KC_EQL, _______, _______, __NAV_R3___________________________________, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Nav + * Available in raise. + */ +[_NAV] = LAYOUT_planck_wrapper( + __BLANK____________________________________, _______, _______, __BLANK____________________________________, + __BLANK____________________________________, _______, _______, __BLANK____________________________________, + __BLANK____________________________________, _______, _______, __BLANK____________________________________, + __BLANK____________________________________, _______, _______, __BLANK____________________________________ +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * v------------------------RGB CONTROL--------------------v + * ,-----------------------------------------------------------------------------------. + * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Brite |MUSmod|Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|CLMKII|Plover| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof|ClmkDH| | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_wrapper( + __ADJUST_L1________________________________, AU_NEXT, PLOVER, __MEDIA_R1_________________________________, + __ADJUST_L2________________________________, AU_PREV, CLMK_DH, __MEDIA_R2_________________________________, + __ADJUST_L3________________________________, MU_NEXT, QWERTY, __MEDIA_R3_________________________________, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +) + +/* + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' +[_ADJUST] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + */ + // clang-format on +}; + +#ifdef AUDIO_ENABLE +float plover_song[][2] = SONG(PLOVER_SOUND); +float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +#define LIGHT_GOLDEN 30, 255, 100 +#define LIGHT_MAGENTA 213, 255, 100 +#define LIGHT_AZURE 148, 255, 100 + +// Define light layers +// -- e.g., light up LEDS 3-6 with RED when the numpd layer is active +const rgblight_segment_t PROGMEM rgb_clmk_dh[] = RGBLIGHT_LAYER_SEGMENTS({0, 9, HSV_RED}); +const rgblight_segment_t PROGMEM rgb_lower[] = RGBLIGHT_LAYER_SEGMENTS({0, 9, LIGHT_GOLDEN}); +const rgblight_segment_t PROGMEM rgb_raise[] = RGBLIGHT_LAYER_SEGMENTS({0, 9, LIGHT_MAGENTA}); +const rgblight_segment_t PROGMEM rgb_numpd[] = RGBLIGHT_LAYER_SEGMENTS({0, 9, LIGHT_AZURE}); + +const rgblight_segment_t* const PROGMEM rgb_layers[] = RGBLIGHT_LAYERS_LIST(rgb_clmk_dh, rgb_lower, rgb_raise, rgb_numpd); + +void keyboard_post_init_user(void) { + rgblight_layers = rgb_layers; // Enable the LED layers +} + +layer_state_t layer_state_set_user(layer_state_t state) { + rgblight_set_layer_state(1, layer_state_cmp(state, _LOWER)); + rgblight_set_layer_state(2, layer_state_cmp(state, _RAISE)); + return state; +} + +bool process_record_keymap(uint16_t keycode, keyrecord_t* record) { + switch (keycode) { + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); +#ifdef BACKLIGHT_ENABLE + backlight_step(); +#endif +#ifdef KEYBOARD_planck_rev5 + writePinLow(E6); +#endif + } else { + unregister_code(KC_RSFT); +#ifdef KEYBOARD_planck_rev5 + writePinHigh(E6); +#endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); +#endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); +#endif + layer_off(_PLOVER); + } + return false; + break; + } + + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo += 1; + } else { + muse_tempo -= 1; + } + } + } else { + if (clockwise) { +#ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); +#else + tap_code(KC_PGDN); +#endif + } else { +#ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); +#else + tap_code(KC_PGUP); +#endif + } + } + return true; +} + +void dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { + PLAY_SONG(plover_song); + } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { + PLAY_SONG(plover_gb_song); + } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } +} + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/muppetjones/readme.md b/keyboards/planck/keymaps/muppetjones/readme.md new file mode 100644 index 000000000000..de9680b49851 --- /dev/null +++ b/keyboards/planck/keymaps/muppetjones/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/muppetjones/rules.mk b/keyboards/planck/keymaps/muppetjones/rules.mk new file mode 100644 index 000000000000..1db412715d96 --- /dev/null +++ b/keyboards/planck/keymaps/muppetjones/rules.mk @@ -0,0 +1,5 @@ +SRC += muse.c + +MOUSEKEY_ENABLE = yes +TAP_DANCE_ENABLE = yes +COMBO_ENABLE = yes diff --git a/keyboards/planck/keymaps/muzfuz/config.h b/keyboards/planck/keymaps/muzfuz/config.h new file mode 100644 index 000000000000..89b3042486b0 --- /dev/null +++ b/keyboards/planck/keymaps/muzfuz/config.h @@ -0,0 +1,37 @@ +#pragma once + +#ifdef AUDIO_ENABLE +#define STARTUP_SONG SONG(PLANCK_SOUND) +// #define STARTUP_SONG SONG(NO_SOUND) + +#define DEFAULT_LAYER_SONGS \ + { \ + SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/muzfuz/keymap.c b/keyboards/planck/keymaps/muzfuz/keymap.c new file mode 100644 index 000000000000..0126ffdf25d3 --- /dev/null +++ b/keyboards/planck/keymaps/muzfuz/keymap.c @@ -0,0 +1,297 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers +{ + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes +{ + QWERTY = SAFE_RANGE, + BACKLIT, + EXT_PLV, + HASHRKT, + CLNEQLS +}; + +#define RSE_ENT LT(_RAISE, KC_ENT) +#define LWR_SPC LT(_LOWER, KC_SPC) +#define ESC_CTL CTL_T(KC_ESCAPE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI | Enter | Space | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + ESC_CTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, KC_NO, RSE_ENT, KC_NO, LWR_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |ESCCTL| := | | { | } | ( | ) | - | = | \ | ~ | GUI | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | => | | [ | ] | | | _ | + | | | Home | End | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + + [_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + ESC_CTL, CLNEQLS, _______, KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, KC_MINS, KC_EQL, KC_BSLS, KC_TILD, KC_RGUI, + _______, HASHRKT, _______, KC_LBRC, KC_RBRC, _______, _______, KC_UNDS, KC_PLUS, KC_PIPE, KC_HOME, KC_END, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | | | Up | | | | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |ESCCTL| | Left | Down | Right | | | 4 | 5 | 6 | | GUI | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | 1 | 2 | 3 | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_planck_grid( + KC_GRV, _______, _______, KC_UP, _______, _______, _______, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + ESC_CTL, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_4, KC_5, KC_6, _______, KC_RGUI, + _______, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL, + _______, _______, MU_NEXT, AU_ON, AU_OFF, _______, _______, QWERTY, _______, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) + +}; + +#ifdef AUDIO_ENABLE +float plover_song[][2] = SONG(PLOVER_SOUND); +float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) +{ + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + switch (keycode) + { + case HASHRKT: + if (record->event.pressed) + { + SEND_STRING("=>"); + } + break; + case CLNEQLS: + if (record->event.pressed) + { + SEND_STRING(":="); + } + break; + case QWERTY: + if (record->event.pressed) + { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) + { + register_code(KC_RSFT); +#ifdef BACKLIGHT_ENABLE + backlight_step(); +#endif +#ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1 << 6); +#endif + } + else + { + unregister_code(KC_RSFT); +#ifdef KEYBOARD_planck_rev5 + PORTE |= (1 << 6); +#endif + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) + { + if (IS_LAYER_ON(_RAISE)) + { + if (clockwise) + { + muse_offset++; + } + else + { + muse_offset--; + } + } + else + { + if (clockwise) + { + muse_tempo += 1; + } + else + { + muse_tempo -= 1; + } + } + } + else + { + if (clockwise) + { +#ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_DOWN); + unregister_code(KC_MS_WH_DOWN); +#else + register_code(KC_PGDN); + unregister_code(KC_PGDN); +#endif + } + else + { +#ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_UP); + unregister_code(KC_MS_WH_UP); +#else + register_code(KC_PGUP); + unregister_code(KC_PGUP); +#endif + } + } + return true; +} + +bool encoder_update_user(uint8_t index, bool clockwise) { + switch (index) + { + case 0: + if (active) + { +#ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); +#endif + layer_on(_ADJUST); + } + else + { +#ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); +#endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) + { + muse_mode = true; + } + else + { + muse_mode = false; +#ifdef AUDIO_ENABLE + stop_all_notes(); +#endif + } + } + return true; +} + +void matrix_scan_user(void) +{ +#ifdef AUDIO_ENABLE + if (muse_mode) + { + if (muse_counter == 0) + { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) + { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } +#endif +} + +bool music_mask_user(uint16_t keycode) +{ + switch (keycode) + { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/muzfuz/readme.md b/keyboards/planck/keymaps/muzfuz/readme.md new file mode 100644 index 000000000000..6f78284d70d7 --- /dev/null +++ b/keyboards/planck/keymaps/muzfuz/readme.md @@ -0,0 +1,5 @@ +# The muzfuz Planck Layout + +```shell +make planck/rev6:muzfuz:dfu-util +``` diff --git a/keyboards/planck/keymaps/muzfuz/rules.mk b/keyboards/planck/keymaps/muzfuz/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/muzfuz/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/mwpeterson/config.h b/keyboards/planck/keymaps/mwpeterson/config.h new file mode 100644 index 000000000000..657ffda599b9 --- /dev/null +++ b/keyboards/planck/keymaps/mwpeterson/config.h @@ -0,0 +1,36 @@ +#pragma once + +#define PERMISSIVE_HOLD + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(ONE_UP_SOUND) + // #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + #define GOODBYE_SONG SONG(COIN_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND) } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/mwpeterson/keymap.c b/keyboards/planck/keymaps/mwpeterson/keymap.c new file mode 100644 index 000000000000..5871fe4bfe35 --- /dev/null +++ b/keyboards/planck/keymaps/mwpeterson/keymap.c @@ -0,0 +1,312 @@ +// from event.pressed) { +#ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); +#endif + layer_off(RAISE_LAYER); + layer_off(LOWER_LAYER); + layer_off(ADJUST_LAYER); + layer_on(STENO_LAYER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + plover_resume(); + } + return false; + case PV_EXIT: + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); +#endif + plover_suspend(); + layer_off(STENO_LAYER); + } + return false; + case PV_LOOK: + if (record->event.pressed) { + plover_lookup(); + } + return false; + case SEND_VERSION: + if (record->event.pressed) { + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP "@" QMK_VERSION " (" QMK_BUILDDATE ")"); + } + return false; + case SEND_MAKE: + if (record->event.pressed) { + SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP ":dfu\n"); + } + return false; + } + return true; +} diff --git a/keyboards/planck/keymaps/mwpeterson/rules.mk b/keyboards/planck/keymaps/mwpeterson/rules.mk new file mode 100644 index 000000000000..e82617028134 --- /dev/null +++ b/keyboards/planck/keymaps/mwpeterson/rules.mk @@ -0,0 +1,7 @@ +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Disable shift combination, which conflicts with shift-parens +MOUSEKEY_ENABLE = yes # Mouse keys (disabled to save space) +NKRO_ENABLE = no # N-key rollover required for use as a steno board +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODEMAP_ENABLE = yes # Enable extended unicode diff --git a/keyboards/planck/keymaps/myoung34/config.h b/keyboards/planck/keymaps/myoung34/config.h new file mode 100644 index 000000000000..f69cb6228008 --- /dev/null +++ b/keyboards/planck/keymaps/myoung34/config.h @@ -0,0 +1,55 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#undef WORKMAN_SOUND +#define WORKMAN_SOUND COLEMAK_SOUND + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +// #define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#define WS2812_DI_PIN B2 // The pin the LED strip is connected to (PB2 by default) +#define RGBLED_NUM 3 // Number of LEDs in your strip +#define RGBLIGHT_EFFECT_BREATHING +#define RGBLIGHT_EFFECT_RAINBOW_MOOD +#define RGBLIGHT_EFFECT_RAINBOW_SWIRL +#define RGBLIGHT_EFFECT_SNAKE +#define RGBLIGHT_EFFECT_KNIGHT +#define RGBLIGHT_EFFECT_CHRISTMAS +#define RGBLIGHT_EFFECT_STATIC_GRADIENT +#define RGBLIGHT_EFFECT_RGB_TEST +#define RGBLIGHT_EFFECT_ALTERNATING +#define RGBLIGHT_EFFECT_TWINKLE + +#endif diff --git a/keyboards/planck/keymaps/myoung34/keymap.c b/keyboards/planck/keymaps/myoung34/keymap.c new file mode 100644 index 000000000000..1142ab8cb044 --- /dev/null +++ b/keyboards/planck/keymaps/myoung34/keymap.c @@ -0,0 +1,139 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + BACKLIT +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | H | J | K | L | ; |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Ctrl | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC , + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, RSFT_T(KC_ENT), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT , + _______, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | BL | | | | | | | Play | Vol- | Vol+ | Next | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_TAB, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + BL_TOGG, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_VOLD, KC_VOLU, KC_MNXT + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | BL | | | | | | | Play | Vol- | Vol+ | Next | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL , + KC_TAB, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + BL_TOGG, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_VOLD, KC_VOLU, KC_MNXT + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, RGB_M_R, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + } + return true; +} diff --git a/keyboards/planck/keymaps/myoung34/readme.md b/keyboards/planck/keymaps/myoung34/readme.md new file mode 100644 index 000000000000..6814683840fc --- /dev/null +++ b/keyboards/planck/keymaps/myoung34/readme.md @@ -0,0 +1,19 @@ +# myoung34's Planck Layout + +A basic Planck layout with simultaneous backlight and audio support. + +## Features + +- Base Layers + - QWERTY + - Colemak +- Audio +- Backlight + +## Building and flashing + +1. Put your board in DFU mode with either the button on the bottom, or with a software key in your current firmware +1. Flash: + ```bash + $ make planck/rev4:myoung34:dfu + ``` diff --git a/keyboards/planck/keymaps/myoung34/rules.mk b/keyboards/planck/keymaps/myoung34/rules.mk new file mode 100644 index 000000000000..0560de1dc4bb --- /dev/null +++ b/keyboards/planck/keymaps/myoung34/rules.mk @@ -0,0 +1,8 @@ +AUDIO_ENABLE = yes # Audio output on port C6 +CONSOLE_ENABLE = no # Console for debug(+400) +MIDI_ENABLE = no # MIDI controls +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +BACKLIGHT_ENABLE = yes + diff --git a/keyboards/planck/keymaps/narze/config.h b/keyboards/planck/keymaps/narze/config.h new file mode 100644 index 000000000000..a7fccc41873f --- /dev/null +++ b/keyboards/planck/keymaps/narze/config.h @@ -0,0 +1,43 @@ +#pragma once + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#undef TAPPING_TERM +#define TAPPING_TERM 100 + +#define COMBO_TERM 20 + +#define PERMISSIVE_HOLD + +#define SUPER_DUPER_SOUND S__NOTE(_B1) + +#define MOUSEKEY_DELAY 100 + +#define USB_POLLING_INTERVAL_MS 1 + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif diff --git a/keyboards/planck/keymaps/narze/keymap.c b/keyboards/planck/keymaps/narze/keymap.c new file mode 100644 index 000000000000..870690596803 --- /dev/null +++ b/keyboards/planck/keymaps/narze/keymap.c @@ -0,0 +1,367 @@ +#include QMK_KEYBOARD_H +#include "narze.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#include "keymap_colemak.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _QWOC, + _LOWER, + _RAISE, + _PLOVER, + _SUPERDUPER, + _DEV, + _MOUSE, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + QWOC, + PLOVER, + SUPERDUPER, + DEV, + MOUSE, + LOWER, + RAISE, + BACKLIT, + EXT_PLV, + SDTOGG, // Toggle SuperDuper + GUI_UNDS, + LSFT_LPRN, +}; + +enum process_combo_event { + CB_SUPERDUPER, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | F19 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Hp/Ec| A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Sft/(| Z/Dv | X | C | V | B | N | M | , | . | SD-/ |Sft/Ent| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Rse/[| Ctrl | Alt | GUI/_|Lower | Space | Raise| Bksp | Alt | Ctrl | Low/]| + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_F19, + HPR_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + LSFT_LPRN, LT(_DEV, KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, LT(_SUPERDUPER, KC_SLSH), SFT_ENT, + LT(_RAISE, KC_LBRC), KC_LCTL, KC_LALT, GUI_UNDS, LOWER, KC_SPC, KC_SPC, RAISE, KC_BSPC, ALT_COLN, KC_RCTL, LT(_LOWER, KC_RBRC) +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | - | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Hp/Ec| A | R | S | T | D | H | N | E | I | O | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Sft/(| Z/Dv | X | C | V | B | K | M | , | . | SD-/ |Sft/Ent| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI/_|Lower | Space | Raise| Bksp | Alt | Ctrl | Low/]| + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS, + HPR_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + LSFT_LPRN, LT(_DEV, KC_Z), KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, LT(_SUPERDUPER, KC_SLSH), SFT_ENT, + LT(_RAISE, KC_LBRC), KC_LCTL, KC_LALT, GUI_UNDS, LOWER, KC_SPC, KC_SPC, RAISE, KC_BSPC, ALT_COLN, KC_RCTL, LT(_LOWER, KC_RBRC) +), + +/* Qwerty on software Colemak : Useful for gaming with qwerty keymaps! */ +[_QWOC] = LAYOUT_planck_grid( + KC_TAB, CM_Q, CM_W, CM_E, CM_R, CM_T, CM_Y, CM_U, CM_I, CM_O, CM_P, KC_MINS, + HPR_ESC, CM_A, CM_S, CM_D, CM_F, CM_G, CM_H, CM_J, CM_K, CM_L, CM_SCLN, KC_QUOT, + LSFT_LPRN, LT(_DEV, KC_Z), CM_X, CM_C, CM_V, CM_B, CM_N, CM_M, CM_COMM, CM_DOT, LT(_SUPERDUPER, CM_SLSH), SFT_ENT, + LT(_RAISE, KC_LBRC), KC_LCTL, KC_LALT, GUI_UNDS, LOWER, KC_SPC, KC_SPC, RAISE, KC_BSPC, ALT_COLN, KC_RCTL, LT(_LOWER, KC_RBRC) +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ` | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ | | | |Sft/Ent| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),_______,_______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # | | | |Sft/Ent| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |TogOut| S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* SuperDuper : https://gist.github.com/narze/861e2167784842d38771 + * /-----------------------------------------------------------------------------------\ + * | | | | | | | | | T← | T→ | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Alt | [SuperDuper]| Bksp | Gui | ← | ↓ | ↑ | → | Del | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | Shift | | | | | | + * \-----------------------------------------------------------------------------------/ + */ +[_SUPERDUPER] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, S(LGUI(KC_LBRC)), S(LGUI(KC_RBRC)), _______, _______, + _______, KC_LALT, _______, _______, KC_BSPC, KC_LGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_DEL, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, KC_LSFT, KC_LSFT, _______, _______, _______, _______, _______ +), + +/* Dev Layer + * /-----------------------------------------------------------------------------------\ + * | | | | | | | | - | + | ( | ) | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | _ | [ | ] | { | } | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | = | | | < | > | ? | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | + * \-----------------------------------------------------------------------------------/ + */ +[_DEV] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, KC_MINS, S(KC_EQL), S(KC_9), S(KC_0), _______, + _______, _______, _______, _______, _______, _______, S(KC_MINS), KC_LBRC, KC_RBRC, S(KC_LBRC), S(KC_RBRC), _______, + _______, _______, _______, _______, _______, _______, KC_EQL, S(KC_BSLS), S(KC_COMM), S(KC_DOT), S(KC_SLSH), _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Mouse + * /-----------------------------------------------------------------------------------\ + * | | | S↑ | M↑ | S↓ | | | | S↑ | S↓ | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | M← | M↓ | M→ | | M← | M↓ | M↑ | M→ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |[Mouse| | | | M3 | M3 | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | M2 | LeftClick | M2 | | | | | + * \-----------------------------------------------------------------------------------/ + */ +[_MOUSE] = LAYOUT_planck_grid( + _______, _______, KC_WH_U, KC_MS_U, KC_WH_D, _______, _______, _______, KC_WH_U, KC_WH_D, _______, _______, + _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______, + _______, _______, _______, _______, _______, KC_BTN3, KC_BTN3, _______, _______, _______, _______, _______, + _______, _______, _______, _______, KC_BTN2, KC_BTN1, KC_BTN1, KC_BTN2, _______, _______, _______, _______ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|QwOnCo|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof|SDtogg| | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, QWOC, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, SDTOGG, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BACKLIT +) + +}; + +#ifdef AUDIO_ENABLE + float tone_plover[][2] = SONG(PLOVER_SOUND); + float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); + float tone_coin[][2] = SONG(VIOLIN_SOUND); + float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + + set_superduper_key_combo_layer(_QWERTY); + } + return false; + + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + + set_superduper_key_combo_layer(_COLEMAK); + } + return false; + + case QWOC: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWOC); + + set_superduper_key_combo_layer(_QWOC); + } + return false; + + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(tone_plover); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_plover_gb); + #endif + layer_off(_PLOVER); + } + return false; + + case SDTOGG: + if (record->event.pressed) { + bool enabled = toggle_superduper_mode(); + + #ifdef AUDIO_ENABLE + if (enabled) { + PLAY_SONG(tone_coin); + } else { + PLAY_SONG(tone_goodbye); + } + #endif + } + return false; + + // Macros + + // 1. Hold for LGUI, tap for Underscore + case GUI_UNDS: + perform_space_cadet(record, keycode, KC_LGUI, KC_LSFT, KC_MINS); + return false; + + // 2. Hold for LSHIFT, tap for Parens open + case LSFT_LPRN: + perform_space_cadet(record, keycode, KC_LSFT, KC_LSFT, KC_9); + return false; + + default: + return true; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +void matrix_setup(void) { + set_superduper_key_combos(); +} + +void matrix_scan_user(void) { +} + +void process_combo_event(uint16_t combo_index, bool pressed) { + if (pressed) { + switch(combo_index) { + case CB_SUPERDUPER: + layer_on(_SUPERDUPER); + break; + } + } else { + layer_off(_SUPERDUPER); + unregister_mods(MOD_BIT(KC_LGUI) | MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); // Sometimes mods are held, unregister them + } +} diff --git a/keyboards/planck/keymaps/narze/readme.md b/keyboards/planck/keymaps/narze/readme.md new file mode 100644 index 000000000000..86bf426d3961 --- /dev/null +++ b/keyboards/planck/keymaps/narze/readme.md @@ -0,0 +1,17 @@ +# narze's layout + +## Key features +- Qwerty + [Colemak](https://colemak.com) layouts, and you can type Qwerty on software-level Colemak as well. Very useful for gaming or when your friend wanna type something but don't use Colemak. +- [(S)uper (D)uper Mode](/users/narze/readme.md) +- Mouse keys with Z + +## Build instructions +- `cd /path/to/qmk_firmware` +- Ensure latest libraries are loaded `make git-submodule` +- Build with docker + - Planck Rev. 4 : `util/docker_build.sh planck/rev4:narze` + - Planck Light : `util/docker_build.sh planck/light:narze` +- Flash hex file + - Using dfu-programmer `dfu-programmer atmega32u4 erase --force && dfu-programmer atmega32u4 flash .build/planck_rev4_narze.hex` + - For Planck Light change the target microcontroller `dfu-programmer at90usb1286 erase --force && dfu-programmer at90usb1286 flash .build/planck_light_narze.hex` + - Use [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) diff --git a/keyboards/planck/keymaps/narze/rules.mk b/keyboards/planck/keymaps/narze/rules.mk new file mode 100644 index 000000000000..e066906f9d7a --- /dev/null +++ b/keyboards/planck/keymaps/narze/rules.mk @@ -0,0 +1,25 @@ + + +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +AUDIO_ENABLE = yes + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +COMBO_ENABLE = yes + +ifeq ($(strip $(KEYBOARD)), planck/rev4) + MOUSEKEY_ENABLE = no # Mouse keys(+4700) + MIDI_ENABLE = no +else + MOUSEKEY_ENABLE = yes + MIDI_ENABLE = yes +endif diff --git a/keyboards/planck/keymaps/navi/config.h b/keyboards/planck/keymaps/navi/config.h new file mode 100644 index 000000000000..df9d67680c88 --- /dev/null +++ b/keyboards/planck/keymaps/navi/config.h @@ -0,0 +1,48 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +#define MOUSEKEY_INTERVAL 16 + +#define MOUSEKEY_DELAY 0 + +#define MOUSEKEY_TIME_TO_MAX 60 + +#define MOUSEKEY_MAX_SPEED 7 + +#define MOUSEKEY_WHEEL_DELAY 0 + +#define TAPPING_TERM 80 +#define TAPPING_TOGGLE 2 diff --git a/keyboards/planck/keymaps/navi/keymap.c b/keyboards/planck/keymaps/navi/keymap.c new file mode 100644 index 000000000000..95f1dea79a21 --- /dev/null +++ b/keyboards/planck/keymaps/navi/keymap.c @@ -0,0 +1,218 @@ +/* Copyright 2015-2017 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. + * cd /c/qmk_firmware-master... make planck/rev6:navi + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _FUNCTION, + _ADJUST + +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + FUNCTION +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | CtlE | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | FN |CtlSE | GUI | Alt | Lower| Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + * CtlSE = Control+shift+esc/ + * CtlE = Control when held, esc when tapped + * FN takes two taps to have it stay as FN + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + LCTL_T(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, + TT(_FUNCTION), LCTL(LALT(KC_DEL)), KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ | ISO | End | Home | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | |Pg DN | Pg UP| | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_END, KC_HOME, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN , KC_PGUP, _______ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |Shift | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | End | Home | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | |Pg DN |Pg UP | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_END, KC_HOME, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN , KC_PGUP, _______ +), + + +/* Function + * ,-----------------------------------------------------------------------------------. + * | Vol- | Mute | Vol+ | | | | | # | 7 | 8 | 9 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Prev | Play | Next | | | | | + | 4 | 5 | 6 | - | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | CALC | MWU | M1 |MouseU| M2 | | | $ | 1 | 2 | 3 | Enter| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | MWD |MouseL|MouseD|MouseR| | * | 0 | . |Numlck| / | + * `-----------------------------------------------------------------------------------' + */ + +[_FUNCTION] = LAYOUT_planck_grid( + KC_VOLD, KC_MUTE, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_HASH, KC_KP_7, KC_KP_8, KC_KP_9, KC_BSPC, + KC_MPRV, KC_MPLY, KC_MNXT, AU_ON, AU_OFF, MU_ON, MU_OFF, KC_PPLS, KC_KP_4, KC_KP_5, KC_KP_6, KC_PMNS, + KC_CALC, KC_WH_U, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, KC_DLR, KC_KP_1, KC_KP_2, KC_KP_3, KC_ENTER, + KC_TRNS, KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, KC_PAST, KC_KP_0, KC_KP_DOT,KC_NUM, KC_PSLS +) + +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case FUNCTION: + if (record->event.pressed) { + layer_on(_FUNCTION); + } else { + layer_off(_FUNCTION); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_DOWN); + unregister_code(KC_MS_WH_DOWN); + #else + register_code(KC_PGDN); + unregister_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_UP); + unregister_code(KC_MS_WH_UP); + #else + register_code(KC_PGUP); + unregister_code(KC_PGUP); + #endif + } + } + return true; +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/navi/readme.md b/keyboards/planck/keymaps/navi/readme.md new file mode 100644 index 000000000000..2103b1ab1df8 --- /dev/null +++ b/keyboards/planck/keymaps/navi/readme.md @@ -0,0 +1,6 @@ +# Navi (Navigatorade)'s personal key layout. +# Primarily focused on qwerty & colemak +# Added a numberpad layer, mainly for accounting + + + diff --git a/keyboards/planck/keymaps/navi/rules.mk b/keyboards/planck/keymaps/navi/rules.mk new file mode 100644 index 000000000000..4852442b36b3 --- /dev/null +++ b/keyboards/planck/keymaps/navi/rules.mk @@ -0,0 +1,4 @@ +AUDIO_ENABLE = yes +MOUSEKEY_ENABLE = yes + +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave \ No newline at end of file diff --git a/keyboards/planck/keymaps/neo2planck/keymap.c b/keyboards/planck/keymaps/neo2planck/keymap.c new file mode 100644 index 000000000000..3650152033c9 --- /dev/null +++ b/keyboards/planck/keymaps/neo2planck/keymap.c @@ -0,0 +1,90 @@ +#include QMK_KEYBOARD_H +#include "keymap_german.h" + +// for intellisense, has to be commented for building +/* +#include "..\..\..\..\quantum\keymap_extras\keymap_german.h" +#include "..\..\..\..\tmk_core\common\keycode.h" +*/ + +/* +This layout tries to emulate Neo2, and is intended to be used with a German QWERTZ softwarelayout. +It has "üäöß" as it is optimized for a mix of German & English. +The special character layer and the navigation & number block layer are designed to keep the fingers near the home row. +*/ +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* +,-----------------------------------------------------------------------------------. +| Esc | X | V | L | C | W | K | H | G | F | Q | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Ent | U | I | A | E | O | S | N | R | T | D | Y | +|------+------+------+------+------+------|------+------+------+------+------+------| +| Shift| Ü | Ö | Ä | P | Z | B | M | , | . | J |Shift | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Ctrl | GUI | Alt | M2 | M1 | Space | M1 | M2 | Alt |MRight| Ctrl | +`-----------------------------------------------------------------------------------' +*/ + +[0] = LAYOUT_planck_grid( + KC_ESC, DE_X, DE_V, DE_L, DE_C, DE_W, DE_K, DE_H, DE_G, DE_F, DE_Q, KC_BSPC , + KC_ENT, DE_U, DE_I, DE_A, DE_E, DE_O, DE_S, DE_N, DE_R, DE_T, DE_D, DE_Y , + KC_LSFT, DE_UDIA, DE_ODIA, DE_ADIA, DE_P, DE_Z, DE_B, DE_M, DE_COMM, DE_DOT, DE_J, KC_LSFT , + KC_LCTL , KC_RGUI, KC_LALT, MO(2), MO(1), KC_SPC, KC_SPC, MO(1), MO(2), KC_RALT, KC_BTN2, KC_RCTL +), + +/* M1 + ,-----------------------------------------------------------------------------------. + | Esc | | _ | [ | ] | ^ | ! | < | > | = | & | ß | + |------+------+------+------+------+-------------+------+------+------+------+------| + | Tab | \ | / | { | } | * | ? | ( | ) | - | : | @ | + |------+------+------+------+------+------|------+------+------+------+------+------| + | Shift| # | $ | | | ~ | ` | + | % | " | ' | ; |Shift | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Ctrl | GUI | Alt | M2 | M1 | Space | M1 | M2 | Alt | Esc | Ctrl | + `-----------------------------------------------------------------------------------' +*/ +[1] = LAYOUT_planck_grid( + _______, _______, DE_UNDS, DE_LBRC, DE_RBRC, DE_CIRC, DE_EXLM, DE_LABK, DE_RABK, DE_EQL, DE_AMPR, DE_SS , + KC_TAB, DE_BSLS, DE_SLSH, DE_LCBR, DE_RCBR, DE_ASTR, DE_QUES, DE_LPRN, DE_RPRN, DE_MINS, DE_COLN, DE_AT , + _______, DE_HASH, DE_DLR, DE_PIPE, DE_TILD, DE_ACUT, DE_PLUS, DE_PERC, DE_DQUO, DE_QUOT, DE_SCLN, _______ , + _______, _______, _______, MO(3), _______, _______, _______, _______, MO(3), _______, _______, _______ +), + +/* M2 Navigation & Number Blocks +* very easy to get used to & intuituve placement +* ,-----------------------------------------------------------------------------------. +* | | PgUp | Bksp | Up | DEL | PgDn | | 7 | 8 | 9 | | Ins | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | Tab | Home | Lft | Down | Right| End | | 4 | 5 | 6 | . | Enter| +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | Shift| | Tab | | Enter| | 0 | 1 | 2 | 3 | , |Shift | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | Ctrl | GUI | Alt | M2 | M1 | Space | M1 | M2 | Alt | Esc | Ctrl | +* `-----------------------------------------------------------------------------------' +*/ +[2] = LAYOUT_planck_grid( + XXXXXXX, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, XXXXXXX, DE_7, DE_8, DE_9, XXXXXXX, KC_INS , + KC_TAB, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, DE_4, DE_5, DE_6, DE_DOT, KC_ENT , + _______, XXXXXXX, KC_TAB, XXXXXXX, KC_ENT, XXXXXXX, DE_0, DE_1, DE_2, DE_3, DE_COMM, _______ , + _______, _______, _______, _______, MO(3), _______, _______, MO(3), _______, _______, _______, _______ +), + +/* M3 Function & Media Keys +* ,-----------------------------------------------------------------------------------. +* | | | Print|Scroll|Pause | | | F7 | F8 | F9 | F12 | | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | Tab | | Mute | Vol- | Vol+ | | ³ | F4 | F5 | F6 | F11 | Enter| +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | Shift| | Prev | Play | Next | | ² | F1 | F2 | F3 | F10 |Shift | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | Ctrl | GUI | Alt | M2 | M1 | Space | M1 | M2 | Alt | Esc | Ctrl | +* `-----------------------------------------------------------------------------------' +*/ +[3] = LAYOUT_planck_grid( + XXXXXXX, XXXXXXX, KC_PSCR, KC_SCRL, KC_PAUS, XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F12, XXXXXXX , + KC_TAB, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, DE_SUP3, KC_F4, KC_F5, KC_F6, KC_F11, KC_ENT , + _______, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, DE_SUP2, KC_F1, KC_F2, KC_F3, KC_F10, _______ , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +}; diff --git a/keyboards/planck/keymaps/neo2planck/readme.md b/keyboards/planck/keymaps/neo2planck/readme.md new file mode 100644 index 000000000000..2f1c3205717c --- /dev/null +++ b/keyboards/planck/keymaps/neo2planck/readme.md @@ -0,0 +1,64 @@ +Neo2Planck +===================================== + +This layout tries to emulate Neo2, and is intended to be used with a German QWERTZ softwarelayout. +It has "üäöß" as it is optimized for a mix of German & English. +The special character layer and the navigation & number block layer are designed to keep the fingers near the home row. + +This layout has some adaptations, due to the limited keys available: +* function-keys moved to the bottom row +* press M1 + M2 to get to layer 3 + +Neo2 wiki page: http://wiki.neo-layout.org/ + +## Neo2 Base Layer +``` + ,-----------------------------------------------------------------------------------. + | Esc | X | V | L | C | W | K | H | G | F | Q | Bksp | + |------+------+------+------+------+-------------+------+------+------+------+------| + | Ent | U | I | A | E | O | S | N | R | T | D | Y | + |------+------+------+------+------+------|------+------+------+------+------+------| + | Shift| Ü | Ö | Ä | P | Z | B | M | , | . | J |Shift | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Ctrl | GUI | Alt | M2 | M1 | Space | M1 | M2 | Alt |MRight| Ctrl | + `-----------------------------------------------------------------------------------' +``` + +# M1 Special Characters +``` + ,-----------------------------------------------------------------------------------. + | Esc | | _ | [ | ] | ^ | ! | < | > | = | & | ß | + |------+------+------+------+------+-------------+------+------+------+------+------| + | Tab | \ | / | { | } | * | ? | ( | ) | - | : | @ | + |------+------+------+------+------+------|------+------+------+------+------+------| + | Shift| # | $ | | | ~ | ` | + | % | " | ' | ; |Shift | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Ctrl | GUI | Alt | M2 | M1 | Space | M1 | M2 | Alt | Esc | Ctrl | + `-----------------------------------------------------------------------------------' +``` + +## M2 Navigation & Number Blocks +``` + ,-----------------------------------------------------------------------------------. + | | PgUp | Bksp | Up | DEL | PgDn | | 7 | 8 | 9 | | Ins | + |------+------+------+------+------+-------------+------+------+------+------+------| + | Tab | Home | Lft | Down | Right| End | | 4 | 5 | 6 | . | Enter| + |------+------+------+------+------+------|------+------+------+------+------+------| + | Shift| | Tab | | Enter| | 0 | 1 | 2 | 3 | , |Shift | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Ctrl | GUI | Alt | M2 | M1 | Space | M1 | M2 | Alt | Esc | Ctrl | + `-----------------------------------------------------------------------------------' +``` + +## M3 F-Keys and Media-Keys +``` + ,-----------------------------------------------------------------------------------. + | | | Print|Scroll|Pause | | | F7 | F8 | F9 | F12 | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | Tab | | Mute | Vol- | Vol+ | | ³ | F4 | F5 | F6 | F11 | Enter| + |------+------+------+------+------+------|------+------+------+------+------+------| + | Shift| | Prev | Play | Next | | ² | F1 | F2 | F3 | F10 |Shift | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Ctrl | GUI | Alt | M2 | M1 | Space | M1 | M2 | Alt | Esc | Ctrl | + `-----------------------------------------------------------------------------------' +``` diff --git a/keyboards/planck/keymaps/neo2planck/rules.mk b/keyboards/planck/keymaps/neo2planck/rules.mk new file mode 100644 index 000000000000..bf83171565a3 --- /dev/null +++ b/keyboards/planck/keymaps/neo2planck/rules.mk @@ -0,0 +1,20 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/nick/config.h b/keyboards/planck/keymaps/nick/config.h new file mode 100644 index 000000000000..3b8eff7513b5 --- /dev/null +++ b/keyboards/planck/keymaps/nick/config.h @@ -0,0 +1,4 @@ +#pragma once + +#define TAP_CODE_DELAY 10 +#define ENCODER_RESOLUTION 2 diff --git a/keyboards/planck/keymaps/nick/keymap.c b/keyboards/planck/keymaps/nick/keymap.c new file mode 100644 index 000000000000..219665c201e8 --- /dev/null +++ b/keyboards/planck/keymaps/nick/keymap.c @@ -0,0 +1,123 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define ADJUST MO(_ADJUST) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl |Adjust| Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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_LCTL, ADJUST, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_MPLY, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (clockwise && !IS_LAYER_ON(_RAISE)) { + tap_code(KC_MS_WH_DOWN); + } else if (!clockwise && !IS_LAYER_ON(_RAISE)) { + tap_code(KC_MS_WH_UP); + } else if (clockwise && IS_LAYER_ON(_RAISE)) { + tap_code(KC_VOLU); + } else if (!clockwise && IS_LAYER_ON(_RAISE)) { + tap_code(KC_VOLD); + } + return true; +} diff --git a/keyboards/planck/keymaps/nick/readme.md b/keyboards/planck/keymaps/nick/readme.md new file mode 100644 index 000000000000..da7d3861ac61 --- /dev/null +++ b/keyboards/planck/keymaps/nick/readme.md @@ -0,0 +1,6 @@ +# Nick's Planck Layout + +Similar to default layout with some minor changes: +- scroll and volume control knob +- added rule to remove audio +- encoder resolution altered to suit [this model](https://au.element14.com/alps/ec11e15244g1/encoder-vertical-11mm-30det-15ppr/dp/2064986?ost=EC11E15244G1&ddkey=https%3Aen-AU%2FElement14_Australia%2Fsearch) diff --git a/keyboards/planck/keymaps/nick/rules.mk b/keyboards/planck/keymaps/nick/rules.mk new file mode 100644 index 000000000000..3bf3f2731452 --- /dev/null +++ b/keyboards/planck/keymaps/nick/rules.mk @@ -0,0 +1 @@ +AUDIO_ENABLE = no diff --git a/keyboards/planck/keymaps/not-quite-neo/config.h b/keyboards/planck/keymaps/not-quite-neo/config.h new file mode 100644 index 000000000000..7fa3bf328ec9 --- /dev/null +++ b/keyboards/planck/keymaps/not-quite-neo/config.h @@ -0,0 +1,6 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#endif diff --git a/keyboards/planck/keymaps/not-quite-neo/keymap.c b/keyboards/planck/keymaps/not-quite-neo/keymap.c new file mode 100644 index 000000000000..2248c7a2b958 --- /dev/null +++ b/keyboards/planck/keymaps/not-quite-neo/keymap.c @@ -0,0 +1,129 @@ +/* +NQN is not-quite-neo +A layout based on the +*/ + + +#include QMK_KEYBOARD_H +#include "nqn-keys-on-quertz-de-latin1.h" +#include "nqn-basic-layout.h" + + +// Automatic number generation of important keywords +enum my_keycodes{ + // Layer numbers follow the neo2 terminology, i.e. base layer = layer 1 + L01 = 0, + /* L02, SHIFT is not (yet) implemented as a fully customizable layer */ + L03, + L04, + L05, + /* L06, UNSPECIFIED not (yet) needed */ + LFN +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* L01 -> default: BASE LAYER + * ,-----------------------------------------------------------------------------------. + * | ESC | | | ENTER| + * |------+ | +------| + * | L03 | L01_LEFT | L01_RIGHT | L03 | + * |------+ | +------| + * | SHIFT| | | SHIFT| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | CTLR | GUI | ALT | L05 | L04 | SPACE| SPACE| L04 | L05 | ALTGR| LFN | CTLR | + * `-----------------------------------------------------------------------------------' + */ +[L01] = LAYOUT_planck_grid( + KC_ESC, L01_LEFT_01, L01_RIGHT_01, KC_ENTER, + MO(L03), L01_LEFT_02, L01_RIGHT_02, MO(L03), + KC_LSFT, L01_LEFT_03, L01_RIGHT_03, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, MO(L05), MO(L04), KC_SPC, KC_SPC, MO(L04), MO(L05), KC_RALT, MO(LFN), KC_RCTL +), + + +/* +L02 -> MO(L02): SHIFT (as a layer not used, not defined, not reachable) + */ + + +/* L03 -> MO(L03): PROGRAMMING + * ,-----------------------------------------------------------------------------------. + * | | | | | + * |------+ | +------| + * | | L03_LEFT | L03_RIGHT | | + * |------+ | +------| + * | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[L03] = LAYOUT_planck_grid( + _______, L03_LEFT_01, L03_RIGHT_01, _______, + _______, L03_LEFT_02, L03_RIGHT_02, _______, + _______, L03_LEFT_03, L03_RIGHT_03, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + + +/* L04 -> MO(L04): NAVIGATION AND NUMBERS + * ,-----------------------------------------------------------------------------------. + * | | | | | + * |------+ | +------| + * | | L04_LEFT | L04_RIGHT | | + * |------+ | +------| + * | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | 0 | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[L04] = LAYOUT_planck_grid( + _______, L04_LEFT_01, L04_RIGHT_01, _______, + _______, L04_LEFT_02, L04_RIGHT_02, _______, + _______, L04_LEFT_03, L04_RIGHT_03, _______, + _______, _______, _______, _______, _______, _______, KC_0, _______, _______, _______, _______, _______ +), + + +/* L05 -> MO(L05): ALTERNATE + * ,-----------------------------------------------------------------------------------. + * | | | | | + * |------+ | +------| + * | | L05_LEFT | L05_RIGHT | | + * |------+ | +------| + * | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[L05] = LAYOUT_planck_grid( + _______, L05_LEFT_01, L05_RIGHT_01, _______, + _______, L05_LEFT_02, L05_RIGHT_02, _______, + _______, L05_LEFT_03, L05_RIGHT_03, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + + +/* +L06 -> : UNSPECIFIED +*/ + + +/* LFN -> MO(FN): FUNCTION + * ,-----------------------------------------------------------------------------------. + * | QK_BOOT| | | BACKS| + * |------+ | +------| + * | | L06_LEFT | L06_RIGHT |INSERT| + * |------+ | +------| + * | | | |DELETE| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |VOICE-|VOICE+|MUS ON|MUS OF| LIGHT| | | VOL+ | VOL- | MUTE | | | + * `-----------------------------------------------------------------------------------' + */ +[LFN] = LAYOUT_planck_grid( + QK_BOOT, L06_LEFT_01, L06_RIGHT_01, KC_BSPC, + _______, L06_LEFT_02, L06_RIGHT_02, KC_INS, + _______, L06_LEFT_03, L06_RIGHT_03, KC_DEL, + AU_PREV, AU_NEXT, MU_ON, MU_OFF, _______, _______, _______, KC_VOLU, KC_VOLD, KC_MUTE, _______, _______ +) +}; diff --git a/keyboards/planck/keymaps/not-quite-neo/readme.md b/keyboards/planck/keymaps/not-quite-neo/readme.md new file mode 100644 index 000000000000..3fcb4edf0d99 --- /dev/null +++ b/keyboards/planck/keymaps/not-quite-neo/readme.md @@ -0,0 +1,5 @@ +# not-quite-neo + +This is my personal take on porting the [neo2 layout](https://www.neo-layout.org/) to support multiple keyboards. + +Refer to the [readme.md](../../../../users/not-quite-neo/readme.md) of the generic parts of the implementation. \ No newline at end of file diff --git a/keyboards/planck/keymaps/not-quite-neo/rules.mk b/keyboards/planck/keymaps/not-quite-neo/rules.mk new file mode 100644 index 000000000000..b4e2e5c8156d --- /dev/null +++ b/keyboards/planck/keymaps/not-quite-neo/rules.mk @@ -0,0 +1,24 @@ +# Based on Zach's Planck Makefile +# Max .hex size is about 28636 bytes + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +TAP_DANCE_ENABLE = no # Enable TapDance functionality +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +#VARIABLE_TRACE = no # Debug changes to variable values +UNICODE_ENABLE = no # Unicode (can't be used with unicodemap) +UNICODEMAP_ENABLE = no # Enable extended unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/originerd/keymap.c b/keyboards/planck/keymaps/originerd/keymap.c new file mode 100644 index 000000000000..85e5cd3b1642 --- /dev/null +++ b/keyboards/planck/keymaps/originerd/keymap.c @@ -0,0 +1,184 @@ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +enum planck_layers { + _NERD, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + NERD = SAFE_RANGE, + LOWER, + RAISE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* NERD + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | DEL | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_NERD] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT , + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_DEL, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap| NERD | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, NERD, _______, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_nerd[][2] = SONG(QWERTY_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case NERD: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_nerd); + #endif + persistent_default_layer_set(1UL<<_NERD); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user(void) +{ + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user(void) +{ + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif diff --git a/keyboards/planck/keymaps/originerd/readme.md b/keyboards/planck/keymaps/originerd/readme.md new file mode 100644 index 000000000000..6b627006e806 --- /dev/null +++ b/keyboards/planck/keymaps/originerd/readme.md @@ -0,0 +1,58 @@ +# The Originerd Planck Layout +- MIT Layout + +## Nerd - Qwerty + +``` +,-----------------------------------------------------------------------------------. +| Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Tab | A | S | D | F | G | H | J | K | L | ; |Enter | +|------+------+------+------+------+------|------+------+------+------+------+------| +| Shift| Z | X | C | V | B | N | M | , | . | / |Shift | +|------+------+------+------+------+------+------+------+------+------+------+------| +| DEL | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | +`-----------------------------------------------------------------------------------' +``` + +## Lower + +``` +,-----------------------------------------------------------------------------------. +| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | \ | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | Next | Vol- | Vol+ | Play | +`-----------------------------------------------------------------------------------' +``` + +## Upper Layer + +``` +,-----------------------------------------------------------------------------------. +| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | ' | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | Next | Vol- | Vol+ | Play | +`-----------------------------------------------------------------------------------' +``` + +## Adjust + +``` +,-----------------------------------------------------------------------------------. +| | Reset| | | | | | | | | | Del | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | | |Aud on|Audoff|AGnorm|AGswap| NERD | | | | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | +`-----------------------------------------------------------------------------------' +``` diff --git a/keyboards/planck/keymaps/orthodeluxe/config.h b/keyboards/planck/keymaps/orthodeluxe/config.h new file mode 100644 index 000000000000..05b5e8debbf1 --- /dev/null +++ b/keyboards/planck/keymaps/orthodeluxe/config.h @@ -0,0 +1,27 @@ +/* Copyright 2020 Erik Bakker + * + * 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 . + */ + +#pragma once + +#define ENCODER_RESOLUTION 4 +#define TAPPING_TERM 175 +#define TAPPING_TOGGLE 3 +#define BOOTMAGIC_LITE_ROW 0 +#define BOOTMAGIC_LITE_COLUMN 0 +#define BOOTMAGIC_LITE_MACOS_ROW 2 +#define BOOTMAGIC_LITE_MACOS_COLUMN 7 +#define BOOTMAGIC_LITE_WIN_ROW 0 +#define BOOTMAGIC_LITE_WIN_COLUMN 2 diff --git a/keyboards/planck/keymaps/orthodeluxe/keymap.c b/keyboards/planck/keymaps/orthodeluxe/keymap.c new file mode 100644 index 000000000000..7e5ee3139b6f --- /dev/null +++ b/keyboards/planck/keymaps/orthodeluxe/keymap.c @@ -0,0 +1,533 @@ +/* Copyright 2020 Erik Bakker + * + * 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 QMK_KEYBOARD_H +#include "muse.h" + +enum planck_layers { + _BASELAYER_MACOS, + _BASELAYER_WINDOWS, + _LEFTYLAYER, + _NUMLAYER_MACOS, + _NUMLAYER_WINDOWS, + _NAVLAYER_MACOS, + _NAVLAYER_WINDOWS, + _SYMLAYER_MACOS, + _SYMLAYER_WINDOWS, + _UTILSLAYER +}; + +enum planck_keycodes { + MACOS = SAFE_RANGE, + WINDOWS, + RCMDCTRL, + LEFTYCUT, LEFTYCOPY, LEFTYPASTE, + PLUSCOLON, + APPSWITCH, TASKVIEW, PREVDESK, NEXTDESK, + QUOTES, DQUOTES, + POINTYBR, SQUAREBR, CURLYBR, ROUNDBR +}; + +enum appswitch_mode { + APPSWITCH_OFF, + APPSWITCH_FIRST_TIME, + APPSWITCH_ON, + APPSWITCH_TASK_VIEW +}; + +enum quote_shapes { + SINGLE_QUOTE, DOUBLE_QUOTE +}; + +enum bracket_shapes { + POINTY, SQUARE, CURLY, ROUND +}; + +uint8_t windowsmode = 0; + +#define L_NUM_M MO(_NUMLAYER_MACOS) +#define L_NUM_W MO(_NUMLAYER_WINDOWS) +#define L_NAV_M MO(_NAVLAYER_MACOS) +#define L_NAV_W MO(_NAVLAYER_WINDOWS) +#define L_SYM_M MO(_SYMLAYER_MACOS) +#define L_SYM_W MO(_SYMLAYER_WINDOWS) +#define UTILSLAYER MO(_UTILSLAYER) + +static void set_keycodes_for_os(int os); +static bool handle_app_switch(bool pressed); +static bool app_switch_valid_keycode(uint16_t keycode); +static bool handle_right_command_or_control(bool pressed); +static bool handle_pluscolon(bool pressed); +static bool type_quotes(uint8_t quote_shape, bool pressed); +static bool type_brackets(uint8_t bracket_shape, bool pressed); + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Base layer: + * ,-----------------------------------------------------------------------------------. + * |BckSpc| Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; : | Enter| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab- | Z | X | C | V | B | N | M | , < | . > | / ? | Tab | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Shift| | | |NumLyr| Space |NavLyr| | | | Shift| + * `-----------------------------------------------------------------------------------' + * + * Bottom row for MacOS: + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Shift| Ctrl |Option| Cmd |NumLyr| Space |NavLyr| Cmd |Option| Ctrl | Shift| + * `-----------------------------------------------------------------------------------' + * + * Bottom row for Windows: + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Shift| Win | Alt | Ctrl |NumLyr| Space |NavLyr| Ctrl | Alt | Menu | Shift| + * `-----------------------------------------------------------------------------------' + */ +[_BASELAYER_MACOS] = LAYOUT_planck_grid( + KC_BSPC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_TAB, + KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, L_NUM_M, KC_SPC, KC_SPC, L_NAV_M, RCMDCTRL, KC_RALT, KC_RCTL, KC_RSFT +), +[_BASELAYER_WINDOWS] = LAYOUT_planck_grid( + KC_BSPC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_TAB, + KC_LSFT, KC_LGUI, KC_LALT, KC_LCTL, L_NUM_W, KC_SPC, KC_SPC, L_NAV_W, RCMDCTRL, KC_RALT, KC_APP, KC_RSFT +), + +/* Lefty layer: + * This layer enables lefties (who mouse with their left hand) to easily cut, copy and paste using their right hand. + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Cut | Copy | Paste| | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | |(hold)| | | | + * '-----------------------------------------------------------------------------------' + */ + + [_LEFTYLAYER] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_X, KC_C, KC_V, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Numpad layer: + * ,-----------------------------------------------------------------------------------. + * | | & | | | ! | + | = | % | 7 | 8 | 9 | * | = | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | @ | ' ' | " " | - | _ | € | 4 | 5 | 6 | + : | Enter| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | < > | [ ] | { } | ( ) | \ | $ | 1 | 2 | 3 | / | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | |(hold)| |SymLyr| 0 | . | - | | + * `-----------------------------------------------------------------------------------' + */ +[_NUMLAYER_MACOS] = LAYOUT_planck_grid( + _______, KC_AMPR, KC_PIPE, KC_EXLM, KC_PPLS, KC_EQL, KC_PERC, KC_7, KC_8, KC_9, KC_PAST, KC_EQL, + _______, KC_AT, QUOTES, DQUOTES, KC_MINS, KC_UNDS, RALT(KC_2), KC_4, KC_5, KC_6, PLUSCOLON, KC_PENT, + _______, POINTYBR, SQUAREBR, CURLYBR, ROUNDBR, KC_BSLS, KC_DLR, KC_1, KC_2, KC_3, KC_PSLS, _______, + _______, _______, _______, _______, _______, _______, _______, L_SYM_M, KC_0, KC_PDOT, KC_PMNS, _______ +), +[_NUMLAYER_WINDOWS] = LAYOUT_planck_grid( + _______, KC_AMPR, KC_PIPE, KC_EXLM, KC_PPLS, KC_EQL, KC_PERC, KC_7, KC_8, KC_9, KC_PAST, KC_EQL, + _______, KC_AT, QUOTES, DQUOTES, KC_MINS, KC_UNDS, RALT(KC_5), KC_4, KC_5, KC_6, PLUSCOLON, KC_PENT, + _______, POINTYBR, SQUAREBR, CURLYBR, ROUNDBR, KC_BSLS, KC_DLR, KC_1, KC_2, KC_3, KC_PSLS, _______, + _______, _______, _______, _______, _______, _______, _______, L_SYM_W, KC_0, KC_PDOT, KC_PMNS, _______ +), + +/* Symbol layer: + * ,-----------------------------------------------------------------------------------. + * | | | | € | | ~ | | _ | ^ | | % | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | @ | $ | $ | | ` | # | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | ! | | | \ | ~ | & | | | ! | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | |(hold)| UtilsLayer |(hold)| | | | | + * `-----------------------------------------------------------------------------------' + */ +[_SYMLAYER_MACOS] = LAYOUT_planck_grid( + _______, XXXXXXX, XXXXXXX, RALT(KC_2), XXXXXXX, KC_TILD, XXXXXXX, KC_UNDS, KC_CIRC, XXXXXXX, KC_PERC, _______, + _______, KC_AT, KC_DLR, KC_DLR, XXXXXXX, KC_GRV, KC_HASH, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, XXXXXXX, KC_EXLM, XXXXXXX, XXXXXXX, KC_BSLS, KC_TILD, KC_AMPR, XXXXXXX, XXXXXXX, KC_EXLM, _______, + _______, _______, _______, _______, _______, UTILSLAYER, UTILSLAYER, _______, _______, _______, _______, _______ +), +[_SYMLAYER_WINDOWS] = LAYOUT_planck_grid( + _______, XXXXXXX, XXXXXXX, RALT(KC_5), XXXXXXX, KC_TILD, XXXXXXX, KC_UNDS, KC_CIRC, XXXXXXX, KC_PERC, _______, + _______, KC_AT, KC_DLR, KC_DLR, XXXXXXX, KC_GRV, KC_HASH, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, XXXXXXX, KC_EXLM, XXXXXXX, XXXXXXX, KC_BSLS, KC_TILD, KC_AMPR, XXXXXXX, XXXXXXX, KC_EXLM, _______, + _______, _______, _______, _______, _______, UTILSLAYER, UTILSLAYER, _______, _______, _______, _______, _______ +), + +/* Navigation layer: + * ,-----------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | | PgUp | Home | Up | End |PrtScr| Lock | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F5 | F6 | F7 | F8 | | PgDn | Left | Down | Right| AppSw| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F9 | F10 | F11 | F12 | | |PrDesk| Down |NxDesk|TaskVw| | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | |SymLyr| |(hold)| | | | | + * `-----------------------------------------------------------------------------------' + */ +[_NAVLAYER_MACOS] = LAYOUT_planck_grid( + _______, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, KC_PGUP, G(KC_LEFT), KC_UP, G(KC_RGHT), SGUI(KC_4), C(G(KC_Q)), + _______, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, APPSWITCH, _______, + _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, C(KC_LEFT), KC_DOWN, C(KC_RGHT), C(KC_UP), _______, + _______, _______, _______, _______, L_SYM_M, _______, _______, _______, _______, _______, _______, _______ +), +[_NAVLAYER_WINDOWS] = LAYOUT_planck_grid( + _______, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_PSCR, G(KC_L), + _______, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, APPSWITCH, _______, + _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, C(G(KC_LEFT)), KC_DOWN, C(G(KC_RGHT)), G(KC_TAB), _______, + _______, _______, _______, _______, L_SYM_W, _______, _______, _______, _______, _______, _______, _______ +), + +/* Utilities layer: + * ,-----------------------------------------------------------------------------------. + * | | | Win | | Reset| | | | Ins | | Pause| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | |ScrlLk| Debug| | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |CapsLk| | | NumLk| Mac | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | |(hold)| (hold) |(hold)| | | | | + * `-----------------------------------------------------------------------------------' + */ +[_UTILSLAYER] = LAYOUT_planck_grid( + _______, XXXXXXX, WINDOWS, XXXXXXX, QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, XXXXXXX, KC_PAUS, _______, + _______, XXXXXXX, KC_SCRL, DB_TOGG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, XXXXXXX, XXXXXXX, KC_CAPS, XXXXXXX, XXXXXXX, KC_NUM, MACOS, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) +}; + +/* Bootmagic keys (hold when plugging in the USB cable): + * ,-----------------------------------------------------------------------------------. + * |BootLd| | Win | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Mac | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool app_switch_active = false; +static uint16_t timer; +static uint16_t duration = 0; +static bool double_tap = false; +uint8_t active_modifiers = 0; +bool shift_modifier_active = false; +uint8_t keycode_rightcommand; +uint8_t keycode_appswitch; + +/* main loop */ +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + /* Store modifiers in booleans for easy access in underlying methods. */ + active_modifiers = get_mods(); + shift_modifier_active = active_modifiers & ((1<<((KC_LSFT) & 0x07)) | (1<<((KC_RSFT) & 0x07))); + + /* Switch off timer when double click time is exceeded. */ + if (timer > 0) { + duration = timer_elapsed(timer); + if (duration > TAPPING_TERM) { timer = 0; } + } + + /* Keep app_switch_active true, while a valid key is pressed. */ + if (app_switch_active) { + if ((keycode == L_NAV_M || keycode == L_NAV_W) && record->event.pressed == false) { + unregister_code(keycode_appswitch); + app_switch_active = false; + } + if (app_switch_valid_keycode(keycode) == false) { + unregister_code(keycode_appswitch); + app_switch_active = false; + } + } + + switch (keycode) { + case MACOS: + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + set_keycodes_for_os(MACOS); + default_layer_set(_BASELAYER_MACOS); + layer_on(_BASELAYER_MACOS); + layer_off(_BASELAYER_WINDOWS); + return false; + break; + case WINDOWS: + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_gb_song); + #endif + set_keycodes_for_os(WINDOWS); + default_layer_set(_BASELAYER_WINDOWS); + layer_on(_BASELAYER_WINDOWS); + layer_off(_BASELAYER_MACOS); + return false; + break; + case RCMDCTRL: + return handle_right_command_or_control(record->event.pressed); + break; + case APPSWITCH: + return handle_app_switch(record->event.pressed); + break; + case QUOTES: + return type_quotes(SINGLE_QUOTE, record->event.pressed); + break; + case DQUOTES: + return type_quotes(DOUBLE_QUOTE, record->event.pressed); + break; + case POINTYBR: + return type_brackets(POINTY, record->event.pressed); + break; + case SQUAREBR: + return type_brackets(SQUARE, record->event.pressed); + break; + case CURLYBR: + return type_brackets(CURLY, record->event.pressed); + break; + case ROUNDBR: + return type_brackets(ROUND, record->event.pressed); + break; + case PLUSCOLON: + return handle_pluscolon(record->event.pressed); + break; + } + return true; +} + +void set_keycodes_for_os(int os) { + if (os == MACOS) { + keycode_rightcommand = KC_RGUI; + keycode_appswitch = KC_LGUI; + } else { + keycode_rightcommand = KC_RCTL; + keycode_appswitch = KC_LALT; + } +} + +/* While lefties use their mouse with their left hand, it is handy to use their right hand for Cut, Copy and Paste. */ +bool handle_right_command_or_control(bool pressed) { + if (pressed) { + register_code(keycode_rightcommand); + layer_on(_LEFTYLAYER); + } else { + layer_off(_LEFTYLAYER); + unregister_code(keycode_rightcommand); + } + return false; +} + +/* Key combo to easily switch applications. Press and hold Command or Alt, press and release Tab. Command or Alt is released when an invalid key is pressed in main loop. */ +bool handle_app_switch(bool pressed) { + if (pressed) { + if (app_switch_active == false) { + app_switch_active = true; + register_code(keycode_appswitch); + } + register_code(KC_TAB); + } else { + unregister_code(KC_TAB); + } + return false; +} + +/* Defines valid keys for app_switch function. */ +bool app_switch_valid_keycode(uint16_t keycode) { + if (keycode == APPSWITCH || KC_UP || KC_LEFT || KC_DOWN || KC_RIGHT) { + return true; + } + return false; +} + +/* Type 1 or 2 quotation marks, either single or double quotation marks. + * - Press once: type 1 quote and start timer. + * - Quickly press twice: type pair of quotes and put cursor in between. + */ +bool type_quotes(uint8_t quote_shape, bool pressed) { + clear_mods(); + bool use_shift = quote_shape == DOUBLE_QUOTE ? true : false; + + duration = timer_elapsed(timer); + + if (pressed) { + if ((timer == 0) || (duration == 0) || (duration > TAPPING_TERM)) { + if (use_shift) { register_code(KC_LSFT); } + register_code(KC_QUOT); + double_tap = false; + } else { + if (duration < TAPPING_TERM) { + if (use_shift) { + tap_code16(S(KC_QUOT)); + } else { + tap_code(KC_QUOT); + } + double_tap = true; + } + } + } else { + if (double_tap) { + tap_code(KC_LEFT); + timer = 0; + double_tap = false; + } else { + unregister_code(KC_QUOT); + if (use_shift) { unregister_code(KC_LSFT); } + timer = timer_read(); + double_tap = false; + } + } + + set_mods(active_modifiers); + return false; +} + +/* Type a bracket or a pair of brackets + * - Press once: type opening bracket. + * - Press while holding shift: type closing bracket. + * - Quickly press twice: type pair of brackets and put cursor in between. + */ +bool type_brackets(uint8_t bracket_shape, bool pressed) { + clear_mods(); + + uint8_t opening_bracket; + uint8_t closing_bracket; + bool use_shift; + switch (bracket_shape) { + case POINTY: + opening_bracket = KC_COMM; + closing_bracket = KC_DOT; + use_shift = true; + break; + case SQUARE: + opening_bracket = KC_LBRC; + closing_bracket = KC_RBRC; + use_shift = false; + break; + case CURLY: + opening_bracket = KC_LBRC; + closing_bracket = KC_RBRC; + use_shift = true; + break; + case ROUND: + opening_bracket = KC_9; + closing_bracket = KC_0; + use_shift = true; + break; + } + duration = timer_elapsed(timer); + + if (pressed) { + if ((timer == 0) || (duration == 0) || (duration > TAPPING_TERM) || (shift_modifier_active)) { + if (use_shift) { register_code(KC_LSFT); } + register_code(shift_modifier_active ? closing_bracket : opening_bracket); + double_tap = false; + } else { + if (duration < TAPPING_TERM) { + if (use_shift) { + tap_code16(S(closing_bracket)); + } else { + tap_code(closing_bracket); + } + double_tap = true; + } + } + } else { + if (double_tap) { + tap_code(KC_LEFT); + timer = 0; + double_tap = false; + } else { + unregister_code(shift_modifier_active ? closing_bracket : opening_bracket); + if (use_shift) { unregister_code(KC_LSFT); } + timer = timer_read(); + double_tap = false; + } + } + + set_mods(active_modifiers); + return false; +} + +/* On the Numpad-layer, the semicolon key produces a Plus ('+'). But to help entering time values, we like to have a colon (':') when shift is held. */ +bool handle_pluscolon(bool pressed) { + if (pressed) { + register_code(shift_modifier_active ? KC_SCLN : KC_PPLS); + } else { + unregister_code(shift_modifier_active ? KC_SCLN : KC_PPLS); + } + return false; +} + +// Bootmagic configures the keyboard when initializing (starting up after connecting the USB cable) +void bootmagic_lite(void) { + matrix_scan(); + wait_ms(DEBOUNCE * 2); + matrix_scan(); + int os; + + // hold key in upper left corner while plugging in the USB cable to enter the Bootloader for flashing. + if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { + bootloader_jump(); + } + + // hold M key while plugging in the USB cable to use the keyboard in MacOs mode. + if (matrix_get_row(BOOTMAGIC_LITE_MACOS_ROW) & (1 << BOOTMAGIC_LITE_MACOS_COLUMN)) { + os = MACOS; + } + + // hold W key while plugging in the USB cable to use the keyboard in Windows mode. + if (matrix_get_row(BOOTMAGIC_LITE_WIN_ROW) & (1 << BOOTMAGIC_LITE_WIN_COLUMN)) { + os = WINDOWS; + } + + switch (os){ + case MACOS: + default_layer_set(_BASELAYER_MACOS); + layer_on(_BASELAYER_MACOS); + layer_off(_BASELAYER_WINDOWS); + break; + case WINDOWS: + default_layer_set(_BASELAYER_WINDOWS); + layer_on(_BASELAYER_WINDOWS); + layer_off(_BASELAYER_MACOS); + break; + default: + os = MACOS; + default_layer_set(_BASELAYER_MACOS); + layer_on(_BASELAYER_MACOS); + layer_off(_BASELAYER_WINDOWS); + break; + } + set_keycodes_for_os(os); +} diff --git a/keyboards/planck/keymaps/orthodeluxe/readme.md b/keyboards/planck/keymaps/orthodeluxe/readme.md new file mode 100644 index 000000000000..51ad27e95c2d --- /dev/null +++ b/keyboards/planck/keymaps/orthodeluxe/readme.md @@ -0,0 +1,64 @@ +![Orthodeluxe Layout Image](https://i.imgur.com/xnq1gNj.png) + +# Orthodeluxe layout for Planck keyboards + +By Erik Bakker + +## Main idea + +I use a Planck keyboard as a daily driver since 2018. Over time, I improved the layout and added functionality to the firmware. The main idea was to easily access all keys and functions without moving my hands from the home position (when your fingers rest on ASDF and JKL;). I'd like to share this keyboard layout with you. + +## Notes about left handedness + +This keyboard layout is perfect for people that use the mouse with their left hand. I am right handed myself. But since a couple of years, I learned to use the mouse with my left hand. I started doing that to relieve strain in my right arm. But now, I really like a setup with the keyboard in the middle, a mouse on the left, and pen and paper on the right. For those that insist on using the mouse with their right hand, I plan to create an alternative layout called 'orthodeluxe-R'. + +## Base layer + +Apart from the basic QWERTY layout, the base layer features: + +- A 2U space bar and 2 keys to switch layers. Rotate you keycaps 180 degrees for comfortable access. +- Shift keys in the lower left and lower right corners. You hit them with the sides of your hands. +- 2 sets of modifiers, symmetrically layed out in the bottom row. You can switch between MacOs and Windows layouts. +- In Windows layout, the Ctrl keys are located where you can easily reach it with your thumbs. Just like the command key on Apple keyboards. +- Symmetrical layout of the left and right sides of the keyboard. Row 1: Backspace and Delete, row 2: Escape and Enter, row 3: Left and right Tab. + +## Numpad layer + +The numpad layer contains a numpad and non-alphanumeric characters, like math operators, brackets and quotes. + +- Numpad, math operators and currency symbols are all operated by the right hand. +- All symbols that programmers need are operated by the left hand. +- Clicking a bracket key produces an opening bracket. +- Holding shift while clicking a bracket key produces a closing bracket. +- Double clicking a bracket key produces an opening and closing bracket with the cursor positioned in between. +- Double clicking the quote keys produces 2 quotes with the cursor positioned in between. +- The quote/apostrope is conveniently located at the S key, to easily type "It's everyone's favorite keyboard layout". + +## Navigation layer + +The navigation layer contains the cursor movement keys, keys F1-F12, and more: + +- The cursor keys are in an 'inverted T' configuration at the most comfortable position for the right hand (IJKL). +- An 'App Switch' key to switch appslications, but smarter than just mapping Alt-Tab to that key. +- A Key to easily access Task View in Windows (or Mission Control in MacOs). +- Keys to switch virtual desktops in Windows (or spaces in MacOs). + +## Additional layers + +There are some additional layers for: + +- accessing lesser used symbols and functions; +- switching between MacOs and Windows modes; +- access Cut, Copy and Paste shortcuts wirth the right hand, for people that use the mouse with their left hand. + +## Bootmagic + +This keymap supports Bootmagic Lite. Bootmagic configures the keyboard when initializing (starting up after connecting the USB cable). +- hold key in upper left corner while plugging in the USB cable to enter the Bootloader for flashing. +- hold M key while plugging in the USB cable to use the keyboard in MacOs mode. +- hold W key while plugging in the USB cable to use the keyboard in Windows mode. + + +## Build + +Owners of an older Planck (rev5 or older, those without a USB-C connector) need to disable audio in file 'rules .mk' before building. Otherwise the firmware size will be too large. diff --git a/keyboards/planck/keymaps/orthodeluxe/rules.mk b/keyboards/planck/keymaps/orthodeluxe/rules.mk new file mode 100644 index 000000000000..bf68f645ae06 --- /dev/null +++ b/keyboards/planck/keymaps/orthodeluxe/rules.mk @@ -0,0 +1,5 @@ +AUDIO_ENABLE = yes +BACKLIGHT_ENABLE = no +KEY_LOCK_ENABLE = yes +MOUSEKEY_ENABLE = no +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite diff --git a/keyboards/planck/keymaps/oryx/config.h b/keyboards/planck/keymaps/oryx/config.h new file mode 100644 index 000000000000..d00398621d00 --- /dev/null +++ b/keyboards/planck/keymaps/oryx/config.h @@ -0,0 +1,39 @@ +/* Copyright 2020 ZSA Technology Inc + * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE +# define STARTUP_SONG SONG(PLANCK_SOUND) +#endif + +#define MIDI_BASIC + +#define ENCODER_RESOLUTION 4 + +/* + Set any config.h overrides for your specific keymap here. + See config.h options at https://docs.qmk.fm/#/config_options?id=the-configh-file +*/ +#define ORYX_CONFIGURATOR +#define USB_SUSPEND_WAKEUP_DELAY 0 +#define FIRMWARE_VERSION u8"vAxxa/ZlQEV" +#define RGB_MATRIX_DEFAULT_SPD 60 + +#define PLANCK_EZ_LED_LOWER 1 +#define PLANCK_EZ_LED_RAISE 2 +#define PLANCK_EZ_LED_ADJUST 3 diff --git a/keyboards/planck/keymaps/oryx/keymap.c b/keyboards/planck/keymaps/oryx/keymap.c new file mode 100644 index 000000000000..7996222beffb --- /dev/null +++ b/keyboards/planck/keymaps/oryx/keymap.c @@ -0,0 +1,152 @@ +/* Copyright 2020 ZSA Technology Inc + * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * 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 QMK_KEYBOARD_H + +enum planck_keycodes { + RGB_SLD = SAFE_RANGE, +}; + +enum planck_layers { + _BASE, + _LOWER, + _RAISE, + _ADJUST, +}; + +# define LOWER MO(_LOWER) +# define RAISE MO(_RAISE) + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_planck_grid( + 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_ESCAPE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOTE, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_ENTER, + WEBUSB_PAIR, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPACE, KC_NO, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT + ), + + [_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + KC_DELETE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NONUS_HASH, KC_NUBS,KC_HOME, KC_END, _______, + KC_COMMA, _______, _______, _______, _______, _______, KC_NO, _______, KC_MEDIA_NEXT_TRACK,KC_AUDIO_VOL_DOWN,KC_AUDIO_VOL_UP,KC_MEDIA_PLAY_PAUSE + ), + + [_RAISE] = LAYOUT_planck_grid( + KC_GRAVE,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINUS, KC_EQUAL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NONUS_HASH, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, KC_NO, _______, KC_MEDIA_NEXT_TRACK,KC_AUDIO_VOL_DOWN,KC_AUDIO_VOL_UP,KC_MEDIA_PLAY_PAUSE + ), + + [_ADJUST] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_DEL, _______, AU_ON, AU_OFF, AU_TOGG, _______, _______, RGB_TOG, RGB_VAI, RGB_VAD, LED_LEVEL, QK_BOOT, + _______, _______, MU_ON, MU_OFF, MU_TOGG, _______, _______, RGB_MOD, RGB_HUI, RGB_HUD, TOGGLE_LAYER_COLOR, _______, + _______, _______, _______, _______, _______, _______, KC_NO, _______, _______, _______, _______, _______ + ), + +}; +// clang-format on + +const uint8_t PROGMEM ledmap[][RGB_MATRIX_LED_COUNT][3] = { + [0] = {{42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {146, 224, 255}, {146, 224, 255}, {146, 224, 255}, {146, 224, 255}, {146, 224, 255}, {146, 224, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {146, 224, 255}, {146, 224, 255}, {146, 224, 255}, {146, 224, 255}, {146, 224, 255}, {146, 224, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {32, 255, 234}, {32, 255, 234}, {32, 255, 234}, {32, 255, 234}}, + + [1] = {{89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {169, 120, 255}, {169, 120, 255}, {169, 120, 255}, {169, 120, 255}, {169, 120, 255}, {169, 120, 255}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {169, 120, 255}, {169, 120, 255}, {169, 120, 255}, {169, 120, 255}, {169, 120, 255}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}}, + + [2] = {{216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {249, 228, 255}, {249, 228, 255}, {249, 228, 255}, {216, 255, 255}, {216, 255, 255}, {105, 255, 255}, {105, 255, 255}, {105, 255, 255}, {216, 255, 255}, {14, 255, 255}, {216, 255, 255}, {216, 255, 255}, {249, 228, 255}, {249, 228, 255}, {249, 228, 255}, {216, 255, 255}, {216, 255, 255}, {105, 255, 255}, {105, 255, 255}, {105, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}}, + +}; + +void set_layer_color(int layer) { + for (int i = 0; i < RGB_MATRIX_LED_COUNT; i++) { + HSV hsv = { + .h = pgm_read_byte(&ledmap[layer][i][0]), + .s = pgm_read_byte(&ledmap[layer][i][1]), + .v = pgm_read_byte(&ledmap[layer][i][2]), + }; + if (!hsv.h && !hsv.s && !hsv.v) { + rgb_matrix_set_color(i, 0, 0, 0); + } else { + RGB rgb = hsv_to_rgb(hsv); + float f = (float)rgb_matrix_config.hsv.v / UINT8_MAX; + rgb_matrix_set_color(i, f * rgb.r, f * rgb.g, f * rgb.b); + } + } +} + +bool rgb_matrix_indicators_user(void) { + if (keyboard_config.disable_layer_led) { + return; + } + switch (get_highest_layer(layer_state)) { + case 1: + set_layer_color(0); + break; + case 2: + set_layer_color(1); + break; + case 3: + set_layer_color(2); + break; + default: + if (rgb_matrix_get_flags() == LED_FLAG_NONE) rgb_matrix_set_color_all(0, 0, 0); + break; + } + return false; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case RGB_SLD: + if (record->event.pressed) { + rgblight_mode(1); + } + return false; + } + return true; +} + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (clockwise) { +# ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); +# else + tap_code(KC_PGDN); +# endif + } else { +# ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); +# else + tap_code(KC_PGUP); +# endif + } + return true; +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} + +layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); } diff --git a/keyboards/planck/keymaps/oryx/rules.mk b/keyboards/planck/keymaps/oryx/rules.mk new file mode 100644 index 000000000000..5f561b32e1c6 --- /dev/null +++ b/keyboards/planck/keymaps/oryx/rules.mk @@ -0,0 +1,9 @@ +# Set any rules.mk overrides for your specific keymap here. +# See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file +CONSOLE_ENABLE = no +COMMAND_ENABLE = no +MOUSEKEY_ENABLE = no +RGBLIGHT_ENABLE = no +RGB_MATRIX_ENABLE = yes +WEBUSB_ENABLE = yes +ORYX_ENABLE = yes diff --git a/keyboards/planck/keymaps/paget/config.h b/keyboards/planck/keymaps/paget/config.h new file mode 100755 index 000000000000..59bf4aa2a3ea --- /dev/null +++ b/keyboards/planck/keymaps/paget/config.h @@ -0,0 +1,39 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/paget/keymap.c b/keyboards/planck/keymaps/paget/keymap.c new file mode 100755 index 000000000000..3e5c39ce019c --- /dev/null +++ b/keyboards/planck/keymaps/paget/keymap.c @@ -0,0 +1,68 @@ +//Keymap I created to suit my working style + +#include QMK_KEYBOARD_H + +//Define the layers +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl |Enter | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' +*/ + +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_ENT, KC_LGUI, KC_LALT, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT +), + +/* + * ,-----------------------------------------------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | _ | = | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ` | | | | | | | | | | [ | ] | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| \ | | | | | | | | | # |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | | | |Lower | Space |Raise | | | | | + * `-----------------------------------------------------------------------------------' +*/ +[_LOWER] = LAYOUT_planck_grid( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, + KC_GRV, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LBRC, KC_RBRC, + KC_TRNS, KC_NUBS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NUHS, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO +), + +/* + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | CAPS | | | | | | | |PrtScr| Lock |Break | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| | | | | | | |Insert| Home | PgUp |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | | | Alt |Lower | Space |Raise |Delete| End | PgDn | | + * `-----------------------------------------------------------------------------------' +*/ + +[_RAISE] = LAYOUT_planck_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_CAPS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSCR, KC_SCRL, KC_PAUS, KC_NO, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_INS, KC_HOME, KC_PGUP, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_END, KC_PGDN, KC_NO +) + +}; diff --git a/keyboards/planck/keymaps/palleiko/config.h b/keyboards/planck/keymaps/palleiko/config.h new file mode 100644 index 000000000000..928ddb1617eb --- /dev/null +++ b/keyboards/planck/keymaps/palleiko/config.h @@ -0,0 +1,38 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/palleiko/keymap.c b/keyboards/planck/keymaps/palleiko/keymap.c new file mode 100644 index 000000000000..f6258be5bf59 --- /dev/null +++ b/keyboards/planck/keymaps/palleiko/keymap.c @@ -0,0 +1,297 @@ +/* Copyright 2015-2018 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 . + * + * Palleiko Layout + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _NAV, + _NUM, + _WM, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + NAV, + WM, + NUM +}; + +// i3 Binds +#define WM_1 LALT(KC_1) +#define WM_2 LALT(KC_2) +#define WM_3 LALT(KC_3) +#define WM_4 LALT(KC_4) +#define WM_5 LALT(KC_5) +#define WM_6 LALT(KC_6) +#define WM_7 LALT(KC_7) +#define WM_8 LALT(KC_8) +#define WM_9 LALT(KC_9) +#define WM_0 LALT(KC_0) + +// NOP +#define ___x___ KC_NO + +// MT Shift & Enter +#define S_ENT MT(MOD_RSFT, KC_ENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | NUM | NAV | Alt |Lower | Space |Raise | NAV | GUI | NUM | WM | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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, S_ENT , + KC_LCTL, NUM, NAV, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, NAV, KC_RGUI, NUM, WM +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | NUM | NAV | Alt |Lower | Space |Raise | NAV | GUI | NUM | WM | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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, S_ENT , + KC_LCTL, NUM, NAV, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, NAV, KC_RGUI, NUM, WM +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | NUM | NAV | Alt |Lower | Space |Raise | NAV | GUI | NUM | WM | + * `----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + KC_LCTL, NUM, NAV, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, NAV, KC_RGUI, NUM, WM +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Hex Numpad + * ,-----------------------------------------------------------------------------------. + * | | | | { | } | A | B | 7 | 8 | 9 | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | NUM | | | ( | ) | C | D | 4 | 5 | 6 | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | [ | ] | E | F | 1 | 2 | 3 | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | 0 | | | | + * `-----------------------------------------------------------------------------------' + */ +[_NUM] = LAYOUT_planck_grid( + _______, ___x___, ___x___, KC_LCBR, KC_RCBR, KC_A, KC_B, KC_7, KC_8, KC_9, ___x___, _______, + _______, ___x___, ___x___, KC_LPRN, KC_RPRN, KC_C, KC_D, KC_4, KC_5, KC_6, ___x___, _______, + _______, ___x___, ___x___, KC_LBRC, KC_RBRC, KC_E, KC_F, KC_1, KC_2, KC_3, ___x___, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_0, _______, _______, _______ +), + +/* WM (i3 window binds) + * ,-----------------------------------------------------------------------------------. + * | | WM1 | WM2 | WM3 | WM4 | WM5 | WM6 | WM7 | WM8 | WM9 | WM0 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | WM6 | WM5 | WM4 | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | WM1 | WM2 | WM3 | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | WM0 | | | | + * `-----------------------------------------------------------------------------------' + */ +[_WM] = LAYOUT_planck_grid( + _______, WM_1, WM_2, WM_3, WM_4, WM_5, WM_6, WM_7, WM_8, WM_9, WM_0, _______, + _______, _______, _______, _______, _______, _______, _______, WM_4, WM_5, WM_6, _______, _______, + _______, _______, _______, _______, _______, _______, _______, WM_1, WM_2 , WM_3, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, WM_0, _______, _______, _______ +), + +/* Navigation Layer (Vim-like arrow binds & i3 binds) + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | LEFT | DOWN | UP | RIGHT| NAV | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_NAV] = LAYOUT_planck_grid( + ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, + ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, ___x___, ___x___, + _______, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | |AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | |Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Reset| Debug| | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , + _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, + _______, _______, _______, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case NUM: + if (record->event.pressed) { + layer_on(_NUM); + } else { + layer_off(_NUM); + } + return false; + break; + case NAV: + if (record->event.pressed) { + layer_on(_NAV); + } else { + layer_off(_NAV); + } + return false; + break; + case WM: + if (record->event.pressed) { + layer_on(_WM); + } else { + layer_off(_WM); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/palleiko/readme.md b/keyboards/planck/keymaps/palleiko/readme.md new file mode 100644 index 000000000000..d8c70a65261e --- /dev/null +++ b/keyboards/planck/keymaps/palleiko/readme.md @@ -0,0 +1,63 @@ +# Palleiko's Layout +--- + +This layout is mostly stock with a increased functionality for my usage. + +Changes over stock keymap: +1. Altered R1 +1. Home row navigation layer +1. Hexadecimal numpad layer +1. Window manager layer for my i3 setup + +All-in-all, anyone used to the standard map would have no problem using this. + +### QWERTY Keymap & Addded Layers +##### Qwerty +``` +Hold Enter for Right Shift +,-----------------------------------------------------------------------------------. +| Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Esc | A | S | D | F | G | H | J | K | L | ; | " | +|------+------+------+------+------+------|------+------+------+------+------+------| +| Shift| Z | X | C | V | B | N | M | , | . | / |Enter | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Ctrl | NUM | NAV | Alt |Lower | Space |Raise | NAV | GUI | NUM | WM | +`-----------------------------------------------------------------------------------' +``` +##### Hex Numpad +``` +,-----------------------------------------------------------------------------------. +| | | | { | } | A | B | 7 | 8 | 9 | | | +|------+------+------+------+------+-------------+------+------+------+------+------| +| _NUM | | | ( | ) | C | D | 4 | 5 | 6 | | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | | | [ | ] | E | F | 1 | 2 | 3 | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | 0 | | | | +`-----------------------------------------------------------------------------------' +``` +##### WM (i3 window binds) +``` +,-----------------------------------------------------------------------------------. +| | WM1 | WM2 | WM3 | WM4 | WM5 | WM6 | WM7 | WM8 | WM9 | WM0 | | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | | | | | | WM6 | WM5 | WM4 | | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | | | | | | WM1 | WM2 | WM3 | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | WM0 | | | _WM | +`-----------------------------------------------------------------------------------' +``` +##### Navigation Layer (Vim-like arrow binds & i3 binds) +``` +,-----------------------------------------------------------------------------------. +| | | | | | | | | | | | | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | | | | | | LEFT | DOWN | UP | RIGHT| | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | _NAV | | | | | | | | _NAV | | +`-----------------------------------------------------------------------------------' +``` diff --git a/keyboards/planck/keymaps/palleiko/rules.mk b/keyboards/planck/keymaps/palleiko/rules.mk new file mode 100644 index 000000000000..d5ff6cd3ba64 --- /dev/null +++ b/keyboards/planck/keymaps/palleiko/rules.mk @@ -0,0 +1,2 @@ +# Atmel ATMEGA23U4 Bootloader +BOOTLOADER = atmel-dfu diff --git a/keyboards/planck/keymaps/pascamel/config.h b/keyboards/planck/keymaps/pascamel/config.h new file mode 100644 index 000000000000..fcf90b413200 --- /dev/null +++ b/keyboards/planck/keymaps/pascamel/config.h @@ -0,0 +1,35 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/pascamel/keymap.c b/keyboards/planck/keymaps/pascamel/keymap.c new file mode 100644 index 000000000000..779cb5f2d06e --- /dev/null +++ b/keyboards/planck/keymaps/pascamel/keymap.c @@ -0,0 +1,239 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + BACKLIT, + MY_PWD +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | GUI |Brite |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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_LCTL, KC_LALT, KC_LGUI, BACKLIT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Prev | Play | Next | | | * | 4 | 5 | 6 | - | Del | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Pwd | Vol- | MUTE | Vol+ | | | / | 1 | 2 | 3 | + | PgUp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | 0 | . | = | PgDn | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_ASTR, KC_4, KC_5, KC_6, KC_MINS, KC_DEL, + MY_PWD, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, KC_SLSH, KC_1, KC_2, KC_3, KC_PLUS, KC_PGUP, + _______, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_EQL, KC_PGDN +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | ~ | | / | { | [ | ] | } | \ | - | + | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | _ | = | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Home | PgDn | PgUp | End | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + _______, KC_TILD, _______, KC_SLSH, KC_LCBR, KC_LBRC, KC_RBRC, KC_RCBR, KC_BSLS, KC_MINS, KC_PLUS, KC_PIPE, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_EQL, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap| | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + case MY_PWD: + if (record->event.pressed) { + SEND_STRING("My secret password!"); + false; + } + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } + return true; +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/pascamel/readme.md b/keyboards/planck/keymaps/pascamel/readme.md new file mode 100644 index 000000000000..b6be21cc978d --- /dev/null +++ b/keyboards/planck/keymaps/pascamel/readme.md @@ -0,0 +1,29 @@ +#### Base Layer + +A regular QWERTY layer, with Ctrl/alt/cmd on the bottom right corner + +![Qwerty](https://i.imgur.com/FpRNJZH.png) + + + +#### Lower ⇓ + +Focused on numbers and calculations + +![Lower](https://i.imgur.com/PyXSGba.png) + + + +#### Raise ⇑ + +Symbols + +![Raise](https://i.imgur.com/pYhqcnI.png) + + + +#### Adjust ⇑+⇓ + +Settings and configurations + +![Adjust](https://i.imgur.com/JN7a0Ku.png) diff --git a/keyboards/planck/keymaps/pascamel/rules.mk b/keyboards/planck/keymaps/pascamel/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/pascamel/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/peterfalken/config.h b/keyboards/planck/keymaps/peterfalken/config.h new file mode 100644 index 000000000000..4b14b7756b8e --- /dev/null +++ b/keyboards/planck/keymaps/peterfalken/config.h @@ -0,0 +1,49 @@ +/* Copyright 2015-2021 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE +# define STARTUP_SONG SONG(PLANCK_SOUND) +// #define STARTUP_SONG SONG(NO_SOUND) + +# define DEFAULT_LAYER_SONGS \ + { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND) } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/peterfalken/keymap.c b/keyboards/planck/keymaps/peterfalken/keymap.c new file mode 100644 index 000000000000..140149c47233 --- /dev/null +++ b/keyboards/planck/keymaps/peterfalken/keymap.c @@ -0,0 +1,80 @@ +// Copyright 2023 Peter.Falken (@PeterFalken) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "muse.h" +#include "peterfalken.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ▽ | Ctrl | Opt | Cmd | LWR | Space | RSE | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + _______, KC_LCTL, KC_LOPT, KC_LCMD, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ▽ | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | ▽ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ ▽ | ▽ | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ▽ | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | ▽ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ ▽ | ▽ | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | RSET | ▽ | M.AP | M.AL | LPAD | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | SLEP | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | CPWD | UN | CU | CO | PA | MV | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + QK_BOOT, _______, CK_M1, KC_MCTL, KC_LPAD, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CK_SLP, + CK_CW, _______, CK_CU, CK_CO, CK_PA, CK_MV, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; diff --git a/keyboards/planck/keymaps/peterfalken/readme.md b/keyboards/planck/keymaps/peterfalken/readme.md new file mode 100644 index 000000000000..f64d682a51ed --- /dev/null +++ b/keyboards/planck/keymaps/peterfalken/readme.md @@ -0,0 +1,14 @@ +Copyright 2023 LEG @PeterFalken + +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 . diff --git a/keyboards/planck/keymaps/peterfalken/rules.mk b/keyboards/planck/keymaps/peterfalken/rules.mk new file mode 100644 index 000000000000..a33c6c1ddb85 --- /dev/null +++ b/keyboards/planck/keymaps/peterfalken/rules.mk @@ -0,0 +1,8 @@ +# Setup keymap QMK features +# TODO: Check for space optimizations +AUDIO_ENABLE = yes # Enable Audio Output +ENCODER_ENABLE = no # Disable encoder + +ifeq ($(strip $(AUDIO_ENABLE)), yes) + SRC += muse.c +endif diff --git a/keyboards/planck/keymaps/pevecyan/config.h b/keyboards/planck/keymaps/pevecyan/config.h new file mode 100644 index 000000000000..d21e85693a48 --- /dev/null +++ b/keyboards/planck/keymaps/pevecyan/config.h @@ -0,0 +1,35 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/pevecyan/keymap.c b/keyboards/planck/keymaps/pevecyan/keymap.c new file mode 100644 index 000000000000..e630b12d2814 --- /dev/null +++ b/keyboards/planck/keymaps/pevecyan/keymap.c @@ -0,0 +1,260 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H + +#include "action_layer.h" +#include "muse.h" +#include "keymap_slovenian.h" + +#define ALTG(kc) ALGR(kc) // FIXME: Remove this + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, + _ALTGR, + _CAPS, + _MEMA, + _CARON +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define CAPS MO(_CAPS) +#define ALTGR MO(_ALTGR) +#define MEMA MO(_MEMA) +#define CARON LT(_CARON, SI_QUOT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Z | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | CAPS | A | S | D | F | G | H | J | K | L |CARON |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Y | X | C | V | B | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | GUI |LOWER | Space |RAISE | ALTGR| MEMA | F12 | F5 | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, SI_Q, SI_W, SI_E, SI_R, SI_T, SI_Z, SI_U, SI_I, SI_O, SI_P, KC_BSPC, + CAPS, SI_A, SI_S, SI_D, SI_F, SI_G, SI_H, SI_J, SI_K, SI_L, CARON, KC_ENT, + KC_LSFT, SI_Y, SI_X, SI_C, SI_V, SI_B, SI_N, SI_M, SI_COMM, SI_DOT, SI_MINS, KC_RSFT, + KC_LCTL, KC_LALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, ALTGR, MEMA, KC_F12, KC_F5 +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | " | # | $ | % | & | / | ( | ) | = | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | ? | * | ` | + | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | < | > | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + SI_TILD, SI_EXLM, SI_DQUO, KC_HASH, SI_DLR, SI_PERC, SI_AMPR, SI_SLSH, SI_LPRN, SI_RPRN, SI_EQL, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, SI_QUES, SI_ASTR, SI_GRV, SI_PLUS, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, SI_LABK, SI_RABK, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | | | | | | | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Altgr <> + * ,-----------------------------------------------------------------------------------. + * | | \ | | | € | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | [ | ] | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | @ | { | } | | < | > | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ALTGR] = LAYOUT_planck_grid( + _______, SI_BSLS, SI_PIPE, SI_EURO, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, SI_LBRC, SI_RBRC, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, SI_AT, SI_LCBR, SI_RCBR, _______, SI_LABK, SI_RABK, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_CAPS] = LAYOUT_planck_grid( + KC_ESC , KC_BSPC, KC_UP , KC_DEL , _______, _______, _______, _______, _______, KC_HOME, KC_END, KC_DEL , + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, LCTL(KC_LEFT), LCTL(KC_RIGHT), _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MEMA] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, KC_MPLY, KC_VOLU, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_CARON] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, SI_ZCAR , _______, _______, _______, _______, _______, + _______, _______, SI_SCAR, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, SI_CCAR, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } + return true; +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/pevecyan/readme.md b/keyboards/planck/keymaps/pevecyan/readme.md new file mode 100644 index 000000000000..de9680b49851 --- /dev/null +++ b/keyboards/planck/keymaps/pevecyan/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/pevecyan/rules.mk b/keyboards/planck/keymaps/pevecyan/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/pevecyan/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/phreed/config.h b/keyboards/planck/keymaps/phreed/config.h new file mode 100644 index 000000000000..59bf4aa2a3ea --- /dev/null +++ b/keyboards/planck/keymaps/phreed/config.h @@ -0,0 +1,39 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/phreed/keymap.c b/keyboards/planck/keymaps/phreed/keymap.c new file mode 100644 index 000000000000..21d6fbd501cf --- /dev/null +++ b/keyboards/planck/keymaps/phreed/keymap.c @@ -0,0 +1,79 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERT__Y = 0, + _NP = 1, // Number Pad + _SC = 2, // Special Characters + _CD = 3, // Command Keys + _FN = 4, // Function Key + _PLOVER = 5 // Stenography +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERT__Y] = LAYOUT_planck_grid( + KC_Q, KC_W, KC_E, KC_R, KC_T, MEH_T(KC_ESC), GUI_T(KC_BSLS), KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, LT(_NP,KC_F), KC_G, ALT_T(KC_TAB), ALT_T(KC_QUOT), KC_H, LT(_FN,KC_J), KC_K, KC_L, KC_SCLN, + KC_Z, KC_X, KC_C, LT(_SC,KC_V), KC_B, KC_LBRC, KC_RBRC, KC_N, LT(_CD,KC_M), KC_COMM, KC_DOT, KC_SLSH, + KC_LEFT, KC_DOWN, KC_BSPC, KC_ENT, SC_LSPO,CTL_T(KC_MINS), CTL_T(KC_EQL),SC_RSPC, KC_SPC, KC_DEL, KC_UP, KC_RGHT +), + +[_NP] = LAYOUT_planck_grid( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LABK, KC_RABK, KC_7, KC_8, KC_9, KC_DOT, + XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_LALT, KC_PPLS, KC_PMNS, KC_4, KC_5, KC_6, KC_0, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAST, KC_PSLS, KC_1, KC_2, KC_3, KC_EQL, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LSFT, KC_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +), + +[_SC] = LAYOUT_planck_grid( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_AMPR, KC_ASTR, KC_TILD, XXXXXXX , + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LALT, XXXXXXX, XXXXXXX, KC_DLR, KC_PERC, KC_CIRC, KC_GRV, + XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_EXLM, KC_AT, KC_HASH, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LSFT, KC_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +), + +[_FN] = LAYOUT_planck_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_LALT, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_LCTL, KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +), + +[_CD] = LAYOUT_planck_grid( + KC_HOME, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_PGUP, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LALT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_PGDN, KC_INS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LCTL, KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +), + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif diff --git a/keyboards/planck/keymaps/phreed/readme.md b/keyboards/planck/keymaps/phreed/readme.md new file mode 100644 index 000000000000..963740058b93 --- /dev/null +++ b/keyboards/planck/keymaps/phreed/readme.md @@ -0,0 +1,38 @@ +# The Phreed Planck Layout + + +| Q | W | E | R | T | ESC | | \ | Y | U | I | O | P | +|-----|-----|-----|-----|-----|-----|:---------:|-----|-----|-----|-----|-----|-----| +| | | | | | meh | MOD | gui | | | | | | +| f1 | f2 | f3 | f4 | f5 | f6 || < | > | 7 | 8 | 9 | . | +|home | end | | | | || | | & | * | ~ | | + +| A | S | D | F | G | Tab | | ' " | H | J | K | L | ; : | +|-----|-----|-----|-----|-----|-----|:---------:|-----|-----|-----|-----|-----|-----| +| | | | num | | alt | MOD | alt | | fn | | | | +| f7 | f8 | f9 | f10 | f11 | f12 || + | - | 4 | 5 | 6 | 0 | +|pg up| del | | | | || | | $ | % | ^ | ` | + +| Z | X | C | V | B | [ { | | ] } | N | M | , < | . > | / ? | +|-----|-----|-----|-----|-----|-----|:---------:|-----|-----|-----|-----|-----|-----| +| | | |spec | | | MOD | | | cmd | | | | +| f13 | f14 | f15 | f16 | f17 | f18 || * | / | 1 | 2 | 3 | = | +|pg dn| ins | | | | || | | ! | @ | # | | + +| <-- | dwn | <__ |enter| ( | - _ | | = + | ) | spc | __< | up | --> | +|-----|-----|-----|-----|-----|-----|:---------:|-----|-----|-----|-----|-----|-----| +| | | | |shift| ctl | MOD | ctl |shift| | | | | +| f19 | f20 | f21 | f22 | f23 | f24 || | | | | | | +|pg dn| ins | | | | || | | | | | | + + +Make example for this keyboard (after setting up your build environment): + + make planck/rev3:phreed + +To flash the keyboard + + make planck/rev3:phreed:dfu + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the +[make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/planck/keymaps/pickle_jr/README.md b/keyboards/planck/keymaps/pickle_jr/README.md new file mode 100644 index 000000000000..c26a97f2e55b --- /dev/null +++ b/keyboards/planck/keymaps/pickle_jr/README.md @@ -0,0 +1,102 @@ +Pickle\_Jr's Layout +=================== + +Thanks for checking out my layout! This is the layout I have on my planck. + +Main +------ +``` + ,---------------------------------------------------------------------------------------------------. + | Tab/CALC | Q | W | E | R | T | Y | U | I | O | P | "/CALC | + |----------+----------+------+------+------+-------------+------+------+-------+----------+---------| + | Esc | A | S | D | F | G | H | J | K | L | ;/Nav | Enter | + |----------+----------+------+------+------+------|------+------+------+-------+----------+---------| + | (/SFT | Z | X | C | V | B | N | M | , | . | / | )/SFT | + |----------+----------+------+------+------+------+------+------+------+-------+----------+---------| + | [/SPC | CTRL |PrintS| GUI | Bksp |Lower |Raise | SPC | ALT |VIMSAVE| CTRL | ]/SPC | + `---------------------------------------------------------------------------------------------------' +``` + +Lower +----- +``` + ,-----------------------------------------------------------------------------------. + | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + |------+------+------+------+------+-------------+------+------+------+------+------| + | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | + |------+------+------+------+------+------|------+------+------+------+------+------| + | | | | | | | | | | | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | DEL | | | | | + `-----------------------------------------------------------------------------------' +``` + +Raise +----- +``` + ,-----------------------------------------------------------------------------------. + | | | | | | | | | | | | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | ! | @ | # | $ | % | ^ | & | * | - | = | + | | + |------+------+------+------+------+------|------+------+------+------+------+------| + | | | ~ | ` | CTRL | | | | | _ | | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | | | | + `-----------------------------------------------------------------------------------' +``` + +Special (SPC on main) +------- +``` + ,------------------------------------------------------------------------------------. + | | M2 | MUP | M1 | WUP | | CAPS | | | | | | + |------+------+------+------+------+--------------+------+------+------+------+------| + | |MLEFT |MDOWN |MRIGHT|WDOWN | | | | | | | | + |------+------+------+------+------+------|-------+------+------+------+------+------| + | |WLEFT | M3 |WRIGHT| | |CTLALTD| | | | | | + |------+------+------+------+------+------+-------+------+------+------+------+------| + | | PREV | PLAY | NEXT | | | LOCK | | MUTE | VOL- | VOL+ | | + `------------------------------------------------------------------------------------' +``` + +Calc +---- +``` + ,-----------------------------------------------------------------------------------. + | | F7 | F8 | F9 | | | * | 7 | 8 | 9 | / | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | | F4 | F5 | F6 | | | + | 4 | 5 | 6 | - | \ | + |------+------+------+------+------+------|------+------+------+------+------+------| + | | F1 | F2 | F3 | | | | 1 | 2 | 3 | = | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | F11 | F12 | | DEL | Bksp | 0 | | | | RET | + `-----------------------------------------------------------------------------------' +``` + +Nav +--- +``` + ,-----------------------------------------------------------------------------------. + | | | | | | | | | | | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | HOME | PGUP | PGDN | END | LEFT | DOWN | UP |RIGHT | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | | | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | | | | | + `-----------------------------------------------------------------------------------' +``` + +Adjust (Lower + Raise) +---------------------- +``` + ,-------------------------------------------------------------------------------------------. + | | Reset| |RGB_TOG|RGB_MOD|RGB_HUI|RGB_HUD|RGB_SAI|RGB_SAD|RGB_VAI|RGB_VAD| Del | + |------+------+------+-------+-------+-------+-------+-------+-------+-------+-------+------| + | | |MuNext|Aud on |Audoff |AGnorm |AGswap | | | | | | + |------+------+------+-------+-------+-------+-------+-------+-------+-------+-------+------| + | |Voice-|Voice+|Mus on |Musoff |MIDIon |MIDIof |TERMon |TERMof | | | | + |------+------+------+-------+-------+-------+-------+-------+-------+-------+-------+------| + | | | | | | | | | | | | + `-------------------------------------------------------------------------------------------' +``` diff --git a/keyboards/planck/keymaps/pickle_jr/config.h b/keyboards/planck/keymaps/pickle_jr/config.h new file mode 100644 index 000000000000..526ebe8e87f4 --- /dev/null +++ b/keyboards/planck/keymaps/pickle_jr/config.h @@ -0,0 +1,32 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) +#endif + +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_INTERVAL 16 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_WHEEL_DELAY 0 + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 diff --git a/keyboards/planck/keymaps/pickle_jr/keymap.c b/keyboards/planck/keymaps/pickle_jr/keymap.c new file mode 100644 index 000000000000..92da3c50bd1c --- /dev/null +++ b/keyboards/planck/keymaps/pickle_jr/keymap.c @@ -0,0 +1,196 @@ +#include QMK_KEYBOARD_H + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _SPECIAL 3 +#define _CALC 4 +#define _NAV 5 +#define _ADJUST 6 + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +#define LPSFT SFT_T(KC_RPRN) +#define LCCTL CTL_T(KC_LCBR) +#define RCCTL MT(MOD_RCTL,KC_RCBR) +#define RPSFT MT(MOD_RSFT,KC_LPRN) + +#define SCOLNAV LT(_NAV,KC_SCLN) +#define TABCALC LT(_CALC, KC_TAB) +#define QUOCALC LT(_CALC, KC_QUOT) +#define LBRACK LT(_SPECIAL,KC_LBRC) +#define RBRACK LT(_SPECIAL,KC_RBRC) + +#define LOCK RGUI(KC_L) + +enum custom_keycoedes { + CTLALTD = SAFE_RANGE, + VIMSAVE, + VIMWQ +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if(record->event.pressed) { + switch(keycode) { + case CTLALTD: + SEND_STRING(SS_DOWN(X_LCTL)SS_DOWN(X_LALT)SS_DOWN(X_DELETE)SS_UP(X_DELETE)SS_UP(X_LALT)SS_UP(X_LCTL)); + return false; + case VIMSAVE: + SEND_STRING(":w"); + return false; + } + } + return true; +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,----------------------------------------------------------------------------------------------------. + * | Tab/CALC | Q | W | E | R | T | Y | U | I | O | P | "/CALC | + * |----------+----------+-------+------+------+-------------+------+------+-------+----------+---------| + * | Esc | A | S | D | F | G | H | J | K | L | ;/Nav | Enter | + * |----------+----------+-------+------+------+------|------+------+------+-------+----------+---------| + * | (/SFT | Z | X | C | V | B | N | M | , | . | / | )/SFT | + * |----------+----------+-------+------+------+------+------+------+------+-------+----------+---------| + * | [/SPC | CTRL |PrintS | GUI | Bksp |Lower |Raise | SPC | ALT |VIMSAVE| CTRL | ]/SPC | + * `----------------------------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + TABCALC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, QUOCALC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SCOLNAV, KC_ENT , + SC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SC_RSPC, + LBRACK , KC_LCTL, KC_PSCR, KC_LGUI, KC_BSPC, LOWER, RAISE, KC_SPC, KC_RALT, VIMSAVE, KC_RCTL, RBRACK +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | DEL | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 , + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, KC_TRNS, _______, KC_DEL, _______, _______, _______, _______ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ! | @ | # | $ | % | ^ | & | * | - | = | + | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | ~ | ` | CTRL | | | | | _ | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_MINS, KC_EQL, KC_PLUS, _______, + _______, _______, KC_TILD, KC_GRV, KC_LCTL, _______, KC_PIPE, _______, KC_UNDS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_TRNS, _______, _______, _______, _______, _______ +), + +/* Special + * ,------------------------------------------------------------------------------------. + * | | M2 | MUP | M1 | WUP | | CAPS | | | | | | + * |------+------+------+------+------+--------------+------+------+------+------+------| + * | |MLEFT |MDOWN |MRIGHT|WDOWN | |PRTSCRE| | | | | | + * |------+------+------+------+------+------|-------+------+------+------+------+------| + * | |WLEFT | M3 |WRIGHT| | |CTLALTD| | | | | | + * |------+------+------+------+------+------+-------+------+------+------+------+------| + * | | PREV | PLAY | NEXT | | | LOCK | | MUTE | VOL- | VOL+ | | + * `------------------------------------------------------------------------------------' + */ +[_SPECIAL] = LAYOUT_planck_grid( + _______, KC_BTN2, KC_MS_U, KC_BTN1, KC_WH_U, _______, KC_CAPS, _______, _______, _______, _______, _______, + _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, _______, _______, _______, _______, _______, _______, _______, + _______, KC_WH_L, KC_BTN3, KC_WH_R, _______, _______, CTLALTD, _______, _______, _______, _______, _______, + KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, LOCK, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS +), + +/* Calc + * ,-----------------------------------------------------------------------------------. + * | | F7 | F8 | F9 | | | * | 7 | 8 | 9 | / | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F4 | F5 | F6 | | | + | 4 | 5 | 6 | - | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F1 | F2 | F3 | | | | 1 | 2 | 3 | = | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | F11 | F12 | | DEL | Bksp | 0 | | | | RET | + * `-----------------------------------------------------------------------------------' + */ +[_CALC] = LAYOUT_planck_grid( + KC_TRNS, KC_F7, KC_F8, KC_F9, _______, _______, KC_ASTR, KC_7, KC_8, KC_9, KC_BSLS, KC_TRNS, + _______, KC_F4, KC_F5, KC_F6, _______, _______, KC_PLUS, KC_4, KC_5, KC_6, KC_MINS, KC_BSLS, + _______, KC_F1, KC_F2, KC_F3, _______, _______, _______, KC_1, KC_2, KC_3, KC_EQL, _______, + _______, _______, KC_F11, KC_F12, _______, KC_DEL, KC_BSPC, KC_0, _______, _______, KC_ENT, _______ +), + +/* Nav + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | HOME | PGUP | PGDN | END | LEFT | DOWN | UP |RIGHT | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_NAV] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Adjust (Lower + Raise) + * ,-------------------------------------------------------------------------------------------. + * | | Reset| |RGB_TOG|RGB_MOD|RGB_HUI|RGB_HUD|RGB_SAI|RGB_SAD|RGB_VAI|RGB_VAD| Del | + * |------+------+------+-------+-------+-------+-------+-------+-------+-------+-------+------| + * | | |MUNEXT|Aud on |Audoff |AGnorm |AGswap | | | | | | + * |------+------+------+-------+-------+-------+-------+-------+-------+-------+-------+------| + * | |Voice-|Voice+|Mus on |Musoff |MIDIon |MIDIof |TERMon |TERMof | | | | + * |------+------+------+-------+-------+-------+-------+-------+-------+-------+-------+------| + * | | | | | | | | | | | | + * `-------------------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, KC_TRNS, KC_TRNS, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +}; + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +}; diff --git a/keyboards/planck/keymaps/pickle_jr/rules.mk b/keyboards/planck/keymaps/pickle_jr/rules.mk new file mode 100644 index 000000000000..6933bd75551a --- /dev/null +++ b/keyboards/planck/keymaps/pickle_jr/rules.mk @@ -0,0 +1,18 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/planck/keymaps/piemod/README.md b/keyboards/planck/keymaps/piemod/README.md new file mode 100644 index 000000000000..9c29e75db34c --- /dev/null +++ b/keyboards/planck/keymaps/piemod/README.md @@ -0,0 +1,27 @@ +PieMod +====== + +A keymap for users that need: + +- *P*: Programming symbols. + +- *I*: i3wm. + +- *E*: Emacs. + +- *M*: Macros. + +- *O*: Ortholinear. + +- *D*: Dvorak. + +Still a work-in-progress. Suggestions welcome @ https://github.com/dwrz/piemod. + +### TODO + +- [ ] Add Emacs layer. +- [ ] Add Macro layer. +- [ ] Add system control keys (rotation, brightness). +- [ ] Switch " and ' quotes (or function to toggle default). +- [ ] Add capslock. +. diff --git a/keyboards/planck/keymaps/piemod/keymap.c b/keyboards/planck/keymaps/piemod/keymap.c new file mode 100644 index 000000000000..60fb2bbf1251 --- /dev/null +++ b/keyboards/planck/keymaps/piemod/keymap.c @@ -0,0 +1,77 @@ +#include QMK_KEYBOARD_H + +#define DVORAK 0 +#define ARROW 1 +#define SYMBOL 2 +#define NUMBER 3 +#define FUNCTION 4 +#define EMACS 5 +#define CUSTOM_MACROS 6 +#define MOUSE 7 + +#define LT_1A LT(1, KC_A) +#define LT_2O LT(2, KC_O) +#define LT_3E LT(3, KC_E) +#define LT_4U LT(4, KC_U) +#define LT_5Q LT(5, KC_Q) +#define LT_6CTL LT(6, KC_LCTL) +#define LT_7COM LT(7, KC_COMM) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DVORAK] = LAYOUT_planck_grid( + KC_ESC, KC_QUOTE, LT_7COM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DELETE, + KC_TAB, LT_1A, LT_2O, LT_3E, LT_4U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENTER, + KC_LSFT, KC_SCLN, LT_5Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_MINUS, + C(KC_LALT), LT_6CTL, KC_MENU, KC_LALT, KC_LGUI, KC_BSPC, KC_SPACE, KC_RCTL, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT + ), + + [ARROW] = LAYOUT_planck_grid( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_HOME, KC_UP, KC_END, KC_PGUP, + KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDN, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_HOME, KC_PGDN, KC_PGUP, KC_END, 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 + ), + + [SYMBOL] = LAYOUT_planck_grid( + KC_TILD, KC_GRAVE, KC_NO, KC_EQUAL, KC_PLUS, KC_NO, KC_LBRC, KC_RBRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, + KC_NO, KC_NO, KC_TRNS, KC_SCLN, KC_COLN, KC_NO, KC_LCBR, KC_RCBR, KC_DLR, KC_PERC, KC_CIRC, S(KC_SLSH), + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_BSLS, KC_SLASH, KC_EXLM, KC_AT, KC_HASH, KC_PIPE, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_ASTR, KC_SLASH, KC_MINUS, KC_PLUS, KC_EQUAL + ), + + [NUMBER] = LAYOUT_planck_grid( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_7, KC_8, KC_9, KC_NO, + KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_4, KC_5, KC_6, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_0, KC_1, KC_2, KC_3, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_ASTR, KC_SLASH, KC_MINUS, KC_PLUS, KC_EQUAL + ), + + [FUNCTION] = LAYOUT_planck_grid( + KC_PSCR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, + KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, + QK_BOOT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_DELETE, KC_INSERT, KC_HOME, KC_PGDN, KC_PGUP, KC_END + ), + + [EMACS] = LAYOUT_planck_grid( + 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, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + ), + + [CUSTOM_MACROS] = LAYOUT_planck_grid( + 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, 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, + KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + ), + + [MOUSE] = LAYOUT_planck_grid( + KC_NO, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MS_U, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, 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, KC_NO, KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, KC_NO, KC_NO, KC_NO + ), + + }; diff --git a/keyboards/planck/keymaps/piemod/rules.mk b/keyboards/planck/keymaps/piemod/rules.mk new file mode 100644 index 000000000000..4f83056a800a --- /dev/null +++ b/keyboards/planck/keymaps/piemod/rules.mk @@ -0,0 +1,13 @@ +MOUSEKEY_ENABLE = yes +EXTRAKEY_ENABLE = yes +AUDIO_ENABLE = yes + +ifeq ($(MCU),at90usb1286) +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +CONSOLE_ENABLE = no +COMMAND_ENABLE = no +BLUETOOTH_ENABLE = no +else +BLUETOOTH_ENABLE = yes +endif + diff --git a/keyboards/planck/keymaps/pjanx/config.h b/keyboards/planck/keymaps/pjanx/config.h new file mode 100644 index 000000000000..b38db026e06c --- /dev/null +++ b/keyboards/planck/keymaps/pjanx/config.h @@ -0,0 +1,49 @@ +/* Copyright 2015-2018 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/pjanx/keymap.c b/keyboards/planck/keymaps/pjanx/keymap.c new file mode 100644 index 000000000000..a491a34f9603 --- /dev/null +++ b/keyboards/planck/keymaps/pjanx/keymap.c @@ -0,0 +1,354 @@ +/* Copyright 2015-2017 Jack Humbert + * Copyright 2021 Přemysl Eric Janouch + * + * 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 QMK_KEYBOARD_H +#include "muse.h" + + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |LCtrl | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |LShift| Z | X | C | V | B | N | M | , | . | / |RShift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | Caps | LGUI | LAlt |Lower | Space |Raise | RAlt | Down | Up |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, KC_DOWN, KC_UP, KC_ENT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Ins | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |RCtrl | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | RGUI | | | | | | Left | Vol- | Vol+ | Right| + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_INS, + KC_RCTL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______, + _______, KC_RGUI, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_VOLD, KC_VOLU, KC_RGHT +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |RCtrl | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | PgDn | PgUp | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | App | | | | | | Left | Vol- | Vol+ | Right| + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_RCTL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGDN, KC_PGUP, _______, + _______, KC_APP, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_VOLD, KC_VOLU, KC_RGHT +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * v------------------------RGB CONTROL--------------------v + * ,-----------------------------------------------------------------------------------. + * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | |MUSmod|Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | M1 | M2 | M3 | | | | | <- | vv | ^^ | -> | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, _______, _______, _______, _______, _______, KC_MS_LEFT, KC_MS_DOWN, KC_MS_UP, KC_MS_RIGHT +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + writePinLow(E6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + writePinHigh(E6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_song); } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_gb_song); } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } + return true; +} + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/pjanx/readme.md b/keyboards/planck/keymaps/pjanx/readme.md new file mode 100644 index 000000000000..e53397847d6a --- /dev/null +++ b/keyboards/planck/keymaps/pjanx/readme.md @@ -0,0 +1,2 @@ +# Modified Default Planck Layout + diff --git a/keyboards/planck/keymaps/pjanx/rules.mk b/keyboards/planck/keymaps/pjanx/rules.mk new file mode 100644 index 000000000000..3a551bd429bc --- /dev/null +++ b/keyboards/planck/keymaps/pjanx/rules.mk @@ -0,0 +1,2 @@ +SRC += muse.c +MOUSEKEY_ENABLE = yes diff --git a/keyboards/planck/keymaps/pok3r/config.h b/keyboards/planck/keymaps/pok3r/config.h new file mode 100644 index 000000000000..1c42f854eae5 --- /dev/null +++ b/keyboards/planck/keymaps/pok3r/config.h @@ -0,0 +1,39 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/pok3r/keymap.c b/keyboards/planck/keymaps/pok3r/keymap.c new file mode 100644 index 000000000000..b5340db4ab58 --- /dev/null +++ b/keyboards/planck/keymaps/pok3r/keymap.c @@ -0,0 +1,287 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST, + _FUNCTION +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV, + FUNCTION +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Func | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Esc | Alt |Lower | Space |Raise | Left | Up | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB , KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + FUNCTION , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + SFT_T(KC_ESC) , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_RSFT, KC_ENT), + KC_LCTL , KC_LGUI, KC_ESC, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Func | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Esc | Alt |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + KC_TAB , KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + FUNCTION , KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + SFT_T(KC_ESC) , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_RSFT, KC_ENT), + KC_LCTL , KC_LGUI, KC_ESC, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Func | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Esc | Alt |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB , KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + FUNCTION , KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + SFT_T(KC_ESC) , KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, MT(MOD_RSFT, KC_ENT), + KC_LCTL , KC_LGUI, KC_ESC, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Home |Pg Up |Pg Dn | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL , + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Home |Pg Up |Pg Dn | End | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL , + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Caps |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | Caps | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + KC_CAPS, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, KC_CAPS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Function + * ,-----------------------------------------------------------------------------------. + * | Esc | | Prev | Play | Next | | |Pg Up | Up |Pg Dn |Prt Sc| Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | Vol- | Mute | Vol+ | | Home | Left | Down |Right | End | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | Esc | | Esc | Home |Pg Up |Pg Dn | End | + * `-----------------------------------------------------------------------------------' + */ +[_FUNCTION] = LAYOUT_planck_grid( + KC_ESC , _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_DEL, + _______, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END , _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, KC_ESC , _______, _______, KC_ESC , KC_HOME, KC_PGUP, KC_PGDN, KC_END +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + case FUNCTION: + if (record->event.pressed) { + layer_on(_FUNCTION); + } else { + layer_off(_FUNCTION); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/pok3r/readme.md b/keyboards/planck/keymaps/pok3r/readme.md new file mode 100644 index 000000000000..66320e9916ee --- /dev/null +++ b/keyboards/planck/keymaps/pok3r/readme.md @@ -0,0 +1,15 @@ +This layout adds a new function layer similar to the default one from the pok3r: + + /* Function + * ,-----------------------------------------------------------------------------------. + * | Esc | | Prev | Play | Next | | |Pg Up | Up |Pg Dn |Prt Sc| Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | Vol- | Mute | Vol+ | | Home | Left | Down |Right | End | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Home |Pg Up |Pg Dn | End | + * `-----------------------------------------------------------------------------------' + */ + +You can acces this layer by holding the first key on the second line from the top. diff --git a/keyboards/planck/keymaps/premek/config.h b/keyboards/planck/keymaps/premek/config.h new file mode 100644 index 000000000000..6a7e5f734c18 --- /dev/null +++ b/keyboards/planck/keymaps/premek/config.h @@ -0,0 +1,27 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif diff --git a/keyboards/planck/keymaps/premek/keymap.c b/keyboards/planck/keymaps/premek/keymap.c new file mode 100644 index 000000000000..76d3cabfbc71 --- /dev/null +++ b/keyboards/planck/keymaps/premek/keymap.c @@ -0,0 +1,220 @@ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _PLOVER 5 +#define _ADJUST 16 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_DEL, KC_Y, KC_U, KC_I, KC_O, KC_P , + KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_TAB, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, + KC_LGUI, _______, _______, KC_LALT, LOWER, MT(MOD_LSFT, KC_SPC), KC_ENT, KC_SPC, RAISE, KC_RALT, _______, KC_RGUI +), +[_COLEMAK] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), +[_LOWER] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, KC_6, KC_7, KC_8, KC_9, KC_0, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_F6, KC_HOME, KC_PGDN, KC_PGUP, KC_END , + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, KC_F12, KC_PLUS, KC_PIPE, KC_LCBR, KC_RCBR, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +[_RAISE] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, + _______, _______, _______, KC_QUOT, KC_MINS, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + _______, KC_TILD, KC_GRV, KC_PLUS, KC_EQL, KC_PIPE, _______, KC_BSLS, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MS_BTN3 +), + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(tone_plover); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_plover_gb); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user(void) +{ + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user(void) +{ + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif diff --git a/keyboards/planck/keymaps/premek/readme.md b/keyboards/planck/keymaps/premek/readme.md new file mode 100644 index 000000000000..98ca55be43ee --- /dev/null +++ b/keyboards/planck/keymaps/premek/readme.md @@ -0,0 +1,4 @@ +# Split Layout +Inspired by TECK + +[Layout](http://www.keyboard-layout-editor.com/##@_switchMount=cherry&switchBrand=gateron&switchType=KS-3-Tea&pcb:true%3B&@_c=%23e6e6e6&t=%23757575&a:7&fa@:5%3B%3B&=Esc&_a:4&fa@:5&:0&:0&:0&:0&:0&:0&:0&:0&:5%3B%3B&=%0A%0A!%0A1%0A%0A%0A%0A%0A%0AQ&=%0A%0A%2F@%0A2%0A%0A%0A%0A%0A%0AW&=%0A%0A%23%0A3%0A%0A%0A%0A%0A%0AE&=%0A%0A$%0A4%0A%0A%0A%0A%0A%0AR&=%0A%0A%25%0A5%0A%0A%0A%0A%0A%0AT&_c=%23e3b02d&a:7%3B&=Del&_c=%23e6e6e6&a:4%3B&=%0A%0A%5E%0A6%0A%0A%0A%0A%0A%0AY&=%0A%0A%2F&%0A7%0A%0A%0A%0A%0A%0AU&=%0A%0A*%0A8%0A%0A%0A%0A%0A%0AI&=%0A%0A(%0A9%0A%0A%0A%0A%0A%0AO&=%0A%0A)%0A0%0A%0A%0A%0A%0A%0AP%3B&@_a:7%3B&=Shift&_a:4%3B&=%0A%0A%0AF1%0A%0A%0A%0A%0A%0AA&=%0A%0A%0AF2%0A%0A%0A%0A%0A%0AS&=%0A%0A'%0AF3%0A%0A%0A%0A%0A%0AD&_c=%23e3b02d&n:true%3B&=%0A%0A-%0AF4%0A%0A%0A%0A%0A%0AF&_c=%23e6e6e6%3B&=%0A%0A%0AF5%0A%0A%0A%0A%0A%0AG&_c=%23e3b02d&a:7%3B&=Tab&_c=%23e6e6e6&a:4%3B&=%0A%0A%0AF6%0A%0A%0A%0A%0A%0AH&_c=%23e3b02d&fa@:5&:0&:4&:0&:0&:0&:0&:0&:0&:5%3B&n:true%3B&=%0A%0A%2F&larr%2F%3B%0AHom%0A%0A%0A%0A%0A%0AJ&_c=%23e6e6e6%3B&=%0A%0A%2F&darr%2F%3B%0APgD%0A%0A%0A%0A%0A%0AK&_fa@:5&:0&:5&:0&:0&:0&:0&:0&:0&:5%3B%3B&=%0A%0A%2F&uarr%2F%3B%0APgU%0A%0A%0A%0A%0A%0AL&=%0A%0A%2F&rarr%2F%3B%0AEnd%0A%0A%0A%0A%0A%0A%2F%3B%3B&@_a:7%3B&=Ctrl&_a:4&fa@:5&:0&:0&:0&:0&:0&:0&:0&:0&:5%3B%3B&=%0A%0A~%0AF7%0A%0A%0A%0A%0A%0AZ&=%0A%0A%60%0AF8%0A%0A%0A%0A%0A%0AX&=%0A%0A+%0AF9%0A%0A%0A%0A%0A%0AC&=%0A%0A%2F=%0AF10%0A%0A%0A%0A%0A%0AV&=%0A%0A%7C%0AF11%0A%0A%0A%0A%0A%0AB&_c=%23e3b02d&a:7%3B&=BSp&_c=%23e6e6e6&a:4%3B&=%0A%0A%5C%0AF12%0A%0A%0A%0A%0A%0AN&=%0A%0A%5B%0A%0A%0A%0A%0A%0A%0AM&=%0A%0A%5D%0A%0A%0A%0A%0A%0A%0A,&=%0A%0A%7B%0A%0A%0A%0A%0A%0A%0A.&=%0A%0A%7D%0A%0A%0A%0A%0A%0A%0A%2F%2F%3B&@_a:7%3B&=Alt&=&=&=Super&_c=%23e3b02d%3B&=%2F&dArr%2F%3B&_c=%23e6e6e6%3B&=Shift&_c=%23e3b02d%3B&=%2F&crarr%2F%3B&_c=%23e6e6e6%3B&=spc&_c=%23e3b02d%3B&=%2F&uArr%2F%3B&_c=%23e6e6e6&a:4%3B&=%0A%0AVolUp&=%0A%0AVolDn&_fa@:5&:0&:2%3B%3B&=%0A%0AMdlClick) diff --git a/keyboards/planck/keymaps/premek/rules.mk b/keyboards/planck/keymaps/premek/rules.mk new file mode 100644 index 000000000000..10de3bfc0359 --- /dev/null +++ b/keyboards/planck/keymaps/premek/rules.mk @@ -0,0 +1,19 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/planck/keymaps/priyadi/config.h b/keyboards/planck/keymaps/priyadi/config.h new file mode 100644 index 000000000000..d72b6d39083f --- /dev/null +++ b/keyboards/planck/keymaps/priyadi/config.h @@ -0,0 +1,52 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#define PRIYADI_PLANCK + +#define UNICODE_TYPE_DELAY 0 + +#define LAYOUT_DVORAK +#define LAYOUT_COLEMAK +#define LAYOUT_NORMAN +#define LAYOUT_WORKMAN + +#define DOUBLESPACE_LAYER_ENABLE + // #define TOLELOT_ENABLE + +#ifdef __AVR__ +#define LAYOUT( \ + k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ + k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ + k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, \ + tp1, tp2, tp3 \ +) \ +{ \ + {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c}, \ + {k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c}, \ + {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c}, \ + {k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c} \ +} +#elif KEYBOARD_planck_rev6 +#define LAYOUT( \ + 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, \ + tp1, tp2, tp3 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k39, k3a, k3b }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k33, k34, k35 } \ +} +#endif + +#endif diff --git a/keyboards/planck/keymaps/priyadi/keymap.c b/keyboards/planck/keymaps/priyadi/keymap.c new file mode 100644 index 000000000000..bb3a2e92c4ee --- /dev/null +++ b/keyboards/planck/keymaps/priyadi/keymap.c @@ -0,0 +1 @@ +#include "../../../handwired/promethium/keymaps/priyadi/keymap.c" \ No newline at end of file diff --git a/keyboards/planck/keymaps/priyadi/readme.md b/keyboards/planck/keymaps/priyadi/readme.md new file mode 100644 index 000000000000..99bdd9d9b636 --- /dev/null +++ b/keyboards/planck/keymaps/priyadi/readme.md @@ -0,0 +1,11 @@ +# Priyadi's Planck Layout + +Features: + +- Supports QWERTY, Colemak and Workman layouts. +- Cursor and nav cluster on home row. +- Hybrid number row and numpad, located on home row. +- Number layer supports hexadecimal input. +- Left and right side modifiers. +- Emoji layer. An entire layer filled with common emojis. +- Faux-clickey (poor man's replacement for Cherry blue switches) \ No newline at end of file diff --git a/keyboards/planck/keymaps/priyadi/rules.mk b/keyboards/planck/keymaps/priyadi/rules.mk new file mode 100644 index 000000000000..694d38b3f8ba --- /dev/null +++ b/keyboards/planck/keymaps/priyadi/rules.mk @@ -0,0 +1,27 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +UNICODEMAP_ENABLE = yes # Unicode map +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +ifeq ($(strip $(KEYBOARD)), planck/rev4) +BACKLIGHT_ENABLE = yes +AUDIO_ENABLE = no +endif + +ifeq ($(strip $(KEYBOARD)), planck/rev6) +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/prog_qgmlwb/.gitignore b/keyboards/planck/keymaps/prog_qgmlwb/.gitignore new file mode 100644 index 000000000000..a39c64224957 --- /dev/null +++ b/keyboards/planck/keymaps/prog_qgmlwb/.gitignore @@ -0,0 +1,3 @@ +build +printout +scripts diff --git a/keyboards/planck/keymaps/prog_qgmlwb/config.h b/keyboards/planck/keymaps/prog_qgmlwb/config.h new file mode 100644 index 000000000000..b52b41746a36 --- /dev/null +++ b/keyboards/planck/keymaps/prog_qgmlwb/config.h @@ -0,0 +1,12 @@ +// Copyright 2022 David Kristoffersen (@davidkristoffersen) +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#define ENABLE_COMPILE_KEYCODE + +// Userspace defines +// #define SPLIT_SPACE +// #define NO_SPECIAL_SHIFT +#define LAYER_EN QGMLWB_EN +#define LAYER_NO QGMLWB_NO diff --git a/keyboards/planck/keymaps/prog_qgmlwb/keymap.c b/keyboards/planck/keymaps/prog_qgmlwb/keymap.c new file mode 100644 index 000000000000..72e67ac3e7b7 --- /dev/null +++ b/keyboards/planck/keymaps/prog_qgmlwb/keymap.c @@ -0,0 +1,4 @@ +// Copyright 2022 David Kristoffersen (@davidkristoffersen) +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "src/layouts.h" diff --git a/keyboards/planck/keymaps/prog_qgmlwb/readme.md b/keyboards/planck/keymaps/prog_qgmlwb/readme.md new file mode 100644 index 000000000000..e9117507cd3f --- /dev/null +++ b/keyboards/planck/keymaps/prog_qgmlwb/readme.md @@ -0,0 +1,82 @@ +# PROG-QGMLWB + +The prog-qgmlwb layout is a QMK firmware layout for the Planck keyboard. + +For letter placement, the layout uses the optimized QGMLWB layout from the [Carpalx project](http://mkweb.bcgsc.ca/carpalx). + +> The carpalx project introduces a quantitative model for typing effort and applies it to (a) evaluate QWERTY and popular alternatives, such as Dvorak and Colemak and (b) find the keyboard layouts that minimize typing effort for a given set of input documents. + +Carpalx named "QGMLWB" as the fully optimized layout according to the English alphabet, with an effort reduction of approximately 44.4%. + +The programming part of the name is inspired by the modified version of Dvorak, [Programmer Dvorak](http://programmer-dvorak.appspot.com), where the symbols have been adjusted logically for developers. + +The final layout swaps some Dvorak symbols and combines them with the QGMLWB letters, giving it the name **prog-qgmlwb**. + +The layout includes an English and Norwegian layer, whereas the Norwegian one only adds the three letters; æ, ø, and å. + +## Typing layers + +![Typing layers](https://i.imgur.com/QaHnqW8.png) + +## Adjust layer + +![Adjust layer](https://i.imgur.com/63I69P0.png) + +## Usage + +### Clone the QMK Firmware repo + +```bash +git clone --recurse-submodules https://github.com/qmk/qmk_firmware.git +``` + +### Move into this keymap + +```bash +cd /keyboards/planck/keymaps/prog_qgmlwb +``` + +### Initialize QMK the first time + +Set default keyboard: + +```bash +qmk config user.keyboard=planck/ +``` + +Set default keymap: + +```bash +qmk config user.keymap=prog_qgmlwb +``` + +Initialize libraries: + +```bash +qmk setup +``` + +### Compile and flash the keyboard + +```bash +qmk compile +qmk flash +``` + +## QMK documentation + +Found in the QMK docs: + +## Printing layout + +This keymap uses macros such that [qmk configurator](https://config.qmk.fm) cannot match its behavior. The images was designed using [Figma](https://figma.com). + +## Future additions + +Features disabled due to the lack of storage space in the Planck PCB version 5: + +- Audio +- Plover mode +- Use alt codes to fix missing characters in the english layout +- Improve documentation of code and readme files +- Reimplement right version of modifier keys through raise+space diff --git a/keyboards/planck/keymaps/prog_qgmlwb/rules.mk b/keyboards/planck/keymaps/prog_qgmlwb/rules.mk new file mode 100644 index 000000000000..7431d9e0b7c8 --- /dev/null +++ b/keyboards/planck/keymaps/prog_qgmlwb/rules.mk @@ -0,0 +1,6 @@ +# Compiler source files +SRC += src/layouts.c + +USER_NAME := davidkristoffersen + +SIZE_OPTIMIZE = yes diff --git a/keyboards/planck/keymaps/prog_qgmlwb/src/enums.h b/keyboards/planck/keymaps/prog_qgmlwb/src/enums.h new file mode 100644 index 000000000000..0c03b5dd04d7 --- /dev/null +++ b/keyboards/planck/keymaps/prog_qgmlwb/src/enums.h @@ -0,0 +1,23 @@ +// Copyright 2022 David Kristoffersen (@davidkristoffersen) +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +// Layouts enum +enum keyboard_layouts { + QGMLWB_NO, + QGMLWB_EN, + + QWERTY, + COLEMAK, + DVORAK, + + NORMAL_LOWER, + NORMAL_RAISE, + + QGMLWB_LOWER, + QGMLWB_RAISE, + + ADJUST, + NUMPAD, +}; diff --git a/keyboards/planck/keymaps/prog_qgmlwb/src/layouts.c b/keyboards/planck/keymaps/prog_qgmlwb/src/layouts.c new file mode 100644 index 000000000000..54ff411d8667 --- /dev/null +++ b/keyboards/planck/keymaps/prog_qgmlwb/src/layouts.c @@ -0,0 +1,25 @@ +// Copyright 2022 David Kristoffersen (@davidkristoffersen) +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "layouts.h" +#ifdef LAYER_NO +# include "sendstring_norwegian.h" +#endif + +KEYMAP keymaps [][MATRIX_ROWS][MATRIX_COLS] = { + [QGMLWB_NO] = qgmlwb_no_map, + [QGMLWB_EN] = qgmlwb_en_map, + + [QWERTY] = qwerty_map, + [COLEMAK] = colemak_map, + [DVORAK] = dvorak_map, + + [NORMAL_LOWER] = normal_lower_map, + [NORMAL_RAISE] = normal_raise_map, + + [QGMLWB_LOWER] = qgmlwb_lower_map, + [QGMLWB_RAISE] = qgmlwb_raise_map, + + [ADJUST] = adjust_map, + [NUMPAD] = numpad_map, +}; diff --git a/keyboards/planck/keymaps/prog_qgmlwb/src/layouts.h b/keyboards/planck/keymaps/prog_qgmlwb/src/layouts.h new file mode 100644 index 000000000000..19cbefb9abb8 --- /dev/null +++ b/keyboards/planck/keymaps/prog_qgmlwb/src/layouts.h @@ -0,0 +1,27 @@ +// Copyright 2022 David Kristoffersen (@davidkristoffersen) +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include QMK_KEYBOARD_H + +#include "davidkristoffersen.h" +#include "enums.h" + +#include "normal.h" +#include "qgmlwb.h" +#include "special.h" + +#define KEYMAP const uint16_t PROGMEM + +// Layouts keycodes +#define lower MO(NORMAL_LOWER) +#define raise MO(NORMAL_RAISE) + +#define QLower MO(QGMLWB_LOWER) +#define QRaise MO(QGMLWB_RAISE) + +#define adjust MO(ADJUST) +#define numpad MO(NUMPAD) + +extern KEYMAP keymaps [][MATRIX_ROWS][MATRIX_COLS]; diff --git a/keyboards/planck/keymaps/prog_qgmlwb/src/normal.h b/keyboards/planck/keymaps/prog_qgmlwb/src/normal.h new file mode 100644 index 000000000000..98909c43951f --- /dev/null +++ b/keyboards/planck/keymaps/prog_qgmlwb/src/normal.h @@ -0,0 +1,96 @@ +// Copyright 2022 David Kristoffersen (@davidkristoffersen) +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include "layouts.h" + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ;: |Return| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | ,< | .> | /? | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt |NumPad| GUI | Lower| Space| Space| Raise| Left | Down | Up | Right| + * `-----------------------------------------------------------------------------------' +*/ +#define qwerty_map LAYOUT_ortho_4x12( + 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_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LALT, numpad, KC_LGUI, lower, KC_SPC, KC_SPC, raise, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT +) + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O |Return| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt |NumPad| GUI | Lower| Space| Space| Raise| Left | Down | Up | Right| + * `-----------------------------------------------------------------------------------' +*/ +#define colemak_map LAYOUT_ortho_4x12( + 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_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, + KC_LCTL, KC_LALT, numpad, KC_LGUI, lower, KC_SPC, KC_SPC, raise, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT +) + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S |Return| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt |NumPad| GUI | Lower| Space| Space| Raise| Left | Down | Up | Right| + * `-----------------------------------------------------------------------------------' +*/ +#define dvorak_map LAYOUT_ortho_4x12( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_SLSH, + KC_LCTL, KC_LALT, numpad, KC_LGUI, lower, KC_SPC, KC_SPC, raise, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT +) + +/* Lower - Normal + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | End | Home | XXXX | XXXX | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' +*/ +#define normal_lower_map LAYOUT_ortho_4x12( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_END, KC_HOME, XXXXXXX, XXXXXXX, _______, + _______, _______, _______, _______, _______, _______, _______, adjust, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +) + +/* Raise - Normal + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | # | \ | PgDn | PgUp | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' +*/ +#define normal_raise_map LAYOUT_ortho_4x12( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HASH, KC_BSLS, KC_PGDN, KC_PGUP, _______, + _______, _______, _______, _______, adjust, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +) diff --git a/keyboards/planck/keymaps/prog_qgmlwb/src/qgmlwb.h b/keyboards/planck/keymaps/prog_qgmlwb/src/qgmlwb.h new file mode 100644 index 000000000000..290fee765d75 --- /dev/null +++ b/keyboards/planck/keymaps/prog_qgmlwb/src/qgmlwb.h @@ -0,0 +1,63 @@ +// Copyright 2022 David Kristoffersen (@davidkristoffersen) +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include "layouts.h" + +/* QGMLWB + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | G | M | L | W | B | Y | U | V | '" | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | D | S | T | N | R | I | A | E | O | H |Return| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | F | J | K | P | ,; | .: | -_ | \| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt |NumPad| GUI | Lower|LSpace|RSpace| Raise| Left | Down | Up | Right| + * `-----------------------------------------------------------------------------------' +*/ +// English Layout +#define qgmlwb_en_map LAYOUT_ortho_4x12(\ + KC_TAB, KC_Q, KC_G, KC_M, KC_L, KC_W, KC_B, KC_Y, KC_U, KC_V, KC_QUOT, KC_BSPC,\ + KC_ESC, KC_D, KC_S, KC_T, KC_N, KC_R, KC_I, KC_A, KC_E, KC_O, KC_H, KC_ENT,\ + KC_LSFT, KC_Z, KC_X, KC_C, KC_F, KC_J, KC_K, KC_P, KC_COMM, KC_DOT, KC_MINS, KC_BSLS,\ + KC_LCTL, KC_LALT, numpad, KC_LGUI, QLower, SC_LSPC, SC_RSPC, QRaise, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT\ +) +// Norwegian Layout +#define qgmlwb_no_map qgmlwb_en_map + +/* Lower - QGMLWB + * ,-----------------------------------------------------------------------------------. + * | ! | % | [ | { | ( | < | > | ) | } | ] | & | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | Mute | XXXX | Refr | XXXX | XXXX | XXXX | = | + | * | / | ~ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Sleep|ScrLck| Caps |NumLck|PrtScr| Ins | End | Home | Æ | Ø | Å | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | |Adjust| Bri- | Vol- | Vol+ | Bri+ | + * `-----------------------------------------------------------------------------------' +*/ +#define qgmlwb_lower_map LAYOUT_ortho_4x12(\ + KC_EXLM, KC_PERC, KC_LBRC, KC_LCBR, KC_LPRN, KC_LT, KC_GT, KC_RPRN, KC_RCBR, KC_RBRC, KC_AMPR, _______,\ + KC_DEL, KC_MUTE, XXXXXXX, KC_WREF, XXXXXXX, XXXXXXX, XXXXXXX, KC_EQL, KC_PLUS, KC_ASTR, KC_SLSH, KC_TILD,\ + _______, KC_SLEP, KC_SCRL, KC_CAPS, KC_NUM, KC_PSCR, KC_INS, KC_END, KC_HOME, KC_AE, KC_OE, KC_AA,\ + _______, _______, _______, _______, _______, _______, _______, adjust, KC_BRID, KC_VOLD, KC_VOLU, KC_BRIU\ +) + +/* Raise - QGMLWB + * ,-----------------------------------------------------------------------------------. + * | ? | 9 | 7 | 5 | 3 | 1 | 0 | 2 | 4 | 6 | 8 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del+ | F1 | F2 | F3 | F4 | F5 | F6 | # | @ | ^ | $ | ` | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |RShift| F7 | F8 | F9 | F10 | F11 | F12 | PgDn | PgUp | XXXX | XXXX | XXXX | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | RCtrl| RAlt | | |Adjust| | | | Prev | Stop | Play | Next | + * `-----------------------------------------------------------------------------------' +*/ +#define qgmlwb_raise_map LAYOUT_ortho_4x12(\ + KC_QUES, KC_9, KC_7, KC_5, KC_3, KC_1, KC_0, KC_2, KC_4, KC_6, KC_8, _______,\ + S(KC_DEL), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_HASH, KC_AT, KC_CIRC, KC_DLR, KC_GRV,\ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PGDN, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX,\ + _______, _______, _______, _______, adjust, _______, _______, _______, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT\ +) diff --git a/keyboards/planck/keymaps/prog_qgmlwb/src/special.h b/keyboards/planck/keymaps/prog_qgmlwb/src/special.h new file mode 100644 index 000000000000..bff1e4c5ab50 --- /dev/null +++ b/keyboards/planck/keymaps/prog_qgmlwb/src/special.h @@ -0,0 +1,43 @@ +// Copyright 2022 David Kristoffersen (@davidkristoffersen) +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include "layouts.h" + +/* Adjust + * v------------------------RGB CONTROL--------------------v + * ,-----------------------------------------------------------------------------------. + * | | Reset| Debug| RGB |RGBMod| Hue- | Hue+ | Sat- | Sat+ | Bri- | Bri+ | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | XXXX |MusMod|AudOff| AudOn|AgNorm|AgSwap|Dvorak|Colmak|Qwerty|QgmlEN|QgmlNO| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|MusOff| MusOn|MIDIOf|MIDIOn| | | T0 | T1 | T2 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | XXXX | XXXX | XXXX | XXXX | + * `-----------------------------------------------------------------------------------' +*/ +#define adjust_map LAYOUT_ortho_4x12(\ + QK_RBT, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, KC_DEL,\ + QK_MAKE, XXXXXXX, MU_NEXT, AU_OFF, AU_ON, AG_NORM, AG_SWAP, DF(DVORAK), DF(COLEMAK), DF(QWERTY), DF(QGMLWB_EN), DF(QGMLWB_NO),\ + _______, AU_NEXT, AU_PREV, MU_OFF, MU_ON, MI_OFF, MI_ON, _______, _______, KC_T0, KC_T1, KC_T2,\ + _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX\ +) + +/* Numpad + * ,-----------------------------------------------------------------------------------. + * | | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | 7 | 8 | 9 | / | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | 4 | 5 | 6 | * | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | 1 | 2 | 3 | - | XXXX | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | XXXX | | | 0 | , | . | + | XXXX | + * `-----------------------------------------------------------------------------------' +*/ +#define numpad_map LAYOUT_ortho_4x12(\ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_7, KC_8, KC_9, KC_KP_SLASH, _______,\ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_4, KC_5, KC_6, KC_KP_ASTERISK, _______,\ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, KC_KP_MINUS, XXXXXXX,\ + _______, _______, _______, _______, XXXXXXX, _______, _______, KC_0, KC_COMM, KC_DOT, KC_KP_PLUS, XXXXXXX\ +) diff --git a/keyboards/planck/keymaps/ptillemans/config.h b/keyboards/planck/keymaps/ptillemans/config.h new file mode 100644 index 000000000000..c88a9c01497a --- /dev/null +++ b/keyboards/planck/keymaps/ptillemans/config.h @@ -0,0 +1,40 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + + +// setup double tapping to lock layers +#define TAPPING_TERM 175 +#define TAPPING_TOGGLE 2 diff --git a/keyboards/planck/keymaps/ptillemans/keymap.c b/keyboards/planck/keymaps/ptillemans/keymap.c new file mode 100644 index 000000000000..6d55617f7ff3 --- /dev/null +++ b/keyboards/planck/keymaps/ptillemans/keymap.c @@ -0,0 +1,324 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +#define MY_SHEN MT(MOD_LSFT, KC_ENT) +#define MY_CTES MT(MOD_LCTL, KC_ESC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Q | W | E | R | T | PgUp | Up | Y | U | I | O | P | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | A | S | D | F | G | PgDn | Down | H | J | K | L | ; | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Z | X | C | V | B | Home | End | N | M | , | . | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Raise| Tab | super| Alt | BS | Ctrl/Esc |Spc/Alt| Lower| ' | \ |Sh/Ent| + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_PGUP, KC_UP, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_PGDN, KC_DOWN, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_HOME, KC_END, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, + LOWER, KC_TAB, KC_LGUI, KC_LSFT, KC_BSPC, MY_CTES, MY_CTES, KC_SPC, RAISE, KC_QUOT,KC_MINUS, MY_SHEN +), +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB , KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + MY_CTES, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, MY_SHEN , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | Ins | Home | Up | End | PgUp | | | | F7 | F8 | F9 | F10 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | Left | Down |Right | PgDn | | | | F4 | F5 | F6 | F11 | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Vol+ | | | | | | | F1 | F2 | F3 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Vol- | | | Next | | | |PrtScr| Lock | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_PERC, KC_CIRC, KC_AMPR, KC_F7, KC_F8, KC_F9, KC_F10, + KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, KC_F4, KC_F5, KC_F6, KC_F11, + _______, KC_VOLU, _______, _______, _______, _______, _______, KC_TILD, KC_F1, KC_F2, KC_F3, KC_F12, + _______, KC_VOLD, _______, _______, KC_MNXT, _______, _______, _______, TO(_QWERTY), KC_PSCR, KC_SCRL, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ! | @ | Up | _ | + | | | PgUp | 7 | 8 | 9 | * | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | # | Left | Down |Right | $ | | | PgDn | 4 | 5 | 6 | + +| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | [ | ] | ( | ) | & | | | ` | 1 | 2 | 3 | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | . | 0 | = | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_EXLM, KC_AT, KC_UP, KC_UNDS, KC_PLUS, _______, _______, KC_PGUP, KC_7, KC_8, KC_9, KC_ASTR, + KC_HASH, KC_LEFT, KC_DOWN, KC_RGHT, KC_DLR, _______, _______, KC_PGDN, KC_4, KC_5, KC_6, KC_PLUS, + KC_MINS, KC_EQL, KC_LPRN, KC_RPRN, KC_AMPR, _______, _______, KC_GRV, KC_1, KC_2, KC_3, KC_BSLS, + _______, _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY), KC_DOT, KC_0, KC_RBRC +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap| |Qwerty|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, QWERTY, DVORAK, PLOVER, _______, + BACKLIT, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_DOWN); + unregister_code(KC_MS_WH_DOWN); + #else + register_code(KC_PGDN); + unregister_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_UP); + unregister_code(KC_MS_WH_UP); + #else + register_code(KC_PGUP); + unregister_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } + return true; +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/ptillemans/readme.md b/keyboards/planck/keymaps/ptillemans/readme.md new file mode 100644 index 000000000000..de9680b49851 --- /dev/null +++ b/keyboards/planck/keymaps/ptillemans/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/ptillemans/rules.mk b/keyboards/planck/keymaps/ptillemans/rules.mk new file mode 100644 index 000000000000..c329d16ff8a9 --- /dev/null +++ b/keyboards/planck/keymaps/ptillemans/rules.mk @@ -0,0 +1,2 @@ +SRC += muse.c +BACKLIGHT_ENABLE = yes diff --git a/keyboards/planck/keymaps/raffle/config.h b/keyboards/planck/keymaps/raffle/config.h new file mode 100644 index 000000000000..d21e85693a48 --- /dev/null +++ b/keyboards/planck/keymaps/raffle/config.h @@ -0,0 +1,35 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/raffle/keymap.c b/keyboards/planck/keymaps/raffle/keymap.c new file mode 100644 index 000000000000..08059e1d4068 --- /dev/null +++ b/keyboards/planck/keymaps/raffle/keymap.c @@ -0,0 +1,305 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "action_layer.h" +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, + _NAV, + _DEV +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + BACKLIT, + // my macros + R_ASGN, + R_PIPE, + R_CMLN, +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +// my defs +#define LT_ESC LT(_NAV, KC_ESC) //tap for esc, hold for mouse nav layer +#define DEV MO(_DEV) // get to dev layer +#define KC_CAD LALT(LCTL(KC_DEL)) // because awkwardness + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | CTRL | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ESC | APP | GUI | ALT |Lower | Space |Raise | DEV | | | | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + LT_ESC, KC_APP, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, DEV, _______, _______, _______ +), + + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Home | END | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | DEL | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_HOME, KC_END, _______, _______, + KC_DEL, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | |Pg Up |Pg Dn | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | | | | | | | Next | Vol- | Vol+ | Play + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_PGUP, KC_PGDN, _______, _______, + KC_DEL, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Nav Layer + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | PGUP | UP | PGDN | |KC_CAD| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | HOME | LEFT | DOWN |RIGHT | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | END | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_NAV] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_UP, KC_PGDN, _______, KC_CAD, + _______, _______, _______, _______, _______, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, KC_END, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* DEV Layer + * ,-----------------------------------------------------------------------------------. + * | | | |R_CMLM| | | | | | | |KC_CAD| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | |R_ASGN|R_PIPE| | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_DEV] = LAYOUT_planck_grid( + _______, _______, _______, R_CMLN, _______, _______, _______, _______, _______, _______, _______, KC_CAD, + _______, _______, _______, _______, _______, _______, _______, R_ASGN, R_PIPE, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + // my macros + case R_ASGN: + if (record->event.pressed) { + SEND_STRING(" <- "); + } + return false; + break; + case R_PIPE: + if (record->event.pressed) { + SEND_STRING(" %>%\n"); + } + return false; + break; + case R_CMLN: + if (record->event.pressed) { + SEND_STRING("################################################################################"); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } + return true; +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/raffle/readme.md b/keyboards/planck/keymaps/raffle/readme.md new file mode 100644 index 000000000000..4cfb312b9518 --- /dev/null +++ b/keyboards/planck/keymaps/raffle/readme.md @@ -0,0 +1,11 @@ +# Raffle's Planck Layout + +- Caps -> LCtrl +- LCtrol -> Nav Layer + + Nav uses pok3r-like nav (IJKL, H/N for home/end, U/P for pgup/pgdn) +- RArrow -> Dev layer + + handy macros for R programming + +Also removes keymaps I don't use (dvorak, etc). + + diff --git a/keyboards/planck/keymaps/raffle/rules.mk b/keyboards/planck/keymaps/raffle/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/raffle/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/rennerom/config.h b/keyboards/planck/keymaps/rennerom/config.h new file mode 100644 index 000000000000..af93b5e2cec3 --- /dev/null +++ b/keyboards/planck/keymaps/rennerom/config.h @@ -0,0 +1,38 @@ +// Copyright 2022 Max Renner (@rennerom) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) +/* + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +*/ +#endif + +#define TAPPING_TERM 200 + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +// Most tactile encoders have detents every 4 stages +//#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/rennerom/keymap.c b/keyboards/planck/keymaps/rennerom/keymap.c new file mode 100644 index 000000000000..67394b8964bc --- /dev/null +++ b/keyboards/planck/keymaps/rennerom/keymap.c @@ -0,0 +1,174 @@ +// Copyright 2022 Max Renner (@rennerom) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H +#include "muse.h" + + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, + _FN, + _NAV +}; + + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define ESCNAV LT(_NAV, KC_ESC) +#define WORDL LALT(KC_LEFT) +#define WORDR LALT(KC_RGHT) +#define EOL LGUI(KC_RIGHT) +#define BOL LGUI(KC_LEFT) +#define SPOTLT LGUI(KC_SPC) +#define VBA LSFT(LALT(KC_F11)) +#define UNDO LGUI(KC_Z) +#define CUT LGUI(KC_X) +#define COPY LGUI(KC_C) +#define PSTE LGUI(KC_V) +#define ALL LGUI(KC_A) +#define FIND LGUI(KC_F) +#define SAVE LGUI(KC_S) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |ESCNAV| A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |shfent| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + ESCNAV, 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, SC_SENT , + FN, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* fn + * ,------------------------------------------------------------------------------------. + * | | f1 | f2 | f3 | f4 | | | | | | | | + * ,------------------------------------------------------------------------------------. + * | | f5 | f6 | f7 | f8 | | | | | | | | + * ,------------------------------------------------------------------------------------. + * | | f9 | f10 | f11 | f12 | | | | | | | | + * ,------------------------------------------------------------------------------------. + * | | | | | | | | | | | | + * ,------------------------------------------------------------------------------------. + */ + +[_FN] = LAYOUT_planck_grid( + _______, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, _______, _______, _______, _______, _______, + _______, KC_F5, KC_F6, KC_F7, KC_F8, _______, _______, _______, _______, _______, _______, _______, + _______, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* NAV + * ,------------------------------------------------------------------------------------. + * | | | WORDL| WORDR| | | | |Insert| | | Del | + * ,------------------------------------------------------------------------------------. + * | | | | | | | Left | Down | Up | Right| | | + * ,------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * ,------------------------------------------------------------------------------------. + * | | | | | |OpenSpotlight| | | | | | + * ,------------------------------------------------------------------------------------. + */ + +[_NAV] = LAYOUT_planck_grid( + _______, _______, WORDL, WORDR, _______, _______, _______, KC_INS , _______, _______, _______, KC_DEL, + _______, ALL, SAVE, _______, FIND, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, + _______, UNDO, CUT, COPY, PSTE, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, SPOTLT, SPOTLT, _______, _______, _______, _______, _______ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ` ~ | 1 ! | 2 @ | 3 # | 4 $ | 5 % | 6 ^ | 7 & | 8 * | 9 ( | 0 ) | Bksp | + * ,------------------------------------------------------------------------------------. + * | Del | { [ | } ] | ( | ) | - _ | + | = | * | % | _ | \ | | + * ,------------------------------------------------------------------------------------. + * | | ! | @ | # | $ | % | ^ | & | * | | | | + * ,------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * ,------------------------------------------------------------------------------------. + */ + +[_LOWER] = LAYOUT_planck_grid( + 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_DEL, KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_MINS, KC_PLUS, KC_EQL, KC_ASTR, KC_PERC, KC_UNDS, KC_BSLS, + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Raise + * ,------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * ,------------------------------------------------------------------------------------. + * | Del | | | | | | | | | | | | + * ,------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * ,------------------------------------------------------------------------------------. + * | | | | | | | | |Brite-|Brite+| Vol- | Vol+ | + * ,------------------------------------------------------------------------------------. + */ + +[_RAISE] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_DEL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, VBA, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU +), + +/* Adjust (Lower + Raise) + * ,------------------------------------------------------------------------------------. + * | | f1 | f2 | f3 | f4 |RGBTOG| |HUE - |HUE + | |Debug |Reset | + * ,------------------------------------------------------------------------------------. + * | | f5 | f6 | f7 | f8 |RGBM -|RGBM +|SAT - |SAT + | | | | + * ,------------------------------------------------------------------------------------. + * | | f9 | f10 | f11 | f12 |RGBsp-|RGBsp+|VIB - |VIB + | | | | + * ,------------------------------------------------------------------------------------. + * | | | | | | | | | | | | + * ,------------------------------------------------------------------------------------. + */ + +[_ADJUST] = LAYOUT_planck_grid( + _______, KC_F1, KC_F2, KC_F3, KC_F4, RGB_TOG, _______, RGB_HUD, RGB_HUI, _______, DB_TOGG, QK_BOOT, + _______, KC_F5, KC_F6, KC_F7, KC_F8, RGB_RMOD, RGB_MOD, RGB_SAD, RGB_SAI, _______, _______, _______, + _______, KC_F9, KC_F10, KC_F11, KC_F12, RGB_SPD, RGB_SPI, RGB_VAD, RGB_VAI, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +/* fn + * ,------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * ,------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * ,------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * ,------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * ,------------------------------------------------------------------------------------. + */ + +//#ifdef AUDIO_ENABLE +// float plover_song[][2] = SONG(PLOVER_SOUND); +// float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +//#endif + + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} diff --git a/keyboards/planck/keymaps/rennerom/readme.md b/keyboards/planck/keymaps/rennerom/readme.md new file mode 100644 index 000000000000..81d580bba30c --- /dev/null +++ b/keyboards/planck/keymaps/rennerom/readme.md @@ -0,0 +1,2 @@ +# A Modified Default Planck Layout + diff --git a/keyboards/planck/keymaps/rennerom/rules.mk b/keyboards/planck/keymaps/rennerom/rules.mk new file mode 100644 index 000000000000..acf0896a321b --- /dev/null +++ b/keyboards/planck/keymaps/rennerom/rules.mk @@ -0,0 +1 @@ +SRC += muse.c \ No newline at end of file diff --git a/keyboards/planck/keymaps/rjhilgefort/config.h b/keyboards/planck/keymaps/rjhilgefort/config.h new file mode 100644 index 000000000000..9020d2b9f882 --- /dev/null +++ b/keyboards/planck/keymaps/rjhilgefort/config.h @@ -0,0 +1,36 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/rjhilgefort/keymap.c b/keyboards/planck/keymaps/rjhilgefort/keymap.c new file mode 100644 index 000000000000..08e9809e907f --- /dev/null +++ b/keyboards/planck/keymaps/rjhilgefort/keymap.c @@ -0,0 +1,251 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + + +enum planck_layers { + _MAC, + _LINUX, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + MAC = SAFE_RANGE, + LINUX, + BACKLIT, +}; + +#define ALT_ESC ALT_T(KC_ESC) +#define CTL_ESC CTL_T(KC_ESC) +#define GUI_ESC GUI_T(KC_ESC) +#define HYPER LGUI(LSFT(KC_LALT)) + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_MAC] = LAYOUT_planck_grid( +// ,-----------------------------------------------------------------------------------------------------------. + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, +// |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + CTL_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, +// |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, RAISE, ALT_ESC, KC_LGUI, KC_SPC, KC_SPC, LOWER, HYPER, _______, _______, _______ +// ,-----------------------------------------------------------------------------------------------------------. +), + +[_LINUX] = LAYOUT_planck_grid( +// ,-----------------------------------------------------------------------------------------------------------. + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, +// |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + ALT_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, +// |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, RAISE, GUI_ESC, KC_LCTL, KC_SPC, KC_SPC, LOWER, HYPER, _______, _______, _______ +// ,-----------------------------------------------------------------------------------------------------------. +), + +[_LOWER] = LAYOUT_planck_grid( +// ,-----------------------------------------------------------------------------------------------------------. + _______, KC_BSLS, KC_SLSH, KC_LBRC, KC_RBRC, KC_TILD, KC_PIPE, KC_EQL, KC_PLUS, KC_MINS, KC_UNDS, _______, +// |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, KC_GRV, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, _______, _______, +// |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, +// |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +// ,-----------------------------------------------------------------------------------------------------------. +), + +[_RAISE] = LAYOUT_planck_grid( +// ,-----------------------------------------------------------------------------------------------------------. + _______, _______, KC_BRID, KC_VOLU, KC_BRIU, _______, _______, KC_7, KC_8, KC_9, KC_ASTR, _______, +// |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, KC_MUTE, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_4, KC_5, KC_6, KC_PLUS, _______, +// |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, KC_VOLD, _______, _______, _______, KC_1, KC_2, KC_3, KC_BSLS, _______, +// |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, _______, _______ +// ,-----------------------------------------------------------------------------------------------------------. +), + +[_ADJUST] = LAYOUT_planck_grid( +// ,-----------------------------------------------------------------------------------------------------------. + _______, MAC, LINUX, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, +// |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +// ,-----------------------------------------------------------------------------------------------------------. +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case MAC: + if (record->event.pressed) { + set_single_persistent_default_layer(_MAC); + } + return false; + break; + case LINUX: + if (record->event.pressed) { + set_single_persistent_default_layer(_LINUX); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + writePinLow(E6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + writePinHigh(E6); + #endif + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_song); } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_gb_song); } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } + return true; +} + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/rjhilgefort/readme.md b/keyboards/planck/keymaps/rjhilgefort/readme.md new file mode 100644 index 000000000000..08c073178559 --- /dev/null +++ b/keyboards/planck/keymaps/rjhilgefort/readme.md @@ -0,0 +1,100 @@ +# [🐦 @rjhilgefort](https://twitter.com/rjhilgefort) Planck Layout + +Fairly straight forward Planck layout, but arranges the symbols more toward coding and features a Mac and Linux base layer instead of multiple Alpha layouts. + +![Imgur](https://i.imgur.com/elygxAb.jpg) + +## Features + +Here's some highlights/features of the layout. + +- Ergonomic symbols layer. +- Media and Numpad layer. +- Supports Mac and Linux as 1st class citizens giving each a dedicated base layer and a media layer for each that matches media keys for each OS. The Linux default layer focuses on `Ctrl` instead of `Super` and vice versa for Mac. (When you set Linux as your base layer, the Linux media layer is what you shift into. Same for the Mac layer when that's the base) + +## Layers + +#### Base (Mac) + +``` +,-----------------------------------------------------------------------------------------------------------. + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + CTL_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, +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, RAISE, ALT_ESC, KC_LGUI, KC_SPC, KC_SPC, LOWER, HYPER, _______, _______, _______ +,-----------------------------------------------------------------------------------------------------------. +``` + +#### Base (Linux) + +``` +,-----------------------------------------------------------------------------------------------------------. + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + ALT_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, +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, RAISE, GUI_ESC, KC_LCTL, KC_SPC, KC_SPC, LOWER, HYPER, _______, _______, _______ +,-----------------------------------------------------------------------------------------------------------. +``` + +#### Lower: Symbol Layer + +``` +,-----------------------------------------------------------------------------------------------------------. + _______, KC_BSLS, KC_SLSH, KC_LBRC, KC_RBRC, KC_TILD, KC_PIPE, KC_EQL, KC_PLUS, KC_MINS, KC_UNDS, _______, +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, KC_GRV, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, _______, _______, +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +,-----------------------------------------------------------------------------------------------------------. +``` + +#### Raise: Media & Numbers + +``` +,-----------------------------------------------------------------------------------------------------------. + _______, _______, KC_BRID, KC_VOLU, KC_BRIU, _______, _______, KC_7, KC_8, KC_9, KC_ASTR, _______, +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, KC_MUTE, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_4, KC_5, KC_6, KC_PLUS, _______, +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, KC_VOLD, _______, _______, _______, KC_1, KC_2, KC_3, KC_BSLS, _______, +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, _______, _______ +,-----------------------------------------------------------------------------------------------------------. +``` + +#### Adjust + +``` +,-----------------------------------------------------------------------------------------------------------. + _______, MAC, LINUX, _______, _______, _______, _______, _______, _______, _______, _______, _______, +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +,-----------------------------------------------------------------------------------------------------------. +) +``` + +## Building And Flashing + +#### CLI + +``` +sudo make planck/rev6:rjhilgefort-dualos:flash +``` + +#### Docker + +``` +util/docker_build.sh planck/rev6:rjhilgefort-dualos:flash +``` diff --git a/keyboards/planck/keymaps/rjhilgefort/rules.mk b/keyboards/planck/keymaps/rjhilgefort/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/rjhilgefort/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/rodhaene/config.h b/keyboards/planck/keymaps/rodhaene/config.h new file mode 100644 index 000000000000..a63f3c2f23eb --- /dev/null +++ b/keyboards/planck/keymaps/rodhaene/config.h @@ -0,0 +1,10 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + +#endif + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/rodhaene/keymap.c b/keyboards/planck/keymaps/rodhaene/keymap.c new file mode 100644 index 000000000000..2cf441bf1670 --- /dev/null +++ b/keyboards/planck/keymaps/rodhaene/keymap.c @@ -0,0 +1,196 @@ +/* Copyright 2018 Robert Dhaene + * + * 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 QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _NUMPAD, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + NUMPAD, + LOWER, + RAISE, + BACKLIT, + EXT_NUMPAD +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; |Delete| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | | Alt | GUI |Lower |Enter |Space |Raise | Left | Up | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_DEL, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT , + KC_LCTL, _______, KC_LALT, KC_LGUI, LOWER, KC_ENT, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT +), + +/* Number Pad + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | 7 | 8 | 9 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | 4 | 5 | 6 |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | 1 | 2 | 3 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | | | | | | 0 | . | | | + * `-----------------------------------------------------------------------------------' + */ +[_NUMPAD] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, KC_7 , KC_8 , KC_9 , KC_BSPC , + _______, _______, _______, _______, _______, _______, _______, _______, KC_4 , KC_5 , KC_6 , KC_ENT , + _______, _______, _______, _______, _______, _______, _______, _______, KC_1 , KC_2 , KC_3 , _______, + EXT_NUMPAD, _______, _______, _______, _______, _______, _______, _______, KC_0 , KC_DOT , _______, _______ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Numpad| | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Brite | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, NUMPAD, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + BACKLIT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + PORTE &= ~(1<<6); + } else { + unregister_code(KC_RSFT); + PORTE |= (1<<6); + } + return false; + break; + case NUMPAD: + if(record->event.pressed) { + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_NUMPAD); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_NUMPAD: + if(record->event.pressed) { + layer_off(_NUMPAD); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/rodhaene/readme.md b/keyboards/planck/keymaps/rodhaene/readme.md new file mode 100644 index 000000000000..de9680b49851 --- /dev/null +++ b/keyboards/planck/keymaps/rodhaene/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/rodhaene/rules.mk b/keyboards/planck/keymaps/rodhaene/rules.mk new file mode 100644 index 000000000000..4b9265909ffe --- /dev/null +++ b/keyboards/planck/keymaps/rodhaene/rules.mk @@ -0,0 +1,19 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/planck/keymaps/roguepullrequest/config.h b/keyboards/planck/keymaps/roguepullrequest/config.h new file mode 100644 index 000000000000..13d3a6370f74 --- /dev/null +++ b/keyboards/planck/keymaps/roguepullrequest/config.h @@ -0,0 +1,8 @@ +#pragma once + + + + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(RICK_ROLL) +#endif diff --git a/keyboards/planck/keymaps/roguepullrequest/keymap.c b/keyboards/planck/keymaps/roguepullrequest/keymap.c new file mode 100644 index 000000000000..61221601e6d9 --- /dev/null +++ b/keyboards/planck/keymaps/roguepullrequest/keymap.c @@ -0,0 +1,254 @@ +#include QMK_KEYBOARD_H + +#ifdef AUDIO_ENABLE + float mushroom[][2] = SONG(MARIO_MUSHROOM); +#endif + + +extern keymap_config_t keymap_config; + +// Complex Tapdance hoopla +typedef struct { + bool is_press_action; + int state; +} tap; + +enum { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, + DOUBLE_TAP = 3, + DOUBLE_HOLD = 4, + TRIPLE_TAP = 5, + TRIPLE_HOLD = 6, +}; + +// Tap dance enums +enum { + X_AT_FUN = 0, + RSHIFT, + LSHIFT, + TD_S, + SLASH +}; + +int cur_dance (tap_dance_state_t *state); + +void x_finished (tap_dance_state_t *state, void *user_data); +void x_reset (tap_dance_state_t *state, void *user_data); +void lshift_finished (tap_dance_state_t *state, void *user_data); +void lshift_reset(tap_dance_state_t *state, void *user_data); + + +bool is_alt_tab_active = false; +uint16_t alt_tab_timer = 0; + +// Modified Programmer Dvorak enums + +enum planck_layers { + _PDVORAK, + _UPPER, + _LOWER, + _FUNCTION, +}; + +enum custom_keycodes { + PDVK = SAFE_RANGE, + KC_LAST, + ALT_TAB +}; + +// For getting the last arg in shell line (SUPER THANKS to Drashna over on Discord) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint16_t macro_timer; + + switch (keycode) { + case ALT_TAB: + if (record->event.pressed) { + if (!is_alt_tab_active) { + is_alt_tab_active = true; + register_code(KC_LALT); + } + alt_tab_timer = timer_read(); + register_code(KC_TAB); + } else { + unregister_code(KC_TAB); + } + break; + } + + switch (keycode){ + case KC_LAST: + if(record->event.pressed){ + macro_timer = timer_read(); + register_mods(MOD_BIT(KC_LCTL)); + } else { + unregister_mods(MOD_BIT(KC_LCTL)); + if (timer_elapsed(macro_timer) < 150) { + SEND_STRING("!$"); + } + } + return false; + } + return true; +} + +void matrix_scan_user(void) { + if (is_alt_tab_active) { + if (timer_elapsed(alt_tab_timer) > 1000) { + unregister_code16(KC_LALT); + is_alt_tab_active = false; + } + } +} + +#define PDVORAK MO(_PDVORAK) +#define LOWER MO(_LOWER) +#define UPPER MO(_UPPER) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + + /* Programmer Dvorak */ + [_PDVORAK] = LAYOUT_planck_grid( + QK_GESC, KC_SCLN, KC_COMMA, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_LAST, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, TD(TD_S), TD(SLASH), + TD(LSHIFT), KC_QUOT, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, TD(RSHIFT), + TD(X_AT_FUN), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, ALT_TAB, KC_SPACE, KC_ENTER, MT(MOD_LCTL | MOD_LSFT, KC_LGUI), KC_PGUP, KC_PGDN, LT(_LOWER, KC_PLUS) + ), + + [_UPPER] = LAYOUT_planck_grid( + KC_GRAVE, KC_AMPR, KC_PERC, KC_NO, KC_NO, KC_EQL, KC_ASTR, KC_NO, KC_NO, KC_EXLM, KC_HASH, KC_TRNS, + KC_PLUS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_BSLS, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS + ), + + [_LOWER] = LAYOUT_planck_grid( + KC_DLR, KC_7, KC_5, KC_3, KC_1, KC_9, KC_0, KC_2, KC_4, KC_6, KC_8, KC_TRNS, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, CK_DOWN, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS + ), + + [_FUNCTION] = LAYOUT_planck_grid( + KC_F11, KC_F7, KC_F5, KC_F3, KC_F1, KC_F9, KC_F12, KC_F2, KC_F4, KC_F6, KC_F8, QK_BOOT, + 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, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS + ), +}; + + +// Super crazy tap dancing stuff - see quad dance in feature_tap_dance.md + +int cur_dance (tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) return SINGLE_TAP; + // key not interrupted, but still held sends 'HOLD' + else return SINGLE_HOLD; + } + else if (state->count == 2) { + if (state->interrupted || !state->pressed) return DOUBLE_TAP; + else return DOUBLE_HOLD; + } + else if (state->count == 3) { + if (state->interrupted || !state->pressed)return TRIPLE_TAP; + else return TRIPLE_HOLD; + } + else return 8; // magic number that i dont believe works. +} + +// instance of tap for the 'X' dance. +static tap xtap_state = { + .is_press_action = true, + .state = 0 +}; + +// registering keypresses +void x_finished (tap_dance_state_t *state, void *user_data) { + xtap_state.state = cur_dance(state); + switch (xtap_state.state) { + case SINGLE_TAP: register_code16(KC_AT); break; + case SINGLE_HOLD: set_oneshot_layer(_UPPER, ONESHOT_START); break; + case DOUBLE_TAP: set_oneshot_layer(_FUNCTION, ONESHOT_START); break; + case DOUBLE_HOLD: reset_keyboard(); break; + } +} + +void lshift_finished (tap_dance_state_t *state, void *user_data) { + xtap_state.state = cur_dance(state); + switch (xtap_state.state) { + case SINGLE_TAP: register_code16(KC_LSFT); register_code16(KC_9); break; + case SINGLE_HOLD: register_code16(KC_LSFT); break; + case DOUBLE_TAP: register_code16(KC_LBRC); break; + case TRIPLE_TAP: register_code16(KC_LSFT); register_code16(KC_LBRC); break; + } +} +void s_finished (tap_dance_state_t *state, void *user_data) { + xtap_state.state = cur_dance(state); + switch (xtap_state.state) { + case SINGLE_TAP: register_code16(KC_S); break; + case DOUBLE_TAP: register_code16(KC_MINUS); break; + case TRIPLE_TAP: register_code16(KC_LSFT); register_code16(KC_MINUS); break; + } +} + +void rshift_finished (tap_dance_state_t *state, void *user_data) { + xtap_state.state = cur_dance(state); + switch (xtap_state.state) { + case SINGLE_TAP: register_code16(KC_LSFT); register_code16(KC_0); break; + case SINGLE_HOLD: register_code16(KC_RSFT); break; + case DOUBLE_TAP: register_code16(KC_RBRC); break; + case TRIPLE_TAP: register_code16(KC_LSFT); register_code16(KC_RBRC); break; + } +} + +// forgetting keypresses + +void x_reset (tap_dance_state_t *state, void *user_data) { + switch (xtap_state.state) { + case SINGLE_TAP: unregister_code16(KC_AT); break; + case SINGLE_HOLD: clear_oneshot_layer_state(ONESHOT_PRESSED); break; + case DOUBLE_TAP: clear_oneshot_layer_state(ONESHOT_PRESSED); break; + case DOUBLE_HOLD: reset_keyboard(); break; + } + xtap_state.state = 0; +} +void lshift_reset (tap_dance_state_t *state, void *user_data) { + switch (xtap_state.state) { + case SINGLE_TAP: unregister_code16(KC_9); unregister_code16(KC_LSFT); break; + case SINGLE_HOLD: unregister_code16(KC_LSFT); break; + case DOUBLE_TAP: unregister_code16(KC_LBRC); break; + case TRIPLE_TAP: unregister_code16(KC_LBRC); unregister_code16(KC_LSFT); break; + } + xtap_state.state = 0; +} + +void rshift_reset (tap_dance_state_t *state, void *user_data) { + switch (xtap_state.state) { + case SINGLE_TAP: unregister_code16(KC_0); unregister_code16(KC_LSFT); break; + case SINGLE_HOLD: unregister_code16(KC_RSFT); break; + case DOUBLE_TAP: unregister_code16(KC_RBRC); break; + case TRIPLE_TAP: unregister_code16(KC_RBRC); unregister_code16(KC_LSFT); break; + } + xtap_state.state = 0; +} +void s_reset (tap_dance_state_t *state, void *user_data) { + switch (xtap_state.state) { + case SINGLE_TAP: unregister_code16(KC_S); break; + case DOUBLE_TAP: unregister_code16(KC_MINUS); break; + case TRIPLE_TAP: unregister_code16(KC_MINUS); unregister_code16(KC_LSFT); break; + } + xtap_state.state = 0; +} +tap_dance_action_t tap_dance_actions[] = { + [X_AT_FUN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, x_finished, x_reset), + [LSHIFT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lshift_finished, lshift_reset), + [RSHIFT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rshift_finished, rshift_reset), + [TD_S] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, s_finished, s_reset), + [SLASH] = ACTION_TAP_DANCE_DOUBLE(KC_SLASH, KC_BSLS), + +}; + +void shutdown_user(void) { clear_keyboard(); } diff --git a/keyboards/planck/keymaps/roguepullrequest/readme.md b/keyboards/planck/keymaps/roguepullrequest/readme.md new file mode 100644 index 000000000000..687a65fc9324 --- /dev/null +++ b/keyboards/planck/keymaps/roguepullrequest/readme.md @@ -0,0 +1,20 @@ +# Programmer Dvorak for the Planck (Light) + + +| | | | | | | | | | | | | +|----------|---------|-------|-----|------|-------|-------|------|------|------|------|------| +| GRAVE_ESC | ; [u]; [l]7 | , [u]% [l]5 | . [l]3 | p [l]1 | y [u]= [l]9 | f [u]* [l]0 | g [l]2 | c [l]4 | r [u]! [l]6 | l [u]# [l]8 | BKSP | +| LCTRL [TD]!$ | a | o | e | u | i | d | h | t | n | s [TD]- _ | / [TD]\ | +| LSHFT [TD]( [ { | ' | q | j | k | x | b | m | w | v | z | LSHFT [TD]) ] } | +| @ [TD]UPPER FUN RESET | LEFT | DOWN | UP | RIGHT | ALT_TAB | SPACE | ENTER | LGUI | PGUP | PGDOWN | = [TD]LOWER | + +# Layout notes +- [u] = UPPER symbol +- [l] = LOWER symbol +- [TD] = Tap Dances +- ALT_TAB = cycle through windows as long as you keep tapping it keeps alt tabbing +- LAST = "!$" = is useful for using the last parm in bash/zsh +- More to come + + +# Dvorak base Layer diff --git a/keyboards/planck/keymaps/roguepullrequest/rules.mk b/keyboards/planck/keymaps/roguepullrequest/rules.mk new file mode 100644 index 000000000000..5eb053e886a3 --- /dev/null +++ b/keyboards/planck/keymaps/roguepullrequest/rules.mk @@ -0,0 +1,3 @@ +AUDIO_ENABLE = yes +COMMAND_ENABLE = no +TAP_DANCE_ENABLE = yes diff --git a/keyboards/planck/keymaps/rootiest/config.h b/keyboards/planck/keymaps/rootiest/config.h new file mode 100644 index 000000000000..3d2d3f38a632 --- /dev/null +++ b/keyboards/planck/keymaps/rootiest/config.h @@ -0,0 +1,155 @@ +/* Copyright 2021 Chris Laprade + * + * 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 . + */ + +#pragma once + +/* + * USB/POWER OPTIONS + */ +// #define USB_MAX_POWER_CONSUMPTION 500 +#define USB_SUSPEND_WAKEUP_DELAY 200 +#define USB_POLLING_INTERVAL_MS 1 + +/* + * MUSIC/AUDIO options + */ +#ifdef AUDIO_ENABLE +# define AUDIO_CLICKY +# define MUSIC_MAP +# define AUDIO_VOICES +# define AUDIO_VOICE_DEFAULT something +# define AUDIO_DAC_SAMPLE_MAX 2732U + +# define DEFAULT_LAYER_SONGS \ + { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND) } + +/* Plays during keyboard startup */ +# define STARTUP_SONG SONG(NO_SOUND) + +#endif + +/* + * MIDI options + */ +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +#define MIDI_ADVANCED + +/* + * ENCODER options + */ +#define ENCODER_DIRECTION_FLIP +#define ENCODER_RESOLUTION 4 // Define number of stages between detents on encoders +#define ENCODERS_PAD_A \ + { B12 } +#define ENCODERS_PAD_B \ + { B13 } + +/* + * RGB options + */ +#ifdef RGBLIGHT_ENABLE +# define RGBLIGHT_SLEEP // Allows rgb to sleep when the host/keyboard does +# define RGBLIGHT_EFFECT_BREATHING +# define RGBLIGHT_EFFECT_RAINBOW_MOOD +# define RGBLIGHT_EFFECT_RAINBOW_SWIRL +# define RGBLIGHT_EFFECT_SNAKE +# define RGBLIGHT_EFFECT_KNIGHT +# define RGBLIGHT_EFFECT_CHRISTMAS +# define RGBLIGHT_EFFECT_STATIC_GRADIENT +# define RGBLIGHT_EFFECT_RGB_TEST +# define RGBLIGHT_EFFECT_ALTERNATING +# define RGBLIGHT_EFFECT_TWINKLE +# define RGBLIGHT_LAYERS // Enable indicating layers using layered rgb assignments +# define RGBLIGHT_LAYER_BLINK // Allows rgb layers to be blinked (activate for a set amount of time) +# define RGBLIGHT_MAX_LAYERS 32 // Overides the default (8) max number of rgb layers +# define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF // Allows rgb layers to work even when rgb is toggled off +#endif + +/* + * UNICODE options + */ +#define UNICODE_SELECTED_MODES UNICODE_MODE_WINCOMPOSE, UNICODE_MODE_LINUX, UNICODE_MODE_MACOS // Define the methods used for in/outputting unicode + +/* + * TAP-DANCE options + */ +#define TAPPING_TERM_PER_KEY // Control Tap-Dance time individually by key +#define TAPPING_TERM 250 // Default time allowed before resetting a Tap-Dance combo +#define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped once again. */ +#define ONESHOT_TIMEOUT 5000 /* Time (in ms) before the one shot key is released */ +#define TAPPING_TOGGLE 3 + +/* + * LEADER-KEY options + */ // Used for on-board chording +#define LEADER_PER_KEY_TIMING +#define LEADER_TIMEOUT 500 + +/* + * COMBO-KEY options + */ +#define COMBO_TERM 300 +/* + * MACRO per-key options + */ +#define RETRO_TAPPING_PER_KEY // Control Retro-Tap individually by key +#define QUICK_TAP_TERM_PER_KEY // Control Quick-Tap individually by key +#define HOLD_ON_OTHER_KEY_PRESS_PER_KEY // Control Hold-on-Other-Key-Press individually by key +#define PERMISSIVE_HOLD_PER_KEY // Control Permissive-Hold individually by key + +#define MK_KINETIC_SPEED // Use kinetic acceleration for mouse-keys + +// Fall-back defines to prevent compile errors if user_song_list is missing +#ifndef ZELDA_PUZZLE2 +# define ZELDA_PUZZLE2 Q__NOTE(_G5) +#endif +#ifndef SONIC_RING2 +# define SONIC_RING2 E__NOTE(_E6) +#endif +#ifndef ZELDA_CHEST2 +# define ZELDA_CHEST2 Q__NOTE(_G5) +#endif +#ifndef COIN_SOUND2 +# define COIN_SOUND2 E__NOTE(_A5) +#endif +#ifndef ONE_UP_SOUND2 +# define ONE_UP_SOUND2 Q__NOTE(_E6) +#endif +#ifndef IMPERIAL_MARCH +# define IMPERIAL_MARCH HD_NOTE(_A4) +#endif +#ifndef MARIO_GAMEOVER +# define MARIO_GAMEOVER HD_NOTE(_C5) +#endif +#ifndef LEAD_START_SOUND +# define LEAD_START_SOUND E__NOTE(_C5) +#endif +#ifndef LEAD_SUCCESS_SOUND +# define LEAD_SUCCESS_SOUND E__NOTE(_A5), HD_NOTE(_E6), +#endif +#ifndef LEAD_FAIL_SOUND +# define LEAD_FAIL_SOUND E__NOTE(_A5), HD_NOTE(_E4), +#endif diff --git a/keyboards/planck/keymaps/rootiest/keymap.c b/keyboards/planck/keymaps/rootiest/keymap.c new file mode 100644 index 000000000000..7e3b8af36762 --- /dev/null +++ b/keyboards/planck/keymaps/rootiest/keymap.c @@ -0,0 +1,1939 @@ +/* Copyright 2021 Chris Laprade + * + * 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 QMK_KEYBOARD_H +#include "raw_hid.h" +#include "print.h" +#include "muse.h" + +/* + * Define keyboard name to be used by UI. + * This allows for using a different name + * than the one defined by QMK for your board. + */ +#define KEEB_MODEL_NAME "The Rootiest BoogieBoard" + +// Give names to the layers so they are easier to reference +enum custom_layers { + _BASE, + _QWERTY = _BASE, + _COLEMAK, + _DVORAK, + _SYMBLS, + _RAISE = _SYMBLS, + _NUMBRS, + _LOWER = _NUMBRS, + _PLOVER, + _FEATURS, + _ADJUST = _FEATURS, + _NUMPD, + _TABULA, + _MOUSY, +}; + +#define LOWER MO(_NUMBRS) +#define RAISE MO(_SYMBLS) + +// unicode hexes +#define UC_DEG UC(0x00B0) // ° +#define UC_DEGF UC(0x2109) // ℉ + +// Time (ms) to wait between frames for the wake rgb animation +#define WAKE_ANIMATION_TIMER_FREQUENCY 50 + +// Is a display connected +// #define USING_OLED_DISPLAY false + +// wait DELAY ms before unregistering media keys +#define TAP_CODE_DELAY 10 + +// Modifier remover +#define WITHOUT_MODS(...) \ + do { \ + const uint8_t _real_mods = get_mods(); \ + clear_mods(); \ + {__VA_ARGS__} set_mods(_real_mods); \ + } while (0) + +// A whole boatload of audio "songs" defined for use by the keyboard +#ifdef AUDIO_ENABLE +float planck_song[][2] = SONG(PLANCK_SOUND); +float hello_song[][2] = SONG(ONE_UP_SOUND2); +float bye_song[][2] = SONG(GOODBYE_SOUND); +float num_song[][2] = SONG(DVORAK_SOUND); +float qwerty_song[][2] = SONG(QWERTY_SOUND); +float colemak_song[][2] = SONG(COLEMAK_SOUND); +float dvorak_song[][2] = SONG(DVORAK_SOUND); +float funk_song[][2] = SONG(COLEMAK_SOUND); +float workman_song[][2] = SONG(WORKMAN_SOUND); +float term_song[][2] = SONG(TERMINAL_SOUND); +float lover_song[][2] = SONG(PLOVER_SOUND); +float ode_song[][2] = SONG(ODE_TO_JOY); +float rock_song[][2] = SONG(ROCK_A_BYE_BABY); +float clue_song[][2] = SONG(CLUEBOARD_SOUND); +float camp_song[][2] = SONG(CAMPANELLA); +float imp_march_song[][2] = SONG(IMPERIAL_MARCH); +float gameover_song[][2] = SONG(MARIO_GAMEOVER); +float puzzle_song[][2] = SONG(ZELDA_PUZZLE2); +float caps_on[][2] = SONG(CAPS_LOCK_ON_SOUND); +float caps_off[][2] = SONG(CAPS_LOCK_OFF_SOUND); +float slctl_on[][2] = SONG(SCROLL_LOCK_ON_SOUND); +float slctl_off[][2] = SONG(SCROLL_LOCK_OFF_SOUND); +float slalt_on[][2] = SONG(NUM_LOCK_ON_SOUND); +float slalt_off[][2] = SONG(NUM_LOCK_OFF_SOUND); +float leader_started[][2] = SONG(LEAD_START_SOUND); +float leader_succeed[][2] = SONG(LEAD_SUCCESS_SOUND); +float leader_fail[][2] = SONG(LEAD_FAIL_SOUND); +float plover_song[][2] = SONG(PLOVER_SOUND); +float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +// Declare stored memory config +typedef union { + uint32_t raw; + struct { + bool do_wakeup_animation : 1; + uint8_t rgbcon_tracker : 8; + bool do_wakeup_audio : 1; + }; +} user_config_t; + +user_config_t user_config; + +// Initialize variable holding the binary +// representation of active modifiers. +uint8_t mod_state = 0; + +// Declare custom keycodes +enum custom_keycodes { + MO_BASE = SAFE_RANGE, + MO_SYMBLS, + MO_NUMBRS, + MO_FEATURS, + QWERTY, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + MUSIC_ON, + MUSIC_OFF, + EXT_PLV, + MY_RGBCON, + MY_DEGREES, + ALT_TAB, + PRINT_WPM_KEY, + IRONY, + WAKE_ANI_TOG, + WAKE_AUD_TOG, + DO_RESET, + KC_PRVWD, + KC_NXTWD, + KC_LSTRT, + KC_LEND, + KC_DLINE, + KC_REDO, + KC_SAVE, + KC_SLCTALL, + KC_ALTF4, + KC_KILL, + KC_LCUT, + KC_LCOPY, + KC_NXTAB, + KC_PRVTAB, +}; + +// Declare unicode map array +enum unicode_names { BANG, SNEK }; +const uint32_t unicode_map[] PROGMEM = { + //[UCD_BANG] = 0x203D, // ‽ + //[UCD_IRONY] = 0x2E2E, // ⸮ + [SNEK] = 0x1F40D, // 🐍 +}; + +enum combo_events { ZC_COPY, XV_PASTE }; + +const uint16_t PROGMEM copy_combo[] = {KC_Z, KC_C, COMBO_END}; +const uint16_t PROGMEM paste_combo[] = {KC_X, KC_V, COMBO_END}; + +combo_t key_combos[] = { + [ZC_COPY] = COMBO_ACTION(copy_combo), + [XV_PASTE] = COMBO_ACTION(paste_combo), +}; + +// Tap Dance key declarations +enum { + TD_DEG_DEGF, + TD_SMILEY, + TD_LSHFT_CAPS, + TD_LCTL_STICKY, + TD_LALT_STICKY, + TD_LOWER, + TD_RAISE, +}; + +// Declare available Tap-Dance states +typedef enum { + TD_NONE, + TD_SINGLE_TAP, + TD_DOUBLE_TAP, + TD_TRIPLE_TAP, + TD_DOUBLE_SINGLE_TAP, + TD_SINGLE_HOLD, + TD_DOUBLE_HOLD, + TD_TRIPLE_HOLD, + TD_UNKNOWN, +} td_state_t; + +// Tap-Dance struct +typedef struct { + bool is_press_action; + td_state_t state; +} td_tap_t; + +// Whether or not to do the wake animation+sound +bool do_wake_animation; + +// Variable to keep track of the rgb mode assigned by the RGB_CON key +static uint8_t rgbcon_tracker = 0; + +// Used by the on-board WPM tracker +char wpm_str[12]; + +// Variables used for the alt-tab key +bool is_alt_tab_active = false; +uint16_t alt_tab_timer = 0; + +// Variables used by the Irony key +#define IRONY_HOLD_DELAY 500 +uint16_t irony_pressed_time; +bool irony_active = false; +bool irony_shifted = false; +char irony_str[4] = "⸮"; +char bang_str[4] = "‽"; + +// Variables used for the rgb wakeup animation +static uint16_t wake_rgb_timer; +static uint8_t wake_rgb_count = 0; +bool waking_up = false; +bool do_wake_audio = false; + +// Muse variables +bool muse_mode = false; +bool musical_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +// Used by Leader key chords +bool did_leader_succeed; + +// Tap-Dance stuffs, initializing functions that are coded further below +td_state_t cur_dance(tap_dance_state_t* state); +void sml_finished(tap_dance_state_t* state, void* user_data); +void sml_reset(tap_dance_state_t* state, void* user_data); +void scap_finished(tap_dance_state_t* state, void* user_data); +void scap_reset(tap_dance_state_t* state, void* user_data); +void slctl_finished(tap_dance_state_t* state, void* user_data); +void slctl_reset(tap_dance_state_t* state, void* user_data); +void slalt_finished(tap_dance_state_t* state, void* user_data); +void slalt_reset(tap_dance_state_t* state, void* user_data); +bool lctl_sticky = false; +bool lalt_sticky = false; + +// This function is called when lock indicators (caps-lock led) are changed/toggled/updated +bool led_update_user(led_t led_state) { + rgblight_set_layer_state(10, led_state.caps_lock); +#ifdef AUDIO_ENABLE + static uint8_t caps_state = 0; + if (caps_state != led_state.caps_lock) { + // When the caps-lock led state changes play sounds + led_state.caps_lock ? PLAY_SONG(caps_on) : PLAY_SONG(caps_off); + caps_state = led_state.caps_lock; + } +#endif + return true; +} + +// Define key layout/layers +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Define all the layers + [_BASE] = LAYOUT_planck_mit( // + QK_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, // + LT(_TABULA, KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, // + TD(TD_LSHFT_CAPS), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SC_SENT, // + TD(TD_LCTL_STICKY), QK_LEAD, KC_LGUI, TD(TD_LALT_STICKY), MO(_SYMBLS), KC_SPC, MO(_NUMBRS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), + /* + Base Layer [0] + * ,-----------------------------------------------------------------------------------. + * |Gr/ESC| Q | W | E | R | T | Y | U | I | O | P |BckSpc| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Tabula| A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |SH/CAP| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | LCtrl|Leader| OS | Alt |Symbol| Space |Number| Left | Dwn | Up | Right| + * `-----------------------------------------------------------------------------------' + */ + + [_COLEMAK] = LAYOUT_planck_mit( // + QK_GESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, // + LT(_TABULA, KC_TAB), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, // + TD(TD_LSHFT_CAPS), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SC_SENT, // + TD(TD_LCTL_STICKY), QK_LEAD, KC_LGUI, TD(TD_LALT_STICKY), MO(_SYMBLS), KC_SPC, MO(_NUMBRS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), + /* + Colemak Layer [1] + * ,-----------------------------------------------------------------------------------. + * |Gr/ESC| Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Tabula| A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |SH/CAP| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | LCtrl|Leader| OS | Alt |Symbol| Space |Number| Left | Dwn | Up | Right| + * `-----------------------------------------------------------------------------------' + */ + + [_DVORAK] = LAYOUT_planck_mit( // + QK_GESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, // + LT(_TABULA, KC_TAB), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_TRNS, KC_S, KC_SLSH, // + TD(TD_LSHFT_CAPS), KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SC_SENT, // + TD(TD_LCTL_STICKY), QK_LEAD, KC_LGUI, TD(TD_LALT_STICKY), MO(_SYMBLS), KC_SPC, MO(_NUMBRS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), + /* Dvorak Layer [2] + * ,-----------------------------------------------------------------------------------. + * |Gr/ESC| " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Tabula| A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |SH/CAP| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | LCtrl|Leader| OS | Alt |Symbol| Space |Number| Left | Dwn | Up | Right| + * `-----------------------------------------------------------------------------------' + */ + [_SYMBLS] = LAYOUT_planck_mit( // + KC_MPLY, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, // + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, // + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, LSFT(KC_LCTL), LSFT(KC_LCTL), KC_HOME, KC_END, KC_TRNS, // + TG(_NUMPD), KC_TRNS, KC_TRNS, KC_TRNS, TO(_BASE), KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY), + /* + Symbols Layer [3] + * ,-----------------------------------------------------------------------------------. + * | Play | ! | @ | # | $ | % | ^ | & | * | ( | ) |BckSpc| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Delete| F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| F7 | F8 | F9 | F10 | F11 | F12 |LShLCt|LShLCt| Home | End |------| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | TG(7)|------|------|------| Base | ----- | MO(4)| Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + + [_NUMBRS] = LAYOUT_planck_mit( // + KC_MPLY, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, // + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, // + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, KC_TRNS, // + TG(_NUMPD), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TO(_BASE), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY), + + /* + Numbers Layer [4] + * ,-----------------------------------------------------------------------------------. + * | Play | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |BckSpc| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Delete| F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| F7 | F8 | F9 | F10 | F11 | F12 | # | / | PgUp | PgDwn|------| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | TG(7)|------|------|------| MO(3)| ----- | Base | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + + [_PLOVER] = LAYOUT_planck_mit( // + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, // + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, // + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, // + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX), + /* Plover Layer [5] + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + + [_FEATURS] = LAYOUT_planck_mit( // + LCTL(LALT(KC_DEL)), DO_RESET, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, TD(TD_DEG_DEGF), TD(TD_SMILEY), KC_DEL, // + RGB_VAI, RGB_VAD, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, DF(_BASE), DF(_COLEMAK), DF(_DVORAK), TO(_PLOVER), MY_RGBCON, // + KC_TRNS, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, KC_TRNS, KC_TRNS, CK_ON, CK_OFF, KC_ENTER, // + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG(_MOUSY), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + /* + Special Features Layer [6] + * ,-----------------------------------------------------------------------------------. + * |C+A+DL| Reset| Debug|RGBTog|RGBMod| Hue+ | Hue- | Sat+ | Sat- |Unicod| Emoji|Delete| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |RGBVAI|RGBVAD|MUNEXT| AU_ON|AU_OFF|RALTGU|SALTGU| Base |Colemk|Dvorak|Plover|RGBCON| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |------|AUPREV|AU_EXT| MU_ON|MU_OFF| MI_ON|MI_OFF|------|------|CLK-ON|CLKOFF|Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |------|------|------|------|------| TG(8) |------|------|------|------|------| + * `-----------------------------------------------------------------------------------' + */ + + [_NUMPD] = LAYOUT_planck_mit( // + KC_ESC, KC_HOME, KC_UP, KC_END, KC_PERC, KC_LCBR, KC_RCBR, KC_TAB, KC_P7, KC_P8, KC_P9, KC_BSPC, // + KC_TILD, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSLS, KC_LBRC, KC_RBRC, KC_PSLS, KC_P4, KC_P5, KC_P6, KC_PMNS, // + KC_LSFT, KC_SLSH, KC_CUT, KC_COPY, KC_PASTE, KC_LT, KC_GT, KC_PAST, KC_P1, KC_P2, KC_P3, KC_PPLS, // + TO(_BASE), QK_LEAD, KC_LGUI, KC_LALT, SC_LCPO, KC_SPC, SC_RCPC, KC_HASH, KC_P0, KC_PDOT, KC_PENT), + /* + Numpad Layer [7] + * ,-----------------------------------------------------------------------------------. + * | Esc | Home | Up | End | % | { | } | Tab | 7 | 8 | 9 |BckSpc| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ~ | Left | Down | Right| \ | [ | ] | / | 4 | 5 | 6 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| / |Ctrl+X|Ctrl+C|Ctrl+V| < | > | * | 1 | 2 | 3 | + | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Base |Leader| Alt | OS |LCtl/(| Space |)/RCtl| # | 0 | . |Enter | + * `-----------------------------------------------------------------------------------' + */ + [_TABULA] = LAYOUT_planck_mit( // + KC_ESC, KC_ALTF4, VK_TOGG, PRINT_WPM_KEY, WAKE_ANI_TOG, WAKE_AUD_TOG, KC_REDO, UC_NEXT, UC_WINC, CG_TOGG, AG_TOGG, KC_DLINE, // + KC_NXTAB, KC_SLCTALL, KC_SAVE, KC_TRNS, KC_FIND, SH_TOGG, SH_TOGG, IRONY, KC_LCUT, KC_LCOPY, KC_TRNS, KC_KILL, // + KC_LSFT, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_PRVWD, KC_NXTWD, TG(_MOUSY), KC_TRNS, KC_HOME, KC_END, SC_SENT, // + TO(_BASE), KC_LCTL, KC_LGUI, KC_LALT, SC_LSPO, ALT_TAB, SC_RSPC, KC_PRVWD, KC_BRID, KC_BRIU, KC_NXTWD), + /* Tabular Layer [8] + * ,-----------------------------------------------------------------------------------. + * | Esc |Alt+F4|Veloci| WPM |WakANI|WakAUD|Ctrl+Y|UCMode|UCWinC|CtGUTg|AltGTg| DLine| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab |Ctrl+A|Ctrl+S|------|Ctrl+F| SWAP | SWAP | ⸮^‽ |CutLin|CpyLin|------|DelLin| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift|Ctrl+Z|Ctrl+X|Ctrl+C|Ctrl+V|PrVWin|NxtWin| TG(8)|------| Home | End |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Base | LCtrl| Alt | OS |LSft/(| Alt+Tab |)/RSft|PrvSel|ScrBr-|ScrBr+|NxtSel| + * `-----------------------------------------------------------------------------------' + */ + + [_MOUSY] = LAYOUT_planck_mit( // + KC_ESC, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, UC_NEXT, UC_WINC, CG_TOGG, AG_TOGG, KC_BSPC, // + KC_TAB, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, KC_TRNS, IRONY, VK_TOGG, KC_TRNS, KC_TRNS, KC_TRNS, // + KC_LSFT, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_PRVWD, KC_NXTWD, KC_TRNS, KC_HOME, KC_BTN3, KC_END, SC_SENT, // + TO(_BASE), KC_LCTL, KC_LGUI, KC_LALT, KC_BTN1, ALT_TAB, KC_BTN2, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R)}; +/* MousePad Layer [9] + * ,-----------------------------------------------------------------------------------. + * | Esc |MsBtn1| MsUp |MsBtn2|------|------|------|UCMode|UCWinC|CtGUTg|AltGTg|BckSpc| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ~ |MsLeft|MsDown|MsRigt|------|------|------| ⸮^‽ |Veloci|------|------|------| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift|------|Ctrl+X|Ctrl+C|Ctrl+V|------|------|------| Home |MsBtn3| End |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Base | LCtrl| Alt | OS |MsBtn1| Alt+Tab |MsBtn2|MsWhlL|MsWhlD|MsWhlU|MsWhlR| + * `-----------------------------------------------------------------------------------' + */ + +// Define RGB layers | assign leds and their values for each rgb layer +const rgblight_segment_t PROGMEM my_warning_layer[] = RGBLIGHT_LAYER_SEGMENTS({1, 9, HSV_RED}, {0, 1, HSV_RED}); +const rgblight_segment_t PROGMEM my_allgood_layer[] = RGBLIGHT_LAYER_SEGMENTS({1, 9, HSV_GREEN}, {0, 1, HSV_GREEN}); +const rgblight_segment_t PROGMEM my_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS({1, 1, HSV_RED}, {8, 1, HSV_RED}); +const rgblight_segment_t PROGMEM my_number_layer[] = RGBLIGHT_LAYER_SEGMENTS({1, 1, HSV_MAGENTA}, {8, 1, HSV_MAGENTA}); +const rgblight_segment_t PROGMEM my_symbol_layer[] = RGBLIGHT_LAYER_SEGMENTS({1, 1, HSV_GREEN}, {8, 1, HSV_GREEN}); +const rgblight_segment_t PROGMEM my_tabula_layer[] = RGBLIGHT_LAYER_SEGMENTS({3, 4, HSV_CORAL}, {1, 1, HSV_CORAL}, {8, 1, HSV_CORAL}); +const rgblight_segment_t PROGMEM my_mousy_layer[] = RGBLIGHT_LAYER_SEGMENTS({3, 4, HSV_TURQUOISE}, {1, 1, HSV_TURQUOISE}, {8, 1, HSV_TURQUOISE}, {7, 1, HSV_MAGENTA}); +const rgblight_segment_t PROGMEM my_numpad_layer[] = RGBLIGHT_LAYER_SEGMENTS({3, 4, HSV_GOLD}, {1, 1, HSV_GOLD}, {8, 1, HSV_GOLD}, {7, 1, HSV_BLUE}); +const rgblight_segment_t PROGMEM my_features_layer[] = RGBLIGHT_LAYER_SEGMENTS({3, 4, HSV_BLUE}, {1, 1, HSV_BLUE}, {8, 1, HSV_BLUE}); +const rgblight_segment_t PROGMEM my_base_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 0, HSV_BLACK}); +const rgblight_segment_t PROGMEM my_colemak_layer[] = RGBLIGHT_LAYER_SEGMENTS({1, 1, HSV_GREEN}); +const rgblight_segment_t PROGMEM my_dvorak_layer[] = RGBLIGHT_LAYER_SEGMENTS({1, 1, HSV_ORANGE}); +const rgblight_segment_t PROGMEM my_plover_layer[] = RGBLIGHT_LAYER_SEGMENTS({1, 1, HSV_GOLD}); + +// Define the array of rgb layers. Later layers take precedence +const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(my_base_layer, // Base Layer + my_colemak_layer, // Overrides previous layer + my_dvorak_layer, // Overrides previous layers + my_symbol_layer, // Overrides previous layers + my_number_layer, // ...etc my_features_layer, // Overrides layers + my_plover_layer, // + my_features_layer, // + my_numpad_layer, // + my_tabula_layer, // + my_mousy_layer, // + my_capslock_layer, // + my_warning_layer, // + my_allgood_layer); // CapsLock Layer); + +// Configure encoders +bool encoder_update_user(uint8_t index, bool clockwise) { + if (musical_mode) { + if (clockwise) { + tap_code16(MU_NEXT); + } else { + tap_code16(MU_NEXT); + } + } else { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo += 1; + } else { + muse_tempo -= 1; + } + } + } else { + if (index == 0) { /* First encoder */ + uint16_t held_keycode_timer = timer_read(); + switch (get_highest_layer(layer_state)) { + case 0: // Base Layer + if ((get_mods() & MOD_MASK_GUI)) { // GUI-ed + if (clockwise) { + tap_code(KC_RIGHT); + + } else { + tap_code(KC_LEFT); + } + } else if ((get_mods() & MOD_MASK_ALT)) { // Alt-ed + if (clockwise) { + tap_code16(LALT(KC_TAB)); // Alt+Tabbing + } else { + tap_code16(LSA(KC_TAB)); + } + } else if ((get_mods() & MOD_MASK_SHIFT)) { // Shifted + const uint8_t _real_mods = get_mods(); + unregister_code16(KC_LSFT); + unregister_code16(KC_RSFT); + clear_mods(); + if (clockwise) { + tap_code16(KC_MS_WH_DOWN); + } else { + tap_code16(KC_MS_WH_UP); + } + set_mods(_real_mods); + } else if ((get_mods() & MOD_MASK_CTRL)) { // Ctrl-ed + if (clockwise) { + tap_code16(RCTL(KC_TAB)); // Ctrl+Tabbing + } else { + tap_code16(RCS(KC_TAB)); + } + } else { // Normal or unspecified modifiers + if (clockwise) { + // Volume control requires extra timer to function correctly + register_code(KC_VOLU); + while (timer_elapsed(held_keycode_timer) < TAP_CODE_DELAY) { + // no-op + } + unregister_code(KC_VOLD); + } else { + register_code(KC_VOLD); + while (timer_elapsed(held_keycode_timer) < TAP_CODE_DELAY) { + // no-op + } + unregister_code(KC_VOLU); + } + } + return false; + break; + case 3: // Symbols Layer + if (clockwise) { + tap_code(KC_WH_D); // Mouse wheeling + } else { + tap_code(KC_WH_U); + } + return false; + break; + case 4: // Numbers Layer + if (clockwise) { + tap_code(KC_WH_D); // Mouse wheeling + } else { + tap_code(KC_WH_U); + } + return false; + break; + case 6: // Features Layer + if (clockwise) { + tap_code16(KC_DOWN); + } else { + tap_code16(KC_UP); + } + default: // Any other layer + if ((get_mods() & MOD_MASK_CSAG)) { + if (clockwise) { + WITHOUT_MODS({ SEND_STRING(SS_TAP(X_RIGHT)); }); + } else { + WITHOUT_MODS({ SEND_STRING(SS_TAP(X_LEFT)); }); + } + } else { + if (clockwise) { + tap_code(KC_DOWN); // Simple Up/Down + } else { + tap_code(KC_UP); + } + } + return false; + break; + } + } else if (index == 1) { /* Second encoder (if we had one) */ + if (clockwise) { + tap_code16(LCTL(KC_LEFT)); // Ctrl+Left/Right + } else { + tap_code16(LCTL(KC_RIGHT)); + } + } + } + } + return true; +} + +// OLED CONFIGURATION +/* +static void render_logo(void) { + static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; + + oled_write_P(qmk_logo, false); +} +*/ + +// Process Combo events +void process_combo_event(uint16_t combo_index, bool pressed) { + switch (combo_index) { + case ZC_COPY: + if (pressed) { + tap_code16(LCTL(KC_C)); + } + break; + case XV_PASTE: + if (pressed) { + tap_code16(LCTL(KC_V)); + } + break; + } +} + +// Runs every time a key is pressed or released +bool process_record_user(uint16_t keycode, keyrecord_t* record) { +#ifdef CONSOLE_ENABLE + dprintf("KL: kc: 0x%04X, col: %u, row: %u, pressed: %b, time: %u, interrupt: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count); +#endif + // Store the current modifier state in the variable for later reference + mod_state = get_mods(); + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + PLAY_SONG(qwerty_song); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + PLAY_SONG(colemak_song); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + PLAY_SONG(dvorak_song); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); +#endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); +#endif + layer_off(_PLOVER); + } + return false; + break; + case MO_SYMBLS: + if (record->event.pressed) { + layer_on(_SYMBLS); + } else { + layer_off(_SYMBLS); + } + return false; + case MO_NUMBRS: + if (record->event.pressed) { + layer_on(_NUMBRS); + } else { + layer_off(_NUMBRS); + } + return false; + case MO_FEATURS: + if (record->event.pressed) { + layer_on(_FEATURS); + } else { + layer_off(_FEATURS); + } + return false; + case MUSIC_ON: + if (record->event.pressed) { + musical_mode = true; + register_code16(MU_ON); + } else { + unregister_code16(MU_ON); + } + break; + case MUSIC_OFF: + if (record->event.pressed) { + musical_mode = false; + register_code16(MU_OFF); + } else { + unregister_code16(MU_OFF); + } + break; + case KC_PRVWD: // Control+Left + if (record->event.pressed) { + if (keymap_config.swap_lctl_lgui) { + register_mods(mod_config(MOD_LALT)); + register_code(KC_LEFT); + } else { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_LEFT); + } + } else { + if (keymap_config.swap_lctl_lgui) { + unregister_mods(mod_config(MOD_LALT)); + unregister_code(KC_LEFT); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_LEFT); + } + } + break; + case KC_NXTWD: // Control+Right + if (record->event.pressed) { + if (keymap_config.swap_lctl_lgui) { + register_mods(mod_config(MOD_LALT)); + register_code(KC_RIGHT); + } else { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_RIGHT); + } + } else { + if (keymap_config.swap_lctl_lgui) { + unregister_mods(mod_config(MOD_LALT)); + unregister_code(KC_RIGHT); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_RIGHT); + } + } + break; + case KC_PRVTAB: // Control+Shift+Tab + if (record->event.pressed) { + register_mods(mod_config(MOD_LCTL)); + register_mods(mod_config(MOD_LSFT)); + register_code(KC_TAB); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_mods(mod_config(MOD_LSFT)); + unregister_code(KC_TAB); + } + break; + case KC_NXTAB: // Control+Tab + if (record->event.pressed) { + if (keymap_config.swap_lctl_lgui) { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_TAB); + } else { + register_mods(mod_config(MOD_LSFT)); + register_code(KC_TAB); + } + } else { + if (keymap_config.swap_lctl_lgui) { + unregister_mods(mod_config(MOD_LALT)); + unregister_code(KC_RIGHT); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_RIGHT); + } + } + break; + case KC_LSTRT: // Basically just Home + if (record->event.pressed) { + if (keymap_config.swap_lctl_lgui) { + // CMD-arrow on Mac, but we have CTL and GUI swapped + register_mods(mod_config(MOD_LCTL)); + register_code(KC_LEFT); + } else { + register_code(KC_HOME); + } + } else { + if (keymap_config.swap_lctl_lgui) { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_LEFT); + } else { + unregister_code(KC_HOME); + } + } + break; + case KC_LEND: // Basically just End + if (record->event.pressed) { + if (keymap_config.swap_lctl_lgui) { + // CMD-arrow on Mac, but we have CTL and GUI swapped + register_mods(mod_config(MOD_LCTL)); + register_code(KC_RIGHT); + } else { + register_code(KC_END); + } + } else { + if (keymap_config.swap_lctl_lgui) { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_RIGHT); + } else { + unregister_code(KC_END); + } + } + break; + case KC_DLINE: // Control+BackSpace + if (record->event.pressed) { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_BSPC); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_BSPC); + } + break; + case KC_COPY: // Copy: Control+C + if (record->event.pressed) { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_C); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_C); + } + return false; + case KC_PASTE: // Paste: Control+V + if (record->event.pressed) { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_V); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_V); + } + return false; + case KC_CUT: // Cut: Control+X + if (record->event.pressed) { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_X); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_X); + } + return false; + break; + case KC_UNDO: // Undo: Control+Z + if (record->event.pressed) { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_Z); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_Z); + } + return false; + case KC_REDO: // Redo: Control+Y + if (record->event.pressed) { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_Y); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_Y); + } + break; + case KC_SAVE: // Save: Control+S + if (record->event.pressed) { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_S); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_S); + } + return false; + case KC_FIND: // Find: Control+F + if (record->event.pressed) { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_F); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_F); + } + return false; + case KC_SLCTALL: // Select All: Control+A + if (record->event.pressed) { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_A); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_A); + } + return false; + case KC_KILL: // Kill: Delete Line + if (record->event.pressed) { + tap_code(KC_HOME); + register_mods(mod_config(MOD_LSFT)); + tap_code(KC_END); + unregister_mods(mod_config(MOD_LSFT)); + tap_code(KC_DELETE); + } else { + } + return false; + case KC_LCUT: // Cut Line + if (record->event.pressed) { + tap_code(KC_HOME); + register_mods(mod_config(MOD_LSFT)); + tap_code(KC_END); + unregister_mods(mod_config(MOD_LSFT)); + register_mods(mod_config(MOD_LCTL)); + tap_code(KC_X); + unregister_mods(mod_config(MOD_LCTL)); + } else { + } + return false; + case KC_LCOPY: // Copy Line + if (record->event.pressed) { + tap_code(KC_HOME); + register_mods(mod_config(MOD_LSFT)); + tap_code(KC_END); + unregister_mods(mod_config(MOD_LSFT)); + register_mods(mod_config(MOD_LCTL)); + tap_code(KC_C); + unregister_mods(mod_config(MOD_LCTL)); + tap_code(KC_END); + } else { + } + return false; + case KC_ALTF4: // Close Window: Alt+F4 + if (record->event.pressed) { + register_mods(mod_config(MOD_LALT)); + register_code(KC_F4); + } else { + unregister_mods(mod_config(MOD_LALT)); + unregister_code(KC_F4); + } + return false; + case ALT_TAB: // Change Window: Super ⭍ Alt+Tab + if (record->event.pressed) { + if (!is_alt_tab_active) { + is_alt_tab_active = true; + register_code(KC_LALT); + } + alt_tab_timer = timer_read(); + register_code(KC_TAB); +#ifdef CONSOLE_ENABLE + dprint("I've tabbed to another window!\n"); +#endif + } else { + unregister_code(KC_TAB); + } + break; + case KC_BSPC: { + // Initialize a boolean variable that keeps track + // of the delete key status: registered or not? + static bool delkey_registered; + if (record->event.pressed) { + // Detect the activation of either shift keys + if (mod_state & MOD_MASK_SHIFT) { + // First temporarily canceling both shifts so that + // shift isn't applied to the KC_DEL keycode + del_mods(MOD_MASK_SHIFT); + register_code(KC_DEL); + // Update the boolean variable to reflect the status of KC_DEL + delkey_registered = true; + // Reapplying modifier state so that the held shift key(s) + // still work even after having tapped the Backspace/Delete key. + set_mods(mod_state); + return false; + } + } else { // on release of KC_BSPC + // In case KC_DEL is still being sent even after the release of KC_BSPC + if (delkey_registered) { + unregister_code(KC_DEL); + delkey_registered = false; + return false; + } + } + } + // Let QMK process the KC_BSPC keycode as usual outside of shift + return true; + + case DO_RESET: // Reset button with LED indication + if (record->event.pressed) { + rgblight_set_effect_range(0, 9); + rgblight_sethsv_noeeprom(HSV_RED); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + rgblight_blink_layer(11, 5000); + reset_keyboard(); + } + break; + case WAKE_ANI_TOG: // Toggle the Wakeup RGB animation + if (record->event.pressed) { + user_config.do_wakeup_animation ^= 1; // Toggles the status + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + if (user_config.do_wakeup_animation) { + print("Wake animation enabled.\n"); + PLAY_SONG(slctl_on); + + } else { + print("Wake animation disabled.\n"); + PLAY_SONG(slctl_off); + } + } + break; + case WAKE_AUD_TOG: // Toggle the wake-up music + if (record->event.pressed) { + user_config.do_wakeup_audio ^= 1; // Toggles the status + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + if (user_config.do_wakeup_audio) { + print("Wake music enabled.\n"); + PLAY_SONG(slctl_on); + + } else { + print("Wake music disabled.\n"); + PLAY_SONG(slctl_off); + } + } + break; + case IRONY: // Outputs Irony/Interrobang symbols + if ((get_mods() & MOD_MASK_SHIFT)) { + irony_shifted = true; + } else { + irony_shifted = false; + } + if (record->event.pressed) { + if (irony_shifted) { + send_unicode_string(bang_str); + } else { + send_unicode_string(irony_str); + } + irony_active = true; + irony_pressed_time = timer_read(); + } else { + irony_active = false; + irony_pressed_time = 0; + irony_shifted = false; + } + return false; + case TG(_NUMPD): // Toggle the NumPad layer + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(hello_song); +#endif + print("I've activated the NumPad!\n"); + } else { + } + break; + case TG(_TABULA): // Toggle the Tabula layer + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(lover_song); +#endif + print("I've activated Tabular!\n"); + } else { + } + break; + case TG(_MOUSY): // Toggle the MouseyPad layer + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(funk_song); +#endif + print("I've activated the MousePad!\n"); + } else { + } + break; + case TO(_BASE): // Return to the base layer + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(planck_song); +#endif + print("I've returned to the Base Layer!\n"); + } else { + } + break; + case PRINT_WPM_KEY: // Prints the current average words-per-minute to the console + sprintf(wpm_str, "Current WPM: %hu", get_current_wpm()); + printf("%s\n", wpm_str); + break; + + case MY_RGBCON: // Cycles through custom RGB animation presets + if (record->event.pressed) { + // when keycode RGB-CON is pressed + user_config.rgbcon_tracker = rgbcon_tracker + 1; // Toggles the status + eeconfig_update_user(user_config.raw); + switch (rgbcon_tracker) { + case 0: + rgblight_set_effect_range(0, 9); + rgblight_sethsv(HSV_BLACK); + rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); + print("Changed RGB mode to: Disabled RGB\n"); + rgbcon_tracker++; + break; + case 1: + rgblight_set_effect_range(0, 9); + rgblight_sethsv(HSV_WHITE); + rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); + print("Changed RGB mode to: Static White\n"); + rgbcon_tracker++; + break; + case 2: + rgblight_set_effect_range(0, 9); + rgblight_sethsv(HSV_CYAN); + rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); + print("Changed RGB mode to: Static Cyan\n"); + rgbcon_tracker++; + break; + case 3: + rgblight_set_effect_range(0, 9); + rgblight_sethsv(HSV_WHITE); + rgblight_mode(RGBLIGHT_MODE_BREATHING); + print("Changed RGB mode to: Breathing Lights\n"); +#ifdef AUDIO_ENABLE + print("Played Marching song!\n"); + PLAY_SONG(imp_march_song); +#endif + rgbcon_tracker++; + break; + case 4: + rgblight_set_effect_range(0, 9); + rgblight_sethsv(HSV_RED); + rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL); + print("Changed RGB mode to: Rainbow Swirl\n"); + rgbcon_tracker++; + break; + case 5: + rgblight_set_effect_range(0, 9); + rgblight_sethsv(HSV_CYAN); + rgblight_mode(RGBLIGHT_MODE_RAINBOW_MOOD); + print("Changed RGB mode to: Rainbow Mood\n"); +#ifdef AUDIO_ENABLE + print("Played Game Over song!\n"); + PLAY_SONG(gameover_song); +#endif + rgbcon_tracker = 0; + break; + case 6: + rgblight_set_effect_range(0, 9); + rgblight_sethsv(HSV_BLACK); + rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); + print("Changed RGB mode to: Disabled RGB\n"); + rgbcon_tracker = 1; + break; + } + } else { + } + break; + } + return true; +}; + +// Runs *after* a key is pressed +void post_process_record_user(uint16_t keycode, keyrecord_t* record) { + switch (keycode) { + case QK_DEBUG_TOGGLE: + // Blink the warning layer when the debug key is pressed + rgblight_blink_layer_repeat(debug_enable ? 11 : 12, 1500, 3); + + // Update the console with the debug mode status + if (debug_enable) { + print("Debug mode enabled.\n"); + PLAY_SONG(slctl_on); + + } else { + print("Debug mode disabled.\n"); + PLAY_SONG(slctl_off); + } + break; + } +} + +// RGB Default Layer assignments +layer_state_t default_layer_state_set_user(layer_state_t state) { + state = update_tri_layer_state(state, _SYMBLS, _NUMBRS, _FEATURS); + + // Sets the default RGB layer states + rgblight_set_layer_state(0, layer_state_cmp(state, _BASE)); + rgblight_set_layer_state(1, layer_state_cmp(state, _COLEMAK)); + rgblight_set_layer_state(2, layer_state_cmp(state, _DVORAK)); + return state; +} + +// RGB Layer assignments +layer_state_t layer_state_set_user(layer_state_t state) { + state = update_tri_layer_state(state, _SYMBLS, _NUMBRS, _FEATURS); + + // Sets the RGB layer states + rgblight_set_layer_state(5, layer_state_cmp(state, _PLOVER)); + rgblight_set_layer_state(6, layer_state_cmp(state, _FEATURS)); + rgblight_set_layer_state(3, layer_state_cmp(state, _SYMBLS)); + rgblight_set_layer_state(4, layer_state_cmp(state, _NUMBRS)); + rgblight_set_layer_state(7, layer_state_cmp(state, _NUMPD)); + rgblight_set_layer_state(8, layer_state_cmp(state, _TABULA)); + rgblight_set_layer_state(9, layer_state_cmp(state, _MOUSY)); + return state; +} + +// Runs the wakeup rgb animation + music +void rgb_wakeup_sequence(void) { + if (waking_up) { + if ((timer_elapsed(wake_rgb_timer) > WAKE_ANIMATION_TIMER_FREQUENCY)) { + if (wake_rgb_count < 1) { + rgblight_sethsv_noeeprom(HSV_OFF); + rgblight_set_effect_range(0, 9); + } else if (wake_rgb_count < 2 && wake_rgb_count > 0) { + rgblight_sethsv_noeeprom(HSV_BLACK); + rgblight_set_effect_range(0, 2); + rgblight_sethsv_noeeprom(HSV_WHITE); + rgblight_set_effect_range(2, 9); + } else if (wake_rgb_count < 3 && wake_rgb_count > 1) { + rgblight_sethsv_noeeprom(HSV_BLACK); + rgblight_set_effect_range(0, 2); + rgblight_sethsv_noeeprom(HSV_WHITE); + rgblight_set_effect_range(2, 9); + } else if (wake_rgb_count < 4 && wake_rgb_count > 2) { + rgblight_sethsv_noeeprom(HSV_BLACK); + rgblight_set_effect_range(0, 3); + rgblight_sethsv_noeeprom(HSV_WHITE); + rgblight_set_effect_range(3, 9); + } else if (wake_rgb_count < 5 && wake_rgb_count > 3) { + rgblight_sethsv_noeeprom(HSV_BLACK); + rgblight_set_effect_range(0, 4); + rgblight_sethsv_noeeprom(HSV_WHITE); + rgblight_set_effect_range(4, 9); + } else if (wake_rgb_count < 6 && wake_rgb_count > 4) { + rgblight_sethsv_noeeprom(HSV_BLACK); + rgblight_set_effect_range(0, 5); + rgblight_sethsv_noeeprom(HSV_WHITE); + rgblight_set_effect_range(5, 9); + } else if (wake_rgb_count < 7 && wake_rgb_count > 5) { + rgblight_sethsv_noeeprom(HSV_BLACK); + rgblight_set_effect_range(0, 6); + rgblight_sethsv_noeeprom(HSV_WHITE); + rgblight_set_effect_range(6, 9); + } else if (wake_rgb_count < 8 && wake_rgb_count > 6) { + rgblight_sethsv_noeeprom(HSV_BLACK); + rgblight_set_effect_range(0, 7); + rgblight_sethsv_noeeprom(HSV_WHITE); + rgblight_set_effect_range(7, 9); + } else if (wake_rgb_count < 9 && wake_rgb_count > 7) { + rgblight_sethsv_noeeprom(HSV_BLACK); + rgblight_set_effect_range(0, 8); + rgblight_sethsv_noeeprom(HSV_WHITE); + rgblight_set_effect_range(8, 9); + } else if (wake_rgb_count < 10 && wake_rgb_count > 8) { + rgblight_sethsv_noeeprom(HSV_BLACK); + rgblight_set_effect_range(0, 0); + rgblight_sethsv_noeeprom(HSV_WHITE); + rgblight_set_effect_range(0, 9); + } else if (wake_rgb_count < 11 && wake_rgb_count > 9) { + rgblight_sethsv_noeeprom(HSV_BLACK); + rgblight_set_effect_range(0, 8); + rgblight_sethsv_noeeprom(HSV_WHITE); + rgblight_set_effect_range(8, 9); + } else if (wake_rgb_count < 12 && wake_rgb_count > 10) { + rgblight_sethsv_noeeprom(HSV_BLACK); + rgblight_set_effect_range(0, 7); + rgblight_sethsv_noeeprom(HSV_WHITE); + rgblight_set_effect_range(7, 9); + } else if (wake_rgb_count < 13 && wake_rgb_count > 11) { + rgblight_sethsv_noeeprom(HSV_BLACK); + rgblight_set_effect_range(0, 6); + rgblight_sethsv_noeeprom(HSV_WHITE); + rgblight_set_effect_range(6, 9); + } else if (wake_rgb_count < 14 && wake_rgb_count > 12) { + rgblight_sethsv_noeeprom(HSV_BLACK); + rgblight_set_effect_range(0, 5); + rgblight_sethsv_noeeprom(HSV_WHITE); + rgblight_set_effect_range(5, 9); + } else if (wake_rgb_count < 15 && wake_rgb_count > 13) { + rgblight_sethsv_noeeprom(HSV_BLACK); + rgblight_set_effect_range(0, 4); + rgblight_sethsv_noeeprom(HSV_WHITE); + rgblight_set_effect_range(4, 9); + } else if (wake_rgb_count < 16 && wake_rgb_count > 14) { + rgblight_sethsv_noeeprom(HSV_BLACK); + rgblight_set_effect_range(0, 3); + rgblight_sethsv_noeeprom(HSV_WHITE); + rgblight_set_effect_range(3, 9); + } else if (wake_rgb_count < 17 && wake_rgb_count > 15) { + rgblight_sethsv_noeeprom(HSV_BLACK); + rgblight_set_effect_range(0, 2); + rgblight_sethsv_noeeprom(HSV_WHITE); + rgblight_set_effect_range(2, 9); + } else if (wake_rgb_count < 18 && wake_rgb_count > 16) { + rgblight_sethsv_noeeprom(HSV_BLACK); + rgblight_set_effect_range(0, 1); + rgblight_sethsv_noeeprom(HSV_WHITE); + rgblight_set_effect_range(1, 9); + } else if (wake_rgb_count > 17) { + // Final frame of wake-up rgb animation + rgblight_sethsv_noeeprom(HSV_BLACK); + rgblight_set_effect_range(0, 9); + waking_up = false; + print("I have awoken!\n"); +#ifdef AUDIO_ENABLE + // Play the wake-up sound *after* we finish the animation + if (do_wake_audio) { + PLAY_SONG(puzzle_song); + } +#endif + } + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + wake_rgb_count++; + wake_rgb_timer = timer_read(); + } + } +} + +// Spits out some unicode special characters in response to a tap-dance +void send_degree_symbol(tap_dance_state_t* state, void* user_data) { + switch (state->count) { + case 4: + // ℃ + unicode_input_start(); + register_hex(0x2103); + unicode_input_finish(); + print("You pressed the Degrees key 4 times!\n"); + reset_tap_dance(state); + break; + case 3: + //℉ + unicode_input_start(); + register_hex(0x2109); + unicode_input_finish(); + print("You pressed the Degrees key 3 times!\n"); + reset_tap_dance(state); + break; + case 2: + // € + unicode_input_start(); + register_hex(0x20AC); + unicode_input_finish(); + print("You pressed the Degrees key 2 times!\n"); + reset_tap_dance(state); + break; + case 1: + // ° + unicode_input_start(); + register_hex(0x00B0); + unicode_input_finish(); + print("You pressed the Degrees key 1 time!\n"); + reset_tap_dance(state); + break; + } +} + +// Handles per-key configuration of Retro-Tapping +bool get_retro_tapping(uint16_t keycode, keyrecord_t* record) { + switch (keycode) { + default: + return false; + } +} +// Handles per-key configuration of Hold-on-Other-Key-Press +bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t* record) { + switch (keycode) { + case QK_MOD_TAP ... QK_MOD_TAP_MAX: + return true; + default: + return false; + } +} +// Handles per-key configuration of Quick-Tap +uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t* record) { + switch (keycode) { + default: + return QUICK_TAP_TERM; + } +} +// Handles per-key configuration of Permissive-Hold +bool get_permissive_hold(uint16_t keycode, keyrecord_t* record) { + switch (keycode) { + default: + return false; + } +} +/* + * The following two functions make leader keys "musical" + * by playing sound at different stages of the leader chord + */ +// Called when you tap the Leader key +void leader_start_user(void) { +#ifdef AUDIO_ENABLE + PLAY_SONG(leader_started); +#endif +} +// Called when either the leader sequence is completed, or the leader timeout is hit +void leader_end_user(void) { + did_leader_succeed = false; + + if (leader_sequence_one_key(KC_E)) { + SEND_STRING(SS_LCTL(SS_LSFT("t"))); + did_leader_succeed = true; + } + if (leader_sequence_one_key(KC_C)) { + SEND_STRING(SS_LGUI("r") SS_DELAY(250) "calc\n"); + did_leader_succeed = true; + } + else if (leader_sequence_one_key(KC_V)) { + SEND_STRING(SS_LCTL("v")); + did_leader_succeed = true; + } + else if (leader_sequence_two_keys(KC_E, KC_D)) { + SEND_STRING(SS_LGUI("r") "cmd\n" SS_LCTL("c")); + did_leader_succeed = true; + } + else if (leader_sequence_two_keys(KC_A, KC_C)) { + SEND_STRING(SS_LCTL("a") SS_LCTL("c")); + did_leader_succeed = true; + } + else if (leader_sequence_three_keys(KC_C, KC_A, KC_T)) { + send_unicode_string("😸"); + did_leader_succeed = true; + } + else if (leader_sequence_three_keys(KC_B, KC_A, KC_T)) { + send_unicode_string("🦇"); + did_leader_succeed = true; + } + else if (leader_sequence_three_keys(KC_D, KC_O, KC_G)) { + send_unicode_string("🐶"); + did_leader_succeed = true; + } + else if (leader_sequence_five_keys(KC_S, KC_M, KC_I, KC_L, KC_E)) { + send_unicode_string("🙂"); + did_leader_succeed = true; + } + else if (leader_sequence_four_keys(KC_H, KC_A, KC_P, KC_Y)) { + send_unicode_string("🙂"); + did_leader_succeed = true; + } + else if (leader_sequence_five_keys(KC_H, KC_A, KC_P, KC_P, KC_Y)) { + send_unicode_string("🙂"); + did_leader_succeed = true; + } + else if (leader_sequence_three_keys(KC_S, KC_A, KC_D)) { + send_unicode_string("🙁"); + did_leader_succeed = true; + } + else if (leader_sequence_three_keys(KC_Y, KC_E, KC_S)) { + send_unicode_string("👍"); + did_leader_succeed = true; + } + else if (leader_sequence_two_keys(KC_N, KC_O)) { + send_unicode_string("👎"); + did_leader_succeed = true; + } + else if (leader_sequence_three_keys(KC_W, KC_O, KC_W)) { + send_unicode_string("🤯"); + did_leader_succeed = true; + } + else if (leader_sequence_three_keys(KC_P, KC_O, KC_O)) { + send_unicode_string("💩"); + did_leader_succeed = true; + } + else if (leader_sequence_four_keys(KC_P, KC_O, KC_O, KC_P)) { + send_unicode_string("💩"); + did_leader_succeed = true; + } + else if (leader_sequence_four_keys(KC_B, KC_O, KC_A, KC_T)) { + send_unicode_string("⛵"); + did_leader_succeed = true; + } + + if (did_leader_succeed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(leader_succeed); +#endif + } else { +#ifdef AUDIO_ENABLE + PLAY_SONG(leader_fail); +#endif + } +} + +// Monitors and labels the current state of any tap-dances +td_state_t cur_dance(tap_dance_state_t* state) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) return TD_SINGLE_TAP; + // Key has not been interrupted, but the key is still held. Means you want to send a 'HOLD'. + else + return TD_SINGLE_HOLD; + } else if (state->count == 2) { + if (state->interrupted) + return TD_DOUBLE_SINGLE_TAP; + else if (state->pressed) + return TD_DOUBLE_HOLD; + else + return TD_DOUBLE_TAP; + } + if (state->count == 3) { + if (state->interrupted || !state->pressed) + return TD_TRIPLE_TAP; + else + return TD_TRIPLE_HOLD; + } else + return TD_UNKNOWN; +} + +// Create an instance of 'td_tap_t' for each tap dance. +static td_tap_t sml_state = {.is_press_action = true, .state = TD_NONE}; +static td_tap_t scap_state = {.is_press_action = true, .state = TD_NONE}; +static td_tap_t slctl_state = {.is_press_action = true, .state = TD_NONE}; +static td_tap_t slalt_state = {.is_press_action = true, .state = TD_NONE}; + +// Left-Shift->Sticky-Caps tap-dance finished +void scap_finished(tap_dance_state_t* state, void* user_data) { + scap_state.state = cur_dance(state); + switch (scap_state.state) { + case TD_SINGLE_HOLD: + register_code(KC_LSFT); + break; + default: + if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) { + tap_code(KC_CAPS); + reset_tap_dance(state); + break; + } else { + if ((state->count) >= TAPPING_TOGGLE) { + tap_code(KC_CAPS); + reset_tap_dance(state); + break; + } else { + register_code(KC_LSFT); + break; + } + } + } +} + +// Left-Shift->Sticky-Caps tap-dance reset +void scap_reset(tap_dance_state_t* state, void* user_data) { + unregister_code(KC_LSFT); + scap_state.state = TD_NONE; +} + +// Sticky-Left-Control tap-dance finished +void slctl_finished(tap_dance_state_t* state, void* user_data) { + slctl_state.state = cur_dance(state); + switch (slctl_state.state) { + case TD_SINGLE_HOLD: + register_code(KC_LCTL); + break; + default: + if (lctl_sticky) { + unregister_code(KC_LCTL); + lctl_sticky = false; + PLAY_SONG(slctl_off); + reset_tap_dance(state); + break; + } else { + if ((state->count) >= TAPPING_TOGGLE) { + register_code(KC_LCTL); + lctl_sticky = true; + PLAY_SONG(slctl_on); + reset_tap_dance(state); + break; + } else { + register_code(KC_LCTL); + reset_tap_dance(state); + break; + } + } + } +} + +// Sticky-Left-Control tap-dance reset +void slctl_reset(tap_dance_state_t* state, void* user_data) { + if (!lctl_sticky) { + unregister_code(KC_LCTL); + slctl_state.state = TD_NONE; + } else { + slctl_state.state = TD_NONE; + } +} + +// Sticky-Left-Alt tap-dance finished +void slalt_finished(tap_dance_state_t* state, void* user_data) { + slalt_state.state = cur_dance(state); + switch (slalt_state.state) { + case TD_SINGLE_HOLD: + register_code(KC_LALT); + break; + default: + if (lalt_sticky) { + unregister_code(KC_LALT); + lalt_sticky = false; + PLAY_SONG(slalt_off); + reset_tap_dance(state); + break; + } else { + if ((state->count) >= TAPPING_TOGGLE) { + register_code(KC_LALT); + lalt_sticky = true; + PLAY_SONG(slalt_on); + reset_tap_dance(state); + break; + } else { + register_code(KC_LALT); + reset_tap_dance(state); + break; + } + } + } +} + +// Sticky-Left-Alt tap-dance reset +void slalt_reset(tap_dance_state_t* state, void* user_data) { + if (!lalt_sticky) { + unregister_code(KC_LALT); + slalt_state.state = TD_NONE; + } else { + slalt_state.state = TD_NONE; + } +} + +// Smiley key tap-dance finished +void sml_finished(tap_dance_state_t* state, void* user_data) { + sml_state.state = cur_dance(state); + switch (sml_state.state) { + default: + switch (state->count) { + default: + // 👍 + send_unicode_string("👍"); + print("You pressed the Emoji key at least 11 times!\n"); + reset_tap_dance(state); + break; + case 10: + // 👎 + send_unicode_string("👎"); + print("You pressed the Emoji key 10 times!\n"); + reset_tap_dance(state); + break; + case 9: + //🍌 + send_unicode_string("🍌"); + print("You pressed the Emoji key 9 times!\n"); + reset_tap_dance(state); + break; + case 8: + // 🍑 + send_unicode_string("🍑"); + print("You pressed the Emoji key 8 times!\n"); + reset_tap_dance(state); + break; + case 7: + // 🐕 + send_unicode_string("🐕"); + print("You pressed the Emoji key 7 times!\n"); + reset_tap_dance(state); + break; + case 6: + // 🐈 + send_unicode_string("🐈"); + print("You pressed the Emoji key 6 times!\n"); + reset_tap_dance(state); + break; + case 5: + // 🐍 + send_unicode_string("🐍"); + print("You pressed the Emoji key 5 times!\n"); + reset_tap_dance(state); + break; + case 4: + //🐒 + send_unicode_string("🐒"); + print("You pressed the Emoji key 4 times!\n"); + reset_tap_dance(state); + break; + case 3: + // 💩 + send_unicode_string("💩"); + print("You pressed the Emoji key 3 times!\n"); + reset_tap_dance(state); + break; + case 2: + // 🙁 + send_unicode_string("🙁"); + print("You pressed the Emoji key 2 times!\n"); + reset_tap_dance(state); + break; + case 1: + // 🙂 + send_unicode_string("🙂"); + print("You pressed the Emoji key 1 time!\n"); + reset_tap_dance(state); + break; + } + break; + case TD_SINGLE_HOLD: + // 👍 + send_unicode_string("👍"); + print("You single-held the Emoji key!\n"); + reset_tap_dance(state); + break; + case TD_DOUBLE_HOLD: + // 👎 + send_unicode_string("👎"); + print("You double-held the Emoji key!\n"); + reset_tap_dance(state); + break; + case TD_TRIPLE_HOLD: + //🤯 + send_unicode_string("🤯"); + print("You triple-held the Emoji key!\n"); + reset_tap_dance(state); + break; + case TD_NONE: + reset_tap_dance(state); + break; + } +} +void sml_reset(tap_dance_state_t* state, void* user_data) { sml_state.state = TD_NONE; } + +// Tap Dance definitions +tap_dance_action_t tap_dance_actions[] = { + // Tap once for °, twice for ℉, thrice for ℃ + [TD_DEG_DEGF] = ACTION_TAP_DANCE_FN(send_degree_symbol), // + [TD_LSHFT_CAPS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, scap_finished, scap_reset), // + [TD_LCTL_STICKY] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, slctl_finished, slctl_reset), // + [TD_LALT_STICKY] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, slalt_finished, slalt_reset), // + [TD_SMILEY] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, sml_finished, sml_reset), +}; + +uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case TD(TD_LSHFT_CAPS): + case TD(TD_LCTL_STICKY): + case TD(TD_LALT_STICKY): + return 200; + case TD(TD_SMILEY): + return 500; + default: + return TAPPING_TERM; + } +} + +// Dip-Switch controls +void dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { + PLAY_SONG(plover_song); + } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { + PLAY_SONG(plover_gb_song); + } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } +} + +// Runs at every complete matrix scan +void matrix_scan_user(void) { + // Some code for controlling MIDI output +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif + // Check the shift-state and hold-time for the Irony key + if (irony_active) { + if ((get_mods() & MOD_MASK_SHIFT)) { + irony_shifted = true; + } else { + irony_shifted = false; + } + if (timer_elapsed(irony_pressed_time) >= IRONY_HOLD_DELAY) { + if (irony_shifted) { + send_unicode_string(bang_str); + } else { + send_unicode_string(irony_str); + } + } + } + + // Monitor and respond to the current Alt+Tab state + if (is_alt_tab_active) { + if (timer_elapsed(alt_tab_timer) > 1000) { + unregister_code(KC_LALT); + is_alt_tab_active = false; + } + } + // Run the wake-up RGB animation if performing wake-up + if (do_wake_animation) { + rgb_wakeup_sequence(); + } +} + +// Music mask controls + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} + +void suspend_power_down_user(void) { + // Runs during start of system suspend + print("Going to sleep."); +} + +void suspend_wakeup_init_user(void) { + // Runs during wake from system suspend +} + +void keyboard_post_init_user(void) { + // Print welcome message to console + printf("Welcome to %s!\n", KEEB_MODEL_NAME); + // Read the user config from EEPROM + user_config.raw = eeconfig_read_user(); + do_wake_animation = user_config.do_wakeup_animation; + do_wake_audio = user_config.do_wakeup_audio; + rgbcon_tracker = user_config.rgbcon_tracker; + + // Tell the console the status of saved config + if (user_config.do_wakeup_animation) { + print("Wake animation enabled.\n"); + } else { + print("Wake animation disabled.\n"); + } + if (user_config.do_wakeup_audio) { + print("Wake music enabled.\n"); + } else { + print("Wake music disabled.\n"); + } + switch (user_config.rgbcon_tracker) { + case 2: + print("RGB mode: Static White\n"); + break; + case 3: + print("RGB mode: Static Cyan\n"); + break; + case 4: + print("RGB mode: Breathing Lights\n"); + break; + case 5: + print("RGB mode: Rainbow Swirl\n"); + break; + case 6: + print("RGB mode: Rainbow Mood\n"); + break; + default: + print("RGB mode: Disabled RGB\n"); + break; + } + + // Enable the LED layers + rgblight_enable_noeeprom(); // Enables RGB, without saving settings + rgblight_layers = my_rgb_layers; + + /* + * Initialize the LED crawl wake animation here + * To perform it on just the first wake + */ + wake_rgb_timer = timer_read(); + waking_up = true; + + // Initialize OLED display + /* + if (USING_OLED_DISPLAY) { + print("Initializing display!\n"); + render_logo(); + } + */ +} + +// EEPROM is getting reset! +void eeconfig_init_user(void) { + user_config.raw = 0; + eeconfig_update_user(user_config.raw); // Write default value to EEPROM now +} + +// Communicate 2-way with host via HID_RAW +#ifdef RAW_ENABLE +void raw_hid_receive(uint8_t* data, uint8_t length) { + // Sample code below simply echoes back to the console any data received by the raw_hid process + +# ifdef CONSOLE_ENABLE + dprint("Received USB data from host system:\n"); + dprintf("%s\n", data); +# endif +} +#endif diff --git a/keyboards/planck/keymaps/rootiest/readme.md b/keyboards/planck/keymaps/rootiest/readme.md new file mode 100644 index 000000000000..7932ce3fee3c --- /dev/null +++ b/keyboards/planck/keymaps/rootiest/readme.md @@ -0,0 +1,37 @@ + +![Layout Image](https://github.com/rootiest/rootiest.github.io/raw/main/img/rootiest-planck_legend.png) + +# The Rootiest Planck Layout + +This layout takes advantage of as many QMK features as possible for a huge complicated beast of a keyboard! + +## Features include + +- Encoder functions further extended by layers and modifiers +- Extensive use of the on-board speaker +- Extensive use of the backlight LEDs for startup animations, layer indicators, and bootloader/debug warnings, etc +- Many layers, both toggled and momentary. +- A toggled Numpad layer, with an emphasis on coding/accounting and with arrow keys on WASD +- A "Tabular" layer accessed by holding Tab with frequently used functions, including Alt+Tab via pressing Space +- A toggled Mouse-keys layer that allows full control of the mouse movement and buttons from the keyboard +- Use of Space-Cadet Shift/Ctrl keys on various layers +- Hold enter for Right-Shift +- Shift+BackSpace for Delete +- Grave-Esc in the top-left Esc key position +- Music, Terminal, MIDI, and RGB control on Functions layer +- QWERTY, COLEMAK, DVORAK, and PLOVER layers +- Special keys for common Ctrl+ combos like Ctrl+C, Ctrl+V, etc +- Special keys for Copy-Line, Cut-Line, Delete-Line, etc +- Special keys for Ctrl+Alt+Del, Alt+F4, etc +- Settings like rgb animation state and startup animation/sound are stored in the EEPROM to survive restart +- "Sticky keys" with audible indication allow most modifiers to be locked by pressing multiple times in quick succession +- Sticky-locking the Shift key toggles CapsLock instead of locking Shift +- Unicode characters and emoji can be sent via custom tap-dance keys +- Emoji and app-specific functions can be sent via leader-key chording +- VelociKey and word-per-minute tracking are also included + +See the layout here: [Keyboard Layout](http://www.keyboard-layout-editor.com/#/gists/e48e19bc251a8d07ff8475fc1a16f43b) + +To build and flash this keymap, use this command: + + qmk flash -kb planck/rev6 -km rootiest diff --git a/keyboards/planck/keymaps/rootiest/rules.mk b/keyboards/planck/keymaps/rootiest/rules.mk new file mode 100644 index 000000000000..ca0f90b6e9a8 --- /dev/null +++ b/keyboards/planck/keymaps/rootiest/rules.mk @@ -0,0 +1,24 @@ +SRC += muse.c +ENCODER_ENABLE = yes # Enables basic encoder support +OLED_ENABLE = yes +OLED_DRIVER = SSD1306 # Enables support for OLED displays +# UNICODE_ENABLE = yes # Allow inputting basic unicode characters +UNICODEMAP_ENABLE = yes # Enable use of Unicode mapping array +# UCIS_ENABLE = yes # Another method for generating Unicode characters via maps +TAP_DANCE_ENABLE = yes # Enable Tap-Dance +NKRO_ENABLE = yes # Enable N-Key rollover +MOUSEKEY_ENABLE = yes # Enable mouse emulation +EXTRAKEY_ENABLE = yes # Allows audio control and System control +RAW_ENABLE = yes # Enable bi-directional communication to host +CONSOLE_ENABLE = yes # Enable outputting debugging data/logs to terminal +WPM_ENABLE = yes # Enable on-board words-per-minute tracking +VELOCIKEY_ENABLE = yes # Enables dynamically changing rgb animation speed based on WPM +LEADER_ENABLE = yes # Enables Leader-Key +COMBO_ENABLE = yes # Enables combo keys +KEY_LOCK_ENABLE = yes # Enables using lock key to maintain holds +# LTO_ENABLE = yes # Does some optimisation to make firmware size smaller +# SWAP_HANDS_ENABLE = yes # Enables the swap hands function +# DEBOUNCE_TYPE = sym_eager_pk # Change debounce algorithm + +# NOTE: The following is not yet available in main qmk branch +KEY_OVERRIDE_ENABLE = yes # Allows overiding modifier combos (change Shift+1 without affecting 1 or Shift's normal operation) diff --git a/keyboards/planck/keymaps/samuel/README.org b/keyboards/planck/keymaps/samuel/README.org new file mode 100644 index 000000000000..ab6ce423939a --- /dev/null +++ b/keyboards/planck/keymaps/samuel/README.org @@ -0,0 +1,492 @@ +#+Title: Samuel's Literate QMK Config +#+PROPERTY: header-args :tangle ~/qmk_firmware/keyboards/planck/keymaps/samuel/keymap.c + +This is my qmk firmware for my keyboard. I grew tired of organizing the keycode +array in plain text so I made it a literate .org file. I've never done this +before, so bear with me. + +* Layers + + #+BEGIN_COMMENT + #+NAME: empty-layer + | <6> | <6> | <6> | <6> | <6> | <6> | <6> | <6> | <6> | <6> | <6> | <6> | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | - | - | - | - | - | - | - | - | - | - | - | - | + | - | - | - | - | - | - | - | - | - | - | - | - | + | - | - | - | - | - | - | - | - | - | - | - | - | + | - | - | - | - | - | - | - | - | - | - | - | - | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + #+END_COMMENT + + This is my "pretty" org mode organized table for my main dvorak layer. If you + don't use org mode, it won't be that exciting, but if you enjoy working in org + mode, you can edit this table directly, and this file is tangled to the actual + keymap. No more organizing spaces or converting to and from comments. + + #+NAME: home-layer + |--------+--------+------+------+-----+-----+------+-----+------+-------+--------+--------| + | T_LRSE | QUOT | COMM | DOT | P | Y | F | G | C | R | L | T_RRSE | + | T_LSFT | A | O | E | U | I | D | H | T | N | S | T_RSFT | + | T_LCTL | SCLN | Q | J | K | X | B | M | W | V | Z | T_RCTL | + | T_LGUI | T_LALT | UP | DOWN | SPC | EQL | GRAVE | SPC | LEFT | RIGHT | T_RALT | T_RGUI | + |--------+--------+------+------+-----+-----+------+-----+------+-------+--------+--------| + + Tap keys. Used only with the "T_" keys above. + + #+NAME: tap-layer + |----------+------+---+---+---+---+---+---+---+---+------+----------| + | DEL | - | - | - | - | - | - | - | - | - | - | BSPC | + | TAB | - | - | - | - | - | - | - | - | - | - | ENTER | + | LBRACKET | - | - | - | - | - | - | - | - | - | - | RBRACKET | + | SLASH | LPRN | - | - | - | - | - | - | - | - | RPRN | MINS | + |----------+------+---+---+---+---+---+---+---+---+------+----------| + + #+NAME: hold-layer + |------+------+---+---+---+---+---+---+---+---+------+------| + | RISE | - | - | - | - | - | - | - | - | - | - | RISE | + | LSFT | - | - | - | - | - | - | - | - | - | - | RSFT | + | LCTL | - | - | - | - | - | - | - | - | - | - | RCTL | + | LGUI | LALT | - | - | - | - | - | - | - | - | RALT | RGUI | + |------+------+---+---+---+---+---+---+---+---+------+------| + + I tried to keep my layout bare bones, just what would be available on a normal + keyboard, minus some keys I never used. This one secondary layer should cover a + majority of the keys not found on the home layer. The bottom left copies a normal + keyboards symbols from shifted numbers, and the rest is placed where convenient, + with some considerations for one handed use, hence the shortcuts in the top + left. + + #+NAME: secondary-layer + |--------+--------+--------+--------+--------+------+--------+-----+--------+--------+-------+--------| + | -- | EZUNDO | EZCOPY | EZCUT | EZPSTE | INS | ASTR | 7 | 8 | 9 | -- | -- | + | EZSHFT | ESC | CAPS | PGUP | PGDN | HOME | AMPR | 4 | 5 | 6 | 0 | EZSHFT | + | EZCTRL | EXLM | AT | HASH | DLR | PERC | CIRC | 1 | 2 | 3 | COM | EZCTRL | + | EZGUI | EZALT | EZUP | EZDOWN | SPC | PIPE | BSLASH | END | EZLEFT | EZRGHT | EZALT | EZGUI | + |--------+--------+--------+--------+--------+------+--------+-----+--------+--------+-------+--------| + + Basic command layer for one-shot macros and function keys. + + #+NAME: command-layer + |----+-----+-----+-----+-----+--------+--------+-----+-----+-----+-----+----| + | -- | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | -- | + | -- | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | -- | + | -- | F21 | F22 | F23 | F24 | QWERTY | DVORAK | -- | -- | -- | -- | -- | + | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | + |----+-----+-----+-----+-----+--------+--------+-----+-----+-----+-----+----| + + This qwerty layout is just so normal people can try out the board. Tap keys + would need to be customized I think, more on that later. I also put another + dvorak key here because I have nightmares of getting trapped in this forsaken + layout. + + #+NAME: qwerty-layer + |--------+--------+----+------+-----+-----+------+-----+------+-------+--------+--------| + | T_LRSE | Q | W | E | R | T | Y | U | I | O | P | T_RRSE | + | T_LSFT | A | S | D | F | G | H | J | K | L | SCLN | T_RSFT | + | T_LCTL | Z | X | C | V | B | N | M | COMM | DOT | QUOT | T_RCTL | + | T_LGUI | T_LALT | UP | DOWN | SPC | EQL | GRAVE | SPC | LEFT | RIGHT | T_RALT | DVORAK | + |--------+--------+----+------+-----+-----+------+-----+------+-------+--------+--------| + + +* Keymap Conversion in Python + + This python can convert that table into the array needed for the keymap file. It + simply prepends every key with "KC_". I used to use a dictionary to convert some + keys from the table into qmk keycodes, but the double convertion was + unneccessary so I just prepended all my macros with KC and moved all the + implementation to the `process-user-input` function. + + #+NAME:layer-to-array + #+BEGIN_SRC python :var keys=secondary-layer :tangle no + row = 0 + results = '' + while row < len(keys): + key = 0 + while key < len(keys[row]): + keyName = str(keys[row][key]) + if keyName == '--': + keyName = 'TRANSPARENT' + results += 'KC_' + keyName + if key != 11: + results += ', ' + key+=1 + if row != 3: + results += ',' + results += '\n' + row+=1 + return results + #+END_SRC + + Tap keys are technically defined in the mod_lift function. but this is will + implement that function from the org table. + + #+NAME:define-tap-key + #+BEGIN_SRC python :var row=3 :var col=1 :var id=0 :var tapkeys=tap-layer :var holdkeys=hold-layer :tangle no + def getKey(keys, istapkey): + if istapkey == True: + keyName = str(keys[row][col]) + else: + keyName = str(keys[row][col]) + if keyName == '--': + keyName = 'TRANSPARENT' + if istapkey == False: + return 'KC_T_' + keyName, 'KC_' + keyName + else: + return 'KC_' + keyName + tapKeyName = getKey(tapkeys, True) + holdKeyMacro, holdKeyName = getKey(holdkeys, False) + return """case %s: + if (record->event.pressed) { + mod_press(%s, %s, %i); + } else { + mod_lift(%s, %s, %i); + } + return false; + break;""" % (holdKeyMacro, tapKeyName, holdKeyName, id, tapKeyName, holdKeyName, id) + + #+END_SRC + + +* keymap.c + + Now that we laid out our layout, lets lay out our keymap file. + +** Headers + + #+BEGIN_SRC C :noweb yes +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + + #+END_SRC + +** Keycodes + + #+BEGIN_SRC C :noweb yes +// where the 'T_' communicates how the key does something different when tapped. +enum planck_keycodes { +//DVORAK = SAFE_RANGE, +KC_T_LALT = SAFE_RANGE, +KC_T_RALT, +KC_T_LGUI, +KC_T_RGUI, +KC_T_LCTL, +KC_T_RCTL, +KC_T_LSFT, +KC_T_RSFT, +KC_T_LRSE, +KC_T_RRSE, +KC_EZRGHT, +KC_EZLEFT, +KC_EZUP, +KC_EZDOWN, +KC_EZUNDO, +KC_EZCOPY, +KC_EZCUT, +KC_EZPSTE, +KC_EZSHFT, +KC_EZCTRL, +KC_EZGUI, +KC_EZALT, +KC_DVORAK, +KC_QWERTY, +KC_COM +}; + + #+END_SRC + +** Import Key table + + #+BEGIN_SRC C :noweb yes +enum planck_layers { +_DVORAK, +_QWERTY, +_RISE, +_COMMAND +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + #+END_SRC + + #+BEGIN_SRC C :noweb yes +[_DVORAK] = LAYOUT_planck_grid( +<> +), +[_QWERTY] = LAYOUT_planck_grid( +<> +), +[_RISE] = LAYOUT_planck_grid( +<> +), +[_COMMAND] = LAYOUT_planck_grid( +<> +) +}; + + #+END_SRC + +** Tap Keys + + I don't like tap keys coming out on release. When modified, I often let go of + the modifier too early because the tap button doesn't come out untill release. I + guess you could save the state of the board on press and then apply it after the + timer, but what I really want is the keys to come out on press when they can and + when it is most useful. For me, that is when they are modified a single time. So + I kind of "locked" the board into only doing single modifiers, making them faster. + Disadvantages are double modified keys must be done with one shot keys (its + actually not that bad, it feels like emacs!) and triple modified keys are + impossible at the moment. + + #+BEGIN_SRC C :noweb yes + + static uint16_t tap_timer = 0; + char last_mod = 10; + + void mod_press(uint16_t tap_code, uint16_t hold_code, int id) { + /* this first if body makes double modified keys impossible, but stops the */ + /* delay when modifying a tap key which would result in the tap key not */ + /* getting modified. */ + if (last_mod != id && last_mod != 10) { + tap_code16(tap_code); + last_mod = 10; + } else { + tap_timer = timer_read(); + last_mod = id; + register_code(hold_code); + } + } + + void mod_lift(uint16_t tap_code, uint16_t hold_code, int id) { + unregister_code(hold_code); + if (last_mod == id && timer_elapsed(tap_timer) < TAPPING_TERM) { + tap_code16(tap_code); + } + last_mod = 10; + } + + #+END_SRC +** Process User Input + + #+BEGIN_SRC C :noweb yes +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + #+END_SRC + +*** Layouts + + Set Dvorak layout + + #+BEGIN_SRC C :noweb yes + case KC_DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return true; + break; + + #+END_SRC + + Set Qwerty layout. + + #+BEGIN_SRC C :noweb yes + case KC_QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return true; + break; + + #+END_SRC + +*** Custom Keys +**** Command Layer One Shot + + #+BEGIN_SRC C :noweb yes + case KC_COM: + if (record->event.pressed) { + layer_on(_COMMAND); + set_oneshot_layer(_COMMAND, ONESHOT_START); + last_mod = 10; + } else { + clear_oneshot_layer_state (ONESHOT_PRESSED); + } + return false; + break; + #+END_SRC + +**** Tap Keys + + #+BEGIN_SRC C :noweb yes + <> + <> + <> + <> + <> + <> + <> + <> + #+END_SRC + +**** Rise Keys + + #+BEGIN_SRC C :noweb yes + case KC_T_LRSE: + if (record->event.pressed) { + tap_timer = timer_read(); + last_mod = 8; + layer_on(_RISE); + } else { + layer_off(_RISE); + if (last_mod == 8 && timer_elapsed(tap_timer) < TAPPING_TERM) { + tap_code16(KC_DELETE); + last_mod = 10; + } + } + return false; + break; + case KC_T_RRSE: + if (record->event.pressed) { + tap_timer = timer_read(); + last_mod = 9; + layer_on(_RISE); + } else { + layer_off(_RISE); + if (last_mod == 9 && timer_elapsed(tap_timer) < TAPPING_TERM) { + tap_code16(KC_BACKSPACE); + last_mod = 10; + } + } + return false; + break; + + #+END_SRC + +**** One Shot Keys + + Since I made modified tap keys occur on press instead of release, I need one + shot keys to press any key with more than one modifier. + + #+BEGIN_SRC C :noweb yes + case KC_EZSHFT: + if (record->event.pressed) { + set_oneshot_mods(MOD_LSFT); + last_mod = 10; + } + return false; + break; + case KC_EZCTRL: + if (record->event.pressed) { + set_oneshot_mods(MOD_LCTL); + last_mod = 10; + } + return false; + break; + case KC_EZALT: + if (record->event.pressed) { + set_oneshot_mods(MOD_LALT); + last_mod = 10; + } + return false; + break; + case KC_EZGUI: + if (record->event.pressed) { + set_oneshot_mods(MOD_LGUI); + last_mod = 10; + } + return false; + break; + + #+END_SRC + +**** C-S Arrows + + I use ctrl+shift+arrows keys a lot, so when the layer key is pressed they became + lazy versions of themselves with control and shift already pressed. + + I also added undo, copy, paste, and cut to be easily available with only the + left hand like on a qwerty or colemek keyboard. + + #+BEGIN_SRC C :noweb yes + case KC_EZRGHT: + if (record->event.pressed) { + register_code(KC_LCTL); + tap_code16(S(KC_RGHT)); + unregister_code(KC_LCTL); + last_mod = 10; + } + return false; + break; + case KC_EZLEFT: + if (record->event.pressed) { + register_code(KC_LCTL); + tap_code16(S(KC_LEFT)); + unregister_code(KC_LCTL); + last_mod = 10; + } + return false; + break; + case KC_EZDOWN: + if (record->event.pressed) { + register_code(KC_LCTL); + tap_code16(S(KC_DOWN)); + unregister_code(KC_LCTL); + last_mod = 10; + } + return false; + break; + case KC_EZUP: + if (record->event.pressed) { + register_code(KC_LCTL); + tap_code16(S(KC_UP)); + unregister_code(KC_LCTL); + last_mod = 10; + } + return false; + break; + #+END_SRC + +**** Undo, Copy, Cut, Paste + + #+BEGIN_SRC C :noweb yes + case KC_EZUNDO: + if (record->event.pressed) { + tap_code16(C(KC_Z)); + last_mod = 10; + } + return false; + break; + case KC_EZCOPY: + if (record->event.pressed) { + tap_code16(C(KC_C)); + last_mod = 10; + } + return false; + break; + case KC_EZCUT: + if (record->event.pressed) { + tap_code16(C(KC_X)); + last_mod = 10; + } + return false; + break; + case KC_EZPSTE: + if (record->event.pressed) { + tap_code16(C(KC_V)); + last_mod = 10; + } + return false; + break; + #+END_SRC + +*** Standard inputs interupt tap + + Finally, if just a standard key is tapped, set the interupted flag. + Keep this last. + + #+BEGIN_SRC C :noweb yes + } + last_mod = 10; + return true; + } + #+END_SRC diff --git a/keyboards/planck/keymaps/samuel/config.h b/keyboards/planck/keymaps/samuel/config.h new file mode 100644 index 000000000000..95bfdd36fef0 --- /dev/null +++ b/keyboards/planck/keymaps/samuel/config.h @@ -0,0 +1 @@ +#define TAPPING_TERM 250 diff --git a/keyboards/planck/keymaps/samuel/keymap.c b/keyboards/planck/keymaps/samuel/keymap.c new file mode 100644 index 000000000000..c6e4240916b9 --- /dev/null +++ b/keyboards/planck/keymaps/samuel/keymap.c @@ -0,0 +1,315 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// where the 'T_' communicates how the key does something different when tapped. +enum planck_keycodes { +//DVORAK = SAFE_RANGE, +KC_T_LALT = SAFE_RANGE, +KC_T_RALT, +KC_T_LGUI, +KC_T_RGUI, +KC_T_LCTL, +KC_T_RCTL, +KC_T_LSFT, +KC_T_RSFT, +KC_T_LRSE, +KC_T_RRSE, +KC_EZRGHT, +KC_EZLEFT, +KC_EZUP, +KC_EZDOWN, +KC_EZUNDO, +KC_EZCOPY, +KC_EZCUT, +KC_EZPSTE, +KC_EZSHFT, +KC_EZCTRL, +KC_EZGUI, +KC_EZALT, +KC_DVORAK, +KC_QWERTY, +KC_COM +}; + +enum planck_layers { +_DVORAK, +_QWERTY, +_RISE, +_COMMAND +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_DVORAK] = LAYOUT_planck_grid( +KC_T_LRSE, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_T_RRSE, +KC_T_LSFT, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_T_RSFT, +KC_T_LCTL, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_T_RCTL, +KC_T_LGUI, KC_T_LALT, KC_UP, KC_DOWN, KC_SPC, KC_EQL, KC_GRAVE, KC_SPC, KC_LEFT, KC_RIGHT, KC_T_RALT, KC_T_RGUI +), +[_QWERTY] = LAYOUT_planck_grid( +KC_T_LRSE, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_T_RRSE, +KC_T_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_T_RSFT, +KC_T_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_QUOT, KC_T_RCTL, +KC_T_LGUI, KC_T_LALT, KC_UP, KC_DOWN, KC_SPC, KC_EQL, KC_GRAVE, KC_SPC, KC_LEFT, KC_RIGHT, KC_T_RALT, KC_DVORAK +), +[_RISE] = LAYOUT_planck_grid( +KC_TRANSPARENT, KC_EZUNDO, KC_EZCOPY, KC_EZCUT, KC_EZPSTE, KC_INS, KC_ASTR, KC_7, KC_8, KC_9, KC_TRANSPARENT, KC_TRANSPARENT, +KC_EZSHFT, KC_ESC, KC_CAPS, KC_PGUP, KC_PGDN, KC_HOME, KC_AMPR, KC_4, KC_5, KC_6, KC_0, KC_EZSHFT, +KC_EZCTRL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_1, KC_2, KC_3, KC_COM, KC_EZCTRL, +KC_EZGUI, KC_EZALT, KC_EZUP, KC_EZDOWN, KC_SPC, KC_PIPE, KC_BSLS, KC_END, KC_EZLEFT, KC_EZRGHT, KC_EZALT, KC_EZGUI +), +[_COMMAND] = LAYOUT_planck_grid( +KC_TRANSPARENT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRANSPARENT, +KC_TRANSPARENT, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_TRANSPARENT, +KC_TRANSPARENT, KC_F21, KC_F22, KC_F23, KC_F24, KC_QWERTY, KC_DVORAK, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, +KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT +) +}; + +static uint16_t tap_timer = 0; +char last_mod = 10; + +void mod_press(uint16_t tap_code, uint16_t hold_code, int id) { + /* this first if body makes double modified keys impossible, but stops the */ + /* delay when modifying a tap key which would result in the tap key not */ + /* getting modified. */ + if (last_mod != id && last_mod != 10) { + tap_code16(tap_code); + last_mod = 10; + } else { + tap_timer = timer_read(); + last_mod = id; + register_code(hold_code); + } +} + +void mod_lift(uint16_t tap_code, uint16_t hold_code, int id) { + unregister_code(hold_code); + if (last_mod == id && timer_elapsed(tap_timer) < TAPPING_TERM) { + tap_code16(tap_code); + } + last_mod = 10; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + +case KC_DVORAK: +if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); +} +return true; +break; + +case KC_QWERTY: +if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); +} +return true; +break; + +case KC_COM: +if (record->event.pressed) { + layer_on(_COMMAND); + set_oneshot_layer(_COMMAND, ONESHOT_START); + last_mod = 10; +} else { + clear_oneshot_layer_state (ONESHOT_PRESSED); +} +return false; +break; + +case KC_T_LALT: + if (record->event.pressed) { + mod_press(KC_LPRN, KC_LALT, 0); + } else { + mod_lift(KC_LPRN, KC_LALT, 0); + } + return false; + break; +case KC_T_RALT: + if (record->event.pressed) { + mod_press(KC_RPRN, KC_RALT, 1); + } else { + mod_lift(KC_RPRN, KC_RALT, 1); + } + return false; + break; +case KC_T_LGUI: + if (record->event.pressed) { + mod_press(KC_SLASH, KC_LGUI, 2); + } else { + mod_lift(KC_SLASH, KC_LGUI, 2); + } + return false; + break; +case KC_T_RGUI: + if (record->event.pressed) { + mod_press(KC_MINS, KC_RGUI, 3); + } else { + mod_lift(KC_MINS, KC_RGUI, 3); + } + return false; + break; +case KC_T_LCTL: + if (record->event.pressed) { + mod_press(KC_LEFT_BRACKET, KC_LCTL, 4); + } else { + mod_lift(KC_LEFT_BRACKET, KC_LCTL, 4); + } + return false; + break; +case KC_T_RCTL: + if (record->event.pressed) { + mod_press(KC_RIGHT_BRACKET, KC_RCTL, 5); + } else { + mod_lift(KC_RIGHT_BRACKET, KC_RCTL, 5); + } + return false; + break; +case KC_T_LSFT: + if (record->event.pressed) { + mod_press(KC_TAB, KC_LSFT, 6); + } else { + mod_lift(KC_TAB, KC_LSFT, 6); + } + return false; + break; +case KC_T_RSFT: + if (record->event.pressed) { + mod_press(KC_ENTER, KC_RSFT, 7); + } else { + mod_lift(KC_ENTER, KC_RSFT, 7); + } + return false; + break; + +case KC_T_LRSE: +if (record->event.pressed) { + tap_timer = timer_read(); + last_mod = 8; + layer_on(_RISE); +} else { + layer_off(_RISE); + if (last_mod == 8 && timer_elapsed(tap_timer) < TAPPING_TERM) { + tap_code16(KC_DELETE); + last_mod = 10; + } +} +return false; +break; +case KC_T_RRSE: +if (record->event.pressed) { + tap_timer = timer_read(); + last_mod = 9; + layer_on(_RISE); +} else { + layer_off(_RISE); + if (last_mod == 9 && timer_elapsed(tap_timer) < TAPPING_TERM) { + tap_code16(KC_BACKSPACE); + last_mod = 10; + } +} +return false; +break; + +case KC_EZSHFT: +if (record->event.pressed) { + set_oneshot_mods(MOD_LSFT); + last_mod = 10; +} +return false; +break; +case KC_EZCTRL: +if (record->event.pressed) { + set_oneshot_mods(MOD_LCTL); + last_mod = 10; +} +return false; +break; +case KC_EZALT: +if (record->event.pressed) { + set_oneshot_mods(MOD_LALT); + last_mod = 10; +} +return false; +break; +case KC_EZGUI: +if (record->event.pressed) { + set_oneshot_mods(MOD_LGUI); + last_mod = 10; +} +return false; +break; + +case KC_EZRGHT: +if (record->event.pressed) { + register_code(KC_LCTL); + tap_code16(S(KC_RGHT)); + unregister_code(KC_LCTL); + last_mod = 10; +} +return false; +break; +case KC_EZLEFT: +if (record->event.pressed) { + register_code(KC_LCTL); + tap_code16(S(KC_LEFT)); + unregister_code(KC_LCTL); + last_mod = 10; +} +return false; +break; +case KC_EZDOWN: +if (record->event.pressed) { + register_code(KC_LCTL); + tap_code16(S(KC_DOWN)); + unregister_code(KC_LCTL); + last_mod = 10; +} +return false; +break; +case KC_EZUP: +if (record->event.pressed) { + register_code(KC_LCTL); + tap_code16(S(KC_UP)); + unregister_code(KC_LCTL); + last_mod = 10; +} +return false; +break; + +case KC_EZUNDO: +if (record->event.pressed) { + tap_code16(C(KC_Z)); + last_mod = 10; +} +return false; +break; +case KC_EZCOPY: +if (record->event.pressed) { + tap_code16(C(KC_C)); + last_mod = 10; +} +return false; +break; +case KC_EZCUT: +if (record->event.pressed) { + tap_code16(C(KC_X)); + last_mod = 10; +} +return false; +break; +case KC_EZPSTE: +if (record->event.pressed) { + tap_code16(C(KC_V)); + last_mod = 10; +} +return false; +break; + +} +last_mod = 10; +return true; +} diff --git a/keyboards/planck/keymaps/sascha/keymap.c b/keyboards/planck/keymaps/sascha/keymap.c new file mode 100644 index 000000000000..aaa2c282153c --- /dev/null +++ b/keyboards/planck/keymaps/sascha/keymap.c @@ -0,0 +1,41 @@ +#include "backlight.h" +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_planck_grid( + /* ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┐ + * │ Esc │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ Bksp │ + * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤ + * │ Tab │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; : │ Entr │ + * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤ + * │ Shft │ Y │ X │ C │ V │ B │ N │ M │ , < │ . > │ / ? │ ' " │ + * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤ + * │ Ctrl │ Alt │ ` ~ │ - _ │ = + │ Spce │ \ | │ ( │ ) │ [ { │ ] } │ Lr 1 │ + * └──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘ + */ + KC_ESC , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Z , KC_U , KC_I , KC_O , KC_P , KC_BSPC, + KC_TAB , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_ENT, + KC_LSFT , KC_Y , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_QUOT, + KC_LCTL , KC_LALT , KC_GRV , KC_MINS , KC_EQL , KC_SPC , KC_BSLS , KC_LPRN , KC_RPRN , KC_LBRC , KC_RBRC , MO(1) + ), +[1] = LAYOUT_planck_grid( + /* ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┐ + * │ ~ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ DEL │ + * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤ + * │ ` │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ü │ ö │ ä │ + * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤ + * │ SINS │ … │ ’ │ “ │ ” │ ← │ → │ € │ ß │ Ü │ Ö │ Ä │ + * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤ + * │ Rset │ BLSt │ F1 │ Home │ End │ PgUp │ PgDn │ Left │ Down │ Up │ Rght │ │ + * └──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘ + */ + KC_TILD , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_DEL, + KC_GRV , KC_EXLM , KC_AT , KC_HASH , KC_DLR , KC_PERC , KC_CIRC , KC_AMPR , KC_ASTR , UC(L'ü') , UC(L'ö') , UC(L'ä'), + S(KC_INS) , UC(L'…') , UC(L'’') , UC(L'“') , UC(L'”') , UC(L'←') , UC(L'→') , UC(L'€') , UC(L'ß') , UC(L'Ü') , UC(L'Ö') , UC(L'Ä'), + QK_BOOT , BL_STEP , KC_F1 , KC_HOME , KC_END , KC_PGUP , KC_PGDN , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , KC_TRNS + ) +}; + +void matrix_init_user(void) { + set_unicode_input_mode(UNICODE_MODE_LINUX); +}; diff --git a/keyboards/planck/keymaps/sascha/rules.mk b/keyboards/planck/keymaps/sascha/rules.mk new file mode 100644 index 000000000000..78ac4ca82563 --- /dev/null +++ b/keyboards/planck/keymaps/sascha/rules.mk @@ -0,0 +1,15 @@ +AUTO_SHIFT_ENABLE = no +AUTO_SHIFT_MODIFIERS = no +UNICODE_ENABLE = yes +LTO_ENABLE = yes + +ifeq ($(strip $(KEYBOARD)), planck/rev5) +BACKLIGHT_ENABLE = yes +CONSOLE_ENABLE = no +endif +ifeq ($(strip $(KEYBOARD)), planck/rev6) +BACKLIGHT_ENABLE = no +CONSOLE_ENABLE = yes +EXTRALDFLAGS = -Wl,--build-id=none +UNICODE_ENABLE = yes +endif diff --git a/keyboards/planck/keymaps/scottzach1/config.h b/keyboards/planck/keymaps/scottzach1/config.h new file mode 100644 index 000000000000..387eb45c9745 --- /dev/null +++ b/keyboards/planck/keymaps/scottzach1/config.h @@ -0,0 +1,35 @@ +// Copyright 2022 Zac Scott (@scottzach1) +// SPDX-License-Identifier: GPL-2.0 + +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/scottzach1/keymap.c b/keyboards/planck/keymaps/scottzach1/keymap.c new file mode 100755 index 000000000000..ea3cd134c0f3 --- /dev/null +++ b/keyboards/planck/keymaps/scottzach1/keymap.c @@ -0,0 +1,110 @@ +// Copyright 2022 Zac Scott (@scottzach1) +// SPDX-License-Identifier: GPL-2.0 + +#include QMK_KEYBOARD_H + +enum planck_layers { + _COLEMAK, + _LOWER, + _RAISE, + _FUNCTION, + _DEBUG +}; + +#define xxxxxxx KC_NO +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define FUNCT MO(_FUNCTION) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Colemak Mod-DH + * ,-----------------------------------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | B | J | L | U | Y | ; | ' | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Func | A | R | S | T | G | M | N | E | I | O | Enter | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Shift | Z | X | C | D | V | K | H | , | . | / | \ | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Ctrl | GUI | Alt | Shift | Space | Lower | Raise | Bkspc | Shift | - | = | Ctrl | + * `-----------------------------------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_QUOT, + FUNCT, KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, + KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, KC_SPC, LOWER, RAISE, KC_BSPC, KC_RSFT, KC_MINS, KC_EQL, KC_RCTL +), + +/* Lower + * ,-----------------------------------------------------------------------------------------------------------. + * | Tab | | { | } | | | ` | 7 | 8 | 9 | 0 | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Func | | ( | ) | | | * | 4 | 5 | 6 | - | Enter | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Shift | | [ | ] | | | / | 1 | 2 | 3 | + | = | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Ctrl | GUI | Alt | Shift | Space | Lower | Func | Bkspc | 0 | . | = | Ctrl | + * `-----------------------------------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( + _______, xxxxxxx, KC_LCBR, KC_RCBR, xxxxxxx, xxxxxxx, KC_GRV, KC_7, KC_8, KC_9, KC_0, _______, + _______, xxxxxxx, KC_LPRN, KC_RPRN, xxxxxxx, xxxxxxx, KC_ASTR, KC_4, KC_5, KC_6, KC_MINS, _______, + _______, xxxxxxx, KC_LBRC, KC_RBRC, xxxxxxx, xxxxxxx, KC_SLSH, KC_1, KC_2, KC_3, KC_PLUS, KC_EQL, + _______, _______, _______, _______, _______, _______, FUNCT, _______, KC_0, KC_DOT, _______, _______ +), + +/* Raise + * ,-----------------------------------------------------------------------------------------------------------. + * | Tab | | { | } | | | | Pg_Up | Up | Pg_Dn | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Func | | ( | ) | | | Home | Left | Down | Right | Del | Ent er | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Shift | | [ | ] | | | | End | Ins | Caps | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Ctrl | GUI | Alt | Shift | Space | Func | Raise | Bkspc | | | | Ctr l | + * `-----------------------------------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( + _______, xxxxxxx, KC_LCBR, KC_RCBR, xxxxxxx, xxxxxxx, xxxxxxx, KC_PGUP, KC_UP, KC_PGDN, _______, _______, + _______, xxxxxxx, KC_LPRN, KC_RPRN, xxxxxxx, xxxxxxx, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL , _______, + _______, xxxxxxx, KC_LBRC, KC_RBRC, xxxxxxx, xxxxxxx, KC_SLSH, KC_END, KC_INS, KC_CAPS, xxxxxxx, xxxxxxx, + _______, _______, _______, _______, _______, FUNCT, _______, _______, _______, _______, _______, _______ +), + +/* Function + * ,-----------------------------------------------------------------------------------------------------------. + * | Esc | | Prev | Play | Next | | | F7 | F8 | F9 | F10 | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | Vol- | Vol+ | Mute | | | F4 | F5 | F6 | F11 | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | F1 | F2 | F3 | F12 | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | Funct | Funct | | | | | | + * `-----------------------------------------------------------------------------------------------------------' + */ +[_FUNCTION] = LAYOUT_ortho_4x12( + KC_ESC, xxxxxxx, KC_MPRV, KC_MPLY, KC_MNXT, xxxxxxx, xxxxxxx, KC_F7, KC_F8, KC_F9, KC_F10, xxxxxxx, + _______, xxxxxxx, KC_VOLD, KC_VOLU, KC_MUTE, xxxxxxx, xxxxxxx, KC_F4, KC_F5, KC_F6, KC_F11, _______, + _______, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, KC_F1, KC_F2, KC_F3, KC_F12, _______, + _______, _______, _______, _______, _______, DB_TOGG, DB_TOGG, _______, _______, _______, _______, _______ +), + +/* Debug + * ,-----------------------------------------------------------------------------------------------------------. + * | Reset | Debug | | | | | | | | | | EEP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------------------------------' + */ +[_DEBUG] = LAYOUT_ortho_4x12( + QK_BOOT, DB_TOGG, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, EE_CLR, + xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, + xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, + xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx +) +}; diff --git a/keyboards/planck/keymaps/scottzach1/readme.md b/keyboards/planck/keymaps/scottzach1/readme.md new file mode 100644 index 000000000000..76a337f6d1f9 --- /dev/null +++ b/keyboards/planck/keymaps/scottzach1/readme.md @@ -0,0 +1,76 @@ +![Personal Planck Rev6](https://github.com/scottzach1/Planck/blob/master/img/img_05.jpg) + +# Scottzach1 Planck Layout + +Upstream: [scottzach1/planck](https://github.com/scottzach1/Planck) + +This keyboard layout implements a personal variation of Colemak Mod-DH with M-K switched. +One notable change with this layout is space + backspace in line with the homing keys. +As such, Lower and Raise have been moved to occupy the middle two keys. + +I have been using this layout happily daily now since June 2019. + +``` + Colemak Mod-DH +,-----------------------------------------------------------------------------------------------. +| Tab | Q | W | F | P | B | J | L | U | Y | ; | ' | +|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| +| Func | A | R | S | T | G | M | N | E | I | O | Enter | +|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| +| Shift | Z | X | C | D | V | K | H | , | . | / | \ | +|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| +| Ctrl | GUI | Alt | Shift | Space | Lower | Raise | Bkspc | Shift | - | = | Ctrl | +`-----------------------------------------------------------------------------------------------' +``` + +``` + Lower +,-----------------------------------------------------------------------------------------------. +| Tab | | { | } | | | ` | 7 | 8 | 9 | 0 | | +|-------+-------+-------+-------+-------+-------+-------+------+-------+-------+--------+-------| +| Func | | ( | ) | | | * | 4 | 5 | 6 | - | Enter | +|-------+-------+-------+-------+-------+-------+-------+------+-------+-------+--------+-------| +| Shift | | [ | ] | | | / | 1 | 2 | 3 | + | = | +|-------+-------+-------+-------+-------+-------+-------+------+-------+-------+--------+-------| +| Ctrl | GUI | Alt | Shift | Space | Lower | Func | Bksp | 0 | . | = | Ctrl | +`-----------------------------------------------------------------------------------------------' +``` + +``` + Raise +,-----------------------------------------------------------------------------------------------. +| Tab | | { | } | | | | Pg_Up | Up | Pg_Dn | | | +|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| +| Func | | ( | ) | | | Home | Left | Down | Right | Del | Enter | +|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| +| Shift | | [ | ] | | | | End | Ins | Caps | | | +|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| +| Ctrl | GUI | Alt | Shift | Space | Func | Raise | Bkspc | | | | Ctrl | +`-----------------------------------------------------------------------------------------------' +``` + +``` + Function +,-----------------------------------------------------------------------------------------------. +| Esc | | Prev | Play | Next | | | F7 | F8 | F9 | F10 | | +|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| +| | | Vol- | Vol+ | Mute | | | F4 | F5 | F6 | F11 | | +|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| +| | | | | | | | F1 | F2 | F3 | F12 | | +|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| +| | | | | | Funct | Funct | | | | | | +`-----------------------------------------------------------------------------------------------' +``` + +``` + Debug +,-----------------------------------------------------------------------------------------------. +| Reset | Debug | | | | | | | | | | EEP | +|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| +| | | | | | | | | | | | | +|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| +| | | | | | | | | | | | | +|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| +| | | | | | | | | | | | | +`-----------------------------------------------------------------------------------------------' +``` diff --git a/keyboards/planck/keymaps/sdothum/beakl.h b/keyboards/planck/keymaps/sdothum/beakl.h new file mode 100644 index 000000000000..999f0aac95a7 --- /dev/null +++ b/keyboards/planck/keymaps/sdothum/beakl.h @@ -0,0 +1,551 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// .................................................................... BEAKL EZ +#ifdef BEAKLEZ + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | K | ^Alt | ^GUI | F | G | R | C | V | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | H | I | E | A | " | ↑Alt | ↑GUI | L | S | T | N | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | ; | , | J | . | X | Caps |^Shift| B | D | M | P | Z | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_Y, KC_O, KC_U, KC_K, CNTR_TL, CNTR_TR, KC_F, KC_G, KC_R, KC_C, KC_V , + KC_H, KC_I, KC_E, HOME_A, TD_QUOT, CNTR_HL, CNTR_HR, KC_L, KC_S, KC_T, KC_N, KC_W , + KC_SCLN, KC_COMM, KC_J, KC_DOT, KC_X, CNTR_BL, CNTR_BR, KC_B, KC_D, KC_M, KC_P, KC_Z , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_K), CNTR_TL, CNTR_TR, S(KC_F), S(KC_G), S(KC_R), S(KC_C), S(KC_V), + S(KC_H), S(KC_I), S(KC_E), S(KC_A), TD_QUOT, CNTR_HL, CNTR_HR, S(KC_L), S(KC_S), S(KC_T), S(KC_N), S(KC_W), + KC_SCLN, KC_COMM, S(KC_J), KC_DOT, S(KC_X), CNTR_BL, CNTR_BR, S(KC_B), S(KC_D), S(KC_M), S(KC_P), S(KC_Z), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | K | ^Alt | ^GUI | F | G | R | C | V | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | H | I | E | A | " | ↑Alt | ↑GUI | L | S | T | N | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | : | ~ | J | ` | X | Caps |^Shift| B | D | M | P | Z | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | _ | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_K), CNTR_TL, CNTR_TR, S(KC_F), S(KC_G), S(KC_R), S(KC_C), S(KC_V), + S(KC_H), S(KC_I), S(KC_E), S(KC_A), TD_DQOT, CNTR_HL, CNTR_HR, S(KC_L), S(KC_S), S(KC_T), S(KC_N), S(KC_W), + TD_COLN, TD_TILD, S(KC_J), TD_GRV, S(KC_X), CNTR_BL, CNTR_BR, S(KC_B), S(KC_D), S(KC_M), S(KC_P), S(KC_Z), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_UNDS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | K | ^Alt | ^GUI | F | G | R | C | V | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | H | I | E | A | " | ↑Alt | ↑GUI | L | S | T | N | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | : | / | J | ? | X | Caps |^Shift| B | D | M | P | Z | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | - | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_K), CNTR_TL, CNTR_TR, S(KC_F), S(KC_G), S(KC_R), S(KC_C), S(KC_V), + S(KC_H), S(KC_I), S(KC_E), S(KC_A), TD_DQOT, CNTR_HL, CNTR_HR, S(KC_L), S(KC_S), S(KC_T), S(KC_N), S(KC_W), + TD_COLN, KC_SLSH, S(KC_J), KC_QUES, S(KC_X), CNTR_BL, CNTR_BR, S(KC_B), S(KC_D), S(KC_M), S(KC_P), S(KC_Z), + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_MINS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + +// ..................................................................... BEAKL 8 +#ifdef BEAKL8 + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | X | ^Alt | ^GUI | G | C | R | F | Z | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | . | ↑Alt | ↑GUI | D | S | T | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | ; | " | I | , | Caps |^Shift| W | M | L | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_Y, KC_O, KC_U, KC_X, CNTR_TL, CNTR_TR, KC_G, KC_C, KC_R, KC_F, KC_Z , + KC_K, KC_H, KC_E, HOME_A, KC_DOT, CNTR_HL, CNTR_HR, KC_D, KC_S, KC_T, KC_N, KC_B , + KC_J, KC_SCLN, TD_QUOT, KC_I, KC_COMM, CNTR_BL, CNTR_BR, KC_W, KC_M, KC_L, KC_P, KC_V , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_X), CNTR_TL, CNTR_TR, S(KC_G), S(KC_C), S(KC_R), S(KC_F), S(KC_Z), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_DOT, CNTR_HL, CNTR_HR, S(KC_D), S(KC_S), S(KC_T), S(KC_N), S(KC_B), + S(KC_J), KC_SCLN, TD_QUOT, S(KC_I), KC_COMM, CNTR_BL, CNTR_BR, S(KC_W), S(KC_M), S(KC_L), S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | X | ^Alt | ^GUI | G | C | R | F | Z | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | ~ | ↑Alt | ↑GUI | D | S | T | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | I | ` | Caps |^Shift| W | M | L | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | _ | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_X), CNTR_TL, CNTR_TR, S(KC_G), S(KC_C), S(KC_R), S(KC_F), S(KC_Z), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), TD_TILD, CNTR_HL, CNTR_HR, S(KC_D), S(KC_S), S(KC_T), S(KC_N), S(KC_B), + S(KC_J), TD_COLN, TD_DQOT, S(KC_I), TD_GRV, CNTR_BL, CNTR_BR, S(KC_W), S(KC_M), S(KC_L), S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_UNDS, SL_LEFT, S_DOWN, S_UP, S_RGHT , + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | X | ^Alt | ^GUI | G | C | R | F | Z | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | ? | ↑Alt | ↑GUI | D | S | T | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | I | / | Caps |^Shift| W | M | L | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | - | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_X), CNTR_TL, CNTR_TR, S(KC_G), S(KC_C), S(KC_R), S(KC_F), S(KC_Z), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, S(KC_D), S(KC_S), S(KC_T), S(KC_N), S(KC_B), + S(KC_J), TD_COLN, TD_DQOT, S(KC_I), KC_SLSH, CNTR_BL, CNTR_BR, S(KC_W), S(KC_M), S(KC_L), S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_MINS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + +// .................................................................... BEAKL 8P +#ifdef BEAKL8P + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | ^Alt | ^GUI | G | D | R | F | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | . | ↑Alt | ↑GUI | C | T | S | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | ; | " | I | , | Caps |^Shift| W | M | L | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_Y, KC_O, KC_U, KC_Z, CNTR_TL, CNTR_TR, KC_G, KC_D, KC_R, KC_F, KC_X , + KC_K, KC_H, KC_E, HOME_A, KC_DOT, CNTR_HL, CNTR_HR, KC_C, KC_T, KC_S, KC_N, KC_B , + KC_J, KC_SCLN, TD_QUOT, KC_I, KC_COMM, CNTR_BL, CNTR_BR, KC_W, KC_M, KC_L, KC_P, KC_V , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + , + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_R), S(KC_F), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_DOT, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_S), S(KC_N), S(KC_B), + S(KC_J), KC_SCLN, TD_QUOT, S(KC_I), KC_COMM, CNTR_BL, CNTR_BR, S(KC_W), S(KC_M), S(KC_L), S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + , + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | { | } | $ | ^Alt | ^GUI | G | D | R | F | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | < | > | ~ | ↑Alt | ↑GUI | C | T | S | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | ! | = | ` | Caps |^Shift| W | M | L | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | _ | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), KC_LCBR, KC_RCBR, KC_DLR, CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_R), S(KC_F), S(KC_X), + S(KC_K), S(KC_H), TD_LT, TD_GT, TD_TILD, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_S), S(KC_N), S(KC_B), + S(KC_J), KC_COLN, KC_EXLM, KC_EQL, TD_GRV, CNTR_BL, CNTR_BR, S(KC_W), S(KC_M), S(KC_L), S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_UNDS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | ^Alt | ^GUI | ^ | [ | ] | F | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | ? | ↑Alt | ↑GUI | | | ( | ) | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | I | / | Caps |^Shift| \ | $ | * | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | - | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, KC_CIRC, KC_LBRC, KC_RBRC, S(KC_F), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, KC_PIPE, KC_LPRN, KC_RPRN, S(KC_N), S(KC_B), + S(KC_J), TD_COLN, TD_DQOT, S(KC_I), KC_SLSH, CNTR_BL, CNTR_BR, KC_BSLS, KC_DLR, KC_ASTR, S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_MINS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + +// ................................................................... BEAKL 8TX +#ifdef BEAKL8TX + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | J | ^Alt | ^GUI | G | D | R | F | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | . | ↑Alt | ↑GUI | C | T | S | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | ; | " | I | , | Caps |^Shift| W | M | L | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_Y, KC_O, KC_U, KC_J, CNTR_TL, CNTR_TR, KC_G, KC_D, KC_R, KC_F, KC_X , + HOME_K, HOME_H, HOME_E, HOME_A, KC_DOT, CNTR_HL, CNTR_HR, KC_C, HOME_T, HOME_S, HOME_N, HOME_B , + KC_Z, KC_SCLN, TD_QUOT, KC_I, KC_COMM, CNTR_BL, CNTR_BR, KC_W, KC_M, KC_L, KC_P, KC_V , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_J), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_R), S(KC_F), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_DOT, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_S), S(KC_N), S(KC_B), + S(KC_Z), KC_SCLN, TD_QUOT, S(KC_I), KC_COMM, CNTR_BL, CNTR_BR, S(KC_W), S(KC_M), S(KC_L), S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | $ | { | } | J | ^Alt | ^GUI | G | D | R | F | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | / | < | > | ~ | ↑Alt | ↑GUI | C | T | S | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | : | ! | = | ` | Caps |^Shift| W | M | L | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | _ | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), KC_DLR, KC_LCBR, KC_RCBR, S(KC_J), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_R), S(KC_F), S(KC_X), + S(KC_K), KC_SLSH, TD_LT, TD_GT, TD_TILD, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_S), S(KC_N), S(KC_B), + S(KC_Z), KC_COLN, KC_EXLM, KC_EQL, TD_GRV, CNTR_BL, CNTR_BR, S(KC_W), S(KC_M), S(KC_L), S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_UNDS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | J | ^Alt | ^GUI | G | [ | ] | ^ | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | ? | ↑Alt | ↑GUI | | | ( | ) | $ | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | : | " | I | / | Caps |^Shift| \ | * | . | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | - | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_J), CNTR_TL, CNTR_TR, S(KC_G), KC_LBRC, KC_RBRC, KC_CIRC, S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, KC_PIPE, KC_LPRN, KC_RPRN, KC_DLR, S(KC_B), + S(KC_Z), TD_COLN, TD_DQOT, S(KC_I), KC_SLSH, CNTR_BL, CNTR_BR, KC_BSLS, KC_ASTR, KC_DOT, S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_MINS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + +// ................................................................... BEAKL 8TT +#ifdef BEAKL8TT + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | J | Fn | Caps | G | D | R | F | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | . |Cursor| Mouse| C | T | S | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | ; | " | I | , | Num | Regex| W | M | L | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_Y, KC_O, KC_U, KC_J, CNTR_TL, CNTR_TR, KC_G, KC_D, KC_R, KC_F, KC_X , + HOME_K, HOME_H, HOME_E, HOME_A, KC_DOT, CNTR_HL, CNTR_HR, KC_C, HOME_T, HOME_S, HOME_N, HOME_B , + KC_Z, KC_SCLN, TD_QUOT, KC_I, KC_COMM, CNTR_BL, CNTR_BR, KC_W, KC_M, KC_L, KC_P, KC_V , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_J), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_R), S(KC_F), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_DOT, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_S), S(KC_N), S(KC_B), + S(KC_Z), KC_SCLN, TD_QUOT, S(KC_I), KC_COMM, CNTR_BL, CNTR_BR, S(KC_W), S(KC_M), S(KC_L), S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | $ | { | } | J | Fn | Caps | G | D | R | F | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | / | < | > | ~ |Cursor| Mouse| C | T | S | N | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | : | ! | = | ` | Num | Regex| W | M | L | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | _ | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), KC_DLR, KC_LCBR, KC_RCBR, S(KC_J), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_R), S(KC_F), S(KC_X), + S(KC_K), KC_SLSH, TD_LT, TD_GT, TD_TILD, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_S), S(KC_N), S(KC_B), + S(KC_Z), KC_COLN, KC_EXLM, KC_EQL, TD_GRV, CNTR_BL, CNTR_BR, S(KC_W), S(KC_M), S(KC_L), S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_UNDS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | J | Fn | Caps | G | [ | ] | ^ | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | ? |Cursor| Mouse| | | ( | ) | $ | B | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | : | " | I | / | Num | Regex| \ | * | . | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | - | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_J), CNTR_TL, CNTR_TR, S(KC_G), KC_LBRC, KC_RBRC, KC_CIRC, S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, KC_PIPE, KC_LPRN, KC_RPRN, KC_DLR, S(KC_B), + S(KC_Z), TD_COLN, TD_DQOT, S(KC_I), KC_SLSH, CNTR_BL, CNTR_BR, KC_BSLS, KC_ASTR, KC_DOT, S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_MINS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + +// .................................................................... BEAKL 10 +#ifdef BEAKL10 + // ,-----------------------------------------------------------------------------------. + // | Q | H | O | U | X | ^Alt | ^GUI | G | D | N | M | V | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | Y | I | E | A | . | ↑Alt | ↑GUI | C | S | R | T | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | ; | " | , | Z | Caps |^Shift| B | P | L | F | K | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_H, KC_O, KC_U, KC_X, CNTR_TL, CNTR_TR, KC_G, KC_D, KC_N, KC_M, KC_V , + KC_Y, KC_I, KC_E, HOME_A, KC_DOT, CNTR_HL, CNTR_HR, KC_C, KC_S, KC_R, KC_T, KC_W , + KC_J, KC_SCLN, TD_QUOT, KC_COMM, KC_Z, CNTR_BL, CNTR_BR, KC_B, KC_P, KC_L, KC_F, KC_K , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_H), S(KC_O), S(KC_U), S(KC_X), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_V), + S(KC_Y), S(KC_I), S(KC_E), S(KC_A), KC_DOT, CNTR_HL, CNTR_HR, S(KC_C), S(KC_S), S(KC_R), S(KC_T), S(KC_W), + S(KC_J), KC_SCLN, TD_QUOT, KC_COMM, S(KC_Z), CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_K), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | [ | ! | ] | X | ^Alt | ^GUI | G | D | N | M | V | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | Y | < | = | > | ~ | ↑Alt | ↑GUI | C | S | R | T | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | ` | Z | Caps |^Shift| B | P | L | F | K | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | _ | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), TD_LBRC, KC_EXLM, TD_RBRC, S(KC_X), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_V), + S(KC_Y), TD_LT, KC_EQL, TD_GT, TD_TILD, CNTR_HL, CNTR_HR, S(KC_C), S(KC_S), S(KC_R), S(KC_T), S(KC_W), + S(KC_J), KC_COLN, TD_DQOT, TD_GRV, S(KC_Z), CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_K), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_UNDS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | H | O | U | X | ^Alt | ^GUI | G | { | + | } | V | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | Y | I | E | A | ? | ↑Alt | ↑GUI | C | ( | * | ) | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | / | Z | Caps |^Shift| B | P | L | F | K | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | - | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_H), S(KC_O), S(KC_U), S(KC_X), CNTR_TL, CNTR_TR, S(KC_G), TD_LCBR, KC_PLUS, TD_RCBR, S(KC_V), + S(KC_Y), S(KC_I), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, S(KC_C), TD_LPRN, KC_ASTR, TD_RPRN, S(KC_W), + S(KC_J), TD_COLN, TD_DQOT, KC_SLSH, S(KC_Z), CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_K), + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_MINS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + +// ............................................................... BEAKL Mash Up +#ifdef BEAKL810 + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | ^Alt | ^GUI | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | . | ↑Alt | ↑GUI | C | T | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | ; | " | I | , | Caps |^Shift| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_Y, KC_O, KC_U, KC_Z, CNTR_TL, CNTR_TR, KC_G, KC_D, KC_N, KC_M, KC_X , + KC_K, KC_H, KC_E, HOME_A, KC_DOT, CNTR_HL, CNTR_HR, KC_C, KC_T, KC_R, KC_S, KC_W , + KC_J, KC_SCLN, TD_QUOT, KC_I, KC_COMM, CNTR_BL, CNTR_BR, KC_B, KC_P, KC_L, KC_F, KC_V , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_DOT, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_R), S(KC_S), S(KC_W), + S(KC_J), KC_SCLN, TD_QUOT, S(KC_I), KC_COMM, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | { | } | $ | ^Alt | ^GUI | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | < | > | ~ | ↑Alt | ↑GUI | C | T | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | ! | = | ` | Caps |^Shift| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | _ | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), KC_LCBR, KC_RCBR, KC_DLR, CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + S(KC_K), S(KC_H), TD_LT, TD_GT, TD_TILD, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_R), S(KC_S), S(KC_W), + S(KC_J), KC_COLN, KC_EXLM, KC_EQL, TD_GRV, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_UNDS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | ^Alt | ^GUI | ^ | [ | ] | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | ? | ↑Alt | ↑GUI | | | ( | ) | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | I | / | Caps |^Shift| \ | $ | * | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | - | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, KC_CIRC, KC_LBRC, KC_RBRC, S(KC_M), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, KC_PIPE, KC_LPRN, KC_RPRN, S(KC_S), S(KC_W), + S(KC_J), TD_COLN, TD_DQOT, S(KC_I), KC_SLSH, CNTR_BL, CNTR_BR, KC_BSLS, KC_DLR, KC_ASTR, S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_MINS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + +// .................................................................... BEAKL MU +#ifdef BEAKLMU + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | Fn | Caps | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | . |Cursor| Mouse| C | T | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | ; | " | I | , | Num | Regex| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_Y, KC_O, KC_U, KC_Z, CNTR_TL, CNTR_TR, KC_G, KC_D, KC_N, KC_M, KC_X , + HOME_K, HOME_H, HOME_E, HOME_A, KC_DOT, CNTR_HL, CNTR_HR, KC_C, HOME_T, HOME_R, HOME_S, HOME_W , + KC_J, KC_SCLN, TD_QUOT, KC_I, KC_COMM, CNTR_BL, CNTR_BR, KC_B, KC_P, KC_L, KC_F, KC_V , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_DOT, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_R), S(KC_S), S(KC_W), + S(KC_J), KC_SCLN, TD_QUOT, S(KC_I), KC_COMM, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | $ | { | } | Z | Fn | Caps | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | / | < | > | ~ |Cursor| Mouse| C | T | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | ! | = | ` | Num | Regex| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | _ | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), KC_DLR, KC_LCBR, KC_RCBR, S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + S(KC_K), KC_SLSH, TD_LT, TD_GT, TD_TILD, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_R), S(KC_S), S(KC_W), + S(KC_Z), KC_COLN, KC_EXLM, KC_EQL, TD_GRV, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_UNDS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | Fn | Caps | G | [ | ] | ^ | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | ? |Cursor| Mouse| | | ( | ) | $ | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | I | / | Num | Regex| \ | * | . | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | - | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), KC_LBRC, KC_RBRC, KC_CIRC, S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, KC_PIPE, KC_LPRN, KC_RPRN, KC_DLR, S(KC_W), + S(KC_J), TD_COLN, TD_DQOT, S(KC_I), KC_SLSH, CNTR_BL, CNTR_BR, KC_BSLS, KC_ASTR, KC_DOT, S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_MINS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + +// .................................................................... BEAKL SP +#ifdef BEAKLSP + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | Shift| Caps | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | . |Cursor| Mouse| C | T | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | ; | " | I | , | Num | Regex| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Ins | Left | Ent | Bksp | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_Y, KC_O, KC_U, KC_Z, CNTR_TL, CNTR_TR, KC_G, KC_D, KC_N, KC_M, KC_X , + HOME_K, HOME_H, HOME_E, HOME_A, KC_DOT, CNTR_HL, CNTR_HR, KC_C, HOME_T, HOME_R, HOME_S, HOME_W , + KC_J, KC_SCLN, TD_QUOT, KC_I, KC_COMM, CNTR_BL, CNTR_BR, KC_B, KC_P, KC_L, KC_F, KC_V , + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_INS, SP_LEFT, TD_ENT, SP_BSPC, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_DOT, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_R), S(KC_S), S(KC_W), + S(KC_J), KC_SCLN, TD_QUOT, S(KC_I), KC_COMM, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_INS, SP_LEFT, TD_ENT, SP_BSPC, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | [ | ] | Z | Shift| Caps | G | D | N | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | ^ | < | > | ~ |Cursor| Mouse| C | T | R | S | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | ! | = | ` | Num | Regex| B | P | L | F | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | ↑Tab | f() | Ins | Left | _ | Del | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), KC_LBRC, KC_RBRC, S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), S(KC_D), S(KC_N), S(KC_M), S(KC_X), + S(KC_K), KC_CIRC, TD_LT, TD_GT, TD_TILD, CNTR_HL, CNTR_HR, S(KC_C), S(KC_T), S(KC_R), S(KC_S), S(KC_W), + S(KC_Z), KC_COLN, KC_EXLM, KC_EQL, TD_GRV, CNTR_BL, CNTR_BR, S(KC_B), S(KC_P), S(KC_L), S(KC_F), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, S_TAB, ___fn__, LT_INS, S_LEFT, KC_UNDS, SP_DEL, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | Y | O | U | Z | Shift| Caps | G | { | } | M | X | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | K | H | E | A | ? |Cursor| Mouse| | | ( | ) | $ | W | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | J | : | " | I | / | Num | Regex| \ | * | . | P | V | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Tab | - | Ins | Left | f() | Bksp | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_Y), S(KC_O), S(KC_U), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_G), KC_LCBR, KC_RCBR, S(KC_M), S(KC_X), + S(KC_K), S(KC_H), S(KC_E), S(KC_A), KC_QUES, CNTR_HL, CNTR_HR, KC_PIPE, KC_LPRN, KC_RPRN, KC_DLR, S(KC_W), + S(KC_J), TD_COLN, TD_DQOT, S(KC_I), KC_SLSH, CNTR_BL, CNTR_BR, KC_BSLS, KC_ASTR, KC_DOT, S(KC_P), S(KC_V), + OS_CTL, OS_GUI, OS_ALT, KC_TAB, KC_MINS, LT_INS, S_LEFT, ___fn__, SP_BSPC, S_DOWN, S_UP, S_RGHT + ), +#endif diff --git a/keyboards/planck/keymaps/sdothum/colemak.h b/keyboards/planck/keymaps/sdothum/colemak.h new file mode 100644 index 000000000000..3d8f0d4863df --- /dev/null +++ b/keyboards/planck/keymaps/sdothum/colemak.h @@ -0,0 +1,125 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// .............................................................. Colemak Mod-DH +#ifdef COLEMAK + // ,-----------------------------------------------------------------------------------. + // | Q | W | F | P | B | ^Alt | ^GUI | J | L | U | Y | ; | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | R | S | T | G | ↑Alt | ↑GUI | M | N | E | I | O | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | X | C | D | V | Caps |^Shift| K | H | , | . | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_W, KC_F, KC_P, KC_B, CNTR_TL, CNTR_TR, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, + KC_A, KC_R, KC_S, KC_T, KC_G, CNTR_HL, CNTR_HR, KC_M, KC_N, KC_E, KC_I, KC_O , + KC_Z, KC_X, KC_C, KC_D, KC_V, CNTR_BL, CNTR_BR, KC_K, KC_H, KC_COMM, KC_DOT, TD_QUOT, + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_W), S(KC_F), S(KC_P), S(KC_B), CNTR_TL, CNTR_TR, S(KC_J), S(KC_L), S(KC_U), S(KC_Y), KC_SCLN, + S(KC_A), S(KC_R), S(KC_S), S(KC_T), S(KC_G), CNTR_HL, CNTR_HR, S(KC_M), S(KC_N), S(KC_E), S(KC_I), S(KC_O), + S(KC_Z), S(KC_X), S(KC_C), S(KC_D), S(KC_V), CNTR_BL, CNTR_BR, S(KC_K), S(KC_H), KC_COMM, KC_DOT, TD_QUOT, + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | W | F | P | B | ^Alt | ^GUI | J | L | U | Y | : | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | R | S | T | G | ↑Alt | ↑GUI | M | N | E | I | O | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | X | C | D | V | Caps |^Shift| K | H | / | ? | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | - | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_W), S(KC_F), S(KC_P), S(KC_B), CNTR_TL, CNTR_TR, S(KC_J), S(KC_L), S(KC_U), S(KC_Y), TD_COLN, + S(KC_A), S(KC_R), S(KC_S), S(KC_T), S(KC_G), CNTR_HL, CNTR_HR, S(KC_M), S(KC_N), S(KC_E), S(KC_I), S(KC_O), + S(KC_Z), S(KC_X), S(KC_C), S(KC_D), S(KC_V), CNTR_BL, CNTR_BR, S(KC_K), S(KC_H), KC_SLSH, KC_QUES, TD_DQOT, + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_MINS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | W | F | P | B | ^Alt | ^GUI | J | L | U | Y | : | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | R | S | T | G | ↑Alt | ↑GUI | M | N | E | I | O | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | X | C | D | V | Caps |^Shift| K | H | ~ | ` | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | _ | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_W), S(KC_F), S(KC_P), S(KC_B), CNTR_TL, CNTR_TR, S(KC_J), S(KC_L), S(KC_U), S(KC_Y), TD_COLN, + S(KC_A), S(KC_R), S(KC_S), S(KC_T), S(KC_G), CNTR_HL, CNTR_HR, S(KC_M), S(KC_N), S(KC_E), S(KC_I), S(KC_O), + S(KC_Z), S(KC_X), S(KC_C), S(KC_D), S(KC_V), CNTR_BL, CNTR_BR, S(KC_K), S(KC_H), TD_TILD, TD_GRV, TD_DQOT, + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_UNDS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + +// ..................................................................... ColemaX +#ifdef COLEMAX + // ,-----------------------------------------------------------------------------------. + // | Q | W | C | G | Z | ^Alt | ^GUI | J | L | U | Y | ; | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | R | S | T | B | ↑Alt | ↑GUI | K | N | E | I | O | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | X | V | F | D | P | Caps |^Shift| M | H | , | . | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_W, KC_C, KC_G, KC_Z, CNTR_TL, CNTR_TR, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, + KC_A, KC_R, KC_S, KC_T, KC_B, CNTR_HL, CNTR_HR, KC_K, KC_N, KC_E, KC_I, KC_O , + KC_X, KC_V, KC_F, KC_D, KC_P, CNTR_BL, CNTR_BR, KC_M, KC_H, KC_COMM, KC_DOT, TD_QUOT, + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_W), S(KC_C), S(KC_G), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_J), S(KC_L), S(KC_U), S(KC_Y), KC_SCLN, + S(KC_A), S(KC_R), S(KC_S), S(KC_T), S(KC_B), CNTR_HL, CNTR_HR, S(KC_K), S(KC_N), S(KC_E), S(KC_I), S(KC_O), + S(KC_X), S(KC_V), S(KC_F), S(KC_D), S(KC_P), CNTR_BL, CNTR_BR, S(KC_M), S(KC_H), KC_COMM, KC_DOT, TD_QUOT, + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | W | C | G | Z | ^Alt | ^GUI | J | L | U | Y | : | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | R | S | T | B | ↑Alt | ↑GUI | K | N | E | I | O | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | X | V | F | D | P | Caps |^Shift| M | H | / | ? | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | - | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_W), S(KC_C), S(KC_G), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_J), S(KC_L), S(KC_U), S(KC_Y), TD_COLN, + S(KC_A), S(KC_R), S(KC_S), S(KC_T), S(KC_B), CNTR_HL, CNTR_HR, S(KC_K), S(KC_N), S(KC_E), S(KC_I), S(KC_O), + S(KC_X), S(KC_V), S(KC_F), S(KC_D), S(KC_P), CNTR_BL, CNTR_BR, S(KC_M), S(KC_H), KC_SLSH, KC_QUES, TD_DQOT, + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_MINS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | W | C | G | Z | ^Alt | ^GUI | J | L | U | Y | : | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | R | S | T | B | ↑Alt | ↑GUI | K | N | E | I | O | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | X | V | F | D | P | Caps |^Shift| M | H | ~ | ` | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | _ | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_W), S(KC_C), S(KC_G), S(KC_Z), CNTR_TL, CNTR_TR, S(KC_J), S(KC_L), S(KC_U), S(KC_Y), TD_COLN, + S(KC_A), S(KC_R), S(KC_S), S(KC_T), S(KC_B), CNTR_HL, CNTR_HR, S(KC_K), S(KC_N), S(KC_E), S(KC_I), S(KC_O), + S(KC_X), S(KC_V), S(KC_F), S(KC_D), S(KC_P), CNTR_BL, CNTR_BR, S(KC_M), S(KC_H), TD_TILD, TD_GRV, TD_DQOT, + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_UNDS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + diff --git a/keyboards/planck/keymaps/sdothum/common/chord_layout.h b/keyboards/planck/keymaps/sdothum/common/chord_layout.h new file mode 100644 index 000000000000..cb1b7f678550 --- /dev/null +++ b/keyboards/planck/keymaps/sdothum/common/chord_layout.h @@ -0,0 +1,41 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// .................................................................. Short Cuts + + // .-----------------------------------------------------------------------------------. + // | | | Copy | Paste| | | | | | | | | + // |--------------------------------------------------------------+------+------+------| + // | Undo | Cut | Copy | Paste| | | | | PRIV | PUB | | | + // |-----------------------------------------------------------------------------------| + // | | | Nak | Eot | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | | | | | | f() | | | | | | + // | | | | | | | | f() | | | | | see _PLOVER + // '-----------------------------------------------------------------------------------' + + [_EDIT] = LAYOUT_planck_grid( + _______, _______, TMCOPY, TMPASTE, _______, _______, _______, _______, _______, _______, _______, _______, + UNDO, CUT, COPY, PASTE, _______, _______, _______, _______, TD_PRIV, TD_SEND, _______, _______, + _______, _______, NAK, EOT, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, ___fn__, ___fn__, _______, _______, _______, _______ + ), + +// ................................................................ Adjust Layer + + // ,-----------------------------------------------------------------------------------. + // |Plover| | | | | | | | | | | | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // |Aud on| | | | | | | | | | | | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Reset| | | | | | | | | | | | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | | | | f() | | | | | f() | | | | + // `-----------------------------------------------------------------------------------' + + [_ADJUST] = LAYOUT_planck_grid( + PLOVER, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + AU_ON, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, ___fn__, _______, _______, _______, _______, ___fn__, _______, _______, _______ + ), diff --git a/keyboards/planck/keymaps/sdothum/common/init.h b/keyboards/planck/keymaps/sdothum/common/init.h new file mode 100644 index 000000000000..6366a19f65eb --- /dev/null +++ b/keyboards/planck/keymaps/sdothum/common/init.h @@ -0,0 +1,56 @@ + +// ....................................................................... Audio + +void matrix_init_user(void) +{ +#ifdef STENO_ENABLE + steno_set_mode(STENO_MODE_BOLT); // or STENO_MODE_GEMINI +#endif +#ifdef AUDIO_ENABLE + startup_user(); +#endif +} + +#ifdef AUDIO_ENABLE +#ifdef BACKLIGHT_ENABLE +void led_set_user(uint8_t usb_led) +{ + static uint8_t old_usb_led = 0; + _delay_ms(10); // gets rid of tick + if (!is_playing_notes()) { + if ((usb_led & (1<event.pressed) { + key_timer = timer_read(); + register_code(modifier); + if (modifier2) { + register_code(modifier2); + } + } + else { + unregister_code(modifier); + if (modifier2) { + unregister_code(modifier2); + } + if (timer_elapsed(key_timer) < TAPPING_TERM) { + shift_key(keycode); + } + key_timer = 0; + } +} + +// ................................................................... Mod Masks + +// tap dance persistant mods, see process_record_user() +// keyboard_report->mods (?) appears to be cleared by tap dance +static uint8_t mods = 0; + +void tap_mods(keyrecord_t *record, uint16_t keycode) +{ + if (record->event.pressed) { + mods |= MOD_BIT(keycode); + } + else { + mods &= ~(MOD_BIT(keycode)); + } +} + +// (un)register modifiers +void modifier(void (*f)(uint8_t)) +{ + if (mods & MOD_BIT(KC_LCTL)) { + (*f)(KC_LCTL); + } + if (mods & MOD_BIT(KC_LGUI)) { + (*f)(KC_LGUI); + } + if (mods & MOD_BIT(KC_LALT)) { + (*f)(KC_LALT); + } +} + +// .................................................... Triple Dance Shift/Layer + +static uint8_t dt_shift = 0; + +void double_shift(uint16_t keycode, uint8_t layer) +{ + tap_key (keycode); + if (DT_SHIFT) { + // set_oneshot_mods(MOD_LSFT); + // layer_on(layer); + layer_on (_SHIFT); + set_oneshot_layer(_SHIFT, ONESHOT_START); + dt_shift = 1; + } + else { + layer_on(layer); + } +} + +// tap dance LT (LAYER, KEY) emulation with -> and auto-repeat extensions! +void tap_shift(tap_dance_state_t *state, uint16_t keycode, uint8_t layer) +{ + // double tap plus down + if (state->count > 2) { + // double enter shift + if (keycode == KC_ENT) { + tap_key (keycode); + double_shift(keycode, layer); + } + // repeating keycode + else { + register_code(keycode); + } + } + // tap plus down (or double tap): keycode (one shot) shift + else if (state->count > 1) { + double_shift(keycode, layer); + } + // down: shift + else if (state->pressed) { + layer_on(layer); + } + // tap: keycode + else { + modifier(register_code); + tap_key (keycode); + modifier(unregister_code); + } +} + +void tap_reset(uint16_t keycode, uint8_t layer) +{ + unregister_code(keycode); + if (DT_SHIFT && dt_shift) { + clear_oneshot_layer_state(ONESHOT_PRESSED); + dt_shift = 0; + } + else { + layer_off(layer); + } +} + +// augment pseudo LT (_RSHIFT, KC_ENT) handling below for rapid sequences +void enter(tap_dance_state_t *state, void *user_data) +{ + tap_shift(state, KC_ENT, _RSHIFT); +} + +void enter_reset(tap_dance_state_t *state, void *user_data) +{ + tap_reset(KC_ENT, _RSHIFT); +} + +// augment pseudo LT (_LSHIFT, KC_SPC) handling below for rapid sequences +void space(tap_dance_state_t *state, void *user_data) +{ + tap_shift(state, KC_SPC, _LSHIFT); +} + +void space_reset(tap_dance_state_t *state, void *user_data) +{ + tap_reset(KC_SPC, _LSHIFT); +} + +// ......................................................... Triple Dance Insert + +void double_max(uint8_t count, uint8_t shift, uint16_t keycode) +{ + if (shift) { + shift_key(keycode); + if (count > 1) { + shift_key(keycode); + } + } + else { + tap_key(keycode); + if (count > 1) { + tap_key(keycode); + } + } +} + +void colon(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 2) { + tap_key (KC_SPC); + shift_key(KC_SCLN); + shift_key(KC_SCLN); + tap_key (KC_SPC); + } + else { + double_max(state->count, SHIFT, KC_SCLN); + } + reset_tap_dance(state); +} + +void eql(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 2) { + tap_key(KC_SPC); + tap_key(KC_SLSH); + tap_key(KC_EQL); + tap_key(KC_SPC); + } + else { + double_max(state->count, NOSHIFT, KC_EQL); + } + reset_tap_dance(state); +} + +void greater(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 2) { + tap_key (KC_SPC); + tap_key (KC_MINS); + shift_key(KC_DOT); + tap_key (KC_SPC); + } + else { + double_max(state->count, SHIFT, KC_DOT); + } + reset_tap_dance(state); +} + +void lesser(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 2) { + tap_key (KC_SPC); + shift_key(KC_COMM); + tap_key (KC_MINS); + tap_key (KC_SPC); + } + else { + double_max(state->count, SHIFT, KC_COMM); + } + reset_tap_dance(state); +} + +void tilde(tap_dance_state_t *state, void *user_data) +{ + // double tap plus down: repeating keycode + if (state->count > 2) { + register_code(KC_LSFT); + register_code(KC_GRV); + } + // tap: keycode + else { + shift_key(KC_GRV); + // double tap: unix home directory + if (state->count > 1) { + tap_key(KC_SLSH); + } + } +} + +void tilde_reset(tap_dance_state_t *state, void *user_data) +{ + unregister_code(KC_GRV); + unregister_code(KC_LSFT); +} + +// ............................................................. Tap Dance Pairs + +// tap dance shift rules +#define S_NEVER 0 +#define S_SINGLE 1 +#define S_DOUBLE 2 +#define S_ALWAYS S_SINGLE | S_DOUBLE + +void symbol_pair(uint8_t shift, uint16_t left, uint16_t right) +{ + if (shift & S_DOUBLE) { + shift_key(left); + shift_key(right); + } + else { + tap_key(left); + tap_key(right); + } +} + +#define CLOSE 1 + +// tap dance symbol pairs +void tap_pair(tap_dance_state_t *state, uint8_t shift, uint16_t left, uint16_t right, uint16_t modifier, uint8_t close) +{ + // triple tap: left right with cursor between symbol pair a la vim :-) + if (state->count > 2) { + symbol_pair(shift, left, right); + tap_key (KC_LEFT); + } + // double tap: left right + else if (state->count > 1) { + symbol_pair(shift, left, right); + } + // down: modifier + else if (state->pressed) { + if (modifier) { + register_code(modifier); + } + } + // tap: left (close: right) + else { + if (shift & S_SINGLE) { + shift_key(close ? right : left); + } + else { + tap_key(close ? right : left); + } + } + if (!modifier) { + reset_tap_dance(state); + } +} + +void doublequote(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_QUOT, KC_QUOT, 0, 0); +} + +void grave(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_NEVER, KC_GRV, KC_GRV, 0, 0); +} + +void lbrace(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_NEVER, KC_LBRC, KC_RBRC, 0, 0); +} + +void lcurly(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_LBRC, KC_RBRC, 0, 0); +} + +void lparen(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_9, KC_0, KC_LCTL, 0); +} + +void lparen_reset(tap_dance_state_t *state, void *user_data) +{ + unregister_code(KC_LCTL); +} + +void quote(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_NEVER, KC_QUOT, KC_QUOT, 0, 0); +} + +void rangle(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_COMM, KC_DOT, 0, CLOSE); +} + +void rbrace(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_NEVER, KC_LBRC, KC_RBRC, 0, CLOSE); +} + +void rcurly(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_LBRC, KC_RBRC, 0, CLOSE); +} + +void rparen(tap_dance_state_t *state, void *user_data) +{ + tap_pair(state, S_ALWAYS, KC_9, KC_0, 0, CLOSE); +} + +void rparen_reset(tap_dance_state_t *state, void *user_data) +{ + unregister_code(KC_LCTL); +} + +// ............................................................ Tap Dance Insert + +void comma(tap_dance_state_t *state, void *user_data) +{ + tap_key(KC_COMM); + if (state->count > 1) { + tap_key(KC_SPC); + } + reset_tap_dance(state); +} + +void dot(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 1) { + shift_key(KC_COLN); + } + else { + tap_key(KC_DOT); + } + reset_tap_dance(state); +} + +// compile time macro string, see functions/hardware planck script +void private(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 1) { +#ifdef PRIVATE_STRING +#include "private_string.h" +#endif + } + reset_tap_dance(state); +} + +// config.h defined string +void send(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 1) { + SEND_STRING(PUBLIC_STRING); + } + reset_tap_dance(state); +} + +// .......................................................... Tap Dance One Shot + +void caps(tap_dance_state_t *state, void *user_data) +{ + if (state->count > 1) { + tap_key(KC_CAPS); + } + else { + set_oneshot_mods(MOD_LSFT); + register_code (KC_LSFT); // on hold down + } +} + +void caps_reset(tap_dance_state_t *state, void *user_data) +{ + unregister_code(KC_LSFT); +} + +// ................................................................... Tap Dance + +tap_dance_action_t tap_dance_actions[] = { + [_CAPS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, caps, caps_reset) + ,[_COLN] = ACTION_TAP_DANCE_FN (colon) + ,[_COMM] = ACTION_TAP_DANCE_FN (comma) + ,[_DOT] = ACTION_TAP_DANCE_FN (dot) + ,[_DQOT] = ACTION_TAP_DANCE_FN (doublequote) + ,[_ENT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, enter, enter_reset) + ,[_EQL] = ACTION_TAP_DANCE_FN (eql) + ,[_GRV] = ACTION_TAP_DANCE_FN (grave) + ,[_GT] = ACTION_TAP_DANCE_FN (greater) + ,[_LBRC] = ACTION_TAP_DANCE_FN (lbrace) + ,[_LCBR] = ACTION_TAP_DANCE_FN (lcurly) + ,[_LPRN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lparen, lparen_reset) + ,[_LT] = ACTION_TAP_DANCE_FN (lesser) + ,[_PRIV] = ACTION_TAP_DANCE_FN (private) + ,[_QUOT] = ACTION_TAP_DANCE_FN (quote) + ,[_RBRC] = ACTION_TAP_DANCE_FN (rbrace) + ,[_RCBR] = ACTION_TAP_DANCE_FN (rcurly) + ,[_RNGL] = ACTION_TAP_DANCE_FN (rangle) + ,[_RPRN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rparen, rparen_reset) + ,[_SEND] = ACTION_TAP_DANCE_FN (send) + ,[_SPC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, space, space_reset) + ,[_TILD] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tilde, tilde_reset) +}; + +// .............................................................. Dynamic Layers + +#define LEFT 1 +#define RIGHT 2 +static uint8_t thumb = 0; + +// LEFT (KC_SPC, S(KC_BSLS)), RIGHT (KC_LEFT, S(KC_LEFT)) opposite thumb combinations, see process_record_user() +// up, up -> _BASE +// up, down -> _SYMBOL +// down, up -> _NUMBER +// down, down -> _MOUSE // see layer keycodes that raise mouse layer +#define THUMBS_DOWN _MOUSE // layer + +static uint8_t overlayer = 0; + +// left right thumb layer combinations +void thumb_layer(keyrecord_t *record, uint8_t side, uint8_t shift, uint16_t keycode, uint8_t thumb_dn_layer, uint8_t thumb_up_layer) +{ + if (record->event.pressed) { + // layer_on via tap_layer(), see process_record_user() + key_timer = timer_read(); + thumb = thumb | side; + } + else { + layer_off(thumb_dn_layer); + // opposite thumb_layer() thumb may have switched effective layer! + if (overlayer) { + layer_off(overlayer); + overlayer = 0; + } + if (!key_press(shift, keycode)) { + layer_off(THUMBS_DOWN); // both thumbs needed + // opposite thumb down? see left right combination layer table above + if (thumb & (side == LEFT ? RIGHT : LEFT)) { + layer_on(thumb_up_layer); + overlayer = thumb_up_layer; + } + } + clear_mods(); + thumb = thumb & ~side; + key_timer = 0; + } +} + +// #ifdef STENO_ENABLE +// // LT for steno keycode +// void stn_layer(keyrecord_t *record, uint16_t keycode, uint8_t layer) +// { +// if (record->event.pressed) { +// key_timer = timer_read(); +// if (keycode) { +// process_steno(keycode, record); +// } +// layer_on(layer); +// } +// else { +// layer_off(layer); +// if (keycode) { +// if (timer_elapsed(key_timer) < TAPPING_TERM) { +// process_steno(keycode, record); +// } +// else { +// // clear pressed state (request push of updated) process_steno.c and .h +// // steno_clear_state(); +// } +// } +// key_timer = 0; +// } +// } +// #endif + +// LT for S(keycode) +void lt_shift(keyrecord_t *record, uint16_t keycode, uint8_t layer) +{ + if (record->event.pressed) { + key_timer = timer_read(); + layer_on(layer); + } + else { + layer_off(layer); + // for shifted keycodes, hence, LT_SHIFT + key_press(SHIFT, keycode); + clear_mods(); + key_timer = 0; + } +} + +// set layer asap to overcome macro latency errors, notably tap dance and LT usage +// this routine inexplicably (?) sets layer_on() faster than can be done in thumb_layer() +void tap_layer(keyrecord_t *record, uint8_t layer) +{ + if (record->event.pressed) { + layer_on(layer); + } + else { + layer_off(layer); + } +} + +// ..................................................................... Keymaps + +// void persistant_default_layer_set(uint16_t default_layer) +// { +// eeconfig_update_default_layer(default_layer); +// default_layer_set (default_layer); +// } + +void clear_layers(void) +{ + uint8_t layer; + for (layer = 0; layer < _END_LAYERS; layer++) { + layer_off(layer); + } +} + +#ifdef CENTER_TT +static uint16_t tt_keycode = 0; // current TT keycode + +void clear_tt(void) +{ + if (tt_keycode == KC_CAPS) { + tap_key(KC_CAPS); // clear capslock + } + tt_keycode = 0; + clear_layers(); + set_single_persistent_default_layer(_BASE); +} +#endif + +// txbolt plover run state +static uint8_t plover = 0; + +void base_layer(void) +{ +#ifdef AUDIO_ENABLE + if (plover) { + PLAY_SONG(song_plover_gb); + } + else { + PLAY_SONG(song_qwerty); + } +#endif + clear_layers(); + set_single_persistent_default_layer(_BASE); +} + +void toggle_plover(uint8_t state) +{ + if (plover != state) { +#ifdef PLOVER_KEYBIND +#include "plover_keybind.h" +#endif + plover = state; + } +} + +void steno(keyrecord_t *record) +{ + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(song_plover); +#endif + clear_layers(); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + if (!plover) { + toggle_plover(1); + } + } +} + +void steno_exit(keyrecord_t *record) +{ + if (record->event.pressed) { + base_layer(); + toggle_plover(0); + } +} diff --git a/keyboards/planck/keymaps/sdothum/common/number_fkey_layout.h b/keyboards/planck/keymaps/sdothum/common/number_fkey_layout.h new file mode 100644 index 000000000000..e19a6097c10f --- /dev/null +++ b/keyboards/planck/keymaps/sdothum/common/number_fkey_layout.h @@ -0,0 +1,87 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ......................................................... Number Keypad Layer +#ifdef SHIFT_SYMBOLS + // .-----------------------------------------------------------------------------------. + // | | F | E | D | | | | / | 7 | 8 | 9 | * | + // |-----------------------------------------------------------------------------------| + // | Ctrl | C | B | A | | | | . | 4 | 5 | 6 | - | + // |-----------------------------------------------------------------------------------| + // | | # | G | \ | | | | , | 1 | 2 | 3 | + | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | 0 | = | | | | + // | | | | f() | | | | = | 0 | | | | + // '-----------------------------------------------------------------------------------' + + [_NUMBER] = LAYOUT_planck_grid( + _______, KC_F, MT_E, KC_D, _______, ___x___, ___x___, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, + OS_CTL, GT_C, AT_B, ST_A, _______, ___x___, ___x___, TD_DOT, KC_4, KC_5, KC_6, KC_MINS, + _______, KC_HASH, SM_G, KC_BSLS, _______, ___x___, ___x___, TD_COMM, KC_1, KC_2, KC_3, KC_PLUS, +#ifdef THUMB_0 + ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___, KC_0, LT_EQL, ___x___, ___x___, ___x___ +#else + ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___, KC_EQL, LT_0, ___x___, ___x___, ___x___ +#endif + ), +#else + // .-----------------------------------------------------------------------------------. + // | | F | E | D | | | | / | 7 | 8 | 9 | * | + // |-----------------------------------------------------------------------------------| + // | Ctrl | C | B | A | | | | . | 4 | 5 | 6 | - | + // |-----------------------------------------------------------------------------------| + // | | # | X | G | | | | , | 1 | 2 | 3 | + | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | 0 | = | | | | + // | | | | f() | | | | = | 0 | | | | + // '-----------------------------------------------------------------------------------' + + [_NUMBER] = LAYOUT_planck_grid( + _______, KC_F, MT_E, KC_D, _______, _______, _______, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, + OS_CTL, GT_C, AT_B, LT_A, _______, _______, _______, KC_DOT, KC_4, KC_5, KC_6, KC_MINS, + _______, KC_HASH, MT_X, S(KC_G), _______, _______, _______, TD_COMM, KC_1, KC_2, KC_3, KC_PLUS, +#ifdef THUMB_0 + ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___, KC_0, LT_EQL, ___x___, ___x___, ___x___ +#else + ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___, KC_EQL, LT_0, ___x___, ___x___, ___x___ +#endif + ), + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | { | & | ? | : | } | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | ( | $ | % | ^ | ) | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | [ | < | ~ | > | ] | + // |-----------------------------------------------------------------------------------| + // | | | | f() | | | | \ | | | | | | + // '-----------------------------------------------------------------------------------' + + [_NUMSYM] = LAYOUT_planck_grid( + _______, _______, _______, ___x___, _______, _______, _______, TD_LCBR, KC_AMPR, KC_QUES, KC_COLN, KC_RCBR, + ___x___, ___x___, ___x___, ___fn__, _______, _______, _______, TD_LPRN, KC_DLR, KC_PERC, KC_CIRC, KC_RPRN, + _______, _______, _______, ___x___, _______, _______, _______, TD_LBRC, KC_LT, KC_TILD, KC_GT, KC_RBRC, + ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___, KC_BSLS, KC_PIPE, ___x___, ___x___, ___x___ + ), +#endif + +// ............ .................................................. Function Keys + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | F7 | F8 | F9 | F12 | + // |-----------------------------------------------------------------------------------| + // | Ctrl | GUI | Alt | Shift| | | | | F4 | F5 | F6 | F11 | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | F1 | F2 | F3 | F10 | + // |-----------------------------------------------------------------------------------| + // | | | | | | f() | | + | | | | | + // | | | | | f() | | | + | | | | | see _PLOVER + // '-----------------------------------------------------------------------------------' + + [_FNCKEY] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_F7, KC_F8, KC_F9, KC_F12 , + OS_CTL, OS_GUI, OS_ALT, OS_SFT, _______, ___x___, ___x___, _______, KC_F4, KC_F5, KC_F6, KC_F11 , + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_F1, KC_F2, KC_F3, KC_F10 , + _______, _______, _______, _______, ___fn__, ___fn__, _______, KC_PLUS, _______, _______, _______, _______ + ), + diff --git a/keyboards/planck/keymaps/sdothum/common/plover_keybind.h b/keyboards/planck/keymaps/sdothum/common/plover_keybind.h new file mode 100644 index 000000000000..88ec727bfd60 --- /dev/null +++ b/keyboards/planck/keymaps/sdothum/common/plover_keybind.h @@ -0,0 +1,7 @@ + +// simple window manager specific plover keybind hook + +// toggle plover application, see herbstluftwm/config/appbinds +register_code (KC_LGUI); +shift_key (KC_RGHT); +unregister_code(KC_LGUI); diff --git a/keyboards/planck/keymaps/sdothum/common/sounds.h b/keyboards/planck/keymaps/sdothum/common/sounds.h new file mode 100644 index 000000000000..1bfc7a6da0c9 --- /dev/null +++ b/keyboards/planck/keymaps/sdothum/common/sounds.h @@ -0,0 +1,14 @@ + +// ................................................................ Audio Sounds + +#ifdef AUDIO_ENABLE +float song_startup [][2] = SONG(STARTUP_SOUND); +float song_colemak [][2] = SONG(COLEMAK_SOUND); +float song_qwerty [][2] = SONG(QWERTY_SOUND); +float song_plover [][2] = SONG(PLOVER_SOUND); +float song_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float song_caps_on [][2] = SONG(CAPS_LOCK_ON_SOUND); +float song_caps_off [][2] = SONG(CAPS_LOCK_OFF_SOUND); +float music_scale [][2] = SONG(MUSIC_SCALE_SOUND); +float song_goodbye [][2] = SONG(GOODBYE_SOUND); +#endif diff --git a/keyboards/planck/keymaps/sdothum/common/steno_layout.h b/keyboards/planck/keymaps/sdothum/common/steno_layout.h new file mode 100644 index 000000000000..c1f2b5b24ab7 --- /dev/null +++ b/keyboards/planck/keymaps/sdothum/common/steno_layout.h @@ -0,0 +1,39 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ...................................................................... Plover +#ifdef STENO_ENABLE + // ,-----------------------------------------------------------------------------------. + // | # | # | # | # | # | # | # | # | # | # | # | # | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | Base | S | T | P | H | * | * | F | P | L | T | D | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Base | S | K | W | R | * | * | R | B | G | S | Z | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | | A | O | E | U | | + // `-----------------------------------------------------------------------------------' + + [_PLOVER] = LAYOUT_planck_grid( + STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC , + BASE1, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR , + BASE2, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR , + _______, _______, _______, PS_STNA, PS_STNO, _______, _______, PS_STNE, PS_STNU, _______, _______, _______ + ), +#else + // ,-----------------------------------------------------------------------------------. + // | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | Base | S | T | P | H | * | * | F | P | L | T | D | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Base | S | K | W | R | * | * | R | B | G | S | Z | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | | A | O | E | U | | + // `-----------------------------------------------------------------------------------' + + [_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + BASE1, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + BASE2, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + _______, _______, _______, LT_C, LT_V, _______, _______, LT_N, LT_M, _______, _______, _______ + ), +#endif diff --git a/keyboards/planck/keymaps/sdothum/common/symbol_guifn_layout.h b/keyboards/planck/keymaps/sdothum/common/symbol_guifn_layout.h new file mode 100644 index 000000000000..d33ca8baa80c --- /dev/null +++ b/keyboards/planck/keymaps/sdothum/common/symbol_guifn_layout.h @@ -0,0 +1,75 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ..................................................... Symbol Navigation Layer +#ifdef SHIFT_SYMBOLS + // .-----------------------------------------------------------------------------------. + // | | ~ | * | & | | | | | Home | Up | End | PgUp | + // |-----------------------------------------------------------------------------------| + // | Ctrl | ^ | % | $ | | | | | Left | Down | Right| PgDn | + // |-----------------------------------------------------------------------------------| + // | | # | @ | ! | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | | |Adjust| \ | | | | f() | | | | + // '-----------------------------------------------------------------------------------' + + [_SYMBOL] = LAYOUT_planck_grid( + _______, KC_TILD, KC_ASTR, KC_AMPR, _______, ___x___, ___x___, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, + OS_CTL, SM_CIRC, SM_PERC, SM_DLR, _______, ___x___, ___x___, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, + _______, KC_HASH, KC_AT, KC_EXLM, _______, ___x___, ___x___, _______, _______, _______, _______, _______, + ___x___, ___x___, ___x___, ADJUST, LT_BSLS, ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___ + ), +#else + // .-----------------------------------------------------------------------------------. + // | { | . | * | & | } | | | | Home | Up | End | PgUp | + // |-----------------------------------------------------------------------------------| + // | ( | ^ | % | $ | ) | | | | Left | Down | Right| PgDn | + // |-----------------------------------------------------------------------------------| + // | [ | # | @ | ! | ] | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | | | | | \ | | | | f() | | | | + // '-----------------------------------------------------------------------------------' + + [_SYMBOL] = LAYOUT_planck_grid( + KC_LCBR, KC_DOT, KC_ASTR, KC_AMPR, TD_RCBR, _______, _______, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, + SM_LPRN, SM_CIRC, SM_PERC, SM_DLR, TD_RPRN, _______, _______, _______, LT_LFTX, KC_DOWN, KC_RGHT, KC_PGDN, + KC_LBRC, KC_HASH, KC_AT, KC_EXLM, TD_RBRC, _______, _______, _______, _______, _______, _______, _______, + ___x___, ___x___, ___x___, SL_PIPE, LT_BSLS, ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___ + ), + + // .-----------------------------------------------------------------------------------. + // | | ? | + | ~ | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | < | = | > | | | | | f() | | | | + // |-----------------------------------------------------------------------------------| + // | | 3 | 2 | 1 | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | f() | | | | + // '-----------------------------------------------------------------------------------' + + [_SYMREG] = LAYOUT_planck_grid( + ___x___, KC_QUES, KC_PLUS, KC_TILD, ___x___, _______, _______, _______, ___x___, ___x___, ___x___, ___x___, + ___x___, KC_LT, KC_EQL, TD_RNGL, ___x___, _______, _______, _______, ___fn__, ___x___, ___x___, ___x___, + ___x___, KC_3, KC_2, KC_1, ___x___, _______, _______, _______, _______, _______, _______, _______, + ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___fn__, ___x___, ___x___, ___x___ + ), +#endif + +// ............................................................... Mouse Actions + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | Left | Up | Right| Up | + // |-----------------------------------------------------------------------------------| + // | | Btn3 | Btn2 | Btn1 | | | | | Left | Down | Right| Down | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | | | | f() | | | | f() | | | | + // '-----------------------------------------------------------------------------------' + + [_MOUSE] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_WH_U, + _______, KC_BTN3, KC_BTN2, KC_BTN1, _______, ___x___, ___x___, _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, + _______, _______, _______, _______, _______, ___x___, ___x___, _______, _______, _______, _______, _______, + _______, _______, _______, _______, ___fn__, _______, _______, _______, ___fn__, _______, _______, _______ + ), diff --git a/keyboards/planck/keymaps/sdothum/common/tapdance.h b/keyboards/planck/keymaps/sdothum/common/tapdance.h new file mode 100644 index 000000000000..d778286bf1ed --- /dev/null +++ b/keyboards/planck/keymaps/sdothum/common/tapdance.h @@ -0,0 +1,49 @@ + +// tap dance keys +enum tap_dance { + _CAPS = 0 + ,_COLN + ,_COMM + ,_DOT + ,_DQOT + ,_ENT + ,_EQL + ,_GRV + ,_GT + ,_LBRC + ,_LCBR + ,_LPRN + ,_LT + ,_PRIV + ,_QUOT + ,_RBRC + ,_RCBR + ,_RNGL + ,_RPRN + ,_SEND + ,_SPC + ,_TILD +}; + +#define TD_CAPS TD(_CAPS) +#define TD_COLN TD(_COLN) +#define TD_COMM TD(_COMM) +#define TD_DOT TD(_DOT) +#define TD_DQOT TD(_DQOT) +#define TD_ENT TD(_ENT) +#define TD_EQL TD(_EQL) +#define TD_GRV TD(_GRV) +#define TD_GT TD(_GT) +#define TD_LBRC TD(_LBRC) +#define TD_LCBR TD(_LCBR) +#define TD_LPRN TD(_LPRN) +#define TD_LT TD(_LT) +#define TD_PRIV TD(_PRIV) // compile time macro string, provided in private_string.h +#define TD_QUOT TD(_QUOT) +#define TD_RBRC TD(_RBRC) +#define TD_RCBR TD(_RCBR) +#define TD_RNGL TD(_RNGL) +#define TD_RPRN TD(_RPRN) +#define TD_SEND TD(_SEND) // config.h defined macro string +#define TD_SPC TD(_SPC) // see process_record_user() for extended handling of Spc +#define TD_TILD TD(_TILD) diff --git a/keyboards/planck/keymaps/sdothum/common/toggle_layout.h b/keyboards/planck/keymaps/sdothum/common/toggle_layout.h new file mode 100644 index 000000000000..ae44576df9d8 --- /dev/null +++ b/keyboards/planck/keymaps/sdothum/common/toggle_layout.h @@ -0,0 +1,102 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ......................................................... Number Keypad Layer + + // .-----------------------------------------------------------------------------------. + // | | F | E | D | | | | / | 7 | 8 | 9 | * | + // |-----------------------------------------------------------------------------------| + // | Ctrl | C | B | A | | | | . | 4 | 5 | 6 | - | + // |-----------------------------------------------------------------------------------| + // | | # | G | \ | | | | , | 1 | 2 | 3 | + | + // |-----------------------------------------------------------------------------------| + // | | f() | Space| 0 | = | | + // | | f() | Space| = | 0 | | + // '-----------------------------------------------------------------------------------' + + [_TTNUMBER] = LAYOUT_planck_grid( + _______, KC_F, MT_E, KC_D, _______, ___x___, ___x___, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, + OS_CTL, GT_C, AT_B, ST_A, _______, ___x___, ___x___, TD_DOT, KC_4, KC_5, KC_6, KC_MINS, + _______, KC_HASH, SM_G, KC_BSLS, _______, ___x___, ___x___, TD_COMM, KC_1, KC_2, KC_3, KC_PLUS, +#ifdef THUMB_0 + _______, _______, _______, _______, TT_ESC, KC_SPC, KC_0, LT_EQL, _______, _______, _______, _______ +#else + _______, _______, _______, _______, TT_ESC, KC_SPC, KC_EQL, LT_0, _______, _______, _______, _______ +#endif + ), + +// ............ .................................................. Function Keys + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | F7 | F8 | F9 | F12 | + // |-----------------------------------------------------------------------------------| + // | Ctrl | GUI | Alt | Shift| | | | | F4 | F5 | F6 | F11 | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | F1 | F2 | F3 | F10 | + // |-----------------------------------------------------------------------------------| + // | | f() | | + | | | + // '-----------------------------------------------------------------------------------' + + [_TTFNCKEY] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_F7, KC_F8, KC_F9, KC_F12 , + OS_CTL, OS_GUI, OS_ALT, OS_SFT, _______, ___x___, ___x___, _______, KC_F4, KC_F5, KC_F6, KC_F11 , + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_F1, KC_F2, KC_F3, KC_F10 , + _______, _______, _______, _______, TT_ESC, _______, KC_PLUS, _______, _______, _______, _______, _______ + ), + +// ....................................................................... Regex + + // ,-----------------------------------------------------------------------------------. + // | | ~ | { | } | & | | | % | [ | ] | @ | | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | | ^ | < | > | ? | | | | | ( | ) | $ | | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | | : | ! | = | / | | | \ | * | . | # | | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | | f() | - | + | Space| | + // `-----------------------------------------------------------------------------------' + + [_TTREGEX] = LAYOUT_planck_grid( + ___x___, KC_TILD, KC_LCBR, KC_RCBR, KC_AMPR, ___x___, ___x___, KC_PERC, KC_LBRC, KC_RBRC, KC_AT, ___x___, + ___x___, KC_CIRC, KC_LT, KC_GT, KC_QUES, ___x___, ___x___, KC_PIPE, KC_LPRN, KC_RPRN, KC_DLR, ___x___, + ___x___, KC_COLN, KC_EXLM, KC_EQL, KC_SLSH, ___x___, ___x___, KC_BSLS, KC_ASTR, KC_DOT, KC_HASH, ___x___, + _______, _______, _______, _______, TT_ESC, KC_MINS, KC_PLUS, KC_SPC, _______, _______, _______, _______ + ), + +// ............................................................ Navigation Layer + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | Home | Up | End | PgUp | + // |-----------------------------------------------------------------------------------| + // | Ctrl | GUI | Alt | Shift| | | | | Left | Down | Right| PgDn | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | f() | | | | | + // '-----------------------------------------------------------------------------------' + + [_TTCURSOR] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, + OS_CTL, OS_GUI, OS_ALT, OS_SFT, _______, ___x___, ___x___, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, + _______, _______, _______, _______, _______, ___x___, ___x___, _______, _______, _______, _______, _______, + _______, _______, _______, _______, TT_ESC, _______, _______, _______, _______, _______, _______, _______ + ), + +// ............................................................... Mouse Actions + + // .-----------------------------------------------------------------------------------. + // | | | | | | | | | Left | Up | Right| Up | + // |-----------------------------------------------------------------------------------| + // | | Btn3 | Btn2 | Btn1 | | | | | Left | Down | Right| Down | + // |-----------------------------------------------------------------------------------| + // | | | | | | | | | | | | | + // |-----------------------------------------------------------------------------------| + // | | f() | | | | | + // '-----------------------------------------------------------------------------------' + + [_TTMOUSE] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, ___x___, ___x___, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_WH_U, + _______, KC_BTN3, KC_BTN2, KC_BTN1, _______, ___x___, ___x___, _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, + _______, _______, _______, _______, _______, ___x___, ___x___, _______, _______, _______, _______, _______, + _______, _______, _______, _______, TT_ESC, _______, _______, _______, _______, _______, _______, _______ + ), diff --git a/keyboards/planck/keymaps/sdothum/config.h b/keyboards/planck/keymaps/sdothum/config.h new file mode 100644 index 000000000000..6afcc69064b8 --- /dev/null +++ b/keyboards/planck/keymaps/sdothum/config.h @@ -0,0 +1,46 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// tap dance key press termination interval +#define TAPPING_TERM 250 + +// smooth mouse motion +// #define MOUSEKEY_INTERVAL 20 +// #define MOUSEKEY_DELAY 0 +// #define MOUSEKEY_TIME_TO_MAX 60 +// #define MOUSEKEY_MAX_SPEED 7 +// #define MOUSEKEY_WHEEL_DELAY 0 + +// compile time macro string, see functions/hardware planck script (undefine otherwise) +//#define PRIVATE_STRING + +// compile time macro string, must be in quotes +#define PUBLIC_STRING ":%s/arch=(.*)/arch=('any')\n" + +// thumb key tap-shift() double tap: one shot shift (0) off (1) on +#define DT_SHIFT 1 + +// number layer 0 position KEYPAD_0, THUMB_0 +#define THUMB_0 + +// home block shift symbol clustes defined (no overlays required for extended symbols, undefine otherwise) +#define SHIFT_SYMBOLS + +// center column TT assignments (undefine for OSM chords) +#define CENTER_TT +#define TAPPING_TOGGLE 1 + +// home row modifiers +#define HOME_MODS +// fix dual function timing +#define PERMISSIVE_HOLD + +// layout ADNW*, BEAKL*, COLEKA*, QWERTY (default) +#define BEAKLSP + +// sync app with window manager keybind hook defined in plover_keybind.h +#define PLOVER_KEYBIND + +#endif diff --git a/keyboards/planck/keymaps/sdothum/keymap.c b/keyboards/planck/keymaps/sdothum/keymap.c new file mode 100644 index 000000000000..597466ba4729 --- /dev/null +++ b/keyboards/planck/keymaps/sdothum/keymap.c @@ -0,0 +1,472 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. +// +// To flash planck firmware +// ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +// Reset keyboard or press hw reset button on base (hole) +// +// cd qmk_firmware/keyboards/planck +// sudo make KEYMAP=sdothum dfu +// +// sudo make clean (good practice before flashing) +// sudo make KEYMAP=sdothum (to compile check) +// +// Package requirements (for arch linux) +// ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +// avr-gcc-atmel +// avr-libc-atmel +// dfu-programmer +// +// Notes +// ▔▔▔▔▔ +// ** E R G O W I D E S P L I T ** Layout +// +// Autocompletion tap dance key pairs (),[],{} are available from the +// number/symbol layer, as well as, numerous (un)shift key values +// +// The navigation pad provides a single hand right thumb activated cluster +// with left hand modifiers +// +// #define PRIVATE_STRING includes private_string.h, a user defined code +// block for the PRIV tap dance e.g. SEND_STRING("secret messape"), +// see function private() +// +// Modifier clusters +// ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +// The num and sym keys together access the navigation pad layer +// +// ,-----------------------------------------------------------------------------------. +// | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| +// `-----------------------------------------------------------------------------------' +// +// Hint +// ▔▔▔▔ +// For sculpted keycaps such as Cherry or OEM profile, reverse the Alt, Num, +// Shift, Shift, Nav, Sym keycaps for more ergonomic thumb orientation and +// actuation +// +// Code +// ▔▔▔▔ +// This source is shamelessly based on the "default" planck layout +// +// #ifdef/#endif block structures are not indented, as syntax highlighting +// in vim is sufficient for identification +// +// c++ commenting style is used throughout +// +// Change history +// ▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +// See http://thedarnedestthing.com/planck%20constant +// See http://thedarnedestthing.com/planck%20done + + + +// === N O T E === +// +// sudo CPATH=/common make ... + + +#include QMK_KEYBOARD_H +#ifdef STENO_ENABLE +#include "keymap_steno.h" +#endif + +extern keymap_config_t keymap_config; + +enum planck_layers { + _BASE = 0 + ,_SHIFT + ,_LSHIFT + ,_RSHIFT + ,_PLOVER + ,_NUMBER + ,_SYMBOL + ,_FNCKEY + ,_MOUSE +#ifdef CENTER_TT + ,_TTNUMBER + ,_TTREGEX + ,_TTFNCKEY + ,_TTCURSOR + ,_TTMOUSE +#endif +#ifndef SHIFT_SYMBOLS + ,_NUMSYM + ,_SYMREG +#endif + ,_EDIT + ,_QWERTY + ,_ADJUST + ,_END_LAYERS +}; + +enum planck_keycodes { + BASE = SAFE_RANGE + ,BASE1 + ,BASE2 + ,PLOVER + ,PLOEXIT + ,SM_CIRC // pseudo GUI_T(S(KC_6)) for shifted key-codes, see process_record_user() + ,SM_DLR // pseudo SFT_T(S(KC_4)) for shifted key-codes, see process_record_user() + ,SM_G // pseudo MT (MOD_LALT | MOD_LSFT, S(KC_G)) for shifted key-codes, see process_record_user() + ,SM_PERC // pseudo ALT_T(S(KC_5)) for shifted key-codes, see process_record_user() + ,SM_LPRN // pseudo CTL_T(S(KC_9)) for shifted key-codes, see process_record_user() + ,SL_LEFT // pseudo LT (_MOUSE, S(KC_LEFT)) for shifted key-codes, see process_record_user() + ,SP_DEL // pseudo LT (_MOUSE, KC_DEL) for shifted key-codes, see process_record_user() + ,SL_PIPE // pseudo LT (_ADJUST, S(KC_BSLS)) for shifted key-codes, see process_record_user() + ,SL_TAB // pseudo LT (_FNCKEY, S(KC_TAB)) for shifted key-codes, see process_record_user() +#ifdef CENTER_TT + ,TT_ESC +#endif +#ifdef STENO_ENABLE + ,PS_STNA = STN_A + ,PS_STNO = STN_O + ,PS_STNE = STN_E + ,PS_STNU = STN_U +#else + ,LT_C = LT (_NUMBER, KC_C) + ,LT_V = LT (_FNCKEY, KC_V) + ,LT_N = LT (_EDIT, KC_N) + ,LT_M = LT (_SYMBOL, KC_M) +#endif + ,PS_BASE +}; + +// modifier keys +#define AT_B ALT_T(KC_B) +#define AT_DOWN ALT_T(KC_DOWN) +#define CT_RGHT CTL_T(KC_RGHT) +#define GT_C GUI_T(KC_C) +#define GT_UP GUI_T(KC_UP) +#define MT_E MT (MOD_LCTL | MOD_LALT, KC_E) +#define MT_X MT (MOD_LALT | MOD_LSFT, KC_X) +#define ST_A SFT_T(KC_A) +#ifdef HOME_MODS +#define HOME_K CTL_T(KC_K) +#define HOME_H GUI_T(KC_H) +#define HOME_E ALT_T(KC_E) +#define HOME_A SFT_T(KC_A) +#if defined(BEAKLMU) || defined(BEAKLSP) +#define HOME_T SFT_T(KC_T) +#define HOME_R ALT_T(KC_R) +#define HOME_S GUI_T(KC_S) +#define HOME_W CTL_T(KC_W) +#else +#define HOME_T SFT_T(KC_T) +#define HOME_S ALT_T(KC_S) +#define HOME_N GUI_T(KC_N) +#define HOME_B CTL_T(KC_B) +#endif +#else +#define HOME_K KC_K +#define HOME_H KC_H +#define HOME_E KC_E +#define HOME_A KC_A +#define HOME_T KC_T +#define HOME_S KC_S +#define HOME_N KC_N +#define HOME_B KC_B +#endif + +#define S_DOWN S (KC_DOWN) +#define S_LEFT S (KC_LEFT) +#define S_RGHT S (KC_RGHT) +#define S_TAB S (KC_TAB) +#define S_UP S (KC_UP) + +#include "common/tapdance.h" + +// keycodes +#define ___x___ KC_TRNS +#define ___fn__ KC_TRNS +#undef _______ +#define _______ KC_NO + +#define COPY LCTL(KC_C) +#define CUT LCTL(KC_X) +#define EOT LCTL(KC_D) +#define NAK LCTL(KC_U) +#define PASTE LCTL(KC_V) +#define UNDO LCTL(KC_Z) +#define TMCOPY LALT(LCTL(KC_C)) +#define TMPASTE LALT(LCTL(KC_V)) +#define LT_BSLS LT (_MOUSE, KC_BSLS) // see process_record_user() for extended handling +#define LT_BSPC LT (_EDIT, KC_BSPC) +#define SP_LEFT LT (_EDIT, KC_LEFT) +#define LT_ESC LT (_NUMBER, KC_ESC) +#define LT_LEFT LT (_SYMBOL, KC_LEFT) // see process_record_user() for extended handling +#define SP_BSPC LT (_SYMBOL, KC_BSPC) // see process_record_user() for extended handling +#define LT_TAB LT (_FNCKEY, KC_TAB) +#define LT_INS LT (_FNCKEY, KC_INS) +#define LT_ALTG LT (_FNCKEY, KC_RALT) +#define ADJUST MO (_ADJUST) +#define OS_ALT OSM (MOD_LALT) +#define OS_CTL OSM (MOD_LCTL) +#define OS_GUI OSM (MOD_LGUI) +#define OS_SFT OSM (MOD_LSFT) +#define OS_CALT OSM (MOD_LALT | MOD_LCTL) +#define OS_CGUI OSM (MOD_LGUI | MOD_LCTL) +#define OS_CSFT OSM (MOD_LSFT | MOD_LCTL) +#define OS_SALT OSM (MOD_LALT | MOD_LSFT) +#define OS_SGUI OSM (MOD_LGUI | MOD_LSFT) + +#ifdef CENTER_TT +#ifdef BEAKLSP +#define CNTR_TL OSM (MOD_LSFT) +#else +#define CNTR_TL TT (_TTFNCKEY) +#endif +#define CNTR_TR KC_CAPS +#define CNTR_HL TT (_TTCURSOR) +#define CNTR_HR TT (_TTMOUSE) +#define CNTR_BL TT (_TTNUMBER) +#define CNTR_BR TT (_TTREGEX) +#else +#define CNTR_TL OSM (MOD_LALT | MOD_LCTL) +#define CNTR_TR OSM (MOD_LGUI | MOD_LCTL) +#define CNTR_HL OSM (MOD_LALT | MOD_LSFT) +#define CNTR_HR OSM (MOD_LGUI | MOD_LSFT) +#define CNTR_BL TD (_CAPS) +#define CNTR_BR OSM (MOD_LSFT | MOD_LCTL) +#endif + +#ifdef THUMB_0 +#define LT_EQL LT (_ADJUST, KC_EQL) +#else +#define LT_0 LT (_ADJUST, KC_0) +#endif +#ifndef SHIFT_SYMBOLS +#define LT_A LT (_NUMSYM, KC_A) +#define LT_LFTX LT (_SYMREG, KC_LEFT) +#endif + +// ........................................................ Default Alpha Layout + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +#include "beakl.h" +#include "colemak.h" +#include "qwerty.h" +#include "common/steno_layout.h" + +// ...................................................... Number / Function Keys + +#include "common/number_fkey_layout.h" + +// ......................................................... Symbol / Navigation + +#include "common/symbol_guifn_layout.h" + +// ............................................................... Toggle Layers + +#ifdef CENTER_TT +#include "common/toggle_layout.h" +#endif + +// ......................................................... Short Cuts / Adjust + +#include "common/chord_layout.h" + +}; + +// ...................................................................... Sounds + +#include "common/sounds.h" + +// ........................................................... User Keycode Trap + +#include "common/keycode_functions.h" + +#define BASE_1 1 +#define BASE_2 2 +#define BASE_12 3 +static uint8_t base_n = 0; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + switch (keycode) { + case BASE1: + if (record->event.pressed) { + base_n = base_n | BASE_1; + if (base_n == BASE_12) { + base_layer(); + } + } + else { + base_n = base_n & ~BASE_1; + } + return false; + case BASE2: + if (record->event.pressed) { + base_n = base_n | BASE_2; + if (base_n == BASE_12) { + base_layer(); + } + } + else { + base_n = base_n & ~BASE_2; + } + return false; + case AT_DOWN: +#ifdef HOME_MODS + case HOME_E: +#if defined(BEAKLMU) || defined(BEAKLSP) + case HOME_R: +#else + case HOME_S: +#endif +#endif + tap_mods(record, KC_LALT); + break; + case CT_RGHT: +#ifdef HOME_MODS + case HOME_K: +#if defined(BEAKLMU) || defined(BEAKLSP) + case HOME_W: +#else + case HOME_B: +#endif +#endif + tap_mods(record, KC_LCTL); + break; + case GT_UP: +#ifdef HOME_MODS + case HOME_H: +#if defined(BEAKLMU) || defined(BEAKLSP) + case HOME_S: +#else + case HOME_N: +#endif +#endif + tap_mods(record, KC_LGUI); + break; +#ifdef HOME_MODS + case HOME_A: + case HOME_T: + tap_mods(record, KC_LSFT); + break; +#endif +#ifdef CENTER_TT + case TT_ESC: + clear_tt(); // exit TT layer + return false; +#endif + case LT_ESC: +#ifdef CENTER_TT + if (tt_keycode != 0) { + clear_tt(); // exit TT layer + return false; + } +#endif + tap_layer(record, _NUMBER); + break; + case LT_LEFT: + case SP_BSPC: + tap_layer(record, _SYMBOL); + // LT (_SYMBOL, KC_LEFT) left right combination layer + thumb_layer(record, RIGHT, 0, 0, _SYMBOL, _LSHIFT); + break; + case OS_ALT: + tap_mods(record, KC_LALT); + break; + case OS_CTL: + tap_mods(record, KC_LCTL); + break; + case OS_GUI: + tap_mods(record, KC_LGUI); + break; + case SM_CIRC: + // GUI_T(S(KC_6)) + mt_shift(record, KC_LGUI, 0, KC_6); + break; + case SM_DLR: + // SFT_T(S(KC_4)) + mt_shift(record, KC_LSFT, 0, KC_4); + break; + case SM_G: + // MT(MOD_LALT | MOD_LSFT, S(KC_G)) + mt_shift(record, KC_LALT, KC_LSFT, KC_G); + break; + case SM_LPRN: + // CTL_T(S(KC_9)) + mt_shift(record, KC_LCTL, 0, KC_9); + break; + case SM_PERC: + // ALT_T(S(KC_5)) + mt_shift(record, KC_LALT, 0, KC_5); + break; + case LT_BSLS: + tap_layer(record, _MOUSE); + // LT (_MOUSE, KC_BSLS) left right combination layer, see #define LT_BSLS + thumb_layer(record, LEFT, 0, 0, _MOUSE, _SYMBOL); + break; + case SL_LEFT: + tap_layer(record, _MOUSE); + // LT (_MOUSE, S(KC_LEFT)) left right combination layer + thumb_layer(record, RIGHT, SHIFT, KC_LEFT, _MOUSE, _LSHIFT); + break; + case SP_DEL: + tap_layer(record, _MOUSE); + // LT (_MOUSE, S(KC_LEFT)) left right combination layer + thumb_layer(record, RIGHT, NOSHIFT, KC_DEL, _MOUSE, _LSHIFT); + break; + case SL_PIPE: + // LT (_ADJUST, S(KC_BSLS)) emulation + lt_shift(record, KC_BSLS, _ADJUST); + break; + case SL_TAB: + // LT (_FNCKEY, S(KC_TAB)) emulation + lt_shift(record, KC_TAB, _FNCKEY); + break; + case TD_ENT: + tap_layer(record, _RSHIFT); + // LT (_RSHIFT, KC_ENT) emulation, see tap dance enter + break; + case TD_SPC: + tap_layer(record, _LSHIFT); + // LT (_LSHIFT, KC_SPC) left right combination layer, see tap dance TD_SPC + thumb_layer(record, LEFT, 0, 0, _LSHIFT, _SYMBOL); + break; +#ifdef CENTER_TT + case CNTR_TL: + case CNTR_TR: + case CNTR_HL: + case CNTR_HR: + case CNTR_BL: + case CNTR_BR: + if (tt_keycode != keycode && tt_keycode != 0) { + clear_tt(); // return to base layer first if different TT layer selected + } + tt_keycode = keycode; + break; +#endif +// #ifdef STENO_ENABLE +// case PS_STNA: +// stn_layer(record, STN_A, _NUMBER); +// break; +// case PS_STNO: +// stn_layer(record, STN_O, _FNCKEY); +// break; +// case PS_STNE: +// stn_layer(record, STN_E, _EDIT); +// break; +// case PS_STNU: +// stn_layer(record, STN_U, _SYMBOL); +// break; +// #endif + case PS_BASE: + if (record->event.pressed) { + base_layer(); + } + return false; + case PLOVER: + steno(record); + return false; + case PLOEXIT: + steno_exit(record); + return false; + } + return true; +} + +#include "common/init.h" diff --git a/keyboards/planck/keymaps/sdothum/qwerty.h b/keyboards/planck/keymaps/sdothum/qwerty.h new file mode 100644 index 000000000000..3bfdb3e70430 --- /dev/null +++ b/keyboards/planck/keymaps/sdothum/qwerty.h @@ -0,0 +1,64 @@ + +// const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ...................................................................... Qwerty +#ifdef QWERTY + // ,-----------------------------------------------------------------------------------. + // | Q | W | E | R | T | ^Alt | ^GUI | Y | U | I | O | P | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | S | D | F | G | ↑Alt | ↑GUI | H | J | K | L | ; | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | X | C | V | B | Caps |^Shift| N | M | , | . | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | Space| Tab | Bksp | Ent | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_BASE] = LAYOUT_planck_grid( + KC_Q, KC_W, KC_E, KC_R, KC_T, CNTR_TL, CNTR_TR, KC_Y, KC_U, KC_I, KC_O, KC_P , + KC_A, KC_S, KC_D, KC_F, KC_G, CNTR_HL, CNTR_HR, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + KC_Z, KC_X, KC_C, KC_V, KC_B, CNTR_BL, CNTR_BR, KC_N, KC_M, KC_COMM, KC_DOT, TD_QUOT, + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + [_SHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_W), S(KC_E), S(KC_R), S(KC_T), CNTR_TL, CNTR_TR, S(KC_Y), S(KC_U), S(KC_I), S(KC_O), S(KC_P), + S(KC_A), S(KC_S), S(KC_D), S(KC_F), S(KC_G), CNTR_HL, CNTR_HR, S(KC_H), S(KC_J), S(KC_K), S(KC_L), KC_SCLN, + S(KC_Z), S(KC_X), S(KC_C), S(KC_V), S(KC_B), CNTR_BL, CNTR_BR, S(KC_N), S(KC_M), KC_COMM, KC_DOT, TD_QUOT, + OS_CTL, OS_GUI, OS_ALT, LT_ESC, TD_SPC, LT_TAB, LT_BSPC, TD_ENT, LT_LEFT, AT_DOWN, GT_UP, CT_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | W | E | R | T | ^Alt | ^GUI | Y | U | I | O | P | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | S | D | F | G | ↑Alt | ↑GUI | H | J | K | L | : | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | X | C | V | B | Caps |^Shift| N | M | / | ? | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Esc | f() | Tab | Del | - | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_LSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_W), S(KC_E), S(KC_R), S(KC_T), CNTR_TL, CNTR_TR, S(KC_Y), S(KC_U), S(KC_I), S(KC_O), S(KC_P), + S(KC_A), S(KC_S), S(KC_D), S(KC_F), S(KC_G), CNTR_HL, CNTR_HR, S(KC_H), S(KC_J), S(KC_K), S(KC_L), TD_COLN, + S(KC_Z), S(KC_X), S(KC_C), S(KC_V), S(KC_B), CNTR_BL, CNTR_BR, S(KC_N), S(KC_M), KC_SLSH, KC_QUES, TD_DQOT, + OS_CTL, OS_GUI, OS_ALT, LT_ESC, ___fn__, LT_TAB, KC_DEL, KC_MINS, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), + + // ,-----------------------------------------------------------------------------------. + // | Q | W | E | R | T | ^Alt | ^GUI | Y | U | I | O | P | + // |------+------+------+------+------+-------------+------+------+------+------+------| + // | A | S | D | F | G | ↑Alt | ↑GUI | H | J | K | L | : | + // |------+------+------+------+------+------|------+------+------+------+------+------| + // | Z | X | C | V | B | Caps |^Shift| N | M | ~ | ` | " | + // |------+------+------+------+------+------+------+------+------+------+------+------| + // | Ctrl | GUI | Alt | Caps | _ | ↑Tab | Bksp | f() | Left | Down | Up | Right| + // `-----------------------------------------------------------------------------------' + + [_RSHIFT] = LAYOUT_planck_grid( + S(KC_Q), S(KC_W), S(KC_E), S(KC_R), S(KC_T), CNTR_TL, CNTR_TR, S(KC_Y), S(KC_U), S(KC_I), S(KC_O), S(KC_P), + S(KC_A), S(KC_S), S(KC_D), S(KC_F), S(KC_G), CNTR_HL, CNTR_HR, S(KC_H), S(KC_J), S(KC_K), S(KC_L), TD_COLN, + S(KC_Z), S(KC_X), S(KC_C), S(KC_V), S(KC_B), CNTR_BL, CNTR_BR, S(KC_N), S(KC_M), TD_TILD, TD_GRV, TD_DQOT, + OS_CTL, OS_GUI, OS_ALT, KC_CAPS, KC_UNDS, SL_TAB, LT_BSPC, ___fn__, SL_LEFT, S_DOWN, S_UP, S_RGHT + ), +#endif + diff --git a/keyboards/planck/keymaps/sdothum/readme.md b/keyboards/planck/keymaps/sdothum/readme.md new file mode 100644 index 000000000000..58f73e3b445a --- /dev/null +++ b/keyboards/planck/keymaps/sdothum/readme.md @@ -0,0 +1,10 @@ +# The sdothum extended Default Planck Layout + +- Colemak-DH layout layer with shift/tab key overlays +- Number and symbol/function key layer +- Hexadecimal keypad layer +- Navigation keypad layer +- Dynamic macro layer +- Autocompletion tap key pairs (),[],{} +- Normalized enter and esc key position across keyboard layers +- Extensive use of tap keys diff --git a/keyboards/planck/keymaps/sdothum/rules.mk b/keyboards/planck/keymaps/sdothum/rules.mk new file mode 100644 index 000000000000..ea9abc2a80df --- /dev/null +++ b/keyboards/planck/keymaps/sdothum/rules.mk @@ -0,0 +1,23 @@ +# Build Options: +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically + +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # mouse keys(+4700) +EXTRAKEY_ENABLE = no # audio control and System control(+450) +CONSOLE_ENABLE = no # console for debug(+400) +COMMAND_ENABLE = no # commands for debug and configuration +NKRO_ENABLE = yes # nkey rollover +BACKLIGHT_ENABLE = no # enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # audio output on port C6 +UNICODE_ENABLE = no # unicode +BLUETOOTH_ENABLE = no # enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # enable WS2812 RGB underlight, do not enable this with audio at the same time. +STENO_ENABLE = yes # enable TX Bolt protocol, requires VIRTSER and may not work with mouse keys + +# do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # breathing sleep LED during USB suspend + +TAP_DANCE_ENABLE = yes # enable double tap completion of (),[],{} + diff --git a/keyboards/planck/keymaps/sean/config.h b/keyboards/planck/keymaps/sean/config.h new file mode 100644 index 000000000000..2bebf48a1ca9 --- /dev/null +++ b/keyboards/planck/keymaps/sean/config.h @@ -0,0 +1,26 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/sean/keymap.c b/keyboards/planck/keymaps/sean/keymap.c new file mode 100644 index 000000000000..42847b646c16 --- /dev/null +++ b/keyboards/planck/keymaps/sean/keymap.c @@ -0,0 +1,304 @@ +// This is Sean Hunter's keymap file, customized from the canonical layout file for the Quantum project. +// If you want to add another keyboard, that is the style you want to emulate. + +#include QMK_KEYBOARD_H +#include "mymappings.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. + +enum planck_layers { + _DVRK, + _LOWER, + _RAISE, + _SDRK, + _SLWER, + _SRAIS, + _NMPD, + _MVMT, + _ADJUST +}; + +enum planck_keycodes { + DVRK = SAFE_RANGE, + LOWER, + RAISE, + SDRK, + SLWER, + SRAIS, + BACKLIT, + BACKTOG, + CUT, + COPY, + PASTE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | " | , | . | P | Y | / | = | F | G | C | R | L | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | A | O | E | U | I | ESC | BSPC | D | H | T | N | S | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ; | Q | J | K | X | TAB | ENT | B | M | W | V | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Sft | Ctl | Alt | Gui |Lower | Space |Raise | < | v | ^ | > | + * `-----------------------------------------------------------------------------------' + */ +[_DVRK] = LAYOUT_planck_grid( + KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_SLSH, KC_EQL, KC_F, KC_G, KC_C, KC_R, KC_L, + KC_A, KC_O, KC_E, KC_U, KC_I, KC_ESC, KC_BSPC, KC_D, KC_H, KC_T, KC_N, KC_S, + KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_TAB, KC_ENT, KC_B, KC_M, KC_W, KC_V, KC_Z, + KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT +), + + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | { | } | F6 | F7 | F8 | F9 | F10 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | 1 | 2 | 3 | 4 | 5 | [ | ] | 6 | 7 | 8 | 9 | 0 | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | ~ | | | ` | - | _ | INS | DEL | ( | ) | + | = | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Sft | Ctl | Alt | Gui |Lower | |Raise | Home | PgDn | PgUp | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, + KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, + KC_TILD, KC_PIPE, KC_GRV, KC_MINS, KC_UNDS, KC_INS, KC_DEL, KC_LPRN, KC_RPRN, KC_PLUS, KC_EQL, KC_BSLS, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | F11 | F12 | F13 | F14 | F15 | | | F16 | F17 | F18 | F19 | F20 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ! | @ | # | $ | % |Sleep | Wake | ^ | & | * | ( | ) | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | GUI1 | GUI2 | GUI3 | GUI4 | GUI5 | | GUI6 | GUI7 | GUI8 | GUI9 |GUI10 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Sft | Ctl | Alt | Gui |Lower | |Raise | Gui | Alt | Ctl | Sft | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, _______, _______, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_SLEP, KC_WAKE, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, + GUI_1, GUI_2, GUI_3, GUI_4, GUI_5, _______, _______, GUI_6, GUI_7, GUI_8, GUI_9, GUI_10, + KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_RGUI, KC_RALT, KC_RCTL, KC_RSFT +), + +/* 'Software Dvorak': Designed to look like dvorak in the mapping but depend on software + * dvorak (ie the OS keymapping changed to dvorak). + * ,-----------------------------------------------------------------------------------. + * | " | , | . | P | Y | / | = | F | G | C | R | L | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | A | O | E | U | I | ESC | BSPC | D | H | T | N | S | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ; | Q | J | K | X | TAB | ENT | B | M | W | V | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Sft | Ctl | Alt | Gui |SLower| Space |SRaise| < | v | ^ | > | + * `-----------------------------------------------------------------------------------' + */ +[_SDRK] = LAYOUT_planck_grid( + DV_QUOT, DV_COMM, DV_DOT, DV_P, DV_Y, DV_SLSH, DV_EQL, DV_F, DV_G, DV_C, DV_R, DV_L, + DV_A, DV_O, DV_E, DV_U, DV_I, KC_ESC, KC_BSPC, DV_D, DV_H, DV_T, DV_N, DV_S, + DV_SCLN, DV_Q, DV_J, DV_K, DV_X, KC_TAB, KC_ENT, DV_B, DV_M, DV_W, DV_V, DV_Z, + KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, SLWER, KC_SPC, KC_SPC, SRAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT +), + + +/* 'Software dvorak lower mode': Puts all the braces etc in the right places so it works + * just like the lower mode above except that it depends on the OS keymapping being set + * to dvorak. + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | { | } | F6 | F7 | F8 | F9 | F10 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | 1 | 2 | 3 | 4 | 5 | [ | ] | 6 | 7 | 8 | 9 | 0 | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | ~ | | | ` | - | _ | INS | DEL | ( | ) | + | = | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Sft | Ctl | Alt | Gui |SLower| |SRaise| Home | PgDn | PgUp | End | + * `-----------------------------------------------------------------------------------' + */ +[_SLWER] = LAYOUT_planck_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, DV_LCBR, DV_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, + DV_1, DV_2, DV_3, DV_4, DV_5, DV_LBRC, DV_RBRC, DV_6, DV_7, DV_8, DV_9, DV_0, + DV_TILD, DV_PIPE, DV_GRV, DV_MINS, DV_UNDS, KC_INS, KC_DEL, DV_LPRN, DV_RPRN, DV_PLUS, DV_EQL, DV_BSLS, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + + +/* 'Software dvorak raise mode' + * ,-----------------------------------------------------------------------------------. + * | F11 | F12 | F13 | F14 | F15 | | | F16 | F17 | F18 | F19 | F20 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ! | @ | # | $ | % |Sleep | Wake | ^ | & | * | ( | ) | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | GUI1 | GUI2 | GUI3 | GUI4 | GUI5 | | GUI6 | GUI7 | GUI8 | GUI9 |GUI10 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Sft | Ctl | Alt | Gui |Lower | |Raise | Gui | Alt | Ctl | Sft | + * `-----------------------------------------------------------------------------------' + */ +[_SRAIS] = LAYOUT_planck_grid( + KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, _______, _______, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, + DV_EXLM, DV_AT, DV_HASH, DV_DLR, DV_PERC, KC_SLEP, KC_WAKE, DV_CIRC, DV_AMPR, DV_ASTR, DV_LPRN, DV_RPRN, + GUI_1, GUI_2, GUI_3, GUI_4, GUI_5, _______, _______, GUI_6, GUI_7, GUI_8, GUI_9, GUI_10, + KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, SLWER, KC_SPC, KC_SPC, SRAIS, KC_RGUI, KC_RALT, KC_RCTL, KC_RSFT +), + + +/* Adjust (Lower + Raise or SLower + SRaise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | |AGnorm|AGswap| | |HRevl |HReset|HMenu | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | PWR | EJCT | CUT | COPY |PASTE |PrScr |SysReq| CAPS | << | >> | Mute | Stop | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |DVORAK|NUMPAD| MVMT | SDRK | | | | | Next | Vol- | Vol+ | Play | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Brite |BToggl| | | | | | Gui | Alt | Ctl | Sft | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, _______, _______, AG_NORM, AG_SWAP, _______, _______, HRVL, HRESET, HMENU, + KC_PWR, KC_EJCT, CUT, COPY, PASTE, KC_PSCR, KC_SYRQ, KC_CAPS, KC_MRWD, KC_MFFD, KC_MUTE, KC_MSTP, + DVRK, TO(_NMPD), TO(_MVMT), SDRK, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, + BACKLIT, BACKTOG, _______, _______, _______, _______, _______, _______, KC_RGUI, KC_RALT, KC_RCTL, KC_RSFT +), + + +/* Numpad + * ,-----------------------------------------------------------------------------------. + * | | | | | | | |NumLck| 7 | 8 | 9 | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | |Enter | 4 | 5 | 6 | * | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |DVORAK|NUMPAD| MVMT | SDRK | | | | | 3 | 2 | 1 | - | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | 0 | . | + | + * `-----------------------------------------------------------------------------------' + */ +[_NMPD] = LAYOUT_planck_grid( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NUM, KC_P7, KC_P8, KC_P9, KC_PSLS, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PENT, KC_P4, KC_P5, KC_P6, KC_PAST, + TO(_DVRK),TO(_NMPD),TO(_MVMT),SDRK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_PMNS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PPLS +), + + +/* Movement + * ,-----------------------------------------------------------------------------------. + * |MsBut2|MsWhDn|MsWhUp|MsBut1|MsBut3| | | | Home | PgDn | PgUp | End | + * +------+------+------+------+------+------+------+------+------+------+------+------+ + * |Ms Lft|Ms Dn |Ms Up |Ms Rht| | | | | Left | Down | Up | Right| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |DVORAK|NUMPAD| MVMT | SDRK | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Sft | Ctl | Alt | Gui | | | | Gui | Alt | Ctl | Sft | + * `-----------------------------------------------------------------------------------' + */ +[_MVMT] = LAYOUT_planck_grid( + KC_MB2, KC_MWDN, KC_MWUP, KC_MB1, KC_MB3, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_PGUP, KC_END, + KC_MLFT, KC_MDN, KC_MUP, KC_MRGT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + TO(_DVRK),TO(_NMPD),TO(_MVMT),SDRK,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, _______, _______, _______, _______, KC_RGUI, KC_RALT, KC_RCTL, KC_RSFT +), +}; + + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case DVRK: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_DVRK); + layer_on(_DVRK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case SDRK: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_SDRK); + layer_on(_SDRK); + } + return false; + break; + case SLWER: + if (record->event.pressed) { + layer_on(_SLWER); + update_tri_layer(_SLWER, _SRAIS, _ADJUST); + } else { + layer_off(_SLWER); + update_tri_layer(_SLWER, _SRAIS, _ADJUST); + } + return false; + break; + case SRAIS: + if (record->event.pressed) { + layer_on(_SRAIS); + update_tri_layer(_SLWER, _SRAIS, _ADJUST); + } else { + layer_off(_SRAIS); + update_tri_layer(_SLWER, _SRAIS, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case BACKTOG: + if (record->event.pressed) { + #ifdef BACKLIGHT_ENABLE + backlight_toggle(); + #endif + } + return false; + break; + case CUT: //cut macro + return MACRODOWN( DOWN(KC_LCTL), TYPE(KC_X), UP(KC_LCTL), END ); + case COPY: // copy macro + return MACRODOWN( DOWN(KC_LCTL), TYPE(KC_C), UP(KC_LCTL), END ); + case PASTE: // paste macro + return MACRODOWN( DOWN(KC_LCTL), TYPE(KC_V), UP(KC_LCTL), END ); + } + return true; +} + +void matrix_init_user(void) { +} diff --git a/keyboards/planck/keymaps/sean/mymappings.h b/keyboards/planck/keymaps/sean/mymappings.h new file mode 100644 index 000000000000..676cf018ebb8 --- /dev/null +++ b/keyboards/planck/keymaps/sean/mymappings.h @@ -0,0 +1,35 @@ +//Defines etc for Sean Hunter's keymap. + +#include "keymap_extras/keymap_dvorak.h" + +#define PERMISSIVE_HOLD + +//Special hammerspoon keys +#define HMENU LCTL(LSFT(KC_BSLS)) +#define HRESET LCTL(LSFT(KC_EQL)) +#define HRVL LCTL(LSFT(KC_SLSH)) + +//Make virtual desktops a little easier on i3 (otherwise on this keyboard they're awkward +#define GUI_1 LGUI(KC_1) +#define GUI_2 LGUI(KC_2) +#define GUI_3 LGUI(KC_3) +#define GUI_4 LGUI(KC_4) +#define GUI_5 LGUI(KC_5) +#define GUI_6 LGUI(KC_6) +#define GUI_7 LGUI(KC_7) +#define GUI_8 LGUI(KC_8) +#define GUI_9 LGUI(KC_9) +#define GUI_10 LGUI(KC_0) + +//Abbreviations for mouse keys +#define KC_MUP KC_MS_UP +#define KC_MDN KC_MS_DOWN +#define KC_MLFT KC_MS_LEFT +#define KC_MRGT KC_MS_RIGHT +#define KC_MB1 KC_MS_BTN1 +#define KC_MB2 KC_MS_BTN2 +#define KC_MB3 KC_MS_BTN3 +#define KC_MB4 KC_MS_BTN4 +#define KC_MB5 KC_MS_BTN5 +#define KC_MWUP KC_MS_WH_UP +#define KC_MWDN KC_MS_WH_DOWN diff --git a/keyboards/planck/keymaps/sean/readme.md b/keyboards/planck/keymaps/sean/readme.md new file mode 100644 index 000000000000..ac39d185ffa8 --- /dev/null +++ b/keyboards/planck/keymaps/sean/readme.md @@ -0,0 +1,130 @@ +# Sean Hunter's Planck Layout + +## Main layout + +Inspired by my old typematrix dvorak keyboard, with escape, tab, enter and +backspace in the middle. + +``` + ,-----------------------------------------------------------------------------------. + | " | , | . | P | Y | / | = | F | G | C | R | L | + |------+------+------+------+------+------+------+------+------+------+------+------| + | A | O | E | U | I | ESC | BSPC | D | H | T | N | S | + |------+------+------+------+------+------+------+------+------+------+------+------| + | ; | Q | J | K | X | TAB | ENT | B | M | W | V | Z | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Sft | Ctl | Alt | Gui |Lower | Space |Raise | < | v | ^ | > | + `-----------------------------------------------------------------------------------' + ``` + +## Lower + +With Lower, the numbers are on the home row. Brackets and braces are down the +centre of the keyboard when holding lower, and most other special characters, +can be found on the row below home. One row up are the main function keys. +The arrow keys become `Home`, `End` and `Page Up` and `Page Down`. + + ``` + ,-----------------------------------------------------------------------------------. + | F1 | F2 | F3 | F4 | F5 | { | } | F6 | F7 | F8 | F9 | F10 | + |------+------+------+------+------+-------------+------+------+------+------+------| + | 1 | 2 | 3 | 4 | 5 | [ | ] | 6 | 7 | 8 | 9 | 0 | + |------+------+------+------+------+------|------+------+------+------+------+------| + | ~ | | | ` | - | _ | INS | DEL | ( | ) | + | = | \ | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Sft | Ctl | Alt | Gui |Lower | |Raise | Home | PgDn | PgUp | End | + `-----------------------------------------------------------------------------------' +``` + +## Raise + +With Raise, the middle row functions as though we are holding shift and typing +numbers. This makes it a little easier than trying to hold lower and shift at +the same time. The row below home is a set of keys mapped from `Gui-1` to +`Gui-0`. I use these to change virtual desktops on [i3](https://i3wm.org/). I +also include 'right' versions of the modifier keys on here. + + + ``` + ,-----------------------------------------------------------------------------------. + | F11 | F12 | F13 | F14 | F15 | | | F16 | F17 | F18 | F19 | F20 | + |------+------+------+------+------+-------------+------+------+------+------+------| + | ! | @ | # | $ | % |Sleep | Wake | ^ | & | * | ( | ) | + |------+------+------+------+------+-------------+------+------+------+------+------| + | GUI1 | GUI2 | GUI3 | GUI4 | GUI5 | | | GUI6 | GUI7 | GUI8 | GUI9 |GUI10 | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Sft | Ctl | Alt | Gui |Lower | |Raise | Gui | Alt | Ctl | Sft | + `-----------------------------------------------------------------------------------' + +``` + +## Adjust + +Raise and lower at the same time give an adjustment layer, which allows +changing to the numpad and movement layer, and adjusting the backlights +(assuming you have them - I don't yet). I have also added various media keys +and the all-important `Reset` key for programming the keyboard. I've got the +ability to swap `Alt` and `Gui` in hardware and three special keys set up for +[hammerspoon]( http://www.hammerspoon.org/) on mac. If I ever start using this +keyboard seriously on mac again (I'm using it mainly on Windows and Linux atm) +I'll write a special Mac mode and redo all my hammerspoon config to be more +like i3 on Linux. + +``` + Adjust (Lower + Raise) + ,-----------------------------------------------------------------------------------. + | | Reset| | | |AGnorm|AGswap| | |HRevl |HReset|HMenu | + |------+------+------+------+------+-------------+------+------+------+------+------| + | PWR | EJCT | CUT | COPY |PASTE |PrScr |SysReq| CAPS | << | >> | Mute | Stop | + |------+------+------+------+------+------|------+------+------+------+------+------| + |DVORAK|NUMPAD| MVMT | SDRK | | | | | Next | Vol- | Vol+ | Play | + |------+------+------+------+------+------+------+------+------+------+------+------| + |Brite |BToggl| | | | | | Gui | Alt | Ctl | Sft | + `-----------------------------------------------------------------------------------' +``` + +## Numpad + +I have added a numpad, although this is a little annoying at the moment as you +have to first press `NumLock` to use. I guess I could make a macro so as soon as +you go into numpad mode it turns `NumLock` on. + +``` + ,-----------------------------------------------------------------------------------. + | | | | | | | |NumLck| 7 | 8 | 9 | / | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | |Enter | 4 | 5 | 6 | * | + |------+------+------+------+------+------+------+------+------+------+------+------| + |DVORAK|NUMPAD| MVMT | SDRK | | | | | 3 | 2 | 1 | - | + |------+------+------+------+------+-------------+------+------+------+------+------| + | | | | | | | | | 0 | . | + | + `-----------------------------------------------------------------------------------' +``` + +## Movement + +I have added a movement layer but at present I seldom use it. + +``` + ,-----------------------------------------------------------------------------------. + |MsBut2|MsWhDn|MsWhUp|MsBut1|MsBut3| | | | Home | PgDn | PgUp | End | + +------+------+------+------+------+------+------+------+------+------+------+------+ + |Ms Lft|Ms Dn |Ms Up |Ms Rht| | | | | Left | Down | Up | Right| + |------+------+------+------+------+------+------+------+------+------+------+------| + |DVORAK|NUMPAD| MVMT | SDRK | | | | | | | | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | Sft | Ctl | Alt | Gui | | | | Gui | Alt | Ctl | Sft | + `-----------------------------------------------------------------------------------' +``` + +## Software Dvorak mode + +I have implemented a version of the main, lower and raise maps that works if +the computer itself is in dvorak mode at the os level. This allows me to work +well on my laptop when I have to take it with me (eg to go to a meeting) and +don't want the keyboard with me. I simply set it in dvorak mode in the os and +then put the keyboard into this mode. + +## TODO + +1. Actually learn to use the media keys diff --git a/keyboards/planck/keymaps/sebas/keymap.c b/keyboards/planck/keymaps/sebas/keymap.c new file mode 100644 index 000000000000..631ad6fc2310 --- /dev/null +++ b/keyboards/planck/keymaps/sebas/keymap.c @@ -0,0 +1,90 @@ +#include QMK_KEYBOARD_H +enum planck_layers { + _DEFAULT, + _LOWER, + _RAISE, + _FN +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define FN MO(_FN) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Default + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | " | ; | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | Up |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | GUI | FN | Lower| Space |Raise | / | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DEFAULT] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_SCLN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT , + KC_LCTL, KC_LALT, KC_LGUI, FN, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT +), + + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | _ | + | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | { | } | Vol+ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | ? | | Vol- | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + _______, _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, _______, KC_PIPE, + _______, _______, _______, _______, _______, _______, _______, _______, KC_LCBR, KC_RCBR, KC_VOLU, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_QUES, _______, KC_VOLD, _______ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | - | = | | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | [ | ] | Vol- | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | Vol+ | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_MINS, KC_EQL, _______, KC_BSLS, + _______, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, KC_VOLU, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, _______ +), + + /* FN + * ,-----------------------------------------------------------------------------------. + * | Reset| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | F11 | F12 | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | TRNS | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_FN] = LAYOUT_planck_grid( + QK_BOOT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F11, KC_F12, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + + +}; + diff --git a/keyboards/planck/keymaps/sebas/readme.md b/keyboards/planck/keymaps/sebas/readme.md new file mode 100644 index 000000000000..4a0ad84fb69e --- /dev/null +++ b/keyboards/planck/keymaps/sebas/readme.md @@ -0,0 +1,3 @@ + +# Sebas Planck layout +My personal layout diff --git a/keyboards/planck/keymaps/sgoodwin/config.h b/keyboards/planck/keymaps/sgoodwin/config.h new file mode 100644 index 000000000000..2bebf48a1ca9 --- /dev/null +++ b/keyboards/planck/keymaps/sgoodwin/config.h @@ -0,0 +1,26 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/sgoodwin/keymap.c b/keyboards/planck/keymaps/sgoodwin/keymap.c new file mode 100644 index 000000000000..e61cd4de6820 --- /dev/null +++ b/keyboards/planck/keymaps/sgoodwin/keymap.c @@ -0,0 +1,224 @@ +// This is sgoodwin's layout file for the Quantum project. +// It doesn't have Plover or Dvorak layers because he doesn't use that. +// It Also doesn't allow for swapping alt with CMD because that only happens in error. + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 1 +#define _COLEMAK 0 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum planck_keycodes { + COLEMAK = SAFE_RANGE, + QWERTY, + LOWER, + RAISE, + BACKLIT, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |SHEnt | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Hyper| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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, MT(MOD_RSFT, KC_ENT) , + ALL_T(KC_NO), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |SHEnt | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Hyper| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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, MT(MOD_RSFT, KC_ENT) , + ALL_T(KC_NO), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, + BACKLIT, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, + BACKLIT, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff| | |Qwerty|Colemk| | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, _______, AU_ON, AU_OFF, _______, _______, QWERTY, COLEMAK, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user(void) +{ + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user(void) +{ + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif diff --git a/keyboards/planck/keymaps/sgoodwin/readme.md b/keyboards/planck/keymaps/sgoodwin/readme.md new file mode 100644 index 000000000000..dfa88f380da1 --- /dev/null +++ b/keyboards/planck/keymaps/sgoodwin/readme.md @@ -0,0 +1,10 @@ +# sgoodwin's Planck Layout + +Includes: + +1. No Dvorak or Plover +2. No alt-swapping +3. Right enter is shift when held down, enter when tapped. +4. Bottom left corner in normal layers is Hyper and not brightness control. +5. Brightness is instead in the bottom corner on raise/lower. + diff --git a/keyboards/planck/keymaps/sgoodwin/rules.mk b/keyboards/planck/keymaps/sgoodwin/rules.mk new file mode 100644 index 000000000000..10de3bfc0359 --- /dev/null +++ b/keyboards/planck/keymaps/sgoodwin/rules.mk @@ -0,0 +1,19 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/planck/keymaps/sigul/config.h b/keyboards/planck/keymaps/sigul/config.h new file mode 100644 index 000000000000..9020d2b9f882 --- /dev/null +++ b/keyboards/planck/keymaps/sigul/config.h @@ -0,0 +1,36 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/sigul/keymap.c b/keyboards/planck/keymaps/sigul/keymap.c new file mode 100644 index 000000000000..2f5044cda093 --- /dev/null +++ b/keyboards/planck/keymaps/sigul/keymap.c @@ -0,0 +1,222 @@ +/* + * + * An Italian ANSI layout + * Version 0.3 + * + * Created by Silvio Gulizia on the basis of the default Planck keymap. + * Thanks to SomeBuddyOnReddit, gepeirl, fauxpark, BXO511, drashna, and ridingqwerty. + * + * The layout is based on the original Planck layout when used with language set to Italian on your Mac. + * Accented vowels have been moverd on RAISE ("�", "�", and "�") and LOWER ("�", "�", and "�") + * + */ + +#include QMK_KEYBOARD_H +#include "muse.h" +#include "keymap_italian_mac_ansi.h" +#include "sigul.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * |Tab/FN| Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |Esc/FN| A | S | D | F | G | H | J | K | L | ;: | '" | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | MS/B | N | M | ,< | .> | /! |S/Ent | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | FN | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( + TABFN, IT_Q, IT_W, IT_E, IT_R, IT_T, IT_Y, IT_U, IT_I, IT_O, IT_P, KC_BSPC, + ESCFN, IT_A, IT_S, IT_D, IT_F, IT_G, IT_H, IT_J, IT_K, IT_L, IT_SCCL, IT_APDQ, + KC_LSFT, IT_Z, IT_X, IT_C, IT_V, MS_B, IT_N, IT_M, IT_CMLS, IT_DTMR, IT_SLQS, MT(MOD_RSFT, KC_ENT), + FN, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |Enter | F1 | F2 | F3 | F4 | F5 | | _ | = | � | � | � | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F6 | F7 | F8 | F9 | |NUMPAD| � | � | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + +[_LOWER] = LAYOUT_ortho_4x12( + IT_TILD, IT_EXLM, IT_AT, IT_HASH, IT_DLR, IT_PERC, IT_CIRC, IT_AMPR, IT_ASTR, IT_LPRN, IT_RPRN, KC_DEL, + KC_ENT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, S(IT_MINS), IT_EQL, S(IT_EGRV), IT_OGRV, IT_AGRV, + _______, KC_F6, KC_F7, KC_F8, KC_F9, _______, NUMPAD, S(IT_UGRV), IT_PLMN, IT_LCBR, IT_RCBR, IT_PIPE, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | SGCOM| DESK | | | | - | + | � | � | � | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Caps | | PHONE| SVIV |VIVERE| |NUMPAD| | | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Home | PgDn | PgUp | End | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( + IT_GRV, IT_1, IT_2, IT_3, IT_4, IT_5, IT_6, IT_7, IT_8, IT_9, IT_0, _______, + _______, _______, SECRET0, SECRET1, _______, _______, _______, IT_MINS, IT_PLUS, IT_EGRV, IT_IGRV, IT_UGRV, + KC_CAPS, _______, SECRET2, SECRET3, SECRET4, _______, NUMPAD, SECRET5, _______, IT_LBRC, IT_RBRC, IT_BSLS, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Numpad + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | 7 | 8 | 9 | - | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | 4 | 5 | 6 | + | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | |NUMPAD| 1 | 2 | 3 | = | Ent | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | 0 | / | * | | + * `-----------------------------------------------------------------------------------' + */ +[_NUMPAD] = LAYOUT_ortho_4x12( + _______, _______, _______, _______, _______, _______, _______, IT_7, IT_8, IT_9, IT_MINS, KC_BSPC, + _______, _______, _______, _______, _______, _______, _______, IT_4, IT_5, IT_6, IT_PLUS, _______, + _______, _______, _______, _______, _______, _______, NUMPAD, IT_1, IT_2, IT_3, IT_EQL, KC_ENT, + _______, _______, _______, _______, _______, _______, _______, _______, IT_0, IT_SLSH, IT_ASTR, _______ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | |Querty| |ResetE|Reset | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Debug | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | |Music |MusON |MusOff| | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | |Voice-|Aud On|Audoff|Voice+| + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( + _______, DF(QWERTY), _______, EE_CLR, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, MU_NEXT, MU_ON, MU_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, AU_PREV, AU_ON, AU_OFF, AU_NEXT +), + + +/* Function + * ,-----------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | Left | Down | Up | Right| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F6 | F7 | F8 | F9 | F10 | F1 | F2 | F3 | F4 | F5 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_FN] = LAYOUT_ortho_4x12( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* MOUSE + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | But1 |Scr Up|Scr Do| But2 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + +[_MOUSE] = LAYOUT_ortho_4x12( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_BTN1, KC_MS_WH_DOWN, KC_MS_WH_UP, KC_MS_BTN2, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_LEFT, KC_MS_DOWN, KC_MS_UP, KC_MS_RIGHT +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/sigul/readme.md b/keyboards/planck/keymaps/sigul/readme.md new file mode 100644 index 000000000000..11000967ed0c --- /dev/null +++ b/keyboards/planck/keymaps/sigul/readme.md @@ -0,0 +1,32 @@ +# An ANSI Italian Planck Layout +by Silvio Gulizia + +The idea behind this layout is to have an American Keyboard with accented vowels (for Italian) to avoid switching language on the Mac every time you switch form English to Italian and being able to get the advantages that comes with the American (ANSI) keyboard when you write in English, code, or just want to use keybaord shorcuts (most of which are based on the American Keybaord). + +Some things I did, useful to you fi you want to have a look to the scheme or even replicate it for your language. + +- [x] add layer _FN with F keys and VI navigation +- [x] add layer _MOUSE with mouse keys +- [x] add "MOUSEKEY_ENABLE = yes" in rules.mk to enable mouse keys (moved to users/sigul/rules.mk) +- [x] add definition to control the mouse movementes in config.h (moved to users/sigul/config.h) +- [x] add layer _NUMPAD to have a numpad +- [x] add keycode NUMPAD to toggle _NUMPAD (moved in users/sigul/sigul.h) +- [x] modify layer ADJUST to simplify remembering commands (Reset on R, Eeprom reset on E and so) +- [x] add custom keycodes ESCFN and TABFN on QUERTYi (default) layer to add the ability to use arrows with hjkl by activating layer FN when held with the definition LT(_FN,KC_ESC) and LT(_FN, KC_TAB) +- [x] added "#define USB_MAX_POWER_CONSUMPTION 100" in config.h to use the keyboard with the iPad (moved to users/sigul/config.h) +- [x] add "#define TAPPING_TOGGLE 3" in config.h to enable tapping toggle with 3 taps on LOWER and RAISE (moved to users/sigul/config.h) +- [x] add tapping toggle to LOWER, RAISE and MOUSE keys +- [x] add caps lock (KC_CAPS) to RAISE layer on the shift key +- [x] Add del to a thumb layer +- [x] Add MT(MOD_LSFT, KC_ENT) shift when pressed, enter when tapped +- [x] add home, end, pgup and pgwon on _RAISE instead of arrows +- [x] change LSFT to S for more legibility +- [x] add secrets on RAISE to be able to output personal data such as email, phone number, credit cards number... +- [x] remap F keys upon numbers on _FN + +To DO +- [ ] Add Hyper on ESC or TAB to be able to use it for custom keyboard shortcuts +- [ ] consider using layer configuration to have just one keymap (see as a reference qmk_firmware/layouts/community/ortho_4x12/bredfield/) +- [ ] add brightness up (KC_BRMU or KC_BRIU) and down (KC_BRMD or KC_BRID) +- [ ] consider adding AUTO_SHIFT_ENABLE = yes in rules.mk to be able to send shifted key depressing a key for twice the time +- [ ] revert IT_ to KC_ where not required diff --git a/keyboards/planck/keymaps/sigul/rules.mk b/keyboards/planck/keymaps/sigul/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/sigul/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/skank/keymap.c b/keyboards/planck/keymaps/skank/keymap.c new file mode 100644 index 000000000000..fa933dca27fd --- /dev/null +++ b/keyboards/planck/keymaps/skank/keymap.c @@ -0,0 +1,162 @@ +/* Copyright 2019 Khader Syed + * + * 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 QMK_KEYBOARD_H + +enum skank_layers { + _QWERTY, + _COLEMAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum skank_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + LOWER, + RAISE, + ADJUST +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | Up |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | GUI | / |Lower | Space|Space |Raise | / | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + QK_GESC, 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_UP, KC_ENT, + KC_LCTL, KC_LALT, KC_LGUI, KC_BSLS, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | Up |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | / |Lower | Space|Space |Raise | / | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + QK_GESC, 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_UP, KC_ENT, + KC_LCTL, KC_LALT, KC_LGUI, KC_BSLS, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | _ | + |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_UNDS, KC_PLUS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | _ | + | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_UNDS, KC_PLUS, KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|Qwerty|Colemk| | | | | Reset| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, AU_ON, AU_OFF, QWERTY, COLEMAK, _______, _______, _______, _______, QK_BOOT, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + } + return true; +} \ No newline at end of file diff --git a/keyboards/planck/keymaps/skank/readme.md b/keyboards/planck/keymaps/skank/readme.md new file mode 100644 index 000000000000..673956aca19b --- /dev/null +++ b/keyboards/planck/keymaps/skank/readme.md @@ -0,0 +1,8 @@ +# My planck layout + +These are my changes: + +- add a colemak layout +- keep it clean +- add option to enable mouse keys +- and just enable some sound diff --git a/keyboards/planck/keymaps/skank/rules.mk b/keyboards/planck/keymaps/skank/rules.mk new file mode 100644 index 000000000000..4c65d4af1e32 --- /dev/null +++ b/keyboards/planck/keymaps/skank/rules.mk @@ -0,0 +1,2 @@ +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) + diff --git a/keyboards/planck/keymaps/skug/config.h b/keyboards/planck/keymaps/skug/config.h new file mode 100644 index 000000000000..b82385f26858 --- /dev/null +++ b/keyboards/planck/keymaps/skug/config.h @@ -0,0 +1,41 @@ +#pragma once + +// Override SpaceCadet Settings +#undef LSPO_KEY +#undef RSPC_KEY +#define LSPO_KEY KC_8 // Nordic Left SpaceCadet +#define RSPC_KEY KC_9 // Nordic Right SpaceCadet + +// Audio +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(COIN_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/skug/keymap.c b/keyboards/planck/keymaps/skug/keymap.c new file mode 100644 index 000000000000..05fcf93e7504 --- /dev/null +++ b/keyboards/planck/keymaps/skug/keymap.c @@ -0,0 +1,346 @@ +/* Copyright 2015-2017 Jack Humbert, Christoffer Holmberg + * + * 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 QMK_KEYBOARD_H +#include "keymap_swedish.h" +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _DEFAULT, + _LOWER, + _RAISE, + _UTILITY, + _ADJUST +}; + +enum planck_keycodes { + DEFAULT = SAFE_RANGE, + RAISE, + LOWER, + UTILITY, + BACKLIT, + S1, S2, S3, S4, S5, S6, S7, S8, S9 +}; + +#define ESC_LOW LT(_LOWER, KC_ESC) +#define BSP_RAI LT(_RAISE, KC_BSPC) +#define LFT_CTR CTL_T(SE_QUOT) +#define RGT_CTR CTL_T(KC_TILD) +#define UTILITY MO(_UTILITY) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Å | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Fn | A | S | D | F | G | H | J | K | L | Ö | Ä | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | - |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Super| Alt | |L/Esc | Ret | Space|R/Bspc| |AltGr | * | ¨ | + * `-----------------------------------------------------------------------------------' + */ +[_DEFAULT] = LAYOUT_planck_grid( + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , SE_ARNG, + UTILITY, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , SE_ODIA, SE_ADIA, + SC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , SE_MINS, SC_RSPC, + LFT_CTR, KC_LALT, KC_LGUI, SE_AT , ESC_LOW, KC_ENT , KC_SPC , BSP_RAI, _______, KC_ALGR, SE_ASTR, RGT_CTR +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PLUS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, SE_RABK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + SE_HALF, LSFT(KC_1), SE_DQUO, LSFT(KC_3), SE_CURR, LSFT(KC_5), SE_AMPR, SE_SLSH, SE_LPRN, SE_RPRN, SE_EQL , SE_QUES, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, SE_LABK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Utility layer + * ,-----------------------------------------------------------------------------------. + * | | | up | | | | | | S1 | S2 | S3 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | left | down | right| | | | | S4 | S5 | S6 | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | S7 | S8 | S9 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Del | | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_UTILITY] = LAYOUT_planck_grid( + _______, _______, KC_UP , _______, _______, _______, _______, _______, S1 , S2 , S3 , _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, S4 , S5 , S6 , _______, + _______, _______, _______, _______, _______, _______, _______, _______, S7 , S8 , S9 , _______, + _______, _______, _______, _______, _______, _______, _______, KC_DEL , _______, _______, _______, _______ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | |Reset | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | |Utilit| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , + _______, QK_BOOT, MU_NEXT, AU_ON , AU_OFF , AG_NORM, AG_SWAP, DEFAULT, XXXXXXX, XXXXXXX, UTILITY, _______, + _______, SE_PIPE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); + float s1[][2] = SONG(NUMBER_ONE); + float s2[][2] = SONG(ZELDA_PUZZLE); + float s3[][2] = SONG(ZELDA_TREASURE); + float s4[][2] = SONG(OVERWATCH_THEME); + float s5[][2] = SONG(IMPERIAL_MARCH); + float s6[][2] = SONG(E1M1_DOOM); + float s7[][2] = SONG(COIN_SOUND); + float s8[][2] = SONG(ONE_UP_SOUND); + float s9[][2] = SONG(SONIC_RING); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case DEFAULT: + if (record->event.pressed) { + set_single_persistent_default_layer(_DEFAULT); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + case S1: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(s1); + #endif //AUDIO_ENABLE + } + return false; + break; + case S2: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(s2); + #endif //AUDIO_ENABLE + } + return false; + break; + case S3: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(s3); + #endif //AUDIO_ENABLE + } + return false; + break; + case S4: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(s4); + #endif //AUDIO_ENABLE + } + return false; + break; + case S5: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(s5); + #endif //AUDIO_ENABLE + } + return false; + break; + case S6: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(s6); + #endif //AUDIO_ENABLE + } + return false; + break; + case S7: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(s7); + #endif //AUDIO_ENABLE + } + return false; + break; + case S8: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(s8); + #endif //AUDIO_ENABLE + } + return false; + break; + case S9: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(s9); + #endif //AUDIO_ENABLE + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } + return true; +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/skug/readme.md b/keyboards/planck/keymaps/skug/readme.md new file mode 100644 index 000000000000..aa3e6cda0063 --- /dev/null +++ b/keyboards/planck/keymaps/skug/readme.md @@ -0,0 +1,8 @@ +![Nordic Planck](https://i.imgur.com/0ZOLnx2.png) + +# Nordic Planck + +This is my attempt at making a Nordic layout for the planck with all nordic +characters available in the default layer, things to note are the bottom row +with Esc, Enter, Space and Backspace in the middle for easy thumb access and +an arrow cluster on the left. diff --git a/keyboards/planck/keymaps/skug/rules.mk b/keyboards/planck/keymaps/skug/rules.mk new file mode 100644 index 000000000000..9721fcd747e2 --- /dev/null +++ b/keyboards/planck/keymaps/skug/rules.mk @@ -0,0 +1,3 @@ +SRC += muse.c +EXTRAKEY_ENABLE = no +CONSOLE_ENABLE = no diff --git a/keyboards/planck/keymaps/smittey/config.h b/keyboards/planck/keymaps/smittey/config.h new file mode 100644 index 000000000000..17ffcca383d0 --- /dev/null +++ b/keyboards/planck/keymaps/smittey/config.h @@ -0,0 +1,16 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MIDI_BASIC + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/smittey/keymap.c b/keyboards/planck/keymaps/smittey/keymap.c new file mode 100644 index 000000000000..d65f0ffd3ee3 --- /dev/null +++ b/keyboards/planck/keymaps/smittey/keymap.c @@ -0,0 +1,377 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST, + _FN, + _SPACE_FN +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +// Fillers to make layering more clear +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define FN MO(_FN) +#define SPACE_FN LT(_SPACE_FN, KC_SPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | FN | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT_planck_grid( + 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, MT(MOD_LSFT, KC_ENT), + KC_LCTL, FN, KC_LALT, KC_LGUI, LOWER, SPACE_FN, SPACE_FN, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | * | 4 | 5 | 6 | - | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | / | 1 | 2 | 3 | + |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | Space | | 0 | . | = | | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_planck_grid( + XXXXXXX, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_ASTR, KC_4, KC_5, KC_6, KC_MINS, XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLSH, KC_1, KC_2, KC_3, KC_PLUS, MT(MOD_LSFT, KC_ENT), + _______, XXXXXXX, _______, _______, _______, KC_SPC, KC_SPC, _______, KC_0, KC_DOT, KC_EQL, XXXXXXX + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | ! | " | £ | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | ~ | # | / | { | [ | ] | } | \ | - | = | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | _ | + |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | Space | | Home | PgDn | PgUp | End | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_EXLM, KC_DQUO, LALT(KC_4), KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + XXXXXXX, KC_TILD, KC_NUHS, KC_SLSH, KC_LCBR, KC_LBRC, KC_RBRC, KC_RCBR, KC_BSLS, KC_MINS, KC_EQL, KC_PIPE, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UNDS, KC_PLUS, MT(MOD_LSFT, KC_ENT), + _______, XXXXXXX, _______, _______, _______, KC_SPC, KC_SPC, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END + ), + + + /* fn + * ,-----------------------------------------------------------------------------------. + * |DelWrd| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F11 | F12 | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | Enter| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | Space | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_FN] = LAYOUT_planck_grid( + LALT(KC_BSPC), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, + XXXXXXX, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), + + + /* Space fn + * ,-----------------------------------------------------------------------------------. + * |PRNT SC| | UP | | | | | | | | |SLEEP | + * |-------+------+------+------+------+-------------+------+------+------+------+------| + * | | LEFT | DOWN | RIGHT| | | | LEFT | DOWN | UP | RIGHT| | + * |-------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |-------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | MUTE |VOLDWN|VOL UP| | + * `-----------------------------------------------------------------------------------' + */ + [_SPACE_FN] = LAYOUT_planck_grid( + KC_PSCR, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLEP, + XXXXXXX, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX + ), + + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | Reset|Qwerty| | | | | | | |MIDIof|MIDIon| Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Dvorak| |AGnorm|AGswap| | |Audoff|Aud on| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | |Colemk| | | | | |Musoff|Mus on| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Plover| | | | | | | |Voice-|Voice+| | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT_planck_grid( + QK_BOOT, QWERTY, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MI_OFF, MI_ON, KC_DEL, + XXXXXXX, XXXXXXX, XXXXXXX, DVORAK, XXXXXXX, AG_NORM, AG_SWAP, XXXXXXX, XXXXXXX, AU_OFF, AU_ON, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_OFF, MU_ON, XXXXXXX, + PLOVER, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, AU_PREV, AU_NEXT, XXXXXXX + ), + + + /* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_COLEMAK] = LAYOUT_planck_grid( + 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, MT(MOD_LSFT, KC_ENT), + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + + /* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, MT(MOD_LSFT, KC_ENT), + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + + /* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + + [_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX + ), +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return true; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return true; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return true; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + writePinLow(E6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + writePinHigh(E6); + #endif + } + return true; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return true; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return true; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } + return true; +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/smittey/readme.md b/keyboards/planck/keymaps/smittey/readme.md new file mode 100644 index 000000000000..280847655097 --- /dev/null +++ b/keyboards/planck/keymaps/smittey/readme.md @@ -0,0 +1,28 @@ +# Planck Layout created by [Smittey](https://github.com/smittey) + +A layout with a focus around coding, utilising the home row for symbols. There is an additional FN layer and Space function layer + +Main - Qwerty with ctrl swapped around and enter changed to be shift on hold +Lower - Numbers and calculations +Raise - Symbols +Adjust - Keyboard settings and layout changers +FN - Function keys +Space FN - Navigation and media + +## Main +![Main layer layout](https://i.imgur.com/jRbqGUN.png) + +## Lower +![Lower layer layout](https://i.imgur.com/YmdM1q5.png) + +## Raise +![Raise layer layout](https://i.imgur.com/BXxOK1S.png) + +## Adjust +![Adjust layer layout](https://i.imgur.com/M6qBaXO.png) + +## FN +![FN layer layout](https://i.imgur.com/1eiUOH1.png) + +## Space Function +![Space function layer layout](https://i.imgur.com/RJMFEdy.png) \ No newline at end of file diff --git a/keyboards/planck/keymaps/smittey/rules.mk b/keyboards/planck/keymaps/smittey/rules.mk new file mode 100644 index 000000000000..acf0896a321b --- /dev/null +++ b/keyboards/planck/keymaps/smittey/rules.mk @@ -0,0 +1 @@ +SRC += muse.c \ No newline at end of file diff --git a/keyboards/planck/keymaps/smt/config.h b/keyboards/planck/keymaps/smt/config.h new file mode 100644 index 000000000000..2bebf48a1ca9 --- /dev/null +++ b/keyboards/planck/keymaps/smt/config.h @@ -0,0 +1,26 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/smt/keymap.c b/keyboards/planck/keymaps/smt/keymap.c new file mode 100644 index 000000000000..6320e11fcf76 --- /dev/null +++ b/keyboards/planck/keymaps/smt/keymap.c @@ -0,0 +1,256 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + BACKLIT +}; + +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift) +#define MEH_GRV MEH_T(KC_GRV) // Tap for Backtick, hold for Meh (Ctrl+Alt+Shift) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + CTL_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, SFT_ENT, + MEH_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + CTL_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, SFT_ENT, + MEH_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | - | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, + MEH_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | $ | F1 | F2 | F3 | F4 | F5 | F6 | 4 | 5 | 6 | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | 1 | 2 | 3 | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + ALL_T(KC_0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + CTL_T(KC_DLR), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_4, KC_5, KC_6, _______, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_1, KC_2, KC_3, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | _ | ? | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | - | / | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Home |PageDn|PageUp| End | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + ALL_T(KC_TILD), KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + _______, _______, _______, _______, _______, _______, KC_UNDS, KC_QUES, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, _______, _______, _______, _______, _______, KC_MINS, KC_SLSH, KC_EQL, KC_LBRC, KC_RBRC, SFT_T(KC_BSLS), + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Reset| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT, + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user(void) +{ + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user(void) +{ + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif diff --git a/keyboards/planck/keymaps/smt/readme.md b/keyboards/planck/keymaps/smt/readme.md new file mode 100644 index 000000000000..dc7c9cf9f147 --- /dev/null +++ b/keyboards/planck/keymaps/smt/readme.md @@ -0,0 +1,124 @@ +# smt's Planck keymap + +This keymap is primarily based on the default Planck keymap. + +Notable differences from the default are: + +- **[Mod-Tap](https://github.com/jackhumbert/qmk_firmware/wiki#fun-with-modifier-keys) keys** + + - `Esc/Ctrl` + + I am experimenting with using Left Shift as a mod-tap key for Escape, similar to how I use the Enter key. It's set up like this on my Minivan, so in the interest of consistency... + + - `Enter/Shift` + + I use both the left and right shift keys when I type. When I want to modify a key with shift, I hold shift with the hand opposite the one typing the key. In the default keymap, Enter is where shift would be on a standard keyboard layout. Oh, muscle memory. + + - `Tab/Hyper` (Super+Ctrl+Shift+Alt) + + It's great to be able to use Tab as a custom modifier key. I tend to use [Hyper](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/) commands for various OS-specific operations depending on what machine I'm working on. + + - `Backtick/Meh` (Ctrl+Shift+Alt) + + Why use backtick in the lower left corner? I use it as my tmux prefix key, so I need to type it more frequently than most people. Putting it on the base layer works well for me. The "Meh" mapping is just a less-cool "Hyper"; the same, just without Super. + +- **Swapped responsibilities of "lower" and "raise" layers** + + I prefer to use symbols via the "raise" layer, and numbers via the "lower" layer. + +- **Removed Plover layer** + + I don't intend to use stenography anytime soon, so Plover just didn't have a place in my keymap. + + +## Qwerty + +``` +,-----------------------------------------------------------------------------------. +| Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Esc | A | S | D | F | G | H | J | K | L | ; | " | +|------+------+------+------+------+------|------+------+------+------+------+------| +| Shift| Z | X | C | V | B | N | M | , | . | / |Enter | +|------+------+------+------+------+------+------+------+------+------+------+------| +| ` | Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | +`-----------------------------------------------------------------------------------' +``` + +## Colemak + +``` +,-----------------------------------------------------------------------------------. +| Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Esc | A | R | S | T | D | H | N | E | I | O | " | +|------+------+------+------+------+------|------+------+------+------+------+------| +| Shift| Z | X | C | V | B | K | M | , | . | / |Enter | +|------+------+------+------+------+------+------+------+------+------+------+------| +| ` | Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | +`-----------------------------------------------------------------------------------' +``` + +## Dvorak + +``` +,-----------------------------------------------------------------------------------. +| Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Esc | A | O | E | U | I | D | H | T | N | S | - | +|------+------+------+------+------+------|------+------+------+------+------+------| +| Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | +|------+------+------+------+------+------+------+------+------+------+------+------| +| ` | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | +`-----------------------------------------------------------------------------------' +``` + +## Lower + +This is where I put the number row, a numpad cluster, function keys, and media controls. + +``` +,-----------------------------------------------------------------------------------. +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | +|------+------+------+------+------+-------------+------+------+------+------+------| +| $ | F1 | F2 | F3 | F4 | F5 | F6 | 4 | 5 | 6 | | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | F7 | F8 | F9 | F10 | F11 | F12 | 1 | 2 | 3 | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | Next | Vol- | Vol+ | Play | +`-----------------------------------------------------------------------------------' +``` + +## Raise + +As a developer, it makes the most sense for me to group all the commonly-used symbols that don't fit on the main layer. In particular, having the dual-column of parens-braces-brackets really helps a lot. I've also added cursorkeys to correspond to the arrows. + +I haven't completely filled this layer, which leaves room for future mappings and macros. + +``` +,-----------------------------------------------------------------------------------. +| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | | | | | | _ | ? | + | { | } | | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | | | | | | - | / | = | [ | ] | \ | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | Home |PageDn|PageUp| End | +`-----------------------------------------------------------------------------------' +``` + +## Adjust (Lower + Raise) + +Utility layer. This is where I'd switch between Qwerty and Dvorak, ~~fool around with~~ adjust the audio/music settings, or put the Planck into bootloader mode. + +``` +,-----------------------------------------------------------------------------------. +| | Reset| | | | | | | | | | Reset| +|------+------+------+------+------+-------------+------+------+------+------+------| +| | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | +`-----------------------------------------------------------------------------------' +``` diff --git a/keyboards/planck/keymaps/snowkuma/config.h b/keyboards/planck/keymaps/snowkuma/config.h new file mode 100644 index 000000000000..c61d25280451 --- /dev/null +++ b/keyboards/planck/keymaps/snowkuma/config.h @@ -0,0 +1,42 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +// Settings for homerow mods +#define TAPPING_TERM 250 + + +// Add the leader key feature +#define LEADER_TIMEOUT 300 diff --git a/keyboards/planck/keymaps/snowkuma/custom_keycodes.h b/keyboards/planck/keymaps/snowkuma/custom_keycodes.h new file mode 100644 index 000000000000..5e4353c049a1 --- /dev/null +++ b/keyboards/planck/keymaps/snowkuma/custom_keycodes.h @@ -0,0 +1,60 @@ +// These definitions are for convenience. +// It is not wise to put sensitive information here such as passwords +// as anyone with access to your keyboard will be able to use them! + +// magnet keycodes +#define M_LEFT LCA(KC_LEFT) +#define M_TOP LCA(KC_UP) +#define M_BOTT LCA(KC_DOWN) +#define M_RGHT LCA(KC_RGHT) + +#define M_TOPL LCA(KC_U) +#define M_TOPR LCA(KC_I) +#define M_BOTL LCA(KC_J) +#define M_BOTR LCA(KC_K) + +#define M_L13 LCA(KC_D) +#define M_L23 LCA(KC_E) +#define M_C13 LCA(KC_F) +#define M_R23 LCA(KC_T) +#define M_R13 LCA(KC_G) + +#define M_NEXT LCAG(KC_RGHT) +#define M_PREV LCAG(KC_LEFT) + +#define M_MAX LCA(KC_ENT) +#define M_CEN LCA(KC_C) +#define M_REST LCA(KC_BSPC) + +// Shortcuts +#define INPUT_L LCAG(KC_SPC) +#define TXT_PLS LGUI(KC_PLUS) +#define TXT_MIN LGUI(KC_MINS) +#define SC_CAPF LGUI(LSFT(KC_3)) // Capture the full screen to file +#define SC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen to file + +// Special Layer keycodes +#define ESC_NUM LT(_NUMBER, KC_ESC) +#define BSP_REG LT(_REGEX, KC_BSPC) +#define DEL_REG LT(_REGEX, KC_DEL) +#define MIN_ARR LT(_ARRANGE, KC_MINS) +#define TAB_SFT LSFT_T(KC_TAB) +#define SPC_SYM LT(_SYMBOL, KC_SPC) +#define ENT_THU LT(_THUMB, KC_ENT) +#define FUN_L MO(_FUNCTION) + +// HOMEROW SHIFT +#define T_SFT LSFT_T(KC_T) +#define N_SFT RSFT_T(KC_N) + +// Special Characters +#define GBP LALT(KC_3) +#define EURO LALT(S(KC_2)) + +// Modifier tap holds +#define Q_CTL LCTL_T(KC_Q) +#define W_ALT LALT_T(KC_W) +#define F_GUI LGUI_T(KC_F) +#define U_GUI LGUI_T(KC_U) +#define Y_ALT LALT_T(KC_Y) +#define SCL_CTL LCTL_T(KC_SCLN) diff --git a/keyboards/planck/keymaps/snowkuma/keymap.c b/keyboards/planck/keymaps/snowkuma/keymap.c new file mode 100644 index 000000000000..0df04d87fc73 --- /dev/null +++ b/keyboards/planck/keymaps/snowkuma/keymap.c @@ -0,0 +1,373 @@ +/* Copyright 2015-2017 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 . + */ + +/* _ + * ___ _ __ ___ __ __ | | __ _ _ _ __ ___ __ _ + * / __| | '_ \ / _ \ \ \ /\ / / | |/ / | | | | | '_ ` _ \ / _` | + * \__ \ | | | | | (_) | \ V V / | < | |_| | | | | | | | | (_| | + * |___/ |_| |_| \___/ \_/\_/ |_|\_\ \__,_| |_| |_| |_| \__,_| + * + * https://github.com/snowkuma + * + * version 0.1 +*/ + +#include QMK_KEYBOARD_H +#include "muse.h" +#include "custom_keycodes.h" +#include "my_strings.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _COLEMAK = 0, + _SYMBOL, + _SFT_NAV, + _REGEX, + _NUMBER, + _ARRANGE, + _FUNCTION, + _MOUSE, + _THUMB +}; + +enum planck_keycodes { + EMAIL = SAFE_RANGE, + EMOJI, + EXT_PLV, + ITERM, + LESSON, + TYPE_FU, + VS_CODE, + VIM +}; + + +// Tap Dance Declarations +enum { + TD_RESET = 0, + TD_TILD +}; + +// Tap Dance Definitions +void safe_reset(tap_dance_state_t *state, void *user_data) { + if (state->count >=3) { + // Reset the keyboard if you tap the key more than three times + reset_keyboard(); + reset_tap_dance(state); + } +}; void tilde_home(tap_dance_state_t *state, void *user_data) { + if (state->count > 2) { + register_code(KC_LSFT); + register_code(KC_GRV); + } + else { + register_code(KC_LSFT); + register_code(KC_GRV); + if (state->count > 1) { + // Outputs ~/ if tilde tapped twice + unregister_code(KC_GRV); + unregister_code(KC_LSFT); + register_code(KC_SLSH); + } + } +} + +void tilde_reset(tap_dance_state_t *state, void *user_data) +{ + if (state->count == 2) { + unregister_code(KC_SLSH); + } else { + unregister_code(KC_GRV); + unregister_code(KC_LSFT); + } +} + + +tap_dance_action_t tap_dance_actions[] = { + [TD_RESET] = ACTION_TAP_DANCE_FN (safe_reset), + [TD_TILD] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, tilde_home, tilde_reset) +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* COLEMAK + * + * Base layer + * ,-----------------------------------------------------------------------------------------------------------. + * | q | w | f | p | g | | | j | l | u | y | ; | + * | CTRL | ALT | GUI | | | | | | | GUI | ALT | CTRL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | a | r | s | t | d | | | h | n | e | i | o | + * | | | | Shift | | | | | Shift | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | z | x | c | v | b | | | k | m | , | . | ' | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | Esc | BkSp | - | Tab | Space | Enter | | | + * | | | | Num | Regex | Arrange| Shift | Sym | Thumb | | | | + * `--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + Q_CTL, W_ALT, F_GUI, KC_P, KC_G, _______, _______, KC_J, KC_L, U_GUI, Y_ALT, SCL_CTL, + KC_A, KC_R, KC_S, T_SFT, KC_D, _______, _______, KC_H, N_SFT, KC_E, KC_I, KC_O, + KC_Z, KC_X, KC_C, KC_V, KC_B, _______, _______, KC_K, KC_M, KC_COMM, KC_DOT, KC_QUOT, + _______, _______, _______, ESC_NUM, BSP_REG, MIN_ARR, TAB_SFT, SPC_SYM, ENT_THU, _______, _______, _______ +), + +/* Symbol & Cursor Nav layer + * ,-----------------------------------------------------------------------------------------------------------. + * | ! | @ | € | & | | | | | | Home | Up | End | PgUp | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ~ | < | % | > | + | | | | Left | Down | Right | PgDn | + * | 2x ~/ | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ` | | £ | = | - | | | | | | | | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | _ | Del | - | | f() | | | | | + * | | | | | Mouse | | | Sym |Function| | | | + * `--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' + */ +[_SYMBOL] = LAYOUT_planck_grid( + KC_EXLM, KC_AT, EURO, KC_AMPR, KC_PIPE, _______, _______, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, + TD(TD_TILD), KC_LT, KC_PERC, KC_GT, KC_PLUS, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, + KC_GRV, _______, GBP, KC_EQL, KC_MINS, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, KC_UNDS, DEL_REG, KC_MINS, _______, _______, _______, _______, _______, _______ +), + +/* Regex layer + * ,-----------------------------------------------------------------------------------------------------------. + * | | | | | | | | * | [ | ^ | ] | : | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | ? | ( | $ | ) | / | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | { | # | } | \ | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | f() | | | Space | | | | + * | | | | | Regex | | | Mouse | Enter | | | | + * `--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' + */ +[_REGEX] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, KC_ASTR, KC_LBRC, KC_CIRC, KC_RBRC, KC_COLN, + _______, _______, _______, _______, _______, _______, _______, KC_QUES, KC_LPRN, KC_DLR, KC_RPRN, KC_SLSH, + _______, _______, _______, _______, _______, _______, _______, KC_PIPE, KC_LCBR, KC_HASH, KC_RCBR, KC_BSLS, + _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT, _______, _______, _______ +), + +/* Number Layer + * ,-----------------------------------------------------------------------------------------------------------. + * | : | F | E | D | G | | | * | 7 | 8 | 9 | 0 | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | # | C | B | A | + | | | . | 4 | 5 | 6 | / | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | € | x | £ | = | - | | | , | 1 | 2 | 3 | \ | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | f() | | | | | | | | | + * | | | | Number | | | | Space | Enter | | | | + * `--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' +* +*/ +[_NUMBER] = LAYOUT_planck_grid( + KC_COLN, S(KC_F), S(KC_E), S(KC_D), S(KC_G), _______, _______, KC_ASTR, KC_7, KC_8, KC_9, KC_0, + KC_HASH, S(KC_C), S(KC_B), S(KC_A), KC_PLUS, _______, _______, KC_DOT, KC_4, KC_5, KC_6, KC_SLSH, + EURO, KC_X, GBP, KC_EQL, KC_MINS, _______, _______, KC_COMM, KC_1, KC_2, KC_3, KC_BSLS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Mouse Layer + * ,-----------------------------------------------------------------------------------------------------------. + * | Ctrl | Alt | GUI | | | | | | | Up | | wUp | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Btn3 | Btn2 | Btn1 | Shift | | | | | Left | Down | Right | wDn | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | f() | | | f() | | | | + * | | | | | Mouse | | | Mouse | | | | | + * `--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' +*/ +[_MOUSE] = LAYOUT_planck_grid( + KC_LCTL, KC_LALT, KC_LGUI, _______, _______, _______, _______, _______, _______, KC_MS_U, _______, KC_WH_U, + KC_BTN3, KC_BTN2, KC_BTN1, KC_LSFT, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Thumb Layer + * ,-----------------------------------------------------------------------------------------------------------. + * | Reset | | SC_CAPF| SC_CAPP| | | | |Input L | | | | + * | (3x) | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | TypeFu | CMD + | | | | Caps | emoji | iterm | | + * | | | | | | | | | Lock | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | VS_Code| Vim | CMD - | | | | | | | | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | f() | | | | + * | | | | | | | | | Thumb | | | | + * `--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' + */ +[_THUMB] = LAYOUT_planck_grid( + TD(TD_RESET), _______, SC_CAPF, SC_CAPP, _______, _______, _______, _______, INPUT_L, _______, _______, _______, + _______, _______, _______, TYPE_FU, TXT_PLS, _______, _______, _______, KC_CAPS, EMOJI, ITERM, _______, + _______, _______, VS_CODE, VIM, TXT_MIN, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Arrange Layer + * ,-----------------------------------------------------------------------------------------------------------. + * | | | Full | | | | | | Top L | Top | Top R | | + * | | | Screen | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | L 1/3 | L 2/3 | C 1/3 | R 2/3 | R 1/3 | | | Prev | Left | Bottom | Right | Next | + * | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Restore| | Center | | | | | | Bottom | | Bottom | | + * | | | | | | | | | Left | | Right | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | f() | | | | | | + * | | | | | | Arrange| | | | | | | + * `--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' +*/ +[_ARRANGE] = LAYOUT_planck_grid( + _______, _______, M_MAX, _______, _______, _______, _______, _______, M_TOPL, M_TOP, M_TOPR, _______, + M_L13, M_L23, M_C13, M_R23, M_R13, _______, _______, M_PREV, M_LEFT, M_BOTT, M_RGHT, M_NEXT, + M_REST, _______, M_CEN, _______, _______, _______, _______, _______, M_BOTL, _______, M_BOTR, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Function Layer + * ,-----------------------------------------------------------------------------------------------------------. + * | Ctrl | Alt | GUI | | | | | | F7 | F8 | F9 | F10 | + * | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | Shift | | | | | F4 | F5 | F6 | F11 | + * | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | F1 | F2 | F3 | F12 | + * | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | f() | f() | | | | + * | | | | | | | |Function|Function| | | | + * `--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' +*/ +[_FUNCTION] = LAYOUT_planck_grid( + KC_LCTL, KC_LALT, KC_LGUI, _______, _______, _______, _______, KC_F13, KC_F7, KC_F8, KC_F9, KC_F10, + _______, _______, _______, KC_LSFT, _______, _______, _______, KC_F14, KC_F4, KC_F5, KC_F6, KC_F11, + _______, _______, _______, _______, _______, _______, _______, KC_F15, KC_F1, KC_F2, KC_F3, KC_F12, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + state = update_tri_layer_state(state, _SYMBOL, _THUMB, _FUNCTION); + state = update_tri_layer_state(state, _SYMBOL, _REGEX, _MOUSE); + return state; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case EMAIL: + if (record->event.pressed) { + SEND_STRING(MY_EMAIL); + } + return false; + break; + case ITERM: + if (record->event.pressed) { + SEND_STRING(SS_LGUI(" ")); + SEND_STRING("iterm" SS_TAP(X_ENTER)); + } + return false; + break; + case TYPE_FU: + if (record->event.pressed) { + SEND_STRING(SS_LGUI(" ")); + SEND_STRING("type fu" SS_TAP(X_ENTER)); + } + return false; + break; + case VIM: + if (record->event.pressed) { + SEND_STRING(SS_LGUI(" ")); + SEND_STRING("macvim.app" SS_TAP(X_ENTER)); + } + return false; + break; + case VS_CODE: + if (record->event.pressed) { + SEND_STRING(SS_LGUI(" ")); + SEND_STRING("visual studio code" SS_TAP(X_ENTER)); + } + return false; + break; + case EMOJI: + if (record->event.pressed) { + register_code(KC_LGUI); + register_code(KC_LCTL); + register_code(KC_SPC); + unregister_code(KC_LGUI); + unregister_code(KC_LCTL); + unregister_code(KC_SPC); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +void matrix_init_user(void) { + set_unicode_input_mode(UNICODE_MODE_MACOS); +} diff --git a/keyboards/planck/keymaps/snowkuma/my_strings.h b/keyboards/planck/keymaps/snowkuma/my_strings.h new file mode 100644 index 000000000000..4e2ee6f770fd --- /dev/null +++ b/keyboards/planck/keymaps/snowkuma/my_strings.h @@ -0,0 +1,4 @@ +// Email address +#define MY_EMAIL "myname@email.com" +// Canned responses +#define CANNED_1 "A canned response / template for emails." diff --git a/keyboards/planck/keymaps/snowkuma/readme.md b/keyboards/planck/keymaps/snowkuma/readme.md new file mode 100644 index 000000000000..b1d5ff9c9254 --- /dev/null +++ b/keyboards/planck/keymaps/snowkuma/readme.md @@ -0,0 +1,14 @@ +# Snowkuma's Planck Layout v.0.1 + +Wide colemak planck layout. Heavily influenced by the ideas of sdothum and his blog. + +Aims to minimize key usage to minimal set and have hands in a comfortable position. + +![Colemak](https://i.imgur.com/4B3HdCE.png) +![Symbol](https://i.imgur.com/WYxIJqv.png) +![Regex](https://i.imgur.com/PxTCT6P.png) +![Number](https://i.imgur.com/NzhW26R.png) +![Arrange](https://i.imgur.com/BlTJjyW.png) +![Shortcuts](https://i.imgur.com/p2ooSrC.png) +![Function](https://i.imgur.com/U1F5J3R.png) +![Mouse](https://i.imgur.com/nCHabXV.png) diff --git a/keyboards/planck/keymaps/snowkuma/rules.mk b/keyboards/planck/keymaps/snowkuma/rules.mk new file mode 100644 index 000000000000..e7706a252dab --- /dev/null +++ b/keyboards/planck/keymaps/snowkuma/rules.mk @@ -0,0 +1,19 @@ +SRC += muse.c + +AUDIO_ENABLE = yes +BACKLIGHT_ENABLE = no +BLUETOOTH_ENABLE = no +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +COMBO_ENABLE = no +COMMAND_ENABLE = no +CONSOLE_ENABLE = no +EXTRAKEY_ENABLE = yes +LEADER_ENABLE = yes +MIDI_ENABLE = no +MOUSEKEY_ENABLE = yes +NKRO_ENABLE = yes # nkey rollover +RGBLIGHT_ENABLE = no +SLEEP_LED_ENABLE = no +STENO_ENABLE = yes +TAP_DANCE_ENABLE = yes +UNICODE_ENABLE = yes diff --git a/keyboards/planck/keymaps/spacebarracecar/config.h b/keyboards/planck/keymaps/spacebarracecar/config.h new file mode 100644 index 000000000000..4f48857fe57d --- /dev/null +++ b/keyboards/planck/keymaps/spacebarracecar/config.h @@ -0,0 +1,5 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(NO_SOUND) +#endif diff --git a/keyboards/planck/keymaps/spacebarracecar/keymap.c b/keyboards/planck/keymaps/spacebarracecar/keymap.c new file mode 100644 index 000000000000..f8bd8d7182ff --- /dev/null +++ b/keyboards/planck/keymaps/spacebarracecar/keymap.c @@ -0,0 +1,160 @@ +#include QMK_KEYBOARD_H +#include "spacebarracecar.h" + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +enum layers { + _BASE, + _RAISE, + _LOWER, + _MUSICMODE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Base +,-----------------------------------------------------------------------------------------------------------------------. +|Tab |Q |W |E |R |T |Z |U |I |O |P |Backspace| +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Esc/Nav |A |S |D |F |G |H |J |K |L |; |' | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Shift |Y |X |C |V |B |N |M |, |. |/ |Shift | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|LCtrl | |Win |Alt |Lower |Space |Enter |Raise |AltGr |Win |Menu |RCtrl | +`-----------------------------------------------------------------------------------------------------------------------' +*/ + +[_BASE] = LAYOUT_ortho_4x12( + KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, CU_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, + CU_NAV, DE_A, DE_S, DE_D, DE_F, DE_G, DE_H, DE_J, DE_K, DE_L, CU_SCLN, CU_QUOT, + CU_LSFT, CU_Y, DE_X, DE_C, DE_V, DE_B, DE_N, DE_M, CU_COMM, CU_DOT, CU_SLSH, CU_RSFT, + KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, CTLENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL +), + +/* Lower +,-----------------------------------------------------------------------------------------------------------------------. +|~ |! |" |# |$ |% |^ |& |* |( |) | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |@ |Strg+X |Strg+C |Strg+V | | |_ |+ |{ |} || | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |? | | | | | | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | | | | +`-----------------------------------------------------------------------------------------------------------------------' +*/ +[_LOWER] = LAYOUT_ortho_4x12( + DE_TILD, DE_EXLM, DE_DQUO, DE_HASH, DE_DLR, DE_PERC, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, + _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, + _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Raise +,-----------------------------------------------------------------------------------------------------------------------. +|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |F1 |F2 |F3 |F4 |F5 |F6 |- |= |[ |] |\ | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |F7 |F8 |F9 |F10 |F11 |F12 | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | | | | +`-----------------------------------------------------------------------------------------------------------------------' +*/ + +[_RAISE] = LAYOUT_ortho_4x12( + CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MUSICMODE] = LAYOUT_ortho_4x12( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LCTL, KC_LALT, KC_LGUI, KC_DOWN, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_NEXT, MU_OFF +), + +/* Deadkey +,-----------------------------------------------------------------------------------------------------------------------. +| | | | | | | |Ü | |Ö | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |Ä |ß | | | | | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | |" |" | | | | | | +`-----------------------------------------------------------------------------------------------------------------------' +*/ + +[_DEADKEY] = LAYOUT_ortho_4x12( + KC_TAB, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, KC_BSPC, + CU_NAV, CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, + CU_LSFT, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_RSFT, + KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, CU_DDQ, CU_DDQ, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL +), + +/* Navigation +,-----------------------------------------------------------------------------------------------------------------------. +|ALT F4 |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|QK_BOOT |ESCT | | | | | | | | | |Game | +`-----------------------------------------------------------------------------------------------------------------------' +*/ + +[_NAV] = LAYOUT_ortho_4x12( + _______, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, EMOJI, KC_ENT, + _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, MU_ON, XXXXXXX, XXXXXXX, XXXXXXX, _______, + QK_BOOT, CU_ESCT, ALTF4, _______, _______, KC_SPC, CTLENT, _______, _______, _______, _______, CU_GAME +) + +}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { +switch (keycode) { + case MO(_LOWER): + if (game){ + if(record->event.pressed) { + register_code(KC_SPC); + } else { + unregister_code(KC_SPC); + } + return false; + } else { + return true; + } + case KC_LALT: + if (game) { + if (record->event.pressed){ + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + } else { + return true; + } + case MU_ON: + if(record->event.pressed) { + layer_off(_LOWER); + layer_off(_RAISE); + layer_off(_NAV); + layer_off(_DEADKEY); + layer_on(_MUSICMODE); + } + return true; + case MU_OFF: + if(record->event.pressed) { + layer_off(_MUSICMODE); + } + return true; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/spacebarracecar/readme.md b/keyboards/planck/keymaps/spacebarracecar/readme.md new file mode 100644 index 000000000000..c8e8134caa38 --- /dev/null +++ b/keyboards/planck/keymaps/spacebarracecar/readme.md @@ -0,0 +1,5 @@ +# SpacebarRacecar US-International Planck Keymap for German PCs + +This keymap emulates most keys of the US-International layout on PCs that have German set as input language. +This allows the use of the keyboard on any PC in Germany without the need to change any settings. +The keymap is mostly based on the Planck default layout but adds essential features for german input, like access to Ä, Ö, Ü, ß. diff --git a/keyboards/planck/keymaps/spacebarracecar/rules.mk b/keyboards/planck/keymaps/spacebarracecar/rules.mk new file mode 100644 index 000000000000..b65fadcd36ef --- /dev/null +++ b/keyboards/planck/keymaps/spacebarracecar/rules.mk @@ -0,0 +1,22 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# Userspace defines +GERMAN_ENABLE = yes # Enable Custom US Ansi Keycodes for PC with German set as input language diff --git a/keyboards/planck/keymaps/squarecut/config.h b/keyboards/planck/keymaps/squarecut/config.h new file mode 100644 index 000000000000..6e6d0f3ac731 --- /dev/null +++ b/keyboards/planck/keymaps/squarecut/config.h @@ -0,0 +1,46 @@ +/* Copyright 2015-2021 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE +# define STARTUP_SONG SONG(PLANCK_SOUND) +// #define STARTUP_SONG SONG(NO_SOUND) + +# define DEFAULT_LAYER_SONGS \ + { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND) } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/squarecut/keymap.c b/keyboards/planck/keymaps/squarecut/keymap.c new file mode 100644 index 000000000000..3bfb2d499e01 --- /dev/null +++ b/keyboards/planck/keymaps/squarecut/keymap.c @@ -0,0 +1,414 @@ +/* Copyright 2015-2021 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + + +enum planck_layers { + _QWERTY, + _OSX, + _NIXQWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + OSX, + NIXQWERTY, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl |Brite | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, + KC_LCTL, BACKLIT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* OSX - Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | CMD |Brite | Alt | CTRL |Raise | Space |Lower | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_OSX] = LAYOUT_planck_grid( + 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_LGUI, BACKLIT, KC_LALT, KC_LCTL, RAISE, KC_SPC, KC_SPC, LOWER, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* NixQwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl |Brite | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_NIXQWERTY] = LAYOUT_planck_grid( + 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_LCTL, BACKLIT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | Del | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Home | End | Enter| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_HOME, KC_END, KC_ENT, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Pg Up |Pg Dn |Enter| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_PGUP, KC_PGDN, KC_ENT, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * v------------------------RGB CONTROL--------------------v + * ,-----------------------------------------------------------------------------------. + * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | |MUSmod|Aud on|Audoff|AGnorm|AGswap|Qwerty|NixQty| OSX |Plover|Colemk| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL, + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, NIXQWERTY, OSX, PLOVER, COLEMAK, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, DVORAK, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case OSX: + if (record->event.pressed) { + set_single_persistent_default_layer(_OSX); + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + } + return false; + break; + case NIXQWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_NIXQWERTY); + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + writePinLow(E6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + writePinHigh(E6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_song); } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_gb_song); } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } + return true; +} + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/squarecut/readme.md b/keyboards/planck/keymaps/squarecut/readme.md new file mode 100644 index 000000000000..2aff8d543b82 --- /dev/null +++ b/keyboards/planck/keymaps/squarecut/readme.md @@ -0,0 +1,9 @@ +# The Almost Default Planck Layout + +Simple changes right now, just some key shifts. Nothing major. + +# Based off foreveranapple keymap +Lower on left, RAISE on right +Swap Tab and Esc +Assign long press Shift, short press Enter +Continuous enter on lower/upper Enter \ No newline at end of file diff --git a/keyboards/planck/keymaps/squarecut/rules.mk b/keyboards/planck/keymaps/squarecut/rules.mk new file mode 100644 index 000000000000..87df38d49e74 --- /dev/null +++ b/keyboards/planck/keymaps/squarecut/rules.mk @@ -0,0 +1,2 @@ +SRC += muse.c +AUDIO_ENABLED = yes \ No newline at end of file diff --git a/keyboards/planck/keymaps/steno/config.h b/keyboards/planck/keymaps/steno/config.h new file mode 100644 index 000000000000..d3db1ffac1aa --- /dev/null +++ b/keyboards/planck/keymaps/steno/config.h @@ -0,0 +1,39 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif diff --git a/keyboards/planck/keymaps/steno/keymap.c b/keyboards/planck/keymaps/steno/keymap.c new file mode 100644 index 000000000000..9de27e47bfd1 --- /dev/null +++ b/keyboards/planck/keymaps/steno/keymap.c @@ -0,0 +1,255 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "keymap_steno.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +#define ST_BOLT QK_STENO_BOLT +#define ST_GEM QK_STENO_GEMINI + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | FN | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | PWR | RES1 | RES2 | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC , + STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR , + XXXXXXX, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR , + EXT_PLV, XXXXXXX, XXXXXXX, STN_A, STN_O, XXXXXXX, XXXXXXX, STN_E, STN_U, STN_PWR, STN_RE1, STN_RE2 +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | |TXBOLT|GEM RP| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, ST_BOLT, ST_GEM, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (!record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_on(_PLOVER); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/steno/readme.md b/keyboards/planck/keymaps/steno/readme.md new file mode 100644 index 000000000000..e8ffd9756522 --- /dev/null +++ b/keyboards/planck/keymaps/steno/readme.md @@ -0,0 +1,4 @@ +# The Default Planck Layout with TX Bolt for the Plover Layer + +To use set Plover to TX Bolt and select the COM port that represents your keyboard. + diff --git a/keyboards/planck/keymaps/steno/rules.mk b/keyboards/planck/keymaps/steno/rules.mk new file mode 100644 index 000000000000..b2fd63a893d5 --- /dev/null +++ b/keyboards/planck/keymaps/steno/rules.mk @@ -0,0 +1,6 @@ +EXTRAKEY_ENABLE = no +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER +AUDIO_ENABLE = no # Audio output on port C6 +MIDI_ENABLE = no # MIDI controls + diff --git a/keyboards/planck/keymaps/stuartfong1/config.h b/keyboards/planck/keymaps/stuartfong1/config.h new file mode 100644 index 000000000000..7245bc8063d3 --- /dev/null +++ b/keyboards/planck/keymaps/stuartfong1/config.h @@ -0,0 +1,29 @@ +/* Copyright 2020 Stuart Fong + * + * 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 . + */ + +#pragma once +#define MIDI_BASIC +#define DYNAMIC_MACRO_NO_NESTING +#define AUTO_SHIFT_TIMEOUT 175 + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif diff --git a/keyboards/planck/keymaps/stuartfong1/keymap.c b/keyboards/planck/keymaps/stuartfong1/keymap.c new file mode 100644 index 000000000000..8d770ae83b16 --- /dev/null +++ b/keyboards/planck/keymaps/stuartfong1/keymap.c @@ -0,0 +1,318 @@ +/* Copyright 2020 Stuart Fong + * + * 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 QMK_KEYBOARD_H +#include "muse.h" + +enum planck_layers +{ + _COLEMAK, + _PLOVER, + _LOWER, + _RAISE, + _SYMBOL, + _FUNCTION, + _ADJUST +}; + +enum planck_keycodes { + COLEMAK = SAFE_RANGE, + PLOVER, + EXT_PLV, + CBR, // {} + PRN, // () + BRC, // [] + DQUO, // "" + PRTSC3, // Capture Entire Screen + PRTSC4, // Capture Selected Portion + PRTSC5 // Screenshot Toolbar +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define SYMBOL MO(_SYMBOL) +#define FUNCTION MO(_FUNCTION) + +#define LTL LT(LOWER, KC_BSPC) +#define LTS LT(SYMBOL, KC_TAB) +#define LTF LT(FUNCTION, KC_ENT) +#define LTR LT(RAISE, KC_SPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = +{ + /* Colemak + * ,-----------------------------------------------------------------------------------. + * | Q | W | F | P | B |Macro1|Macro2| J | L | U | Y | ; | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | A | R | S | T | G |Play 1|Play 2| M | N | E | I | O | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Z | X | C | D | V | Shift| Shift| K | H | , | . | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | GUI | Bksp | Tab | Caps | Esc | Enter| Space| GUI | Alt | Ctrl | + * `-----------------------------------------------------------------------------------' + */ + [_COLEMAK] = LAYOUT_planck_grid( + KC_Q, KC_W, KC_F, KC_P, KC_B, DM_REC1, DM_REC2, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, + KC_A, KC_R, KC_S, KC_T, KC_G, DM_PLY1, DM_PLY2, KC_M, KC_N, KC_E, KC_I, KC_O, + KC_Z, KC_X, KC_C, KC_D, KC_V, KC_LSFT, KC_RSFT, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, + KC_LCTL, KC_LALT, KC_LGUI, LTL, LTS, KC_CAPS, KC_ESC, LTF, LTR, KC_RGUI, KC_RALT, KC_RCTL + ), + + /* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Enter| S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | Up | Down | A | O | Bksp | Space| E | U | Left | Right| Esc | + * `-----------------------------------------------------------------------------------' + */ + [_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + KC_ENT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, KC_UP, KC_DOWN, KC_C, KC_V, KC_BSPC, KC_SPC, KC_N, KC_M, KC_LEFT, KC_RGHT, KC_ESC + ), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | - | ' | ; | {} | % | | | + | 7 | 8 | 9 | . | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | _ | " | = | () | / | | | - | 4 | 5 | 6 | 0 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | \ | & | ! | [] | ^ | | | * | 1 | 2 | 3 | , | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Enter| Space| Bksp | | | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_planck_grid( + KC_MINS, KC_QUOT, KC_SCLN, CBR, KC_PERC, XXXXXXX, XXXXXXX, KC_PPLS, KC_P7, KC_P8, KC_P9, KC_DOT, + KC_UNDS, DQUO, KC_PEQL, PRN, KC_PSLS, XXXXXXX, XXXXXXX, KC_PMNS, KC_P4, KC_P5, KC_P6, KC_P0, + KC_PIPE, KC_AMPR, KC_EXLM, BRC, KC_CIRC, XXXXXXX, XXXXXXX, KC_PAST, KC_P1, KC_P2, KC_P3, KC_COMM, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_ENT, LTR, KC_BSPC, XXXXXXX, XXXXXXX + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * |Buttn4|Buttn3|RClick|LClick| Mute | | |Accel2| Home | PgDn | PgUp | End | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |MouseL|MouseU|MouseD|MouseR| VolD | | |Accel1| Left | Down | Up | Right| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |WheelL|WheelD|WheelU|WheelR| VolU | | |Accel0| RWD | Play | FFD | Stop | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_planck_grid( + KC_BTN4, KC_BTN3, KC_BTN2, KC_BTN1, KC_MUTE, XXXXXXX, XXXXXXX, KC_ACL2, KC_HOME, KC_PGDN, KC_PGUP, KC_END, + KC_MS_L, KC_MS_U, KC_MS_D, KC_MS_R, KC_VOLD, XXXXXXX, XXXXXXX, KC_ACL1, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_VOLU, XXXXXXX, XXXXXXX, KC_ACL0, KC_MRWD, KC_MPLY, KC_MFFD, KC_MSTP, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), + + /* Symbol + * ,-----------------------------------------------------------------------------------. + * | ! | @ | # | $ | | | | | + | { | } | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | % | ^ | & | | | | | | | - | ( | } | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | = | ` | \ | ~ | | | | | * | ( | ) | _ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_SYMBOL] = LAYOUT_planck_grid( + KC_EXLM, KC_AT, KC_HASH, KC_DLR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PLUS, KC_LCBR, KC_RCBR, KC_QUOT, + KC_PERC, KC_CIRC, KC_AMPR, KC_PIPE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MINS, KC_LPRN, KC_RPRN, KC_DQUO, + KC_EQL, KC_GRV, KC_BSLS, KC_TILD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_ASTR, KC_LBRC, KC_RBRC, KC_UNDS, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), + + /* Function + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 |PrtSc5| | | | F13 | F14 | F15 | F16 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | F5 | F6 | F7 | F8 |PrtSc4| | | | F17 | F18 | F19 | F20 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | F9 | F10 | F11 | F12 |PrtSc3| | | | F21 | F22 | F23 | F24 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_FUNCTION] = LAYOUT_planck_grid( + KC_F1, KC_F2, KC_F3, KC_F4, PRTSC5, XXXXXXX, XXXXXXX, XXXXXXX, KC_F13, KC_F14, KC_F15, KC_F16, + KC_F5, KC_F6, KC_F7, KC_F8, PRTSC4, XXXXXXX, XXXXXXX, XXXXXXX, KC_F17, KC_F18, KC_F19, KC_F20, + KC_F9, KC_F10, KC_F11, KC_F12, PRTSC3, XXXXXXX, XXXXXXX, XXXXXXX, KC_F21, KC_F22, KC_F23, KC_F24, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), + + /* Adjust (Lower + Raise) + * v------------------------RGB CONTROL--------------------v + * ,-----------------------------------------------------------------------------------. + * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | |MUSmod|Aud on|Audoff|AGnorm|AGswap| |Plover| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT_planck_grid( + XXXXXXX, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, XXXXXXX, + XXXXXXX, XXXXXXX, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, XXXXXXX, PLOVER, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ) +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + bool is_plover_on = layer_state_cmp(state, _PLOVER); + bool static was_plover_on = false, autoshift_on; + if (is_plover_on != was_plover_on) { + if (is_plover_on) { + autoshift_on = get_autoshift_state(); + autoshift_disable(); + } else { + if (autoshift_on) { + autoshift_enable(); + autoshift_on = false; + } + } + was_plover_on = is_plover_on; + } + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case CBR: + if (record->event.pressed) { + SEND_STRING("{}" SS_TAP(X_LEFT)); + } + return false; + break; + case PRN: + if (record->event.pressed) { + SEND_STRING("()" SS_TAP(X_LEFT)); + } + return false; + break; + case BRC: + if (record->event.pressed) { + SEND_STRING("[]" SS_TAP(X_LEFT)); + } + return false; + break; + case DQUO: + if (record->event.pressed) { + SEND_STRING("\"\"" SS_TAP(X_LEFT)); + } + return false; + break; + case PRTSC3: + if (record->event.pressed) { + SEND_STRING(SS_LCMD(SS_LSFT("3"))); + } + return false; + break; + case PRTSC4: + if (record->event.pressed) { + SEND_STRING(SS_LCMD(SS_LSFT("4"))); + } + return false; + break; + case PRTSC5: + if (record->event.pressed) { + SEND_STRING(SS_LCMD(SS_LSFT("5"))); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/stuartfong1/readme.md b/keyboards/planck/keymaps/stuartfong1/readme.md new file mode 100644 index 000000000000..1e5bc5e0cd2a --- /dev/null +++ b/keyboards/planck/keymaps/stuartfong1/readme.md @@ -0,0 +1,68 @@ +# stuartfong1's Planck Layout + +I made this layout to improve ergonomics during daily usage, and to make access to symbols easier when writing code. The main idea is to make all keys easily accessible while reducing the risk of finger strain. + +## Specifications +This was made to work on a Planck rev. 6.1, and is used on macOS. + +## Base Layer + +![Image of Base Layer](https://i.imgur.com/XO7sgv4.png) + +This uses the Colemak DH layout with the wide mod. + +- Colemak is an alternative to the QWERTY layout designed for efficient and ergonomic typing in the English language (https://colemak.com). The Colemak DH is a modification of Colemak that makes the D and H keys easier to reach. The wide mod shifts the halves of the keyboard apart, making it easier on the shoulders (https://colemakmods.github.io/mod-dh/). +- Space and backspace are located under the thumbs. Rotate the keys on the bottom row 180° for ease of use. +- I use Auto Shift. This allows me to hold a key to shift it, which prevents me from having to reach for the shift key. The time to activate auto shift can be changed in the config.h file. +- The 4 keys in the center are used for dynamic macros. On each side, hold the top key to start recording, and tap it to stop recording. Tap the middle key to play the macro. 2 macros can be stored at a time; the keys on the left are used for macro #1, and the keys on the right are used for macro #2. +- Modifiers are located at the bottom left and bottom right of the keyboard. They can be accessed by moving the thumbs or with the sides of your hands. + +## Numpad Layer + +![Image of Numpad Layer](https://i.imgur.com/dPzvYM6.png) + +This contains a numpad and some non-alphanumeric characters such as math symbols and quotes. + +- The numpad is found under the right hand. It contains numbers and basic math symbols. +- Brackets are typed using the left index finger. These keys. as well as the quotation marks, are macros that type both the beginning and end bracket, and move the cursor inside them. +- The rest of the keys are those that are commonly used while writing code. + +## Navigation Layer + +![Image of Navigation Layer](https://i.imgur.com/Mr4EQbW.png) + +This contains mouse keys, arrow keys, and other keys used for navigation. + +- The left side has all the basic functionality of a mouse. The keys on the home row are used to move the mouse, the top ones are used for clicking on something, and the keys on the bottom are used to move the scroll wheel. The speed of the mouse can be adjusted using the right index finger. +- The arrow keys are located on the right hand on the home row. Above these keys are some keys that are located on the navigation cluster. +- Media keys are located on the bottom right, and the volume can be adjusted by using the left index finger. + +## Symbol Layer + +![Image of Symbol Layer](https://i.imgur.com/1ny1x9H.png) + +This contains all the symbols that are not found on the other layers. + +- The left side has most of the shifted number keys in increasing order. Some other keys here are for bitwise operators. +- The right side has symbols that are repeated in the numpad layer. Individual brackets are located here in case I accidentally press backspace on one. + +## Function Layer + +![Image of Function Layer](https://i.imgur.com/Sc3qUs3.png) + +This has all the function keys from F1 to F24. + +- The function keys are sorted in increasing order. +- F14 and F15 are used to lower and increase the brightness respectively. +- Commands to screenshot / screen record are accessed with the left index finger. + +## Additional Layers + +- Adjust: Some settings for RGB control, music mode, and to reset the keyboard. + +![Image of Adjust Layer](https://i.imgur.com/gjxXXqj.png) + +- Plover: Used for stenography (http://www.openstenoproject.org). As I am still learning, I have included some extra keys. + +![Image of Plover Layer](https://i.imgur.com/uoSHgIC.png) + diff --git a/keyboards/planck/keymaps/stuartfong1/rules.mk b/keyboards/planck/keymaps/stuartfong1/rules.mk new file mode 100644 index 000000000000..d6c7c7277dca --- /dev/null +++ b/keyboards/planck/keymaps/stuartfong1/rules.mk @@ -0,0 +1,4 @@ +SRC += muse.c +AUTO_SHIFT_ENABLE = yes +DYNAMIC_MACRO_ENABLE = yes +STENO_ENABLE = yes diff --git a/keyboards/planck/keymaps/synth_sample/config.h b/keyboards/planck/keymaps/synth_sample/config.h new file mode 100644 index 000000000000..930b26b00016 --- /dev/null +++ b/keyboards/planck/keymaps/synth_sample/config.h @@ -0,0 +1,56 @@ +/* +Copyright 2020 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 . +*/ + +#pragma once + +#ifdef AUDIO_ENABLE + #define AUDIO_PIN A5 + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/synth_sample/keymap.c b/keyboards/planck/keymaps/synth_sample/keymap.c new file mode 100644 index 000000000000..4b6c53c3a837 --- /dev/null +++ b/keyboards/planck/keymaps/synth_sample/keymap.c @@ -0,0 +1,297 @@ +/* Copyright 2019 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 . + */ + +#include QMK_KEYBOARD_H + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_DOWN); + unregister_code(KC_MS_WH_DOWN); + #else + register_code(KC_PGDN); + unregister_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_UP); + unregister_code(KC_MS_WH_UP); + #else + register_code(KC_PGUP); + unregister_code(KC_PGUP); + #endif + } + return true; +} + +void matrix_scan_user(void) { + +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} + +#include "sample.h" + +uint32_t dac_sample_custom_counter = 0; + +uint16_t dac_value_generate(void) { + if (is_playing_note()) { + uint16_t sample = dac_sample_custom[dac_sample_custom_counter]; + dac_sample_custom_counter = (dac_sample_custom_counter + 1) % AUDIO_DAC_SAMPLE_CUSTOM_LENGTH; + return sample; + } else { + return AUDIO_DAC_OFF_VALUE; + } +} diff --git a/keyboards/planck/keymaps/synth_sample/rules.mk b/keyboards/planck/keymaps/synth_sample/rules.mk new file mode 100644 index 000000000000..ebfcda221435 --- /dev/null +++ b/keyboards/planck/keymaps/synth_sample/rules.mk @@ -0,0 +1,2 @@ +AUDIO_ENABLE = yes +AUDIO_DRIVER = dac_additive diff --git a/keyboards/planck/keymaps/synth_sample/sample.h b/keyboards/planck/keymaps/synth_sample/sample.h new file mode 100644 index 000000000000..71c1b87e7622 --- /dev/null +++ b/keyboards/planck/keymaps/synth_sample/sample.h @@ -0,0 +1,3797 @@ +/* +Copyright 2020 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 . +*/ + +#define AUDIO_DAC_SAMPLE_CUSTOM_LENGTH 30208 + +static const dacsample_t dac_sample_custom[30208] = { + 2041, 2039, 2039, 2037, 2035, 2037, 2037, 2037, + 2038, 2037, 2037, 2040, 2039, 2038, 2036, 2035, + 2036, 2036, 2036, 2034, 2034, 2034, 2032, 2032, + 2033, 2034, 2032, 2030, 2029, 2031, 2030, 2029, + 2029, 2030, 2029, 2030, 2030, 2031, 2028, 2028, + 2028, 2027, 2025, 2026, 2027, 2026, 2025, 2026, + 2026, 2025, 2023, 2022, 2023, 2021, 2021, 2023, + 2020, 2023, 2023, 2022, 2022, 2021, 2021, 2020, + 2022, 2020, 2017, 2016, 2015, 2018, 2017, 2015, + 2013, 2012, 2015, 2013, 2011, 2012, 2011, 2011, + 2010, 2008, 2008, 2010, 2010, 2006, 2006, 2006, + 2004, 2005, 2006, 2006, 2005, 2002, 2005, 2003, + 2003, 2004, 2002, 2001, 2003, 2003, 2002, 2003, + 2003, 2000, 2000, 2000, 1998, 1997, 1998, 1999, + 1997, 1995, 1995, 1996, 1996, 1992, 1995, 1995, + 1994, 1994, 1995, 1997, 1996, 1996, 1997, 1997, + 1997, 1996, 1996, 1995, 1997, 1997, 1996, 1998, + 1995, 1996, 1996, 1996, 1996, 1994, 1990, 1991, + 1992, 1991, 1994, 1992, 1993, 1995, 1994, 1995, + 1992, 1991, 1991, 1992, 1993, 1992, 1992, 1993, + 1993, 1992, 1990, 1989, 1991, 1992, 1991, 1991, + 1990, 1990, 1992, 1992, 1991, 1992, 1992, 1994, + 1992, 1992, 1992, 1993, 1993, 1994, 1995, 1993, + 1991, 1992, 1990, 1989, 1990, 1988, 1988, 1987, + 1989, 1989, 1985, 1986, 1987, 1985, 1986, 1986, + 1987, 1988, 1988, 1989, 1989, 1988, 1988, 1990, + 1991, 1991, 1990, 1991, 1992, 1994, 1994, 1995, + 1994, 1995, 1997, 1995, 1995, 1995, 1997, 1997, + 1997, 1996, 1999, 2000, 1997, 1998, 1999, 2002, + 2001, 2001, 2001, 2002, 2000, 1998, 2000, 2004, + 2002, 2001, 2003, 2005, 2004, 2004, 2002, 2004, + 2004, 2001, 2000, 2001, 2003, 2005, 2005, 2005, + 2005, 2006, 2010, 2010, 2009, 2007, 2006, 2008, + 2006, 2007, 2007, 2005, 2005, 2005, 2007, 2005, + 2006, 2007, 2009, 2010, 2008, 2007, 2006, 2006, + 2005, 2005, 2005, 2004, 2005, 2004, 2004, 2003, + 2007, 2006, 2006, 2004, 2005, 2006, 2007, 2007, + 2006, 2010, 2007, 2008, 2009, 2012, 2012, 2010, + 2011, 2010, 2014, 2012, 2013, 2013, 2014, 2014, + 2013, 2012, 2012, 2012, 2010, 2013, 2012, 2010, + 2011, 2011, 2012, 2012, 2013, 2013, 2015, 2016, + 2015, 2015, 2015, 2015, 2015, 2014, 2012, 2014, + 2016, 2017, 2016, 2015, 2018, 2019, 2017, 2017, + 2017, 2017, 2016, 2016, 2017, 2017, 2018, 2021, + 2020, 2019, 2019, 2022, 2022, 2024, 2024, 2023, + 2023, 2023, 2024, 2025, 2026, 2025, 2024, 2025, + 2025, 2026, 2026, 2023, 2023, 2023, 2023, 2023, + 2023, 2024, 2024, 2025, 2024, 2022, 2022, 2021, + 2021, 2022, 2022, 2024, 2023, 2023, 2023, 2021, + 2023, 2023, 2024, 2024, 2025, 2024, 2026, 2027, + 2025, 2026, 2028, 2026, 2027, 2027, 2025, 2024, + 2027, 2028, 2027, 2028, 2027, 2027, 2028, 2028, + 2030, 2029, 2032, 2031, 2030, 2029, 2028, 2030, + 2027, 2028, 2028, 2028, 2026, 2027, 2028, 2027, + 2029, 2032, 2030, 2030, 2032, 2033, 2030, 2030, + 2032, 2030, 2030, 2030, 2032, 2032, 2033, 2031, + 2034, 2032, 2029, 2028, 2028, 2030, 2028, 2029, + 2030, 2028, 2029, 2029, 2029, 2030, 2032, 2033, + 2031, 2036, 2034, 2032, 2032, 2031, 2032, 2031, + 2032, 2033, 2035, 2033, 2032, 2034, 2035, 2036, + 2037, 2038, 2039, 2038, 2038, 2038, 2040, 2040, + 2041, 2041, 2041, 2043, 2041, 2041, 2043, 2043, + 2041, 2040, 2042, 2042, 2042, 2044, 2044, 2041, + 2042, 2043, 2042, 2044, 2043, 2044, 2044, 2045, + 2045, 2044, 2045, 2044, 2045, 2043, 2042, 2043, + 2043, 2043, 2043, 2044, 2044, 2044, 2045, 2044, + 2044, 2043, 2042, 2045, 2046, 2045, 2046, 2048, + 2048, 2046, 2046, 2046, 2049, 2048, 2050, 2049, + 2049, 2050, 2053, 2051, 2049, 2050, 2047, 2050, + 2048, 2052, 2050, 2051, 2053, 2051, 2051, 2048, + 2051, 2050, 2049, 2051, 2052, 2051, 2050, 2051, + 2050, 2050, 2051, 2050, 2048, 2049, 2049, 2048, + 2050, 2050, 2050, 2049, 2048, 2048, 2048, 2048, + 2049, 2049, 2049, 2050, 2051, 2050, 2053, 2051, + 2051, 2053, 2052, 2052, 2052, 2051, 2053, 2055, + 2056, 2056, 2055, 2056, 2056, 2056, 2059, 2058, + 2055, 2057, 2059, 2057, 2056, 2056, 2056, 2057, + 2059, 2060, 2060, 2059, 2059, 2059, 2059, 2061, + 2059, 2059, 2060, 2061, 2059, 2057, 2058, 2060, + 2060, 2061, 2060, 2061, 2062, 2063, 2062, 2060, + 2062, 2060, 2061, 2061, 2060, 2060, 2061, 2062, + 2062, 2062, 2061, 2059, 2062, 2063, 2062, 2063, + 2063, 2063, 2063, 2063, 2063, 2063, 2065, 2063, + 2063, 2065, 2065, 2066, 2065, 2067, 2067, 2066, + 2065, 2065, 2065, 2066, 2066, 2063, 2064, 2062, + 2063, 2062, 2062, 2061, 2062, 2063, 2062, 2061, + 2061, 2062, 2058, 2059, 2061, 2062, 2062, 2062, + 2062, 2064, 2063, 2063, 2062, 2061, 2061, 2063, + 2060, 2059, 2059, 2058, 2059, 2059, 2059, 2062, + 2063, 2063, 2062, 2061, 2061, 2061, 2061, 2062, + 2060, 2058, 2059, 2060, 2060, 2059, 2059, 2057, + 2059, 2059, 2056, 2057, 2056, 2057, 2056, 2056, + 2056, 2057, 2057, 2057, 2055, 2055, 2055, 2053, + 2054, 2054, 2054, 2054, 2052, 2051, 2054, 2055, + 2055, 2053, 2055, 2054, 2055, 2055, 2053, 2053, + 2054, 2052, 2051, 2053, 2051, 2052, 2052, 2054, + 2054, 2053, 2051, 2051, 2053, 2052, 2051, 2050, + 2049, 2049, 2048, 2049, 2049, 2047, 2046, 2047, + 2047, 2047, 2046, 2048, 2046, 2046, 2046, 2044, + 2043, 2044, 2045, 2046, 2043, 2044, 2043, 2046, + 2044, 2044, 2043, 2043, 2042, 2039, 2037, 2039, + 2038, 2039, 2039, 2038, 2038, 2038, 2039, 2036, + 2034, 2034, 2033, 2035, 2034, 2032, 2031, 2034, + 2035, 2033, 2034, 2032, 2032, 2033, 2031, 2031, + 2031, 2032, 2032, 2032, 2030, 2030, 2029, 2029, + 2029, 2025, 2024, 2024, 2024, 2025, 2025, 2028, + 2028, 2025, 2024, 2026, 2025, 2022, 2023, 2021, + 2018, 2019, 2020, 2020, 2020, 2021, 2021, 2018, + 2017, 2019, 2017, 2016, 2018, 2019, 2018, 2016, + 2017, 2016, 2014, 2017, 2017, 2017, 2016, 2014, + 2012, 2011, 2011, 2011, 2011, 2012, 2011, 2009, + 2011, 2011, 2011, 2012, 2009, 2009, 2010, 2011, + 2011, 2011, 2008, 2008, 2010, 2009, 2009, 2008, + 2007, 2010, 2009, 2011, 2012, 2011, 2012, 2012, + 2010, 2010, 2011, 2009, 2010, 2010, 2010, 2012, + 2011, 2011, 2011, 2010, 2010, 2009, 2012, 2008, + 2009, 2010, 2010, 2008, 2008, 2009, 2007, 2007, + 2007, 2007, 2009, 2008, 2006, 2006, 2010, 2011, + 2011, 2009, 2010, 2007, 2008, 2007, 2009, 2011, + 2009, 2009, 2008, 2009, 2009, 2009, 2007, 2010, + 2008, 2009, 2013, 2011, 2011, 2009, 2010, 2009, + 2007, 2007, 2008, 2008, 2009, 2010, 2008, 2009, + 2009, 2010, 2010, 2010, 2009, 2007, 2008, 2007, + 2011, 2012, 2010, 2009, 2009, 2010, 2008, 2010, + 2011, 2010, 2010, 2012, 2011, 2010, 2013, 2014, + 2013, 2014, 2016, 2015, 2016, 2017, 2016, 2020, + 2022, 2022, 2020, 2022, 2023, 2024, 2023, 2022, + 2021, 2020, 2023, 2022, 2023, 2022, 2023, 2024, + 2022, 2021, 2021, 2021, 2021, 2021, 2021, 2023, + 2024, 2024, 2022, 2022, 2023, 2026, 2027, 2024, + 2025, 2029, 2027, 2029, 2030, 2029, 2029, 2028, + 2029, 2029, 2028, 2031, 2031, 2029, 2027, 2026, + 2026, 2028, 2025, 2025, 2021, 2022, 2025, 2025, + 2028, 2026, 2025, 2025, 2023, 2024, 2024, 2027, + 2027, 2029, 2028, 2025, 2027, 2029, 2031, 2028, + 2026, 2028, 2028, 2028, 2028, 2030, 2026, 2028, + 2029, 2029, 2030, 2030, 2030, 2032, 2032, 2032, + 2031, 2030, 2031, 2031, 2033, 2035, 2033, 2032, + 2031, 2032, 2032, 2032, 2032, 2031, 2030, 2030, + 2028, 2030, 2029, 2027, 2029, 2028, 2027, 2029, + 2032, 2031, 2031, 2032, 2030, 2029, 2032, 2033, + 2032, 2027, 2026, 2029, 2030, 2031, 2033, 2033, + 2033, 2035, 2035, 2034, 2035, 2034, 2035, 2036, + 2037, 2035, 2035, 2034, 2034, 2034, 2037, 2036, + 2035, 2033, 2033, 2034, 2033, 2035, 2035, 2036, + 2038, 2037, 2035, 2038, 2038, 2033, 2033, 2035, + 2036, 2036, 2038, 2037, 2037, 2038, 2038, 2039, + 2039, 2038, 2038, 2040, 2041, 2040, 2042, 2042, + 2042, 2043, 2042, 2040, 2041, 2040, 2041, 2043, + 2040, 2042, 2042, 2041, 2044, 2045, 2043, 2043, + 2045, 2045, 2047, 2045, 2044, 2046, 2045, 2048, + 2049, 2050, 2050, 2050, 2050, 2048, 2050, 2051, + 2050, 2050, 2052, 2053, 2053, 2055, 2054, 2053, + 2055, 2053, 2053, 2052, 2050, 2052, 2052, 2053, + 2053, 2054, 2053, 2055, 2056, 2055, 2053, 2053, + 2054, 2054, 2056, 2054, 2054, 2056, 2054, 2053, + 2054, 2057, 2055, 2054, 2056, 2057, 2056, 2058, + 2057, 2058, 2059, 2057, 2058, 2057, 2057, 2055, + 2056, 2056, 2055, 2059, 2057, 2055, 2052, 2050, + 2053, 2054, 2052, 2053, 2055, 2056, 2055, 2054, + 2055, 2055, 2053, 2053, 2053, 2054, 2055, 2055, + 2055, 2052, 2054, 2056, 2057, 2059, 2058, 2055, + 2056, 2057, 2056, 2056, 2056, 2057, 2057, 2056, + 2057, 2056, 2057, 2055, 2056, 2057, 2057, 2058, + 2057, 2055, 2055, 2056, 2057, 2056, 2056, 2056, + 2057, 2057, 2058, 2058, 2058, 2059, 2057, 2056, + 2057, 2055, 2053, 2055, 2056, 2056, 2056, 2057, + 2059, 2058, 2058, 2058, 2057, 2060, 2058, 2058, + 2058, 2059, 2059, 2060, 2061, 2060, 2058, 2059, + 2060, 2060, 2058, 2058, 2059, 2058, 2056, 2058, + 2059, 2059, 2058, 2058, 2057, 2059, 2060, 2058, + 2058, 2058, 2057, 2059, 2058, 2056, 2061, 2061, + 2060, 2059, 2061, 2062, 2062, 2062, 2059, 2061, + 2059, 2058, 2060, 2061, 2058, 2058, 2058, 2059, + 2059, 2057, 2060, 2058, 2058, 2057, 2055, 2054, + 2056, 2056, 2059, 2056, 2056, 2059, 2059, 2057, + 2055, 2052, 2051, 2052, 2052, 2052, 2053, 2051, + 2052, 2052, 2051, 2050, 2048, 2049, 2050, 2052, + 2050, 2052, 2051, 2052, 2053, 2052, 2050, 2050, + 2052, 2051, 2051, 2053, 2052, 2051, 2053, 2055, + 2055, 2054, 2053, 2054, 2051, 2052, 2052, 2053, + 2053, 2052, 2052, 2053, 2053, 2049, 2048, 2051, + 2048, 2048, 2049, 2050, 2051, 2049, 2047, 2047, + 2049, 2050, 2051, 2049, 2048, 2045, 2045, 2046, + 2046, 2046, 2045, 2046, 2045, 2043, 2044, 2043, + 2043, 2043, 2044, 2042, 2042, 2042, 2044, 2046, + 2044, 2039, 2040, 2039, 2038, 2040, 2040, 2040, + 2040, 2039, 2039, 2039, 2037, 2036, 2036, 2037, + 2037, 2034, 2036, 2035, 2034, 2033, 2033, 2031, + 2029, 2027, 2029, 2028, 2028, 2029, 2030, 2029, + 2027, 2027, 2026, 2028, 2028, 2026, 2026, 2024, + 2025, 2028, 2027, 2025, 2026, 2027, 2023, 2018, + 2017, 2021, 2020, 2019, 2018, 2016, 2014, 2013, + 2011, 2010, 2007, 2010, 2009, 2006, 2008, 2008, + 2004, 2005, 2006, 2009, 2009, 2010, 2009, 2007, + 2007, 2008, 2007, 2006, 2008, 2009, 2008, 2008, + 2006, 2007, 2009, 2008, 2007, 2007, 2008, 2007, + 2007, 2009, 2008, 2007, 2008, 2009, 2007, 2006, + 2005, 2004, 2007, 2006, 2006, 2004, 2004, 2003, + 2001, 2001, 2002, 2004, 2003, 2003, 2001, 2001, + 2002, 1998, 2000, 1999, 2000, 2001, 2001, 1999, + 2000, 1999, 1998, 1998, 2001, 2000, 1998, 1997, + 1996, 1995, 1994, 1994, 1995, 1995, 1993, 1996, + 1996, 1994, 1992, 1992, 1993, 1991, 1990, 1989, + 1991, 1987, 1988, 1989, 1989, 1989, 1992, 1990, + 1992, 1993, 1992, 1993, 1992, 1990, 1989, 1991, + 1990, 1990, 1988, 1989, 1991, 1991, 1992, 1991, + 1994, 1993, 1991, 1991, 1991, 1991, 1989, 1990, + 1990, 1991, 1989, 1991, 1990, 1991, 1989, 1988, + 1988, 1987, 1987, 1990, 1990, 1988, 1988, 1988, + 1988, 1987, 1987, 1984, 1986, 1985, 1986, 1988, + 1988, 1987, 1987, 1988, 1987, 1988, 1989, 1988, + 1989, 1991, 1990, 1988, 1990, 1989, 1987, 1987, + 1987, 1985, 1986, 1987, 1988, 1985, 1987, 1985, + 1986, 1988, 1988, 1988, 1988, 1987, 1988, 1988, + 1988, 1988, 1989, 1987, 1988, 1989, 1989, 1991, + 1990, 1992, 1990, 1990, 1991, 1991, 1993, 1994, + 1994, 1996, 1993, 1995, 1995, 1998, 1997, 1996, + 1997, 1997, 1998, 1998, 1997, 1999, 1999, 2000, + 2001, 2003, 2004, 2004, 2006, 2005, 2003, 2008, + 2006, 2005, 2005, 2005, 2008, 2009, 2011, 2011, + 2009, 2008, 2010, 2010, 2012, 2013, 2014, 2015, + 2015, 2014, 2015, 2015, 2013, 2013, 2013, 2013, + 2014, 2015, 2018, 2018, 2016, 2016, 2018, 2019, + 2017, 2015, 2017, 2016, 2016, 2016, 2015, 2017, + 2018, 2018, 2017, 2016, 2018, 2017, 2019, 2018, + 2016, 2015, 2014, 2014, 2016, 2018, 2018, 2015, + 2016, 2016, 2017, 2017, 2016, 2015, 2015, 2015, + 2015, 2018, 2016, 2017, 2016, 2014, 2016, 2017, + 2020, 2019, 2018, 2018, 2016, 2017, 2019, 2017, + 2017, 2013, 2015, 2016, 2015, 2015, 2016, 2016, + 2017, 2015, 2013, 2016, 2016, 2017, 2018, 2017, + 2016, 2017, 2016, 2016, 2017, 2019, 2019, 2021, + 2020, 2018, 2019, 2019, 2019, 2018, 2018, 2018, + 2020, 2021, 2022, 2023, 2019, 2018, 2022, 2022, + 2022, 2022, 2023, 2024, 2021, 2022, 2023, 2024, + 2024, 2024, 2025, 2027, 2028, 2029, 2030, 2028, + 2029, 2027, 2028, 2026, 2029, 2028, 2029, 2030, + 2029, 2031, 2029, 2030, 2029, 2028, 2028, 2030, + 2029, 2029, 2031, 2029, 2029, 2030, 2029, 2030, + 2030, 2029, 2027, 2026, 2025, 2024, 2024, 2023, + 2024, 2024, 2024, 2023, 2024, 2024, 2025, 2029, + 2027, 2025, 2027, 2029, 2029, 2033, 2034, 2035, + 2034, 2036, 2038, 2035, 2035, 2036, 2037, 2038, + 2036, 2038, 2038, 2037, 2038, 2039, 2039, 2033, + 2031, 2031, 2030, 2030, 2029, 2031, 2031, 2031, + 2031, 2032, 2034, 2034, 2037, 2038, 2038, 2039, + 2038, 2037, 2040, 2039, 2041, 2040, 2039, 2039, + 2038, 2041, 2038, 2035, 2037, 2037, 2037, 2035, + 2033, 2036, 2037, 2037, 2037, 2036, 2036, 2037, + 2035, 2036, 2038, 2039, 2040, 2039, 2039, 2038, + 2039, 2041, 2042, 2042, 2044, 2042, 2042, 2041, + 2041, 2040, 2041, 2041, 2040, 2041, 2041, 2042, + 2042, 2039, 2041, 2040, 2040, 2038, 2030, 2025, + 2024, 2015, 1982, 1933, 1910, 1911, 1896, 1878, + 1888, 1889, 1882, 1894, 1915, 1938, 1950, 1959, + 1977, 1987, 1989, 2008, 2032, 2054, 2074, 2093, + 2112, 2129, 2145, 2158, 2166, 2164, 2146, 2135, + 2129, 2105, 2079, 2064, 2040, 2017, 1999, 1987, + 1980, 1972, 1963, 1962, 1963, 1965, 1968, 1974, + 1982, 1991, 2001, 2014, 2031, 2043, 2058, 2074, + 2089, 2102, 2120, 2136, 2134, 2127, 2123, 2121, + 2116, 2102, 2092, 2087, 2073, 2048, 2032, 2017, + 1998, 1986, 1973, 1960, 1956, 1949, 1945, 1951, + 1957, 1960, 1964, 1976, 1985, 1994, 2014, 2031, + 2039, 2059, 2079, 2089, 2104, 2113, 2117, 2118, + 2114, 2115, 2117, 2112, 2108, 2106, 2085, 2057, + 2049, 2039, 2026, 2019, 2006, 1988, 1975, 1961, + 1958, 1961, 1957, 1956, 1962, 1965, 1966, 1975, + 1988, 1997, 2008, 2012, 2018, 2029, 2036, 2047, + 2059, 2063, 2061, 2057, 2059, 2065, 2062, 2053, + 2048, 2042, 2029, 2024, 2023, 2023, 2023, 2020, + 2015, 2015, 2020, 2021, 2028, 2040, 2042, 2043, + 2049, 2053, 2053, 2058, 2066, 2068, 2061, 2071, + 2089, 2081, 2072, 2088, 2089, 2074, 2061, 2052, + 2049, 2041, 2027, 2014, 2011, 2007, 2010, 2025, + 2026, 2000, 1982, 1984, 1991, 1993, 1992, 1998, + 1997, 2001, 2015, 2038, 2052, 2052, 2057, 2068, + 2070, 2067, 2071, 2084, 2092, 2087, 2079, 2086, + 2089, 2076, 2091, 2106, 2076, 2063, 2079, 2070, + 2058, 2064, 2060, 2040, 2022, 2035, 2043, 2023, + 2024, 2042, 2037, 2022, 2026, 2044, 2030, 2014, + 2025, 2029, 2023, 2034, 2043, 2048, 2051, 2031, + 2030, 2043, 2037, 2039, 2046, 2041, 2033, 2026, + 2038, 2050, 2044, 2050, 2056, 2047, 2041, 2035, + 2036, 2044, 2035, 2028, 2033, 2028, 2029, 2031, + 2038, 2048, 2027, 2017, 2036, 2036, 2033, 2036, + 2039, 2039, 2031, 2034, 2049, 2050, 2045, 2033, + 2032, 2037, 2022, 2021, 2036, 2032, 2031, 2028, + 2032, 2038, 2028, 2028, 2036, 2025, 2017, 2013, + 2017, 2021, 2014, 2018, 2027, 2020, 2021, 2038, + 2042, 2032, 2021, 2026, 2036, 2026, 2014, 2021, + 2023, 2009, 2001, 2003, 2002, 1998, 1986, 1985, + 1992, 1981, 1979, 2006, 2013, 2003, 2013, 2026, + 2027, 2029, 2047, 2064, 2055, 2040, 2052, 2069, + 2069, 2063, 2053, 2052, 2046, 2028, 2007, 1999, + 1993, 1985, 1981, 1977, 1976, 1971, 1976, 1986, + 1977, 1973, 1984, 1996, 2006, 2018, 2029, 2038, + 2045, 2052, 2073, 2092, 2105, 2115, 2106, 2063, + 2025, 2028, 2033, 1998, 1963, 1962, 1957, 1928, + 1932, 1964, 1977, 1980, 1979, 1996, 2011, 2003, + 2001, 2012, 2028, 2039, 2041, 2060, 2086, 2091, + 2093, 2112, 2108, 2078, 2072, 2073, 2047, 2018, + 1989, 1972, 1968, 1939, 1916, 1928, 1925, 1906, + 1904, 1923, 1950, 1953, 1945, 1974, 2006, 2012, + 2042, 2095, 2105, 2098, 2110, 2108, 2097, 2111, + 2111, 2067, 2035, 2022, 1989, 1970, 1956, 1929, + 1915, 1889, 1861, 1867, 1873, 1875, 1893, 1898, + 1916, 1937, 1945, 1985, 2034, 2062, 2080, 2101, + 2113, 2117, 2142, 2178, 2174, 2152, 2142, 2126, + 2110, 2077, 2040, 2046, 2017, 1943, 1932, 1944, + 1911, 1882, 1892, 1928, 1922, 1899, 1949, 1987, + 1968, 1974, 2010, 2042, 2041, 2024, 2063, 2094, + 2082, 2105, 2114, 2114, 2123, 2111, 2131, 2121, + 2064, 2060, 2046, 2015, 2001, 1965, 1958, 1953, + 1938, 1957, 1955, 1979, 2008, 1983, 2027, 2079, + 2038, 2052, 2115, 2120, 2093, 2092, 2122, 2126, + 2103, 2103, 2109, 2106, 2073, 2025, 2035, 2018, + 1956, 1950, 1939, 1887, 1861, 1850, 1851, 1873, + 1863, 1870, 1912, 1936, 1960, 1994, 2022, 2060, + 2082, 2081, 2114, 2142, 2132, 2146, 2165, 2166, + 2156, 2137, 2143, 2144, 2100, 2076, 2083, 2051, + 2018, 2004, 1984, 1971, 1946, 1935, 1955, 1962, + 1973, 1991, 1990, 2012, 2041, 2054, 2094, 2122, + 2104, 2120, 2135, 2114, 2136, 2152, 2137, 2137, + 2123, 2128, 2127, 2082, 2083, 2077, 2017, 1986, + 1969, 1938, 1910, 1894, 1901, 1896, 1905, 1928, + 1921, 1958, 2016, 2007, 2012, 2046, 2031, 2038, + 2079, 2074, 2074, 2093, 2091, 2102, 2131, 2117, + 2102, 2109, 2101, 2084, 2076, 2073, 2058, 2032, + 2016, 2006, 2004, 2009, 1990, 1981, 2006, 1996, + 1982, 2010, 2035, 2023, 2021, 2040, 2045, 2035, + 2033, 2065, 2079, 2050, 2047, 2074, 2093, 2116, + 2124, 2123, 2129, 2117, 2126, 2145, 2157, 2161, + 2115, 2056, 2011, 1943, 1899, 1882, 1861, 1837, + 1795, 1781, 1812, 1825, 1842, 1895, 1920, 1929, + 1948, 1966, 1998, 2039, 2072, 2100, 2139, 2179, + 2230, 2299, 2359, 2371, 2355, 2347, 2345, 2314, + 2274, 2244, 2183, 2096, 2018, 1968, 1954, 1911, + 1860, 1868, 1870, 1850, 1854, 1874, 1916, 1951, + 1948, 1976, 2058, 2103, 2106, 2166, 2246, 2250, + 2237, 2292, 2361, 2357, 2314, 2333, 2334, 2254, + 2225, 2223, 2161, 2099, 2047, 2009, 2004, 1971, + 1936, 1926, 1887, 1852, 1883, 1911, 1896, 1942, + 1999, 1955, 1965, 2055, 2063, 2096, 2166, 2165, + 2156, 2152, 2153, 2179, 2174, 2160, 2142, 2090, + 2086, 2085, 2045, 2052, 2047, 2003, 1985, 1996, + 2024, 2019, 2009, 2035, 2003, 1957, 1988, 2028, + 2047, 2039, 2015, 2029, 2040, 2024, 2046, 2086, + 2086, 2049, 2036, 2066, 2056, 2031, 2046, 2058, + 2024, 2008, 2029, 2032, 2023, 2038, 2043, 2026, + 2034, 2052, 2059, 2071, 2082, 2069, 2042, 2059, + 2091, 2079, 2065, 2085, 2086, 2066, 2100, 2140, + 2106, 2090, 2131, 2120, 2080, 2087, 2088, 2031, + 1987, 1986, 1965, 1930, 1928, 1957, 1972, 1962, + 1969, 2023, 2075, 2066, 2085, 2149, 2139, 2113, + 2166, 2204, 2159, 2145, 2185, 2183, 2164, 2192, + 2207, 2198, 2220, 2226, 2194, 2186, 2185, 2160, + 2127, 2116, 2092, 2018, 1990, 2024, 2011, 1975, + 2015, 2069, 2056, 2051, 2112, 2149, 2131, 2136, + 2165, 2167, 2147, 2143, 2161, 2183, 2178, 2173, + 2217, 2237, 2217, 2227, 2217, 2182, 2153, 2107, + 2080, 2073, 2026, 1969, 1939, 1909, 1879, 1869, + 1888, 1899, 1891, 1904, 1935, 1966, 1995, 2030, + 2069, 2105, 2107, 2085, 2107, 2134, 2109, 2104, + 2149, 2159, 2133, 2156, 2196, 2187, 2184, 2200, + 2191, 2162, 2140, 2110, 2059, 1991, 1940, 1916, + 1882, 1870, 1864, 1831, 1829, 1866, 1889, 1900, + 1928, 1948, 1934, 1917, 1941, 1954, 1934, 1942, + 1953, 1937, 1957, 1998, 2036, 2076, 2104, 2124, + 2126, 2111, 2113, 2116, 2079, 2029, 1992, 1945, + 1883, 1881, 1918, 1894, 1878, 1928, 1936, 1936, + 1997, 2025, 2012, 2037, 2053, 2045, 2058, 2068, + 2078, 2105, 2120, 2110, 2107, 2116, 2123, 2133, + 2150, 2145, 2135, 2139, 2111, 2106, 2141, 2125, + 2099, 2107, 2100, 2097, 2109, 2113, 2126, 2133, + 2135, 2158, 2179, 2177, 2167, 2177, 2189, 2156, + 2127, 2146, 2115, 2068, 2098, 2095, 2055, 2055, + 2064, 2077, 2086, 2096, 2135, 2152, 2148, 2171, + 2176, 2162, 2172, 2168, 2159, 2144, 2126, 2121, + 2095, 2097, 2110, 2083, 2090, 2108, 2094, 2086, + 2083, 2064, 2042, 2027, 2022, 2000, 1986, 1994, + 1989, 1997, 2002, 2004, 2048, 2075, 2066, 2096, + 2114, 2096, 2102, 2113, 2081, 2049, 2051, 2061, + 2039, 2025, 2034, 2017, 2016, 2032, 2055, 2065, + 2063, 2080, 2084, 2063, 2042, 2053, 2030, 1987, + 2002, 1986, 1928, 1937, 1953, 1924, 1937, 1982, + 1985, 1973, 1983, 1989, 1971, 1963, 1975, 1953, + 1915, 1900, 1906, 1928, 1934, 1936, 1935, 1944, + 1964, 1966, 1954, 1945, 1926, 1895, 1876, 1856, + 1826, 1814, 1808, 1791, 1785, 1797, 1802, 1819, + 1840, 1849, 1875, 1900, 1890, 1886, 1908, 1923, + 1913, 1891, 1897, 1915, 1902, 1902, 1923, 1935, + 1960, 1988, 2021, 2066, 2093, 2121, 2153, 2175, + 2204, 2227, 2229, 2241, 2257, 2266, 2270, 2291, + 2314, 2318, 2338, 2362, 2337, 2306, 2310, 2309, + 2272, 2231, 2194, 2176, 2193, 2173, 2148, 2166, + 2180, 2188, 2212, 2244, 2271, 2300, 2316, 2313, + 2346, 2371, 2353, 2356, 2371, 2361, 2340, 2332, + 2340, 2330, 2322, 2329, 2336, 2339, 2331, 2337, + 2354, 2328, 2297, 2297, 2276, 2254, 2251, 2251, + 2267, 2287, 2299, 2312, 2353, 2396, 2393, 2380, + 2388, 2374, 2323, 2274, 2243, 2211, 2164, 2120, + 2103, 2099, 2073, 2055, 2068, 2065, 2049, 2043, + 2037, 2025, 2017, 2011, 2000, 1995, 1992, 1977, + 1967, 1979, 1977, 1955, 1948, 1951, 1946, 1923, + 1905, 1895, 1864, 1815, 1765, 1733, 1683, 1627, + 1593, 1563, 1542, 1544, 1551, 1563, 1590, 1613, + 1631, 1654, 1676, 1692, 1698, 1703, 1716, 1731, + 1743, 1767, 1789, 1802, 1817, 1839, 1859, 1863, + 1856, 1843, 1827, 1801, 1774, 1754, 1727, 1695, + 1677, 1654, 1635, 1635, 1625, 1610, 1618, 1634, + 1634, 1643, 1665, 1681, 1689, 1711, 1726, 1742, + 1774, 1815, 1880, 1951, 2022, 2119, 2197, 2263, + 2363, 2462, 2534, 2609, 2666, 2684, 2710, 2746, + 2766, 2776, 2767, 2757, 2763, 2765, 2770, 2760, + 2731, 2718, 2701, 2673, 2666, 2653, 2622, 2604, + 2616, 2632, 2630, 2655, 2718, 2777, 2832, 2873, + 2915, 2982, 3039, 3059, 3076, 3083, 3031, 2947, + 2886, 2790, 2659, 2541, 2422, 2298, 2187, 2089, + 2012, 1960, 1912, 1862, 1820, 1812, 1835, 1854, + 1884, 1926, 1963, 1992, 2034, 2093, 2133, 2162, + 2205, 2232, 2233, 2245, 2258, 2252, 2247, 2228, + 2184, 2136, 2088, 2040, 1994, 1963, 1932, 1898, + 1889, 1908, 1931, 1964, 2010, 2050, 2083, 2116, + 2151, 2177, 2197, 2209, 2200, 2178, 2150, 2115, + 2066, 2015, 1957, 1883, 1804, 1730, 1654, 1568, + 1487, 1408, 1326, 1253, 1202, 1167, 1145, 1151, + 1180, 1227, 1295, 1377, 1462, 1555, 1648, 1727, + 1796, 1855, 1892, 1913, 1929, 1931, 1916, 1892, + 1856, 1820, 1784, 1738, 1689, 1637, 1584, 1541, + 1504, 1470, 1443, 1431, 1421, 1422, 1454, 1496, + 1546, 1619, 1694, 1765, 1857, 1957, 2043, 2126, + 2187, 2228, 2280, 2307, 2307, 2322, 2309, 2280, + 2262, 2240, 2227, 2237, 2241, 2254, 2279, 2311, + 2352, 2392, 2436, 2473, 2505, 2567, 2638, 2668, + 2697, 2757, 2812, 2856, 2902, 2928, 2945, 2967, + 2985, 2986, 2985, 2982, 2970, 2957, 2932, 2917, + 2937, 2958, 2961, 2977, 3007, 3023, 3065, 3135, + 3154, 3137, 3091, 2996, 2881, 2762, 2607, 2430, + 2270, 2102, 1967, 1888, 1827, 1784, 1774, 1771, + 1771, 1779, 1790, 1792, 1788, 1781, 1776, 1780, + 1798, 1843, 1889, 1941, 2014, 2092, 2170, 2242, + 2299, 2344, 2381, 2408, 2411, 2392, 2350, 2297, + 2244, 2188, 2151, 2119, 2096, 2080, 2086, 2108, + 2139, 2178, 2208, 2221, 2219, 2211, 2187, 2143, + 2087, 2017, 1940, 1863, 1792, 1733, 1681, 1631, + 1583, 1530, 1478, 1435, 1393, 1353, 1316, 1282, + 1257, 1246, 1248, 1269, 1308, 1345, 1390, 1452, + 1515, 1573, 1631, 1676, 1708, 1738, 1755, 1752, + 1740, 1718, 1678, 1636, 1597, 1560, 1527, 1500, + 1476, 1460, 1463, 1478, 1487, 1506, 1540, 1576, + 1612, 1668, 1726, 1786, 1863, 1927, 1999, 2116, + 2199, 2257, 2356, 2424, 2455, 2493, 2514, 2529, + 2536, 2529, 2516, 2496, 2487, 2480, 2468, 2461, + 2452, 2449, 2466, 2501, 2527, 2557, 2594, 2636, + 2682, 2733, 2769, 2807, 2872, 2910, 2921, 2966, + 3030, 3088, 3147, 3185, 3218, 3259, 3314, 3374, + 3388, 3375, 3362, 3368, 3375, 3366, 3338, 3227, + 3059, 2936, 2802, 2623, 2447, 2265, 2083, 1951, + 1873, 1837, 1819, 1812, 1806, 1806, 1824, 1841, + 1851, 1853, 1825, 1786, 1762, 1759, 1778, 1799, + 1811, 1841, 1898, 1971, 2050, 2110, 2151, 2179, + 2195, 2203, 2203, 2192, 2176, 2146, 2138, 2149, + 2172, 2204, 2235, 2273, 2315, 2363, 2418, 2466, + 2496, 2505, 2495, 2469, 2439, 2397, 2321, 2217, + 2109, 2007, 1915, 1837, 1772, 1708, 1649, 1602, + 1566, 1526, 1470, 1398, 1324, 1250, 1186, 1129, + 1086, 1072, 1075, 1104, 1155, 1226, 1311, 1390, + 1462, 1520, 1560, 1586, 1597, 1584, 1562, 1537, + 1500, 1471, 1448, 1423, 1402, 1392, 1403, 1417, + 1436, 1462, 1497, 1531, 1571, 1613, 1654, 1693, + 1722, 1758, 1814, 1873, 1932, 1999, 2068, 2129, + 2200, 2288, 2360, 2394, 2415, 2415, 2392, 2377, + 2356, 2314, 2263, 2220, 2206, 2218, 2251, 2294, + 2337, 2363, 2393, 2438, 2495, 2547, 2566, 2559, + 2562, 2588, 2624, 2666, 2709, 2732, 2741, 2785, + 2857, 2907, 2948, 2987, 3028, 3078, 3140, 3206, + 3255, 3286, 3297, 3318, 3359, 3381, 3376, 3373, + 3353, 3261, 3141, 3049, 2919, 2735, 2553, 2360, + 2188, 2078, 2000, 1936, 1890, 1861, 1845, 1848, + 1861, 1863, 1847, 1832, 1817, 1805, 1799, 1786, + 1774, 1775, 1787, 1792, 1805, 1849, 1912, 1961, + 1996, 2042, 2087, 2111, 2118, 2115, 2101, 2083, + 2073, 2081, 2105, 2128, 2151, 2186, 2238, 2297, + 2350, 2399, 2441, 2474, 2487, 2480, 2458, 2418, + 2344, 2245, 2137, 2031, 1931, 1843, 1758, 1680, + 1623, 1574, 1514, 1466, 1423, 1358, 1288, 1243, + 1198, 1146, 1111, 1103, 1113, 1150, 1195, 1244, + 1311, 1383, 1443, 1495, 1540, 1567, 1569, 1559, + 1540, 1517, 1485, 1447, 1408, 1367, 1337, 1320, + 1311, 1321, 1340, 1356, 1389, 1459, 1526, 1582, + 1659, 1739, 1799, 1864, 1928, 1978, 2035, 2088, + 2126, 2179, 2241, 2284, 2325, 2368, 2389, 2399, + 2414, 2406, 2385, 2367, 2333, 2295, 2294, 2309, + 2314, 2334, 2371, 2399, 2441, 2502, 2553, 2596, + 2635, 2651, 2679, 2731, 2789, 2823, 2844, 2861, + 2884, 2921, 2960, 3004, 3027, 3029, 3057, 3111, + 3181, 3251, 3291, 3320, 3363, 3407, 3433, 3458, + 3475, 3419, 3287, 3161, 3060, 2925, 2788, 2641, + 2459, 2316, 2249, 2211, 2185, 2170, 2134, 2079, + 2044, 2037, 2017, 1964, 1880, 1795, 1725, 1681, + 1658, 1653, 1655, 1661, 1694, 1754, 1843, 1947, + 2015, 2054, 2081, 2102, 2127, 2137, 2118, 2081, + 2049, 2039, 2058, 2094, 2124, 2144, 2165, 2204, + 2265, 2332, 2388, 2414, 2420, 2416, 2411, 2405, + 2381, 2315, 2216, 2133, 2069, 2004, 1955, 1909, + 1847, 1795, 1757, 1709, 1660, 1607, 1516, 1410, + 1330, 1252, 1168, 1113, 1080, 1063, 1082, 1126, + 1180, 1255, 1338, 1398, 1449, 1496, 1523, 1519, + 1495, 1465, 1438, 1404, 1357, 1317, 1292, 1272, + 1262, 1270, 1293, 1314, 1343, 1394, 1447, 1498, + 1554, 1607, 1645, 1702, 1762, 1800, 1846, 1912, + 1975, 2039, 2110, 2189, 2264, 2336, 2396, 2435, + 2467, 2473, 2457, 2433, 2402, 2364, 2333, 2317, + 2315, 2329, 2356, 2391, 2441, 2503, 2557, 2593, + 2632, 2678, 2718, 2738, 2745, 2762, 2784, 2803, + 2835, 2876, 2895, 2927, 2997, 3046, 3098, 3186, + 3242, 3273, 3344, 3410, 3434, 3453, 3465, 3456, + 3444, 3411, 3316, 3201, 3100, 2979, 2842, 2716, + 2594, 2480, 2382, 2314, 2287, 2267, 2228, 2179, + 2143, 2119, 2086, 2047, 2013, 1979, 1939, 1893, + 1847, 1832, 1837, 1824, 1802, 1801, 1828, 1864, + 1900, 1931, 1955, 1974, 1982, 1989, 1997, 2002, + 1990, 1983, 2001, 2040, 2081, 2108, 2145, 2201, + 2261, 2317, 2368, 2413, 2445, 2458, 2460, 2458, + 2449, 2422, 2357, 2270, 2201, 2148, 2088, 2020, + 1948, 1869, 1802, 1737, 1670, 1617, 1554, 1464, + 1386, 1338, 1296, 1250, 1212, 1189, 1191, 1213, + 1236, 1271, 1320, 1364, 1392, 1423, 1454, 1468, + 1455, 1429, 1400, 1373, 1340, 1305, 1263, 1234, + 1211, 1192, 1197, 1219, 1242, 1268, 1303, 1353, + 1421, 1491, 1555, 1618, 1679, 1757, 1830, 1879, + 1944, 2019, 2070, 2119, 2181, 2235, 2279, 2319, + 2346, 2361, 2380, 2383, 2365, 2357, 2355, 2347, + 2335, 2344, 2368, 2396, 2431, 2472, 2520, 2574, + 2619, 2666, 2725, 2772, 2805, 2838, 2875, 2914, + 2949, 2979, 3001, 3024, 3055, 3082, 3106, 3134, + 3177, 3221, 3258, 3312, 3367, 3408, 3456, 3495, + 3502, 3481, 3419, 3321, 3218, 3105, 2971, 2827, + 2692, 2583, 2498, 2440, 2404, 2379, 2350, 2316, + 2286, 2255, 2220, 2176, 2115, 2057, 1997, 1929, + 1867, 1819, 1781, 1752, 1726, 1714, 1726, 1754, + 1793, 1837, 1879, 1922, 1953, 1968, 1976, 1982, + 1979, 1967, 1966, 1976, 1985, 1999, 2030, 2074, + 2130, 2188, 2247, 2309, 2355, 2385, 2403, 2412, + 2403, 2378, 2338, 2284, 2218, 2152, 2109, 2076, + 2025, 1959, 1898, 1840, 1775, 1715, 1658, 1580, + 1500, 1425, 1356, 1307, 1269, 1221, 1177, 1165, + 1162, 1160, 1184, 1220, 1250, 1276, 1309, 1337, + 1359, 1372, 1375, 1364, 1345, 1319, 1288, 1252, + 1217, 1188, 1163, 1152, 1157, 1178, 1204, 1244, + 1288, 1344, 1407, 1466, 1524, 1589, 1649, 1710, + 1771, 1834, 1901, 1960, 2014, 2073, 2125, 2176, + 2223, 2261, 2295, 2329, 2348, 2362, 2376, 2384, + 2391, 2403, 2417, 2418, 2421, 2439, 2465, 2501, + 2540, 2581, 2624, 2676, 2722, 2765, 2824, 2870, + 2891, 2916, 2943, 2961, 2993, 3028, 3063, 3097, + 3136, 3183, 3238, 3300, 3345, 3372, 3400, 3428, + 3440, 3420, 3379, 3313, 3222, 3138, 3059, 2955, + 2843, 2738, 2634, 2561, 2514, 2465, 2418, 2379, + 2338, 2299, 2283, 2268, 2230, 2181, 2127, 2056, + 1974, 1906, 1857, 1802, 1741, 1704, 1690, 1699, + 1727, 1761, 1793, 1825, 1850, 1868, 1881, 1891, + 1887, 1875, 1873, 1881, 1885, 1895, 1920, 1950, + 1988, 2035, 2085, 2133, 2175, 2214, 2248, 2264, + 2275, 2286, 2280, 2258, 2233, 2198, 2148, 2109, + 2083, 2027, 1964, 1908, 1840, 1773, 1732, 1686, + 1620, 1566, 1512, 1443, 1392, 1359, 1301, 1247, + 1218, 1187, 1163, 1171, 1189, 1205, 1224, 1252, + 1279, 1300, 1323, 1338, 1335, 1319, 1303, 1288, + 1265, 1238, 1213, 1189, 1181, 1186, 1187, 1195, + 1223, 1250, 1283, 1334, 1388, 1436, 1500, 1563, + 1619, 1679, 1740, 1802, 1859, 1914, 1962, 2008, + 2057, 2107, 2156, 2209, 2258, 2293, 2321, 2359, + 2388, 2407, 2427, 2442, 2446, 2445, 2452, 2471, + 2494, 2516, 2543, 2579, 2620, 2666, 2717, 2769, + 2816, 2854, 2889, 2933, 2971, 3001, 3042, 3079, + 3106, 3147, 3185, 3217, 3254, 3285, 3299, 3323, + 3344, 3334, 3313, 3300, 3253, 3184, 3133, 3067, + 2976, 2893, 2808, 2725, 2666, 2615, 2555, 2509, + 2470, 2425, 2393, 2374, 2345, 2315, 2282, 2231, + 2180, 2124, 2060, 2004, 1955, 1900, 1851, 1821, + 1799, 1792, 1804, 1815, 1827, 1841, 1848, 1860, + 1876, 1881, 1882, 1888, 1893, 1893, 1898, 1914, + 1932, 1951, 1980, 2011, 2047, 2082, 2116, 2147, + 2170, 2184, 2199, 2208, 2201, 2187, 2157, 2122, + 2101, 2066, 2014, 1960, 1903, 1839, 1794, 1760, + 1711, 1669, 1632, 1587, 1555, 1537, 1503, 1467, + 1444, 1412, 1372, 1358, 1353, 1341, 1344, 1350, + 1354, 1363, 1384, 1393, 1401, 1402, 1397, 1393, + 1383, 1358, 1334, 1310, 1288, 1273, 1266, 1266, + 1268, 1275, 1299, 1334, 1370, 1415, 1467, 1515, + 1564, 1620, 1676, 1722, 1775, 1825, 1861, 1903, + 1945, 1981, 2024, 2073, 2109, 2143, 2190, 2241, + 2276, 2320, 2372, 2402, 2426, 2457, 2481, 2498, + 2521, 2544, 2563, 2584, 2603, 2629, 2662, 2696, + 2729, 2758, 2785, 2808, 2839, 2876, 2907, 2936, + 2972, 3010, 3045, 3083, 3121, 3150, 3175, 3200, + 3217, 3234, 3245, 3238, 3220, 3201, 3178, 3145, + 3107, 3061, 3001, 2936, 2877, 2827, 2774, 2718, + 2665, 2610, 2561, 2522, 2484, 2447, 2410, 2366, + 2317, 2266, 2210, 2155, 2110, 2059, 2010, 1968, + 1935, 1910, 1905, 1903, 1896, 1898, 1906, 1903, + 1903, 1912, 1912, 1910, 1919, 1926, 1926, 1927, + 1937, 1948, 1952, 1965, 1980, 1986, 2000, 2015, + 2021, 2031, 2046, 2058, 2061, 2059, 2048, 2036, + 2025, 2005, 1976, 1943, 1905, 1860, 1823, 1798, + 1772, 1745, 1719, 1685, 1659, 1644, 1621, 1597, + 1580, 1550, 1511, 1484, 1466, 1451, 1450, 1453, + 1443, 1434, 1441, 1454, 1460, 1458, 1453, 1445, + 1434, 1423, 1406, 1386, 1371, 1360, 1343, 1334, + 1335, 1333, 1336, 1350, 1370, 1394, 1429, 1471, + 1509, 1546, 1585, 1641, 1696, 1740, 1781, 1824, + 1865, 1905, 1950, 1988, 2018, 2056, 2093, 2130, + 2176, 2220, 2252, 2289, 2337, 2370, 2389, 2427, + 2464, 2479, 2504, 2542, 2566, 2591, 2627, 2654, + 2677, 2712, 2753, 2788, 2812, 2841, 2886, 2932, + 2976, 3012, 3042, 3078, 3118, 3143, 3160, 3180, + 3197, 3204, 3206, 3206, 3202, 3195, 3183, 3166, + 3140, 3105, 3074, 3045, 3003, 2952, 2903, 2859, + 2823, 2780, 2725, 2682, 2646, 2608, 2573, 2532, + 2486, 2443, 2399, 2342, 2287, 2244, 2199, 2152, + 2109, 2065, 2033, 2022, 2002, 1975, 1960, 1952, + 1938, 1935, 1934, 1928, 1921, 1922, 1924, 1924, + 1933, 1944, 1947, 1958, 1973, 1981, 1985, 1992, + 2002, 2004, 2004, 2013, 2020, 2019, 2009, 1999, + 1993, 1984, 1969, 1945, 1904, 1864, 1831, 1797, + 1768, 1741, 1709, 1678, 1655, 1641, 1628, 1613, + 1605, 1595, 1572, 1557, 1554, 1547, 1537, 1535, + 1531, 1522, 1520, 1525, 1520, 1512, 1509, 1497, + 1480, 1465, 1446, 1427, 1406, 1392, 1378, 1364, + 1360, 1354, 1347, 1355, 1374, 1390, 1413, 1439, + 1471, 1510, 1558, 1606, 1657, 1707, 1748, 1791, + 1834, 1869, 1906, 1940, 1965, 1998, 2029, 2063, + 2099, 2138, 2175, 2211, 2250, 2283, 2310, 2340, + 2370, 2396, 2422, 2455, 2477, 2504, 2533, 2565, + 2596, 2632, 2667, 2695, 2730, 2768, 2806, 2845, + 2889, 2920, 2951, 2991, 3035, 3069, 3094, 3113, + 3129, 3141, 3149, 3150, 3145, 3139, 3127, 3111, + 3102, 3091, 3065, 3039, 3017, 2982, 2948, 2918, + 2886, 2846, 2807, 2770, 2729, 2696, 2669, 2632, + 2587, 2544, 2495, 2441, 2389, 2344, 2289, 2232, + 2189, 2143, 2101, 2072, 2048, 2023, 2002, 1987, + 1970, 1954, 1949, 1935, 1922, 1923, 1914, 1906, + 1911, 1919, 1927, 1936, 1946, 1950, 1955, 1959, + 1959, 1950, 1942, 1930, 1922, 1916, 1905, 1889, + 1879, 1871, 1854, 1836, 1807, 1772, 1738, 1707, + 1679, 1653, 1632, 1608, 1582, 1569, 1559, 1542, + 1534, 1531, 1515, 1497, 1492, 1487, 1482, 1485, + 1487, 1481, 1478, 1482, 1484, 1479, 1473, 1458, + 1437, 1416, 1395, 1372, 1348, 1332, 1317, 1303, + 1295, 1293, 1294, 1301, 1313, 1328, 1347, 1367, + 1390, 1421, 1458, 1496, 1534, 1576, 1621, 1660, + 1696, 1734, 1765, 1797, 1829, 1853, 1877, 1910, + 1939, 1970, 2010, 2049, 2077, 2111, 2144, 2166, + 2196, 2231, 2253, 2281, 2309, 2331, 2361, 2403, + 2436, 2469, 2507, 2536, 2567, 2600, 2636, 2673, + 2707, 2743, 2776, 2812, 2856, 2893, 2921, 2950, + 2976, 2994, 3003, 3010, 3014, 3014, 3015, 3013, + 3005, 2999, 2989, 2978, 2966, 2953, 2939, 2915, + 2891, 2861, 2835, 2809, 2781, 2758, 2734, 2705, + 2666, 2628, 2588, 2532, 2478, 2426, 2371, 2312, + 2257, 2206, 2159, 2124, 2094, 2064, 2034, 2016, + 1990, 1973, 1967, 1947, 1929, 1921, 1907, 1890, + 1888, 1892, 1893, 1897, 1902, 1908, 1907, 1908, + 1906, 1893, 1879, 1864, 1849, 1830, 1814, 1803, + 1789, 1775, 1765, 1748, 1722, 1693, 1662, 1629, + 1597, 1568, 1539, 1512, 1496, 1481, 1467, 1458, + 1452, 1437, 1425, 1412, 1399, 1390, 1389, 1391, + 1394, 1392, 1394, 1404, 1406, 1410, 1411, 1403, + 1383, 1364, 1345, 1318, 1294, 1276, 1257, 1238, + 1231, 1226, 1222, 1227, 1234, 1240, 1255, 1274, + 1291, 1314, 1346, 1384, 1420, 1460, 1504, 1544, + 1583, 1622, 1651, 1679, 1707, 1733, 1750, 1773, + 1802, 1829, 1857, 1892, 1927, 1955, 1985, 2014, + 2040, 2061, 2090, 2114, 2132, 2160, 2194, 2226, + 2265, 2306, 2346, 2383, 2419, 2459, 2497, 2534, + 2571, 2603, 2633, 2671, 2709, 2742, 2778, 2811, + 2836, 2864, 2886, 2902, 2915, 2925, 2924, 2932, + 2938, 2943, 2943, 2944, 2945, 2942, 2941, 2935, + 2923, 2914, 2897, 2878, 2861, 2840, 2818, 2800, + 2779, 2755, 2726, 2693, 2651, 2602, 2556, 2504, + 2453, 2399, 2341, 2291, 2243, 2208, 2172, 2138, + 2111, 2082, 2053, 2035, 2022, 2002, 1987, 1977, + 1958, 1944, 1939, 1934, 1931, 1932, 1934, 1930, + 1928, 1925, 1916, 1898, 1883, 1861, 1839, 1824, + 1810, 1800, 1787, 1775, 1762, 1741, 1714, 1682, + 1650, 1616, 1578, 1545, 1514, 1482, 1464, 1449, + 1430, 1420, 1414, 1396, 1380, 1373, 1367, 1355, + 1352, 1349, 1345, 1346, 1352, 1360, 1362, 1365, + 1366, 1355, 1341, 1332, 1317, 1294, 1277, 1255, + 1233, 1221, 1215, 1209, 1208, 1212, 1212, 1219, + 1233, 1250, 1270, 1293, 1319, 1353, 1388, 1425, + 1469, 1515, 1552, 1580, 1612, 1636, 1655, 1678, + 1698, 1712, 1734, 1769, 1789, 1813, 1848, 1878, + 1901, 1929, 1952, 1969, 1991, 2013, 2035, 2059, + 2092, 2123, 2156, 2192, 2233, 2275, 2314, 2360, + 2404, 2440, 2479, 2518, 2555, 2595, 2632, 2669, + 2705, 2739, 2766, 2794, 2818, 2836, 2861, 2881, + 2889, 2901, 2915, 2929, 2946, 2966, 2973, 2975, + 2988, 2990, 2982, 2985, 2976, 2953, 2937, 2926, + 2910, 2889, 2876, 2858, 2831, 2800, 2767, 2722, + 2670, 2624, 2575, 2517, 2462, 2414, 2361, 2314, + 2276, 2243, 2208, 2180, 2156, 2125, 2099, 2085, + 2068, 2051, 2041, 2029, 2015, 2008, 2007, 2011, + 2013, 2010, 2007, 1996, 1985, 1972, 1958, 1933, + 1908, 1892, 1873, 1855, 1845, 1836, 1821, 1807, + 1790, 1762, 1733, 1706, 1674, 1638, 1604, 1576, + 1547, 1521, 1503, 1483, 1462, 1449, 1431, 1410, + 1396, 1383, 1366, 1360, 1355, 1346, 1343, 1343, + 1343, 1343, 1342, 1340, 1334, 1323, 1311, 1297, + 1283, 1268, 1251, 1236, 1220, 1209, 1204, 1200, + 1201, 1202, 1208, 1215, 1227, 1244, 1262, 1287, + 1318, 1352, 1385, 1424, 1459, 1490, 1522, 1554, + 1578, 1598, 1620, 1637, 1656, 1680, 1711, 1740, + 1764, 1797, 1826, 1854, 1884, 1916, 1945, 1967, + 1994, 2019, 2044, 2074, 2108, 2145, 2178, 2217, + 2253, 2294, 2334, 2374, 2419, 2463, 2506, 2552, + 2594, 2640, 2681, 2717, 2756, 2793, 2820, 2849, + 2878, 2903, 2924, 2948, 2968, 2982, 3009, 3030, + 3045, 3064, 3082, 3095, 3100, 3105, 3103, 3093, + 3089, 3073, 3057, 3045, 3028, 3009, 2985, 2956, + 2922, 2881, 2833, 2776, 2716, 2661, 2599, 2537, + 2483, 2428, 2378, 2336, 2295, 2260, 2229, 2206, + 2178, 2153, 2136, 2116, 2102, 2092, 2084, 2069, + 2061, 2058, 2057, 2055, 2056, 2054, 2046, 2036, + 2025, 2008, 1990, 1969, 1946, 1923, 1903, 1888, + 1873, 1860, 1852, 1833, 1811, 1788, 1760, 1735, + 1711, 1686, 1662, 1634, 1608, 1593, 1569, 1541, + 1518, 1491, 1454, 1426, 1406, 1382, 1369, 1364, + 1347, 1326, 1324, 1318, 1307, 1298, 1290, 1277, + 1261, 1252, 1242, 1229, 1219, 1211, 1195, 1178, + 1171, 1163, 1149, 1145, 1145, 1137, 1139, 1149, + 1159, 1173, 1191, 1215, 1239, 1265, 1293, 1321, + 1353, 1382, 1414, 1446, 1469, 1497, 1524, 1551, + 1583, 1614, 1642, 1665, 1697, 1727, 1753, 1787, + 1818, 1840, 1868, 1896, 1921, 1948, 1980, 2009, + 2040, 2077, 2113, 2149, 2187, 2226, 2267, 2309, + 2357, 2405, 2452, 2501, 2549, 2596, 2644, 2685, + 2722, 2759, 2797, 2831, 2863, 2900, 2934, 2958, + 2993, 3021, 3042, 3068, 3094, 3116, 3134, 3152, + 3165, 3173, 3181, 3180, 3173, 3164, 3154, 3139, + 3123, 3103, 3075, 3049, 3014, 2979, 2933, 2869, + 2798, 2732, 2669, 2597, 2532, 2466, 2396, 2341, + 2299, 2259, 2228, 2201, 2176, 2148, 2125, 2107, + 2094, 2082, 2076, 2066, 2044, 2034, 2033, 2031, + 2033, 2038, 2032, 2023, 2020, 2010, 1995, 1976, + 1956, 1932, 1907, 1887, 1870, 1854, 1843, 1834, + 1811, 1788, 1770, 1748, 1728, 1712, 1700, 1684, + 1667, 1652, 1636, 1615, 1592, 1569, 1534, 1489, + 1447, 1408, 1380, 1354, 1328, 1301, 1280, 1260, + 1242, 1231, 1219, 1201, 1179, 1159, 1137, 1121, + 1108, 1095, 1087, 1077, 1069, 1064, 1058, 1055, + 1057, 1054, 1051, 1059, 1064, 1070, 1081, 1096, + 1113, 1134, 1158, 1179, 1200, 1218, 1240, 1267, + 1293, 1322, 1349, 1373, 1409, 1452, 1491, 1529, + 1570, 1605, 1632, 1663, 1693, 1718, 1749, 1780, + 1799, 1822, 1858, 1896, 1928, 1963, 2001, 2033, + 2066, 2107, 2141, 2177, 2223, 2264, 2301, 2351, + 2400, 2449, 2498, 2546, 2593, 2636, 2683, 2730, + 2769, 2810, 2858, 2901, 2939, 2986, 3032, 3065, + 3101, 3137, 3164, 3193, 3219, 3236, 3257, 3273, + 3275, 3276, 3281, 3273, 3258, 3247, 3225, 3201, + 3173, 3143, 3108, 3061, 3009, 2947, 2872, 2788, + 2704, 2627, 2545, 2457, 2380, 2310, 2243, 2191, + 2156, 2123, 2094, 2072, 2046, 2025, 2014, 2002, + 1984, 1972, 1967, 1955, 1950, 1958, 1961, 1965, + 1970, 1975, 1972, 1964, 1960, 1943, 1920, 1898, + 1872, 1844, 1816, 1799, 1781, 1767, 1757, 1748, + 1733, 1716, 1706, 1700, 1701, 1704, 1706, 1710, + 1710, 1702, 1692, 1675, 1648, 1616, 1578, 1536, + 1492, 1453, 1411, 1382, 1356, 1321, 1289, 1266, + 1241, 1208, 1179, 1152, 1115, 1085, 1062, 1038, + 1020, 1006, 997, 994, 988, 987, 986, 993, + 998, 1002, 1012, 1021, 1036, 1049, 1060, 1076, + 1091, 1109, 1128, 1149, 1166, 1179, 1193, 1215, + 1245, 1276, 1307, 1339, 1374, 1413, 1456, 1500, + 1540, 1574, 1602, 1635, 1670, 1709, 1747, 1783, + 1820, 1860, 1899, 1941, 1988, 2035, 2076, 2112, + 2146, 2181, 2215, 2252, 2287, 2320, 2360, 2401, + 2450, 2498, 2546, 2597, 2649, 2697, 2747, 2800, + 2851, 2901, 2953, 3010, 3057, 3100, 3144, 3182, + 3221, 3265, 3301, 3327, 3359, 3385, 3406, 3427, + 3442, 3454, 3457, 3447, 3431, 3412, 3385, 3351, + 3320, 3284, 3234, 3187, 3136, 3076, 3012, 2935, + 2845, 2749, 2654, 2562, 2465, 2374, 2289, 2216, + 2153, 2100, 2059, 2020, 1990, 1968, 1946, 1926, + 1911, 1899, 1891, 1889, 1887, 1887, 1894, 1902, + 1915, 1926, 1932, 1937, 1932, 1922, 1911, 1893, + 1876, 1861, 1845, 1827, 1808, 1794, 1784, 1779, + 1776, 1762, 1745, 1734, 1725, 1730, 1743, 1757, + 1771, 1783, 1787, 1790, 1792, 1781, 1756, 1720, + 1674, 1624, 1580, 1541, 1498, 1459, 1422, 1384, + 1352, 1326, 1281, 1230, 1189, 1144, 1086, 1040, + 1005, 966, 939, 923, 915, 908, 911, 917, + 919, 922, 931, 944, 948, 952, 961, 972, + 981, 1004, 1031, 1046, 1060, 1074, 1088, 1104, + 1126, 1151, 1174, 1203, 1239, 1279, 1322, 1376, + 1421, 1457, 1494, 1528, 1559, 1586, 1625, 1665, + 1702, 1747, 1794, 1851, 1909, 1968, 2021, 2064, + 2103, 2136, 2169, 2198, 2223, 2252, 2281, 2316, + 2356, 2398, 2446, 2496, 2543, 2593, 2645, 2697, + 2748, 2803, 2862, 2919, 2979, 3036, 3090, 3140, + 3185, 3221, 3251, 3278, 3300, 3323, 3348, 3375, + 3398, 3422, 3441, 3464, 3489, 3504, 3505, 3499, + 3489, 3467, 3440, 3414, 3375, 3335, 3309, 3270, + 3221, 3180, 3122, 3038, 2947, 2844, 2737, 2623, + 2503, 2388, 2277, 2176, 2098, 2039, 1989, 1943, + 1901, 1864, 1828, 1809, 1791, 1762, 1748, 1749, + 1745, 1753, 1780, 1804, 1828, 1854, 1876, 1889, + 1902, 1911, 1910, 1896, 1888, 1889, 1886, 1879, + 1876, 1875, 1866, 1859, 1857, 1841, 1817, 1795, + 1771, 1753, 1754, 1763, 1769, 1785, 1813, 1843, + 1868, 1885, 1883, 1853, 1819, 1786, 1750, 1709, + 1667, 1624, 1580, 1548, 1525, 1496, 1462, 1419, + 1361, 1298, 1228, 1154, 1083, 1016, 951, 889, + 843, 808, 789, 778, 772, 776, 785, 797, + 812, 830, 841, 858, 880, 893, 912, 938, + 960, 985, 1021, 1052, 1081, 1115, 1145, 1182, + 1227, 1268, 1313, 1356, 1390, 1424, 1460, 1487, + 1507, 1530, 1547, 1561, 1586, 1620, 1659, 1709, + 1764, 1823, 1885, 1945, 1994, 2039, 2079, 2113, + 2138, 2162, 2190, 2211, 2237, 2270, 2316, 2368, + 2419, 2473, 2530, 2584, 2638, 2705, 2766, 2821, + 2877, 2941, 2995, 3046, 3103, 3157, 3202, 3240, + 3280, 3322, 3364, 3401, 3433, 3476, 3516, 3548, + 3588, 3630, 3656, 3656, 3652, 3650, 3629, 3599, + 3563, 3524, 3479, 3434, 3398, 3367, 3334, 3294, + 3252, 3205, 3128, 3029, 2911, 2771, 2633, 2492, + 2352, 2209, 2076, 1972, 1887, 1824, 1787, 1752, + 1719, 1689, 1660, 1634, 1620, 1605, 1591, 1586, + 1588, 1592, 1610, 1642, 1675, 1703, 1733, 1762, + 1787, 1819, 1843, 1856, 1865, 1872, 1877, 1878, + 1867, 1854, 1840, 1821, 1804, 1786, 1765, 1743, + 1726, 1723, 1741, 1769, 1793, 1828, 1861, 1902, + 1944, 1976, 1994, 2000, 1988, 1959, 1929, 1908, + 1883, 1843, 1800, 1754, 1711, 1658, 1596, 1535, + 1455, 1354, 1259, 1171, 1075, 977, 877, 780, + 701, 638, 580, 545, 531, 516, 513, 548, + 590, 623, 669, 724, 767, 808, 859, 898, + 925, 951, 978, 1007, 1033, 1070, 1111, 1141, + 1169, 1209, 1251, 1287, 1318, 1342, 1356, 1376, + 1397, 1415, 1431, 1450, 1475, 1504, 1544, 1595, + 1645, 1687, 1739, 1799, 1853, 1903, 1953, 1994, + 2023, 2052, 2082, 2102, 2123, 2147, 2168, 2184, + 2213, 2256, 2294, 2331, 2382, 2434, 2480, 2536, + 2592, 2645, 2699, 2760, 2820, 2878, 2951, 3015, + 3072, 3132, 3193, 3263, 3327, 3380, 3423, 3474, + 3526, 3562, 3598, 3642, 3672, 3691, 3711, 3728, + 3735, 3723, 3700, 3678, 3657, 3608, 3548, 3499, + 3457, 3382, 3313, 3273, 3208, 3142, 3075, 2959, + 2817, 2667, 2519, 2370, 2221, 2069, 1919, 1806, + 1717, 1645, 1604, 1570, 1528, 1489, 1456, 1427, + 1402, 1369, 1344, 1348, 1363, 1373, 1404, 1457, + 1507, 1553, 1606, 1660, 1709, 1755, 1788, 1814, + 1831, 1842, 1851, 1841, 1823, 1812, 1799, 1787, + 1788, 1790, 1774, 1756, 1750, 1751, 1765, 1798, + 1819, 1836, 1865, 1907, 1947, 1986, 2017, 2027, + 2025, 2025, 2033, 2050, 2070, 2073, 2068, 2054, + 2022, 1971, 1907, 1814, 1695, 1575, 1452, 1322, + 1207, 1104, 999, 907, 833, 756, 684, 625, + 552, 482, 446, 421, 396, 394, 417, 445, + 486, 556, 636, 709, 784, 863, 927, 986, + 1044, 1096, 1138, 1182, 1228, 1277, 1328, 1379, + 1423, 1452, 1474, 1484, 1485, 1486, 1495, 1510, + 1525, 1544, 1574, 1609, 1638, 1671, 1709, 1738, + 1758, 1777, 1800, 1826, 1856, 1892, 1932, 1975, + 2014, 2050, 2083, 2116, 2140, 2148, 2151, 2157, + 2161, 2170, 2187, 2210, 2240, 2284, 2344, 2409, + 2477, 2550, 2624, 2702, 2778, 2854, 2938, 3026, + 3115, 3202, 3281, 3353, 3429, 3507, 3561, 3601, + 3650, 3683, 3706, 3747, 3797, 3830, 3873, 3924, + 3949, 3972, 3978, 3955, 3922, 3887, 3821, 3732, + 3655, 3579, 3479, 3401, 3352, 3285, 3209, 3141, + 3040, 2876, 2688, 2517, 2355, 2168, 1979, 1819, + 1679, 1564, 1495, 1459, 1424, 1386, 1344, 1301, + 1274, 1256, 1223, 1201, 1210, 1236, 1261, 1312, + 1384, 1449, 1511, 1577, 1641, 1695, 1750, 1801, + 1834, 1853, 1880, 1912, 1919, 1911, 1910, 1906, + 1897, 1903, 1903, 1884, 1856, 1834, 1824, 1842, + 1887, 1927, 1954, 1992, 2046, 2096, 2142, 2177, + 2194, 2185, 2167, 2166, 2186, 2213, 2246, 2277, + 2306, 2334, 2333, 2288, 2207, 2101, 1966, 1800, + 1634, 1475, 1312, 1164, 1042, 941, 857, 784, + 716, 654, 599, 541, 481, 435, 405, 384, + 379, 399, 446, 520, 616, 713, 806, 898, + 986, 1072, 1150, 1217, 1280, 1331, 1368, 1404, + 1442, 1478, 1507, 1520, 1518, 1506, 1489, 1474, + 1482, 1505, 1526, 1549, 1577, 1614, 1655, 1687, + 1707, 1719, 1719, 1711, 1715, 1727, 1744, 1767, + 1803, 1848, 1899, 1953, 1994, 2024, 2043, 2045, + 2035, 2020, 2002, 1986, 1975, 1971, 1987, 2018, + 2059, 2111, 2166, 2228, 2299, 2377, 2464, 2553, + 2637, 2724, 2814, 2914, 3028, 3140, 3240, 3332, + 3412, 3474, 3542, 3616, 3671, 3720, 3764, 3805, + 3855, 3908, 3953, 3986, 4025, 4042, 4044, 4048, + 4038, 3998, 3961, 3927, 3885, 3828, 3774, 3712, + 3639, 3573, 3491, 3406, 3320, 3221, 3102, 2943, + 2742, 2530, 2346, 2173, 1982, 1799, 1648, 1520, + 1422, 1366, 1330, 1297, 1248, 1199, 1170, 1160, + 1130, 1098, 1100, 1128, 1156, 1198, 1264, 1342, + 1427, 1518, 1601, 1680, 1763, 1838, 1889, 1930, + 1965, 1996, 2010, 2003, 1990, 1980, 1974, 1977, + 1988, 1997, 1998, 1992, 1984, 2002, 2047, 2085, + 2102, 2124, 2152, 2181, 2216, 2246, 2262, 2268, + 2263, 2275, 2302, 2335, 2376, 2413, 2447, 2483, + 2511, 2513, 2494, 2446, 2364, 2246, 2118, 1985, + 1833, 1679, 1530, 1383, 1250, 1135, 1038, 947, + 858, 776, 700, 640, 579, 518, 464, 420, + 396, 395, 421, 465, 520, 577, 648, 746, + 848, 938, 1029, 1115, 1188, 1256, 1322, 1372, + 1413, 1441, 1448, 1443, 1450, 1461, 1469, 1480, + 1500, 1528, 1562, 1606, 1649, 1675, 1692, 1699, + 1687, 1682, 1680, 1671, 1665, 1675, 1693, 1724, + 1764, 1809, 1853, 1888, 1915, 1933, 1945, 1947, + 1929, 1901, 1866, 1838, 1823, 1814, 1817, 1829, + 1846, 1875, 1915, 1969, 2030, 2093, 2161, 2232, + 2308, 2389, 2471, 2554, 2644, 2731, 2823, 2918, + 3032, 3147, 3228, 3317, 3411, 3490, 3582, 3674, + 3736, 3781, 3821, 3846, 3882, 3932, 3947, 3947, + 3976, 4000, 4013, 4047, 4080, 4083, 4083, 4079, + 4052, 4025, 3978, 3903, 3825, 3745, 3646, 3543, + 3457, 3355, 3229, 3081, 2872, 2637, 2440, 2233, + 2004, 1804, 1624, 1462, 1332, 1234, 1156, 1091, + 1036, 971, 913, 884, 848, 800, 797, 850, + 917, 990, 1081, 1192, 1306, 1426, 1536, 1625, + 1715, 1785, 1832, 1867, 1904, 1953, 1978, 1982, + 1993, 2014, 2031, 2047, 2067, 2072, 2064, 2041, + 2013, 2008, 2027, 2043, 2045, 2054, 2088, 2131, + 2168, 2198, 2230, 2248, 2259, 2287, 2329, 2375, + 2421, 2470, 2517, 2569, 2613, 2619, 2593, 2547, + 2484, 2404, 2326, 2256, 2172, 2065, 1941, 1812, + 1679, 1549, 1416, 1271, 1127, 994, 860, 747, + 663, 577, 491, 424, 376, 356, 342, 336, + 334, 347, 378, 429, 509, 594, 677, 766, + 867, 969, 1064, 1145, 1220, 1288, 1342, 1389, + 1428, 1461, 1481, 1503, 1528, 1554, 1589, 1622, + 1627, 1615, 1602, 1584, 1577, 1569, 1559, 1560, + 1566, 1571, 1585, 1614, 1640, 1660, 1670, 1685, + 1706, 1720, 1723, 1727, 1731, 1736, 1740, 1743, + 1747, 1745, 1731, 1709, 1690, 1678, 1671, 1667, + 1676, 1700, 1740, 1787, 1841, 1903, 1965, 2033, + 2109, 2189, 2267, 2352, 2441, 2527, 2626, 2743, + 2857, 2965, 3071, 3173, 3259, 3334, 3404, 3461, + 3530, 3603, 3653, 3704, 3752, 3795, 3834, 3883, + 3935, 3970, 4002, 4038, 4052, 4058, 4075, 4095, + 4094, 4084, 4076, 4046, 4017, 3989, 3933, 3855, + 3773, 3674, 3558, 3452, 3351, 3209, 3023, 2797, + 2555, 2342, 2122, 1878, 1665, 1482, 1308, 1166, + 1067, 979, 909, 855, 779, 731, 714, 658, + 615, 635, 679, 744, 832, 920, 1027, 1152, + 1272, 1387, 1507, 1618, 1709, 1767, 1810, 1867, + 1929, 1956, 1961, 1974, 1984, 1992, 2018, 2034, + 2038, 2044, 2024, 2000, 2018, 2051, 2063, 2059, + 2067, 2090, 2128, 2158, 2185, 2209, 2224, 2237, + 2277, 2334, 2395, 2452, 2504, 2562, 2627, 2677, + 2694, 2677, 2632, 2570, 2504, 2446, 2397, 2332, + 2259, 2182, 2109, 2034, 1951, 1852, 1732, 1593, + 1437, 1291, 1167, 1047, 926, 810, 706, 632, + 577, 522, 487, 465, 427, 397, 412, 435, + 454, 488, 532, 593, 675, 760, 828, 903, + 980, 1041, 1108, 1181, 1249, 1306, 1354, 1402, + 1465, 1533, 1578, 1605, 1614, 1611, 1609, 1603, + 1592, 1592, 1597, 1588, 1594, 1620, 1651, 1686, + 1702, 1700, 1696, 1700, 1695, 1694, 1695, 1690, + 1693, 1699, 1717, 1743, 1753, 1754, 1754, 1751, + 1742, 1731, 1719, 1702, 1688, 1687, 1693, 1706, + 1723, 1741, 1767, 1803, 1851, 1905, 1964, 2034, + 2106, 2183, 2272, 2373, 2471, 2564, 2660, 2756, + 2847, 2947, 3037, 3120, 3209, 3289, 3362, 3432, + 3508, 3576, 3621, 3668, 3712, 3749, 3784, 3803, + 3821, 3862, 3892, 3900, 3928, 3973, 3988, 4005, + 4037, 4047, 4036, 4022, 3988, 3946, 3912, 3858, + 3784, 3710, 3633, 3546, 3446, 3344, 3221, 3046, + 2803, 2566, 2353, 2113, 1878, 1678, 1481, 1308, + 1191, 1088, 989, 921, 837, 727, 653, 596, + 519, 479, 498, 538, 606, 699, 799, 919, + 1049, 1174, 1286, 1387, 1485, 1579, 1642, 1695, + 1788, 1878, 1921, 1960, 2014, 2042, 2065, 2100, + 2117, 2128, 2133, 2116, 2104, 2123, 2160, 2166, + 2160, 2179, 2208, 2224, 2237, 2255, 2260, 2261, + 2285, 2325, 2381, 2455, 2530, 2598, 2674, 2751, + 2806, 2823, 2811, 2779, 2726, 2681, 2652, 2618, + 2569, 2519, 2465, 2408, 2352, 2286, 2196, 2075, + 1944, 1798, 1652, 1527, 1395, 1256, 1133, 1024, + 935, 856, 784, 704, 619, 550, 509, 485, + 458, 435, 419, 429, 462, 503, 547, 591, + 633, 673, 727, 792, 851, 912, 984, 1059, + 1136, 1222, 1305, 1377, 1427, 1460, 1488, 1512, + 1532, 1549, 1570, 1601, 1635, 1683, 1734, 1790, + 1841, 1867, 1888, 1905, 1912, 1910, 1904, 1894, + 1890, 1904, 1926, 1936, 1943, 1950, 1957, 1959, + 1952, 1930, 1901, 1864, 1822, 1795, 1773, 1754, + 1730, 1700, 1677, 1663, 1646, 1629, 1627, 1634, + 1652, 1687, 1739, 1801, 1868, 1938, 2004, 2077, + 2152, 2223, 2290, 2356, 2436, 2523, 2615, 2721, + 2831, 2939, 3034, 3118, 3199, 3263, 3307, 3338, + 3360, 3385, 3412, 3443, 3484, 3532, 3590, 3636, + 3678, 3741, 3795, 3823, 3843, 3860, 3869, 3883, + 3905, 3922, 3931, 3949, 3961, 3967, 3971, 3950, + 3917, 3867, 3796, 3725, 3641, 3527, 3364, 3145, + 2925, 2727, 2501, 2257, 2038, 1833, 1624, 1458, + 1332, 1208, 1102, 997, 875, 772, 695, 608, + 539, 519, 519, 538, 589, 658, 758, 881, + 1002, 1121, 1249, 1370, 1484, 1576, 1646, 1729, + 1821, 1872, 1910, 1966, 2011, 2047, 2093, 2135, + 2168, 2194, 2196, 2185, 2192, 2210, 2209, 2187, + 2176, 2179, 2183, 2183, 2191, 2198, 2198, 2214, + 2249, 2296, 2358, 2432, 2503, 2580, 2662, 2731, + 2778, 2798, 2799, 2781, 2760, 2744, 2719, 2690, + 2660, 2627, 2593, 2566, 2531, 2471, 2388, 2293, + 2188, 2074, 1965, 1850, 1725, 1591, 1448, 1321, + 1214, 1114, 1024, 945, 875, 819, 781, 749, + 711, 677, 640, 606, 595, 587, 579, 581, + 595, 622, 669, 735, 803, 875, 950, 1028, + 1106, 1177, 1229, 1266, 1295, 1321, 1350, 1381, + 1407, 1440, 1481, 1528, 1587, 1654, 1716, 1771, + 1812, 1836, 1853, 1871, 1877, 1876, 1877, 1878, + 1887, 1903, 1917, 1932, 1943, 1947, 1954, 1959, + 1961, 1953, 1935, 1911, 1883, 1851, 1812, 1763, + 1708, 1651, 1605, 1568, 1536, 1512, 1488, 1474, + 1470, 1482, 1502, 1527, 1554, 1580, 1608, 1649, + 1698, 1750, 1808, 1878, 1960, 2048, 2149, 2257, + 2358, 2448, 2534, 2620, 2711, 2796, 2863, 2917, + 2964, 3004, 3034, 3064, 3108, 3140, 3164, 3205, + 3250, 3293, 3327, 3355, 3386, 3423, 3462, 3484, + 3508, 3534, 3552, 3569, 3604, 3639, 3672, 3707, + 3737, 3772, 3803, 3829, 3844, 3850, 3840, 3814, + 3772, 3714, 3647, 3559, 3425, 3233, 3027, 2851, + 2657, 2445, 2257, 2089, 1918, 1770, 1645, 1522, + 1414, 1300, 1158, 1036, 939, 826, 725, 680, + 664, 668, 707, 755, 830, 935, 1031, 1122, + 1213, 1296, 1373, 1440, 1486, 1558, 1641, 1689, + 1732, 1791, 1842, 1889, 1940, 1977, 2013, 2045, + 2051, 2040, 2045, 2053, 2046, 2029, 2016, 2016, + 2020, 2012, 2010, 2013, 2013, 2034, 2069, 2111, + 2173, 2244, 2312, 2387, 2472, 2545, 2598, 2627, + 2643, 2655, 2658, 2667, 2675, 2678, 2686, 2699, + 2704, 2707, 2705, 2682, 2629, 2562, 2483, 2394, + 2306, 2212, 2115, 2022, 1933, 1845, 1755, 1661, + 1569, 1481, 1391, 1305, 1234, 1166, 1093, 1024, + 968, 922, 897, 866, 837, 821, 809, 795, + 792, 812, 829, 848, 872, 913, 966, 1020, + 1062, 1098, 1135, 1167, 1191, 1217, 1244, 1277, + 1316, 1357, 1410, 1472, 1532, 1583, 1633, 1677, + 1716, 1747, 1761, 1770, 1783, 1802, 1821, 1844, + 1872, 1897, 1918, 1929, 1934, 1937, 1934, 1922, + 1908, 1891, 1875, 1863, 1849, 1833, 1815, 1797, + 1774, 1753, 1730, 1706, 1679, 1652, 1636, 1622, + 1616, 1617, 1624, 1633, 1648, 1671, 1695, 1721, + 1752, 1794, 1843, 1894, 1958, 2022, 2084, 2144, + 2203, 2264, 2320, 2372, 2412, 2457, 2501, 2538, + 2577, 2616, 2651, 2683, 2711, 2736, 2764, 2789, + 2798, 2808, 2817, 2824, 2838, 2858, 2873, 2897, + 2921, 2939, 2971, 3004, 3030, 3054, 3079, 3104, + 3131, 3168, 3202, 3242, 3282, 3308, 3342, 3376, + 3408, 3432, 3444, 3445, 3442, 3428, 3404, 3378, + 3344, 3295, 3219, 3110, 2992, 2886, 2763, 2622, + 2498, 2377, 2254, 2155, 2056, 1960, 1891, 1803, + 1704, 1622, 1549, 1471, 1411, 1370, 1342, 1334, + 1331, 1342, 1378, 1427, 1475, 1521, 1557, 1594, + 1638, 1671, 1699, 1738, 1774, 1794, 1821, 1855, + 1876, 1905, 1924, 1930, 1937, 1943, 1935, 1919, + 1905, 1898, 1885, 1871, 1865, 1867, 1867, 1863, + 1862, 1859, 1865, 1878, 1891, 1909, 1942, 1989, + 2040, 2100, 2166, 2229, 2279, 2325, 2362, 2394, + 2427, 2458, 2478, 2496, 2523, 2549, 2567, 2590, + 2601, 2602, 2588, 2564, 2529, 2490, 2444, 2390, + 2334, 2279, 2227, 2174, 2121, 2068, 2014, 1954, + 1887, 1820, 1760, 1701, 1638, 1580, 1524, 1479, + 1444, 1415, 1391, 1372, 1355, 1338, 1322, 1314, + 1304, 1293, 1293, 1302, 1311, 1328, 1351, 1377, + 1413, 1450, 1478, 1506, 1535, 1567, 1604, 1641, + 1678, 1714, 1746, 1777, 1808, 1834, 1856, 1867, + 1870, 1869, 1870, 1866, 1856, 1852, 1852, 1853, + 1858, 1861, 1865, 1868, 1872, 1880, 1883, 1885, + 1885, 1886, 1887, 1888, 1891, 1895, 1895, 1888, + 1885, 1881, 1872, 1860, 1841, 1834, 1823, 1813, + 1809, 1804, 1803, 1804, 1810, 1817, 1825, 1836, + 1847, 1857, 1870, 1888, 1904, 1919, 1937, 1960, + 1983, 2004, 2026, 2045, 2066, 2084, 2098, 2115, + 2132, 2150, 2169, 2185, 2206, 2227, 2243, 2257, + 2271, 2285, 2295, 2302, 2309, 2316, 2323, 2333, + 2347, 2361, 2379, 2395, 2410, 2421, 2436, 2449, + 2465, 2480, 2491, 2500, 2513, 2525, 2538, 2557, + 2577, 2595, 2613, 2632, 2651, 2674, 2691, 2710, + 2727, 2745, 2758, 2769, 2785, 2800, 2810, 2816, + 2826, 2832, 2828, 2823, 2817, 2805, 2797, 2779, + 2750, 2716, 2684, 2650, 2609, 2569, 2528, 2485, + 2447, 2408, 2377, 2351, 2323, 2301, 2281, 2267, + 2257, 2247, 2241, 2243, 2247, 2247, 2253, 2259, + 2270, 2289, 2301, 2308, 2320, 2331, 2341, 2346, + 2348, 2350, 2347, 2338, 2330, 2321, 2311, 2302, + 2290, 2271, 2256, 2239, 2211, 2183, 2161, 2140, + 2115, 2087, 2064, 2047, 2029, 2015, 2001, 1988, + 1980, 1971, 1959, 1954, 1955, 1956, 1962, 1970, + 1978, 1987, 1995, 1998, 2001, 2003, 2000, 1997, + 1989, 1984, 1980, 1973, 1967, 1963, 1958, 1947, + 1939, 1929, 1917, 1905, 1893, 1880, 1869, 1860, + 1850, 1841, 1833, 1827, 1820, 1820, 1821, 1822, + 1824, 1824, 1822, 1824, 1830, 1831, 1837, 1849, + 1857, 1864, 1874, 1880, 1884, 1894, 1902, 1901, + 1900, 1900, 1903, 1909, 1910, 1909, 1901, 1895, + 1891, 1884, 1875, 1867, 1854, 1839, 1829, 1821, + 1811, 1803, 1791, 1779, 1774, 1764, 1751, 1735, + 1724, 1714, 1703, 1693, 1684, 1676, 1669, 1663, + 1659, 1656, 1655, 1653, 1650, 1650, 1651, 1652, + 1652, 1652, 1654, 1656, 1661, 1670, 1677, 1681, + 1690, 1700, 1711, 1719, 1729, 1742, 1750, 1761, + 1771, 1782, 1793, 1803, 1815, 1826, 1836, 1849, + 1861, 1874, 1884, 1894, 1910, 1921, 1934, 1947, + 1960, 1969, 1980, 1995, 2005, 2014, 2022, 2029, + 2035, 2040, 2048, 2054, 2059, 2066, 2074, 2082, + 2088, 2091, 2096, 2102, 2100, 2101, 2104, 2107, + 2113, 2121, 2131, 2136, 2140, 2145, 2148, 2151, + 2156, 2162, 2165, 2170, 2175, 2179, 2184, 2191, + 2198, 2206, 2219, 2229, 2240, 2252, 2268, 2282, + 2295, 2310, 2328, 2346, 2364, 2383, 2402, 2420, + 2439, 2456, 2472, 2489, 2503, 2516, 2530, 2545, + 2561, 2575, 2587, 2595, 2602, 2610, 2615, 2620, + 2620, 2619, 2615, 2612, 2609, 2600, 2594, 2583, + 2571, 2559, 2545, 2531, 2513, 2496, 2477, 2465, + 2451, 2438, 2426, 2409, 2395, 2385, 2369, 2354, + 2344, 2332, 2321, 2310, 2299, 2293, 2289, 2284, + 2277, 2265, 2256, 2249, 2234, 2223, 2215, 2201, + 2189, 2180, 2169, 2158, 2148, 2136, 2120, 2105, + 2091, 2073, 2053, 2034, 2016, 1998, 1982, 1968, + 1959, 1946, 1936, 1929, 1919, 1914, 1909, 1902, + 1899, 1894, 1892, 1890, 1891, 1894, 1895, 1897, + 1895, 1895, 1892, 1892, 1888, 1882, 1877, 1872, + 1869, 1862, 1859, 1858, 1854, 1849, 1843, 1837, + 1828, 1821, 1813, 1801, 1788, 1781, 1772, 1763, + 1752, 1745, 1735, 1724, 1713, 1704, 1693, 1685, + 1677, 1671, 1667, 1667, 1668, 1668, 1670, 1674, + 1678, 1680, 1681, 1683, 1686, 1688, 1689, 1694, + 1696, 1694, 1694, 1700, 1704, 1707, 1711, 1717, + 1721, 1730, 1736, 1741, 1746, 1753, 1760, 1765, + 1775, 1782, 1786, 1793, 1798, 1803, 1811, 1815, + 1822, 1830, 1836, 1844, 1852, 1857, 1864, 1870, + 1873, 1878, 1883, 1885, 1888, 1893, 1894, 1900, + 1905, 1908, 1912, 1916, 1921, 1925, 1927, 1931, + 1936, 1935, 1940, 1945, 1945, 1946, 1952, 1955, + 1958, 1963, 1965, 1967, 1970, 1969, 1969, 1974, + 1974, 1973, 1974, 1975, 1977, 1979, 1983, 1984, + 1989, 1996, 2002, 2002, 2007, 2016, 2021, 2022, + 2029, 2038, 2039, 2041, 2049, 2051, 2054, 2058, + 2063, 2065, 2072, 2079, 2084, 2091, 2100, 2109, + 2114, 2122, 2128, 2135, 2142, 2153, 2162, 2167, + 2179, 2191, 2195, 2204, 2215, 2222, 2233, 2244, + 2253, 2259, 2267, 2275, 2281, 2289, 2297, 2302, + 2301, 2308, 2316, 2316, 2321, 2324, 2324, 2329, + 2334, 2335, 2337, 2339, 2339, 2341, 2342, 2344, + 2344, 2345, 2346, 2349, 2348, 2349, 2350, 2351, + 2350, 2351, 2352, 2350, 2350, 2351, 2347, 2346, + 2346, 2346, 2340, 2339, 2340, 2341, 2337, 2335, + 2335, 2329, 2327, 2324, 2322, 2318, 2318, 2315, + 2311, 2309, 2305, 2303, 2300, 2303, 2301, 2295, + 2292, 2290, 2286, 2282, 2277, 2272, 2267, 2256, + 2248, 2242, 2231, 2220, 2207, 2196, 2185, 2176, + 2166, 2153, 2144, 2132, 2121, 2111, 2100, 2087, + 2074, 2060, 2051, 2042, 2030, 2025, 2015, 2005, + 1998, 1993, 1985, 1978, 1969, 1960, 1954, 1947, + 1940, 1932, 1928, 1921, 1915, 1912, 1904, 1899, + 1892, 1889, 1887, 1879, 1873, 1866, 1860, 1852, + 1848, 1842, 1837, 1835, 1833, 1832, 1828, 1827, + 1826, 1825, 1825, 1824, 1823, 1827, 1829, 1830, + 1833, 1835, 1839, 1841, 1843, 1842, 1846, 1848, + 1851, 1853, 1857, 1863, 1866, 1870, 1871, 1875, + 1877, 1879, 1880, 1881, 1882, 1882, 1883, 1882, + 1884, 1885, 1886, 1886, 1889, 1890, 1890, 1893, + 1893, 1891, 1891, 1893, 1892, 1894, 1896, 1897, + 1900, 1904, 1908, 1913, 1913, 1914, 1919, 1919, + 1923, 1929, 1932, 1937, 1940, 1945, 1949, 1953, + 1955, 1958, 1962, 1967, 1973, 1976, 1977, 1982, + 1986, 1989, 1993, 1999, 2001, 2007, 2009, 2012, + 2018, 2022, 2025, 2033, 2040, 2045, 2051, 2059, + 2064, 2073, 2081, 2082, 2092, 2098, 2105, 2111, + 2116, 2121, 2128, 2133, 2136, 2139, 2142, 2146, + 2152, 2156, 2158, 2161, 2167, 2165, 2169, 2173, + 2174, 2179, 2175, 2176, 2179, 2181, 2184, 2185, + 2186, 2188, 2191, 2189, 2190, 2190, 2191, 2193, + 2197, 2197, 2196, 2199, 2199, 2199, 2201, 2203, + 2205, 2208, 2210, 2212, 2214, 2216, 2219, 2222, + 2222, 2227, 2229, 2229, 2233, 2234, 2236, 2238, + 2240, 2242, 2244, 2248, 2249, 2251, 2250, 2250, + 2251, 2248, 2248, 2247, 2248, 2250, 2250, 2248, + 2247, 2247, 2247, 2247, 2248, 2250, 2252, 2253, + 2253, 2254, 2256, 2258, 2257, 2257, 2256, 2259, + 2258, 2257, 2257, 2256, 2253, 2256, 2258, 2254, + 2251, 2247, 2245, 2243, 2240, 2236, 2231, 2227, + 2224, 2221, 2217, 2215, 2214, 2210, 2206, 2202, + 2200, 2199, 2193, 2190, 2186, 2182, 2180, 2175, + 2171, 2168, 2162, 2157, 2152, 2148, 2144, 2139, + 2131, 2125, 2118, 2113, 2109, 2104, 2099, 2095, + 2090, 2087, 2082, 2076, 2070, 2068, 2065, 2056, + 2052, 2051, 2048, 2048, 2043, 2041, 2037, 2034, + 2030, 2026, 2023, 2021, 2020, 2017, 2014, 2011, + 2009, 2005, 2004, 2003, 2002, 2001, 2000, 1995, + 1993, 1992, 1987, 1984, 1984, 1979, 1976, 1972, + 1967, 1966, 1962, 1960, 1957, 1956, 1956, 1955, + 1953, 1951, 1949, 1946, 1944, 1942, 1938, 1936, + 1937, 1934, 1932, 1932, 1930, 1928, 1929, 1926, + 1925, 1925, 1923, 1923, 1922, 1919, 1922, 1920, + 1920, 1921, 1919, 1924, 1926, 1928, 1929, 1929, + 1934, 1936, 1936, 1937, 1937, 1939, 1939, 1943, + 1944, 1947, 1948, 1950, 1952, 1955, 1959, 1959, + 1963, 1964, 1967, 1970, 1972, 1975, 1978, 1981, + 1985, 1985, 1991, 1994, 1997, 2002, 2007, 2013, + 2016, 2022, 2025, 2028, 2031, 2032, 2033, 2035, + 2040, 2043, 2046, 2049, 2053, 2052, 2052, 2051, + 2050, 2052, 2054, 2053, 2053, 2058, 2062, 2063, + 2064, 2066, 2068, 2066, 2069, 2070, 2071, 2073, + 2074, 2074, 2076, 2076, 2076, 2078, 2077, 2079, + 2078, 2079, 2079, 2078, 2078, 2077, 2074, 2074, + 2073, 2074, 2070, 2068, 2070, 2069, 2067, 2067, + 2064, 2064, 2066, 2065, 2065, 2064, 2063, 2066, + 2066, 2066, 2064, 2065, 2067, 2065, 2067, 2068, + 2067, 2067, 2068, 2068, 2068, 2068, 2069, 2069, + 2071, 2071, 2072, 2075, 2076, 2076, 2076, 2076, + 2076, 2077, 2078, 2080, 2082, 2084, 2087, 2089, + 2090, 2091, 2091, 2093, 2091, 2093, 2097, 2097, + 2098, 2100, 2102, 2102, 2105, 2104, 2103, 2103, + 2105, 2105, 2111, 2112, 2109, 2111, 2111, 2110, + 2108, 2108, 2109, 2110, 2112, 2110, 2106, 2106, + 2106, 2106, 2101, 2102, 2103, 2101, 2098, 2098, + 2098, 2096, 2092, 2092, 2088, 2089, 2085, 2082, + 2081, 2077, 2074, 2069, 2068, 2062, 2058, 2057, + 2054, 2051, 2048, 2046, 2042, 2041, 2037, 2037, + 2031, 2026, 2026, 2021, 2018, 2015, 2011, 2006, + 2000, 1999, 1994, 1991, 1986, 1983, 1984, 1982, + 1980, 1978, 1978, 1977, 1976, 1975, 1973, 1974, + 1974, 1974, 1974, 1974, 1977, 1978, 1977, 1976, + 1976, 1977, 1976, 1978, 1981, 1982, 1980, 1983, + 1984, 1985, 1986, 1985, 1982, 1983, 1983, 1984, + 1984, 1987, 1984, 1983, 1984, 1980, 1979, 1984, + 1981, 1980, 1983, 1985, 1984, 1984, 1982, 1982, + 1987, 1987, 1986, 1992, 1989, 1989, 1998, 2001, + 2000, 2002, 2003, 2003, 2004, 2005, 2007, 2009, + 2010, 2010, 2013, 2013, 2014, 2014, 2016, 2021, + 2018, 2019, 2022, 2026, 2029, 2028, 2029, 2029, + 2033, 2034, 2032, 2035, 2035, 2035, 2038, 2039, + 2041, 2044, 2047, 2046, 2047, 2052, 2054, 2058, + 2059, 2058, 2060, 2063, 2065, 2068, 2067, 2069, + 2068, 2067, 2071, 2073, 2073, 2073, 2075, 2073, + 2071, 2069, 2072, 2072, 2072, 2073, 2072, 2067, + 2063, 2068, 2069, 2068, 2067, 2066, 2066, 2064, + 2065, 2064, 2063, 2061, 2061, 2059, 2061, 2061, + 2059, 2058, 2059, 2056, 2051, 2052, 2051, 2047, + 2045, 2042, 2039, 2041, 2041, 2036, 2035, 2032, + 2031, 2032, 2031, 2028, 2028, 2026, 2026, 2023, + 2022, 2021, 2022, 2022, 2020, 2019, 2016, 2018, + 2017, 2016, 2015, 2013, 2016, 2019, 2019, 2021, + 2023, 2024, 2025, 2027, 2029, 2030, 2033, 2032, + 2035, 2041, 2042, 2043, 2046, 2050, 2051, 2053, + 2057, 2056, 2058, 2055, 2056, 2056, 2054, 2051, + 2051, 2051, 2046, 2045, 2047, 2046, 2046, 2047, + 2046, 2043, 2044, 2041, 2041, 2040, 2040, 2041, + 2040, 2041, 2038, 2036, 2035, 2036, 2037, 2037, + 2034, 2035, 2033, 2030, 2030, 2029, 2029, 2028, + 2027, 2028, 2028, 2026, 2025, 2025, 2028, 2028, + 2030, 2031, 2031, 2033, 2038, 2039, 2040, 2042, + 2044, 2048, 2050, 2050, 2055, 2059, 2064, 2065, + 2068, 2071, 2074, 2076, 2076, 2080, 2086, 2085, + 2086, 2091, 2090, 2092, 2096, 2096, 2097, 2100, + 2103, 2105, 2103, 2104, 2104, 2106, 2107, 2106, + 2107, 2108, 2107, 2108, 2109, 2107, 2107, 2109, + 2107, 2108, 2105, 2103, 2102, 2101, 2101, 2101, + 2101, 2100, 2102, 2099, 2100, 2103, 2100, 2098, + 2095, 2096, 2091, 2088, 2087, 2087, 2086, 2084, + 2084, 2081, 2082, 2081, 2077, 2075, 2073, 2071, + 2069, 2067, 2067, 2067, 2066, 2065, 2068, 2068, + 2066, 2066, 2064, 2063, 2063, 2060, 2058, 2058, + 2057, 2057, 2057, 2055, 2051, 2048, 2049, 2047, + 2046, 2045, 2042, 2042, 2042, 2040, 2040, 2039, + 2038, 2034, 2032, 2032, 2032, 2031, 2029, 2029, + 2028, 2028, 2028, 2026, 2024, 2025, 2026, 2023, + 2024, 2024, 2023, 2023, 2020, 2021, 2020, 2021, + 2023, 2024, 2024, 2026, 2026, 2026, 2026, 2030, + 2028, 2030, 2032, 2034, 2032, 2032, 2032, 2034, + 2038, 2039, 2039, 2037, 2036, 2041, 2043, 2043, + 2044, 2046, 2050, 2052, 2046, 2045, 2048, 2051, + 2049, 2049, 2047, 2047, 2046, 2042, 2041, 2043, + 2040, 2040, 2045, 2045, 2043, 2043, 2038, 2040, + 2037, 2030, 2027, 2031, 2038, 2034, 2038, 2039, + 2033, 2032, 2032, 2028, 2029, 2035, 2037, 2038, + 2038, 2038, 2044, 2047, 2042, 2039, 2043, 2042, + 2044, 2048, 2048, 2051, 2051, 2056, 2058, 2058, + 2055, 2055, 2055, 2060, 2066, 2067, 2070, 2072, + 2074, 2069, 2069, 2070, 2070, 2074, 2076, 2074, + 2074, 2077, 2079, 2080, 2080, 2081, 2078, 2082, + 2084, 2084, 2086, 2086, 2087, 2081, 2087, 2090, + 2088, 2089, 2090, 2087, 2087, 2087, 2086, 2090, + 2094, 2090, 2088, 2093, 2093, 2091, 2090, 2089, + 2087, 2088, 2089, 2092, 2095, 2092, 2086, 2085, + 2085, 2085, 2088, 2087, 2084, 2078, 2075, 2078, + 2079, 2073, 2065, 2063, 2066, 2066, 2065, 2067, + 2063, 2056, 2060, 2062, 2060, 2059, 2062, 2057, + 2056, 2055, 2056, 2059, 2058, 2059, 2052, 2052, + 2054, 2054, 2057, 2055, 2053, 2055, 2056, 2054, + 2048, 2044, 2043, 2041, 2037, 2033, 2031, 2033, + 2035, 2035, 2030, 2025, 2024, 2025, 2028, 2024, + 2021, 2023, 2020, 2016, 2020, 2020, 2012, 2009, + 2015, 2019, 2021, 2019, 2015, 2018, 2017, 2012, + 2011, 2017, 2015, 2012, 2011, 2010, 2011, 2017, + 2018, 2014, 2013, 2015, 2011, 2006, 2006, 2005, + 2005, 2006, 2001, 2002, 2009, 2009, 2010, 2013, + 2017, 2021, 2019, 2020, 2024, 2025, 2028, 2029, + 2028, 2032, 2034, 2037, 2040, 2038, 2036, 2036, + 2040, 2039, 2034, 2034, 2033, 2027, 2030, 2033, + 2030, 2030, 2032, 2030, 2028, 2029, 2027, 2023, + 2022, 2022, 2017, 2018, 2021, 2020, 2017, 2014, + 2017, 2017, 2015, 2020, 2021, 2018, 2019, 2020, + 2021, 2019, 2017, 2017, 2018, 2021, 2021, 2021, + 2024, 2029, 2031, 2035, 2035, 2035, 2036, 2035, + 2038, 2043, 2047, 2048, 2046, 2043, 2045, 2047, + 2046, 2047, 2047, 2048, 2051, 2052, 2052, 2052, + 2052, 2051, 2052, 2050, 2045, 2047, 2050, 2048, + 2049, 2048, 2046, 2050, 2051, 2051, 2052, 2052, + 2055, 2056, 2056, 2055, 2060, 2061, 2057, 2061, + 2064, 2064, 2061, 2061, 2060, 2064, 2064, 2065, + 2068, 2067, 2066, 2066, 2067, 2069, 2070, 2068, + 2069, 2069, 2069, 2073, 2074, 2074, 2075, 2078, + 2082, 2081, 2079, 2084, 2088, 2086, 2085, 2088, + 2091, 2092, 2096, 2100, 2107, 2109, 2110, 2110, + 2113, 2112, 2110, 2114, 2116, 2116, 2116, 2115, + 2114, 2112, 2109, 2110, 2111, 2112, 2112, 2109, + 2108, 2108, 2111, 2113, 2113, 2111, 2109, 2107, + 2107, 2106, 2106, 2106, 2106, 2104, 2100, 2105, + 2105, 2101, 2104, 2104, 2104, 2103, 2098, 2096, + 2100, 2102, 2098, 2098, 2097, 2094, 2094, 2091, + 2089, 2090, 2091, 2091, 2087, 2086, 2086, 2086, + 2087, 2088, 2085, 2082, 2079, 2078, 2079, 2077, + 2079, 2077, 2078, 2078, 2077, 2078, 2083, 2083, + 2082, 2082, 2085, 2086, 2092, 2095, 2092, 2092, + 2096, 2096, 2100, 2102, 2103, 2106, 2108, 2106, + 2104, 2106, 2108, 2109, 2108, 2108, 2106, 2106, + 2103, 2103, 2105, 2103, 2102, 2099, 2098, 2101, + 2101, 2103, 2104, 2107, 2106, 2105, 2106, 2108, + 2108, 2107, 2107, 2106, 2109, 2111, 2108, 2107, + 2107, 2108, 2104, 2105, 2104, 2102, 2101, 2103, + 2107, 2103, 2101, 2099, 2096, 2097, 2098, 2098, + 2098, 2098, 2098, 2100, 2099, 2098, 2099, 2098, + 2098, 2100, 2102, 2099, 2098, 2096, 2095, 2097, + 2094, 2095, 2092, 2086, 2081, 2079, 2070, 2063, + 2053, 2046, 1902, 1613, 1570, 1719, 1812, 1882, + 1946, 1964, 1959, 1931, 1918, 1942, 1980, 2003, + 2025, 2040, 2049, 2063, 2059, 2053, 2062, 2086, + 2102, 2119, 2114, 2081, 2034, 2009, 2013, 2033, + 2068, 2109, 2134, 2126, 2096, 2053, 2007, 1980, + 1980, 2016, 2063, 2086, 2092, 2088, 2082, 2065, + 2051, 2037, 2030, 2040, 2056, 2065, 2048, 2026, + 2014, 2015, 2032, 2054, 2075, 2080, 2069, 2054, + 2031, 2011, 1994, 1982, 1987, 2005, 2030, 2055, + 2064, 2037, 1997, 1967, 1965, 1984, 2004, 2011, + 2007, 2002, 1993, 1985, 1985, 1984, 1985, 1988, + 1994, 1991, 1979, 1960, 1946, 1938, 1931, 1937, + 1952, 1972, 1984, 1979, 1953, 1927, 1909, 1894, + 1897, 1914, 1932, 1939, 1932, 1920, 1914, 1907, + 1913, 1933, 1944, 1937, 1933, 1935, 1925, 1916, + 1909, 1909, 1918, 1936, 1954, 1958, 1953, 1941, + 1927, 1914, 1908, 1925, 1941, 1949, 1955, 1954, + 1950, 1946, 1940, 1929, 1926, 1929, 1937, 1945, + 1950, 1942, 1932, 1925, 1928, 1940, 1947, 1950, + 1951, 1947, 1937, 1924, 1922, 1928, 1931, 1939, + 1947, 1950, 1948, 1941, 1938, 1932, 1927, 1924, + 1926, 1929, 1929, 1931, 1928, 1915, 1909, 1906, + 1909, 1914, 1919, 1921, 1919, 1912, 1903, 1897, + 1899, 1901, 1906, 1909, 1901, 1896, 1897, 1896, + 1893, 1887, 1880, 1884, 1884, 1878, 1878, 1881, + 1875, 1866, 1863, 1854, 1852, 1860, 1865, 1861, + 1853, 1859, 1865, 1865, 1858, 1859, 1858, 1853, + 1852, 1849, 1848, 1846, 1845, 1841, 1830, 1820, + 1827, 1834, 1827, 1828, 1826, 1806, 1804, 1805, + 1806, 1818, 1818, 1813, 1814, 1808, 1804, 1806, + 1813, 1816, 1820, 1821, 1816, 1815, 1813, 1814, + 1818, 1823, 1831, 1841, 1844, 1831, 1825, 1825, + 1821, 1826, 1827, 1827, 1831, 1836, 1841, 1840, + 1830, 1834, 1843, 1845, 1851, 1855, 1849, 1842, + 1839, 1838, 1837, 1841, 1841, 1842, 1842, 1836, + 1830, 1826, 1830, 1842, 1846, 1855, 1864, 1860, + 1859, 1857, 1850, 1853, 1859, 1858, 1862, 1867, + 1868, 1862, 1850, 1842, 1842, 1839, 1847, 1864, + 1870, 1869, 1870, 1862, 1850, 1842, 1846, 1856, + 1859, 1866, 1870, 1866, 1857, 1847, 1844, 1848, + 1858, 1863, 1863, 1861, 1856, 1853, 1858, 1867, + 1873, 1883, 1889, 1892, 1891, 1885, 1884, 1886, + 1891, 1904, 1919, 1925, 1924, 1919, 1911, 1904, + 1894, 1894, 1904, 1915, 1927, 1936, 1937, 1936, + 1926, 1918, 1920, 1926, 1931, 1938, 1937, 1935, + 1936, 1946, 1958, 1962, 1965, 1963, 1953, 1950, + 1947, 1935, 1923, 1914, 1911, 1914, 1925, 1931, + 1933, 1934, 1927, 1923, 1921, 1926, 1926, 1924, + 1929, 1938, 1952, 1956, 1956, 1959, 1957, 1960, + 1964, 1958, 1946, 1947, 1953, 1960, 1969, 1977, + 1983, 1981, 1975, 1965, 1955, 1948, 1937, 1921, + 1916, 1922, 1931, 1945, 1954, 1960, 1957, 1944, + 1927, 1922, 1923, 1925, 1929, 1932, 1943, 1952, + 1960, 1958, 1953, 1953, 1939, 1914, 1901, 1887, + 1880, 1878, 1878, 1883, 1881, 1882, 1888, 1896, + 1895, 1879, 1864, 1846, 1829, 1831, 1842, 1846, + 1851, 1867, 1873, 1866, 1852, 1838, 1834, 1833, + 1831, 1828, 1823, 1820, 1829, 1836, 1838, 1838, + 1837, 1827, 1814, 1801, 1801, 1802, 1797, 1797, + 1814, 1830, 1837, 1844, 1847, 1840, 1830, 1818, + 1803, 1797, 1801, 1811, 1823, 1838, 1837, 1823, + 1810, 1798, 1783, 1765, 1744, 1723, 1708, 1701, + 1701, 1715, 1728, 1737, 1731, 1725, 1723, 1719, + 1700, 1679, 1672, 1671, 1668, 1672, 1678, 1683, + 1692, 1698, 1695, 1684, 1671, 1662, 1660, 1653, + 1641, 1639, 1644, 1657, 1672, 1668, 1647, 1632, + 1626, 1617, 1598, 1584, 1588, 1597, 1603, 1613, + 1622, 1621, 1614, 1606, 1600, 1592, 1575, 1551, + 1537, 1531, 1525, 1531, 1557, 1573, 1574, 1571, + 1571, 1568, 1558, 1561, 1554, 1538, 1531, 1539, + 1553, 1560, 1558, 1547, 1531, 1511, 1498, 1493, + 1491, 1500, 1509, 1508, 1505, 1502, 1505, 1519, + 1531, 1527, 1524, 1529, 1524, 1513, 1517, 1521, + 1527, 1547, 1569, 1592, 1598, 1587, 1569, 1553, + 1538, 1528, 1531, 1538, 1540, 1540, 1544, 1552, + 1552, 1552, 1551, 1557, 1560, 1557, 1557, 1550, + 1535, 1513, 1493, 1501, 1524, 1536, 1543, 1542, + 1534, 1531, 1533, 1544, 1568, 1596, 1616, 1636, + 1653, 1658, 1654, 1647, 1641, 1634, 1637, 1632, + 1630, 1634, 1634, 1637, 1639, 1639, 1650, 1674, + 1689, 1687, 1672, 1663, 1647, 1635, 1646, 1661, + 1680, 1707, 1728, 1731, 1732, 1727, 1710, 1702, + 1711, 1730, 1758, 1770, 1772, 1779, 1778, 1776, + 1793, 1811, 1815, 1822, 1828, 1821, 1811, 1809, + 1812, 1828, 1852, 1871, 1891, 1899, 1881, 1856, + 1837, 1828, 1834, 1853, 1882, 1912, 1930, 1936, + 1931, 1924, 1934, 1962, 1991, 2007, 2007, 2003, + 2001, 1999, 2015, 2038, 2066, 2093, 2112, 2120, + 2119, 2112, 2104, 2106, 2123, 2136, 2155, 2178, + 2195, 2188, 2162, 2145, 2144, 2148, 2160, 2180, + 2194, 2201, 2196, 2189, 2186, 2197, 2213, 2233, + 2243, 2238, 2230, 2217, 2201, 2203, 2216, 2232, + 2251, 2267, 2278, 2283, 2276, 2258, 2252, 2264, + 2279, 2294, 2304, 2302, 2293, 2283, 2277, 2285, + 2302, 2315, 2320, 2313, 2309, 2311, 2316, 2322, + 2334, 2349, 2359, 2368, 2381, 2390, 2384, 2377, + 2381, 2404, 2430, 2449, 2464, 2479, 2481, 2471, + 2475, 2491, 2510, 2524, 2528, 2524, 2520, 2516, + 2523, 2539, 2550, 2559, 2572, 2582, 2583, 2579, + 2573, 2570, 2572, 2574, 2581, 2589, 2600, 2610, + 2602, 2594, 2596, 2610, 2629, 2641, 2642, 2638, + 2643, 2648, 2652, 2660, 2672, 2683, 2682, 2682, + 2692, 2700, 2699, 2703, 2715, 2721, 2724, 2734, + 2740, 2740, 2732, 2726, 2729, 2733, 2731, 2725, + 2721, 2722, 2718, 2708, 2703, 2707, 2714, 2720, + 2722, 2722, 2719, 2708, 2701, 2698, 2693, 2686, + 2679, 2678, 2676, 2676, 2672, 2671, 2663, 2648, + 2632, 2620, 2614, 2615, 2617, 2616, 2611, 2609, + 2603, 2592, 2586, 2587, 2590, 2594, 2590, 2584, + 2574, 2561, 2548, 2534, 2522, 2511, 2503, 2503, + 2501, 2496, 2488, 2488, 2486, 2484, 2492, 2504, + 2499, 2484, 2478, 2474, 2467, 2461, 2458, 2456, + 2449, 2438, 2429, 2426, 2422, 2413, 2404, 2394, + 2387, 2390, 2392, 2392, 2389, 2382, 2375, 2372, + 2367, 2355, 2347, 2346, 2344, 2340, 2333, 2325, + 2317, 2313, 2307, 2303, 2307, 2305, 2297, 2292, + 2288, 2282, 2280, 2282, 2289, 2295, 2298, 2289, + 2276, 2262, 2254, 2253, 2254, 2252, 2249, 2246, + 2234, 2221, 2213, 2214, 2208, 2198, 2192, 2194, + 2190, 2179, 2169, 2167, 2166, 2167, 2167, 2163, + 2155, 2144, 2133, 2130, 2130, 2127, 2123, 2124, + 2124, 2120, 2120, 2116, 2112, 2114, 2116, 2103, + 2083, 2074, 2068, 2068, 2069, 2079, 2093, 2098, + 2089, 2085, 2088, 2090, 2084, 2075, 2074, 2075, + 2079, 2081, 2079, 2075, 2076, 2086, 2096, 2099, + 2104, 2107, 2109, 2112, 2112, 2111, 2113, 2119, + 2123, 2128, 2131, 2130, 2123, 2117, 2118, 2120, + 2125, 2128, 2134, 2135, 2139, 2137, 2131, 2126, + 2123, 2127, 2127, 2126, 2121, 2119, 2114, 2115, + 2118, 2121, 2123, 2123, 2123, 2119, 2113, 2110, + 2107, 2102, 2102, 2105, 2109, 2109, 2099, 2085, + 2077, 2076, 2081, 2087, 2097, 2101, 2102, 2103, + 2104, 2103, 2104, 2108, 2111, 2112, 2111, 2109, + 2106, 2100, 2097, 2095, 2089, 2094, 2094, 2085, + 2074, 2067, 2058, 2053, 2056, 2058, 2056, 2052, + 2044, 2038, 2030, 2023, 2024, 2027, 2028, 2026, + 2019, 2015, 2020, 2022, 2020, 2013, 2013, 2010, + 2005, 2005, 2007, 2009, 2017, 2019, 2020, 2020, + 2021, 2021, 2019, 2015, 2019, 2023, 2031, 2039, + 2044, 2046, 2042, 2041, 2039, 2042, 2039, 2034, + 2030, 2025, 2019, 2020, 2022, 2026, 2028, 2026, + 2017, 2007, 1996, 1983, 1981, 1984, 1984, 1976, + 1973, 1974, 1966, 1953, 1947, 1948, 1947, 1943, + 1933, 1922, 1911, 1905, 1911, 1918, 1924, 1934, + 1942, 1938, 1933, 1927, 1928, 1932, 1937, 1950, + 1960, 1963, 1961, 1960, 1964, 1962, 1959, 1963, + 1964, 1956, 1946, 1936, 1935, 1931, 1925, 1926, + 1935, 1935, 1927, 1914, 1905, 1899, 1901, 1907, + 1910, 1912, 1910, 1908, 1908, 1909, 1914, 1918, + 1917, 1912, 1909, 1911, 1909, 1905, 1909, 1921, + 1931, 1936, 1938, 1940, 1942, 1937, 1934, 1926, + 1929, 1948, 1961, 1960, 1960, 1963, 1963, 1957, + 1954, 1955, 1955, 1953, 1950, 1948, 1953, 1959, + 1956, 1945, 1945, 1952, 1951, 1941, 1929, 1923, + 1926, 1931, 1933, 1940, 1959, 1969, 1961, 1949, + 1948, 1956, 1955, 1955, 1952, 1952, 1957, 1961, + 1968, 1977, 1986, 1991, 1985, 1987, 1991, 1988, + 1989, 1996, 2004, 2010, 2019, 2036, 2048, 2048, + 2044, 2041, 2040, 2048, 2062, 2075, 2078, 2074, + 2080, 2092, 2105, 2118, 2129, 2129, 2123, 2130, + 2141, 2144, 2148, 2163, 2173, 2168, 2169, 2179, + 2187, 2187, 2182, 2179, 2178, 2183, 2181, 2182, + 2190, 2202, 2204, 2195, 2194, 2196, 2198, 2197, + 2193, 2187, 2186, 2189, 2192, 2196, 2199, 2201, + 2198, 2196, 2201, 2201, 2196, 2191, 2193, 2202, + 2216, 2225, 2226, 2224, 2223, 2229, 2231, 2231, + 2236, 2241, 2242, 2240, 2251, 2260, 2265, 2267, + 2277, 2277, 2271, 2278, 2290, 2294, 2292, 2293, + 2301, 2308, 2320, 2332, 2339, 2336, 2327, 2320, + 2330, 2349, 2359, 2361, 2361, 2364, 2361, 2366, + 2371, 2378, 2380, 2379, 2374, 2367, 2367, 2370, + 2375, 2376, 2373, 2374, 2376, 2366, 2361, 2363, + 2362, 2358, 2354, 2351, 2355, 2360, 2359, 2361, + 2364, 2368, 2372, 2374, 2376, 2378, 2382, 2385, + 2393, 2400, 2400, 2393, 2394, 2399, 2399, 2397, + 2397, 2398, 2399, 2399, 2406, 2415, 2414, 2408, + 2402, 2405, 2408, 2405, 2404, 2404, 2404, 2410, + 2414, 2417, 2423, 2419, 2419, 2420, 2418, 2420, + 2423, 2423, 2420, 2424, 2421, 2420, 2426, 2431, + 2429, 2423, 2417, 2413, 2413, 2413, 2420, 2425, + 2424, 2424, 2419, 2416, 2417, 2422, 2418, 2420, + 2423, 2423, 2422, 2426, 2436, 2441, 2442, 2444, + 2446, 2446, 2442, 2443, 2446, 2449, 2446, 2445, + 2449, 2454, 2459, 2457, 2453, 2451, 2448, 2443, + 2441, 2445, 2447, 2449, 2450, 2452, 2455, 2459, + 2457, 2451, 2444, 2439, 2439, 2441, 2448, 2453, + 2455, 2462, 2468, 2471, 2476, 2482, 2486, 2490, + 2486, 2488, 2493, 2500, 2511, 2517, 2520, 2518, + 2521, 2526, 2525, 2521, 2528, 2539, 2545, 2547, + 2554, 2562, 2568, 2573, 2578, 2581, 2586, 2592, + 2596, 2600, 2607, 2612, 2619, 2631, 2639, 2641, + 2639, 2635, 2634, 2639, 2647, 2647, 2645, 2651, + 2650, 2649, 2646, 2635, 2628, 2628, 2627, 2621, + 2614, 2604, 2593, 2591, 2596, 2601, 2595, 2588, + 2590, 2587, 2578, 2579, 2585, 2590, 2589, 2587, + 2589, 2587, 2581, 2582, 2583, 2578, 2572, 2576, + 2576, 2578, 2577, 2576, 2577, 2580, 2584, 2586, + 2588, 2583, 2581, 2587, 2588, 2585, 2591, 2602, + 2605, 2607, 2607, 2609, 2611, 2612, 2614, 2615, + 2615, 2610, 2610, 2610, 2608, 2608, 2609, 2611, + 2600, 2591, 2593, 2592, 2589, 2582, 2575, 2572, + 2572, 2567, 2562, 2557, 2553, 2541, 2532, 2534, + 2534, 2530, 2529, 2526, 2522, 2518, 2512, 2504, + 2507, 2514, 2506, 2494, 2493, 2495, 2490, 2485, + 2487, 2489, 2483, 2470, 2468, 2471, 2471, 2468, + 2465, 2458, 2454, 2449, 2444, 2438, 2429, 2418, + 2416, 2412, 2408, 2404, 2394, 2395, 2395, 2384, + 2376, 2369, 2365, 2359, 2350, 2343, 2343, 2339, + 2331, 2330, 2324, 2320, 2315, 2303, 2295, 2292, + 2289, 2281, 2279, 2276, 2273, 2268, 2266, 2264, + 2259, 2251, 2248, 2244, 2242, 2238, 2234, 2231, + 2231, 2223, 2218, 2218, 2221, 2217, 2209, 2205, + 2201, 2200, 2199, 2202, 2205, 2207, 2203, 2202, + 2201, 2198, 2195, 2195, 2194, 2192, 2191, 2194, + 2196, 2200, 2199, 2202, 2200, 2199, 2196, 2197, + 2203, 2201, 2202, 2204, 2207, 2208, 2211, 2216, + 2215, 2214, 2212, 2213, 2217, 2223, 2227, 2230, + 2236, 2239, 2248, 2254, 2258, 2263, 2269, 2277, + 2286, 2300, 2315, 2331, 2342, 2355, 2371, 2385, + 2398, 2413, 2430, 2443, 2458, 2473, 2486, 2497, + 2512, 2523, 2529, 2533, 2538, 2542, 2546, 2549, + 2553, 2559, 2564, 2564, 2560, 2563, 2559, 2552, + 2548, 2546, 2545, 2540, 2540, 2541, 2537, 2539, + 2544, 2542, 2536, 2531, 2532, 2528, 2522, 2519, + 2516, 2524, 2527, 2527, 2531, 2536, 2536, 2532, + 2531, 2539, 2544, 2544, 2545, 2553, 2564, 2570, + 2571, 2571, 2573, 2574, 2578, 2587, 2595, 2598, + 2603, 2610, 2618, 2628, 2632, 2640, 2652, 2653, + 2650, 2652, 2655, 2660, 2671, 2676, 2681, 2691, + 2688, 2681, 2687, 2690, 2696, 2699, 2698, 2704, + 2709, 2706, 2708, 2717, 2717, 2711, 2710, 2709, + 2710, 2704, 2696, 2691, 2681, 2675, 2668, 2654, + 2634, 2608, 2581, 2560, 2539, 2511, 2479, 2446, + 2408, 2367, 2330, 2289, 2248, 2195, 2139, 2091, + 2037, 1980, 1927, 1871, 1817, 1766, 1716, 1665, + 1613, 1558, 1507, 1465, 1427, 1394, 1363, 1339, + 1315, 1291, 1276, 1266, 1257, 1252, 1253, 1260, + 1271, 1279, 1294, 1316, 1338, 1365, 1393, 1420, + 1443, 1471, 1502, 1534, 1568, 1599, 1629, 1655, + 1681, 1709, 1734, 1755, 1774, 1789, 1803, 1818, + 1828, 1841, 1851, 1855, 1859, 1862, 1864, 1869, + 1868, 1860, 1856, 1850, 1845, 1842, 1837, 1832, + 1824, 1818, 1807, 1802, 1794, 1792, 1786, 1778, + 1773, 1767, 1767, 1769, 1772, 1773, 1772, 1773, + 1777, 1782, 1788, 1799, 1816, 1836, 1857, 1880, + 1905, 1928, 1951, 1974, 2000, 2027, 2055, 2085, + 2120, 2149, 2179, 2208, 2240, 2272, 2298, 2323, + 2347, 2371, 2397, 2422, 2446, 2467, 2487, 2501, + 2516, 2532, 2544, 2550, 2557, 2561, 2567, 2575, + 2578, 2578, 2579, 2580, 2583, 2585, 2585, 2586, + 2587, 2585, 2582, 2590, 2595, 2599, 2601, 2602, + 2608, 2619, 2631, 2635, 2642, 2649, 2660, 2669, + 2683, 2704, 2721, 2739, 2755, 2769, 2791, 2811, + 2829, 2849, 2870, 2888, 2909, 2931, 2948, 2968, + 2989, 3004, 3031, 3052, 3063, 3069, 3081, 3095, + 3102, 3097, 3073, 3042, 3007, 2964, 2919, 2869, + 2814, 2755, 2694, 2634, 2584, 2535, 2473, 2404, + 2319, 2222, 2138, 2079, 2021, 1957, 1890, 1819, + 1758, 1713, 1675, 1641, 1610, 1569, 1526, 1500, + 1493, 1504, 1519, 1531, 1548, 1567, 1587, 1608, + 1634, 1661, 1680, 1704, 1738, 1782, 1844, 1901, + 1949, 1987, 2025, 2062, 2095, 2129, 2158, 2179, + 2192, 2209, 2225, 2246, 2277, 2294, 2301, 2296, + 2281, 2267, 2259, 2260, 2268, 2267, 2258, 2245, + 2229, 2214, 2201, 2187, 2168, 2145, 2119, 2090, + 2065, 2040, 2013, 1981, 1950, 1932, 1907, 1860, + 1805, 1751, 1700, 1661, 1626, 1591, 1554, 1504, + 1442, 1388, 1340, 1296, 1263, 1237, 1213, 1194, + 1173, 1159, 1154, 1154, 1160, 1173, 1190, 1202, + 1210, 1213, 1242, 1277, 1318, 1370, 1421, 1473, + 1517, 1558, 1603, 1657, 1711, 1762, 1812, 1857, + 1895, 1926, 1956, 1985, 2009, 2027, 2039, 2044, + 2042, 2038, 2037, 2039, 2047, 2055, 2057, 2049, + 2030, 2008, 1990, 1981, 1974, 1971, 1966, 1957, + 1949, 1943, 1944, 1953, 1964, 1979, 1986, 1991, + 2002, 2018, 2040, 2069, 2099, 2130, 2163, 2189, + 2212, 2233, 2261, 2297, 2338, 2381, 2416, 2454, + 2493, 2537, 2578, 2621, 2664, 2701, 2730, 2753, + 2776, 2805, 2841, 2877, 2914, 2940, 2961, 2975, + 2984, 2993, 3008, 3028, 3044, 3054, 3055, 3054, + 3058, 3063, 3072, 3080, 3086, 3082, 3074, 3069, + 3070, 3078, 3094, 3116, 3134, 3147, 3155, 3161, + 3171, 3185, 3203, 3222, 3235, 3235, 3229, 3218, + 3210, 3205, 3190, 3171, 3144, 3109, 3055, 3002, + 2953, 2902, 2840, 2760, 2669, 2559, 2445, 2337, + 2236, 2132, 2031, 1930, 1828, 1731, 1635, 1546, + 1473, 1410, 1352, 1298, 1258, 1226, 1205, 1195, + 1206, 1238, 1269, 1305, 1354, 1404, 1461, 1534, + 1624, 1727, 1839, 1952, 2056, 2159, 2258, 2362, + 2465, 2569, 2668, 2751, 2819, 2882, 2944, 3005, + 3063, 3111, 3143, 3152, 3148, 3135, 3115, 3092, + 3068, 3039, 2996, 2942, 2881, 2812, 2744, 2679, + 2611, 2549, 2481, 2412, 2346, 2283, 2230, 2185, + 2142, 2090, 2025, 1945, 1869, 1809, 1762, 1720, + 1681, 1633, 1574, 1519, 1480, 1451, 1427, 1397, + 1363, 1325, 1286, 1258, 1241, 1236, 1234, 1229, + 1226, 1224, 1222, 1220, 1230, 1252, 1284, 1329, + 1379, 1436, 1490, 1540, 1591, 1652, 1720, 1787, + 1850, 1907, 1961, 2016, 2078, 2145, 2213, 2274, + 2319, 2349, 2369, 2380, 2387, 2400, 2411, 2407, + 2392, 2366, 2329, 2292, 2255, 2225, 2192, 2149, + 2101, 2046, 1995, 1956, 1932, 1913, 1897, 1880, + 1851, 1825, 1806, 1799, 1808, 1830, 1854, 1880, + 1905, 1935, 1978, 2031, 2093, 2154, 2209, 2259, + 2315, 2369, 2428, 2497, 2564, 2630, 2685, 2733, + 2777, 2822, 2862, 2904, 2943, 2976, 3003, 3026, + 3043, 3062, 3076, 3079, 3077, 3076, 3075, 3063, + 3048, 3035, 3029, 3022, 3021, 3021, 3020, 3012, + 3004, 3001, 2998, 3004, 3013, 3022, 3031, 3035, + 3038, 3044, 3054, 3058, 3057, 3050, 3036, 3019, + 2998, 2976, 2955, 2925, 2883, 2829, 2770, 2691, + 2600, 2506, 2403, 2296, 2176, 2054, 1938, 1819, + 1703, 1592, 1488, 1383, 1281, 1183, 1096, 1024, + 961, 917, 890, 874, 873, 880, 901, 937, + 983, 1040, 1112, 1195, 1283, 1390, 1504, 1623, + 1753, 1883, 2011, 2131, 2245, 2356, 2464, 2566, + 2664, 2752, 2833, 2906, 2968, 3010, 3039, 3068, + 3070, 3054, 3033, 3002, 2960, 2908, 2853, 2792, + 2724, 2645, 2564, 2476, 2380, 2289, 2199, 2116, + 2039, 1969, 1899, 1839, 1780, 1722, 1670, 1626, + 1585, 1544, 1503, 1462, 1412, 1370, 1340, 1320, + 1299, 1272, 1252, 1224, 1193, 1168, 1156, 1155, + 1152, 1147, 1140, 1129, 1116, 1113, 1115, 1130, + 1143, 1146, 1152, 1169, 1187, 1215, 1258, 1301, + 1345, 1385, 1428, 1469, 1511, 1555, 1611, 1669, + 1716, 1761, 1802, 1841, 1880, 1920, 1959, 1995, + 2024, 2045, 2060, 2069, 2073, 2071, 2067, 2057, + 2039, 2006, 1965, 1921, 1879, 1835, 1799, 1764, + 1727, 1688, 1654, 1621, 1596, 1575, 1562, 1556, + 1549, 1545, 1545, 1557, 1578, 1610, 1654, 1700, + 1752, 1808, 1869, 1935, 2007, 2089, 2173, 2253, + 2327, 2396, 2458, 2518, 2580, 2640, 2694, 2739, + 2772, 2798, 2824, 2852, 2878, 2901, 2925, 2935, + 2940, 2938, 2935, 2931, 2927, 2927, 2921, 2911, + 2897, 2881, 2866, 2861, 2861, 2860, 2860, 2859, + 2858, 2855, 2858, 2860, 2863, 2864, 2863, 2856, + 2841, 2817, 2798, 2777, 2750, 2716, 2676, 2629, + 2570, 2498, 2413, 2325, 2232, 2122, 2010, 1907, + 1791, 1673, 1558, 1448, 1348, 1253, 1159, 1073, + 993, 920, 863, 823, 799, 791, 793, 806, + 836, 870, 913, 973, 1048, 1135, 1229, 1332, + 1440, 1556, 1679, 1806, 1939, 2067, 2184, 2295, + 2398, 2490, 2579, 2663, 2733, 2800, 2849, 2882, + 2903, 2910, 2900, 2880, 2851, 2810, 2755, 2692, + 2623, 2550, 2473, 2393, 2308, 2220, 2127, 2035, + 1944, 1859, 1783, 1713, 1649, 1596, 1549, 1509, + 1478, 1445, 1415, 1385, 1360, 1340, 1317, 1291, + 1271, 1259, 1243, 1229, 1219, 1212, 1199, 1181, + 1170, 1164, 1165, 1161, 1158, 1156, 1153, 1149, + 1150, 1159, 1173, 1185, 1196, 1212, 1236, 1264, + 1297, 1339, 1383, 1424, 1464, 1507, 1547, 1584, + 1627, 1668, 1711, 1747, 1781, 1813, 1845, 1872, + 1901, 1928, 1947, 1958, 1964, 1965, 1962, 1954, + 1943, 1927, 1906, 1875, 1838, 1802, 1770, 1737, + 1702, 1671, 1644, 1620, 1597, 1577, 1565, 1556, + 1550, 1547, 1549, 1557, 1572, 1587, 1610, 1645, + 1686, 1734, 1786, 1845, 1906, 1973, 2045, 2126, + 2209, 2289, 2365, 2435, 2502, 2571, 2632, 2690, + 2745, 2789, 2826, 2859, 2890, 2916, 2935, 2955, + 2975, 2991, 2997, 2994, 2989, 2977, 2966, 2959, + 2952, 2949, 2937, 2913, 2888, 2865, 2848, 2834, + 2820, 2794, 2762, 2729, 2699, 2671, 2644, 2619, + 2584, 2538, 2488, 2428, 2368, 2301, 2224, 2142, + 2053, 1956, 1853, 1754, 1662, 1572, 1481, 1390, + 1308, 1226, 1147, 1074, 1012, 962, 921, 893, + 877, 865, 870, 889, 924, 970, 1024, 1086, + 1153, 1230, 1315, 1407, 1510, 1618, 1729, 1841, + 1944, 2043, 2141, 2233, 2319, 2402, 2475, 2538, + 2598, 2649, 2685, 2714, 2732, 2734, 2725, 2703, + 2663, 2611, 2549, 2481, 2415, 2348, 2276, 2196, + 2114, 2031, 1949, 1867, 1792, 1723, 1661, 1605, + 1552, 1505, 1468, 1436, 1411, 1383, 1352, 1314, + 1281, 1252, 1236, 1221, 1201, 1186, 1171, 1157, + 1149, 1149, 1146, 1136, 1132, 1127, 1123, 1124, + 1135, 1145, 1155, 1163, 1160, 1169, 1187, 1210, + 1238, 1273, 1311, 1355, 1404, 1452, 1503, 1550, + 1598, 1647, 1691, 1729, 1764, 1798, 1828, 1857, + 1885, 1910, 1928, 1939, 1953, 1964, 1968, 1963, + 1955, 1941, 1919, 1892, 1865, 1834, 1804, 1772, + 1731, 1695, 1659, 1627, 1603, 1584, 1566, 1557, + 1554, 1551, 1552, 1560, 1580, 1595, 1617, 1646, + 1679, 1724, 1772, 1825, 1882, 1938, 1994, 2063, + 2135, 2205, 2276, 2347, 2419, 2491, 2564, 2640, + 2709, 2770, 2815, 2857, 2897, 2932, 2966, 2993, + 3017, 3035, 3045, 3052, 3059, 3067, 3068, 3072, + 3071, 3054, 3030, 3006, 2988, 2967, 2945, 2926, + 2897, 2854, 2807, 2758, 2711, 2665, 2621, 2573, + 2512, 2443, 2366, 2289, 2212, 2128, 2034, 1924, + 1801, 1677, 1567, 1465, 1369, 1283, 1202, 1126, + 1051, 982, 931, 896, 866, 842, 835, 845, + 865, 900, 951, 1014, 1086, 1160, 1242, 1332, + 1430, 1535, 1650, 1772, 1896, 2020, 2142, 2253, + 2352, 2438, 2514, 2578, 2632, 2675, 2708, 2731, + 2748, 2755, 2752, 2738, 2707, 2660, 2601, 2531, + 2453, 2371, 2289, 2206, 2121, 2038, 1951, 1867, + 1784, 1701, 1624, 1556, 1497, 1452, 1413, 1382, + 1366, 1357, 1345, 1330, 1316, 1299, 1272, 1237, + 1203, 1181, 1167, 1153, 1142, 1134, 1123, 1102, + 1086, 1080, 1077, 1072, 1067, 1071, 1079, 1087, + 1099, 1120, 1149, 1174, 1197, 1227, 1260, 1301, + 1348, 1402, 1464, 1528, 1587, 1642, 1694, 1739, + 1779, 1814, 1845, 1873, 1894, 1913, 1928, 1946, + 1962, 1974, 1982, 1978, 1964, 1939, 1912, 1883, + 1856, 1827, 1793, 1758, 1719, 1677, 1640, 1610, + 1583, 1561, 1542, 1537, 1538, 1546, 1567, 1592, + 1623, 1659, 1689, 1718, 1751, 1791, 1831, 1877, + 1930, 1990, 2051, 2110, 2172, 2236, 2297, 2353, + 2402, 2449, 2495, 2541, 2584, 2619, 2648, 2671, + 2693, 2711, 2727, 2742, 2753, 2769, 2782, 2803, + 2829, 2851, 2878, 2904, 2927, 2941, 2950, 2951, + 2942, 2928, 2917, 2901, 2876, 2843, 2803, 2766, + 2714, 2660, 2605, 2539, 2459, 2361, 2250, 2134, + 2021, 1900, 1768, 1634, 1507, 1377, 1254, 1147, + 1050, 960, 877, 803, 754, 726, 703, 690, + 699, 722, 757, 805, 874, 956, 1044, 1134, + 1238, 1357, 1481, 1608, 1737, 1864, 1991, 2113, + 2225, 2328, 2418, 2488, 2545, 2587, 2618, 2635, + 2642, 2639, 2620, 2592, 2552, 2505, 2447, 2375, + 2296, 2214, 2126, 2035, 1947, 1857, 1771, 1686, + 1604, 1532, 1471, 1415, 1371, 1338, 1316, 1304, + 1307, 1318, 1330, 1339, 1343, 1344, 1338, 1328, + 1319, 1297, 1262, 1225, 1196, 1172, 1148, 1120, + 1093, 1068, 1037, 1005, 987, 976, 965, 949, + 943, 942, 943, 953, 976, 1006, 1038, 1073, + 1118, 1173, 1236, 1308, 1381, 1456, 1531, 1599, + 1659, 1718, 1767, 1807, 1843, 1878, 1908, 1926, + 1936, 1943, 1945, 1941, 1934, 1917, 1890, 1851, + 1806, 1761, 1719, 1673, 1624, 1579, 1538, 1496, + 1460, 1442, 1435, 1437, 1447, 1467, 1499, 1536, + 1581, 1632, 1683, 1737, 1795, 1853, 1914, 1979, + 2042, 2105, 2168, 2238, 2308, 2369, 2428, 2482, + 2533, 2582, 2623, 2661, 2688, 2700, 2712, 2724, + 2733, 2739, 2735, 2729, 2724, 2719, 2718, 2734, + 2756, 2772, 2784, 2800, 2822, 2836, 2839, 2823, + 2803, 2780, 2749, 2714, 2676, 2636, 2582, 2508, + 2439, 2379, 2307, 2207, 2097, 1977, 1841, 1695, + 1563, 1455, 1351, 1237, 1117, 1015, 923, 843, + 781, 739, 709, 686, 675, 696, 742, 803, + 874, 961, 1055, 1146, 1237, 1334, 1440, 1562, + 1693, 1830, 1968, 2097, 2218, 2322, 2415, 2498, + 2564, 2606, 2631, 2638, 2623, 2603, 2579, 2547, + 2506, 2451, 2371, 2276, 2176, 2077, 1988, 1900, + 1818, 1734, 1648, 1571, 1500, 1429, 1366, 1308, + 1252, 1206, 1176, 1163, 1164, 1186, 1215, 1244, + 1267, 1279, 1285, 1271, 1246, 1230, 1216, 1196, + 1172, 1147, 1109, 1061, 1018, 988, 970, 944, + 908, 878, 858, 847, 850, 874, 915, 942, + 958, 979, 1013, 1060, 1118, 1193, 1280, 1361, + 1435, 1512, 1598, 1679, 1755, 1819, 1866, 1903, + 1928, 1939, 1954, 1973, 1977, 1973, 1961, 1934, + 1892, 1842, 1790, 1744, 1700, 1654, 1600, 1540, + 1483, 1428, 1385, 1354, 1329, 1309, 1296, 1298, + 1318, 1358, 1414, 1485, 1560, 1628, 1696, 1767, + 1842, 1913, 1991, 2071, 2150, 2229, 2292, 2350, + 2414, 2479, 2535, 2582, 2628, 2658, 2673, 2682, + 2700, 2721, 2728, 2725, 2719, 2707, 2679, 2653, + 2642, 2645, 2649, 2649, 2658, 2676, 2697, 2726, + 2755, 2770, 2767, 2755, 2739, 2722, 2696, 2663, + 2621, 2565, 2499, 2432, 2359, 2262, 2157, 2046, + 1915, 1769, 1624, 1487, 1368, 1254, 1134, 1031, + 931, 833, 759, 706, 669, 645, 635, 651, + 689, 745, 819, 914, 1021, 1131, 1240, 1348, + 1460, 1580, 1706, 1839, 1977, 2111, 2231, 2338, + 2431, 2513, 2577, 2616, 2638, 2643, 2627, 2592, + 2550, 2503, 2451, 2386, 2304, 2208, 2103, 1997, + 1897, 1801, 1719, 1645, 1576, 1513, 1455, 1402, + 1358, 1322, 1296, 1270, 1253, 1244, 1252, 1269, + 1290, 1315, 1335, 1346, 1342, 1325, 1299, 1269, + 1236, 1190, 1140, 1090, 1038, 986, 931, 880, + 837, 794, 755, 723, 711, 714, 726, 754, + 795, 844, 896, 954, 1020, 1100, 1186, 1273, + 1369, 1472, 1574, 1672, 1766, 1855, 1932, 1995, + 2040, 2069, 2094, 2106, 2103, 2096, 2079, 2048, + 2006, 1953, 1897, 1834, 1774, 1708, 1641, 1579, + 1520, 1465, 1414, 1377, 1348, 1328, 1321, 1319, + 1329, 1361, 1410, 1471, 1540, 1618, 1698, 1779, + 1866, 1952, 2034, 2117, 2192, 2258, 2320, 2377, + 2431, 2479, 2521, 2558, 2581, 2596, 2610, 2617, + 2616, 2618, 2625, 2624, 2610, 2601, 2597, 2589, + 2584, 2589, 2594, 2612, 2633, 2651, 2692, 2745, + 2787, 2813, 2835, 2854, 2852, 2837, 2821, 2803, + 2774, 2715, 2641, 2566, 2481, 2384, 2272, 2143, + 2003, 1843, 1666, 1507, 1374, 1251, 1128, 1015, + 915, 821, 744, 691, 659, 650, 654, 671, + 713, 783, 872, 979, 1108, 1238, 1364, 1477, + 1592, 1713, 1838, 1966, 2090, 2207, 2314, 2405, + 2475, 2525, 2559, 2571, 2561, 2537, 2497, 2435, + 2363, 2295, 2229, 2157, 2073, 1981, 1880, 1778, + 1689, 1613, 1551, 1506, 1470, 1436, 1418, 1406, + 1398, 1399, 1408, 1421, 1435, 1449, 1461, 1480, + 1502, 1516, 1514, 1500, 1473, 1432, 1372, 1303, + 1236, 1162, 1081, 995, 917, 848, 785, 718, + 669, 632, 595, 575, 574, 601, 646, 693, + 755, 835, 929, 1024, 1124, 1236, 1354, 1468, + 1576, 1688, 1800, 1903, 1985, 2051, 2106, 2150, + 2168, 2162, 2149, 2130, 2093, 2045, 1989, 1929, + 1862, 1792, 1715, 1639, 1573, 1511, 1451, 1398, + 1359, 1335, 1321, 1323, 1331, 1356, 1402, 1453, + 1507, 1576, 1665, 1755, 1838, 1929, 2023, 2110, + 2190, 2261, 2323, 2373, 2415, 2449, 2473, 2497, + 2513, 2504, 2491, 2485, 2468, 2443, 2430, 2413, + 2380, 2358, 2355, 2354, 2349, 2368, 2388, 2403, + 2436, 2478, 2526, 2594, 2673, 2745, 2809, 2877, + 2926, 2942, 2962, 2981, 2972, 2937, 2882, 2829, + 2752, 2666, 2568, 2448, 2320, 2183, 2012, 1813, + 1625, 1455, 1286, 1138, 1015, 902, 802, 715, + 646, 613, 614, 626, 649, 694, 772, 872, + 983, 1118, 1271, 1428, 1569, 1695, 1806, 1920, + 2040, 2151, 2251, 2344, 2415, 2460, 2491, 2500, + 2491, 2458, 2398, 2319, 2231, 2136, 2038, 1941, + 1856, 1782, 1709, 1633, 1556, 1487, 1428, 1387, + 1366, 1364, 1378, 1396, 1416, 1443, 1479, 1520, + 1565, 1604, 1637, 1658, 1671, 1679, 1685, 1674, + 1649, 1602, 1528, 1432, 1320, 1199, 1073, 955, + 842, 731, 635, 553, 482, 426, 391, 382, + 389, 409, 450, 515, 603, 706, 824, 959, + 1108, 1257, 1397, 1531, 1672, 1808, 1928, 2040, + 2137, 2213, 2259, 2286, 2291, 2285, 2256, 2196, + 2120, 2038, 1952, 1861, 1764, 1679, 1604, 1528, + 1451, 1384, 1332, 1293, 1267, 1256, 1265, 1294, + 1334, 1386, 1453, 1535, 1634, 1741, 1845, 1948, + 2053, 2151, 2234, 2305, 2380, 2451, 2504, 2523, + 2527, 2531, 2528, 2509, 2474, 2446, 2422, 2382, + 2322, 2274, 2253, 2240, 2215, 2184, 2172, 2186, + 2199, 2212, 2257, 2327, 2392, 2450, 2522, 2612, + 2714, 2823, 2921, 3008, 3092, 3154, 3180, 3186, + 3189, 3174, 3128, 3049, 2951, 2839, 2711, 2572, + 2418, 2254, 2092, 1912, 1708, 1505, 1315, 1151, + 1010, 895, 805, 739, 696, 670, 667, 710, + 786, 872, 967, 1070, 1196, 1336, 1482, 1634, + 1793, 1945, 2069, 2157, 2225, 2301, 2370, 2412, + 2438, 2451, 2442, 2407, 2349, 2283, 2213, 2133, + 2031, 1925, 1823, 1731, 1643, 1573, 1531, 1507, + 1497, 1485, 1485, 1492, 1520, 1560, 1611, 1676, + 1738, 1796, 1848, 1893, 1934, 1964, 1978, 1976, + 1957, 1904, 1815, 1726, 1631, 1513, 1380, 1243, + 1097, 940, 788, 649, 532, 436, 351, 290, + 258, 256, 276, 316, 391, 494, 613, 739, + 878, 1029, 1181, 1343, 1509, 1669, 1819, 1947, + 2052, 2145, 2220, 2263, 2282, 2284, 2264, 2223, + 2158, 2081, 1997, 1914, 1827, 1736, 1646, 1560, + 1483, 1424, 1377, 1346, 1339, 1346, 1359, 1391, + 1444, 1512, 1579, 1658, 1751, 1849, 1944, 2040, + 2133, 2221, 2300, 2372, 2426, 2464, 2490, 2496, + 2484, 2467, 2437, 2400, 2360, 2309, 2255, 2205, + 2169, 2130, 2080, 2051, 2049, 2068, 2081, 2113, + 2173, 2239, 2309, 2396, 2499, 2606, 2715, 2815, + 2917, 3026, 3140, 3237, 3323, 3408, 3472, 3491, + 3454, 3398, 3342, 3252, 3136, 3009, 2868, 2715, + 2552, 2390, 2240, 2090, 1934, 1769, 1609, 1465, + 1338, 1221, 1116, 1058, 1049, 1040, 1032, 1052, + 1100, 1169, 1245, 1330, 1438, 1550, 1650, 1740, + 1838, 1933, 2015, 2072, 2112, 2149, 2167, 2156, + 2133, 2126, 2121, 2105, 2072, 2027, 1981, 1930, + 1881, 1839, 1802, 1768, 1740, 1723, 1721, 1739, + 1773, 1812, 1866, 1924, 1988, 2047, 2102, 2159, + 2210, 2251, 2274, 2286, 2278, 2254, 2212, 2157, + 2084, 1999, 1909, 1802, 1678, 1548, 1416, 1278, + 1139, 997, 841, 704, 599, 505, 421, 370, + 363, 374, 395, 448, 538, 646, 759, 880, + 1015, 1157, 1299, 1422, 1541, 1671, 1790, 1879, + 1949, 2008, 2060, 2084, 2077, 2065, 2043, 2003, + 1939, 1867, 1803, 1735, 1659, 1589, 1536, 1507, + 1486, 1466, 1462, 1485, 1534, 1587, 1638, 1703, + 1781, 1853, 1917, 1987, 2058, 2121, 2172, 2215, + 2258, 2301, 2331, 2335, 2341, 2355, 2355, 2327, + 2291, 2261, 2221, 2172, 2122, 2080, 2050, 2030, + 2012, 2015, 2042, 2060, 2081, 2126, 2184, 2241, + 2296, 2369, 2449, 2526, 2596, 2663, 2741, 2830, + 2900, 2954, 3003, 3058, 3092, 3101, 3128, 3167, + 3178, 3160, 3129, 3100, 3050, 2972, 2880, 2785, + 2696, 2597, 2481, 2383, 2299, 2221, 2146, 2075, + 2018, 1959, 1883, 1804, 1739, 1681, 1619, 1568, + 1548, 1541, 1536, 1536, 1548, 1577, 1613, 1648, + 1678, 1710, 1737, 1750, 1758, 1779, 1804, 1822, + 1826, 1831, 1845, 1852, 1858, 1872, 1904, 1943, + 1970, 1991, 2015, 2044, 2070, 2084, 2097, 2110, + 2117, 2118, 2120, 2135, 2155, 2171, 2188, 2210, + 2226, 2223, 2208, 2194, 2173, 2142, 2097, 2046, + 1988, 1918, 1836, 1761, 1699, 1622, 1528, 1438, + 1355, 1269, 1186, 1109, 1036, 968, 906, 845, + 798, 773, 757, 749, 762, 803, 857, 915, + 984, 1067, 1151, 1229, 1305, 1380, 1451, 1518, + 1568, 1613, 1657, 1693, 1716, 1736, 1756, 1768, + 1769, 1759, 1750, 1750, 1744, 1728, 1709, 1700, + 1702, 1700, 1700, 1712, 1735, 1766, 1799, 1839, + 1887, 1935, 1969, 1999, 2036, 2069, 2092, 2106, + 2117, 2130, 2136, 2136, 2145, 2153, 2148, 2145, + 2142, 2141, 2136, 2131, 2134, 2147, 2154, 2157, + 2164, 2171, 2176, 2200, 2244, 2290, 2326, 2368, + 2436, 2502, 2560, 2631, 2712, 2769, 2814, 2855, + 2894, 2939, 2991, 3028, 3042, 3069, 3115, 3144, + 3139, 3149, 3177, 3146, 3045, 2956, 2888, 2804, + 2708, 2608, 2497, 2401, 2333, 2263, 2194, 2157, + 2126, 2058, 1970, 1902, 1862, 1818, 1760, 1719, + 1681, 1625, 1582, 1558, 1531, 1528, 1528, 1526, + 1534, 1553, 1588, 1610, 1631, 1655, 1670, 1654, + 1639, 1651, 1670, 1683, 1721, 1789, 1857, 1919, + 1977, 2027, 2076, 2120, 2145, 2162, 2177, 2191, + 2200, 2201, 2211, 2226, 2230, 2219, 2210, 2200, + 2188, 2183, 2180, 2179, 2162, 2132, 2093, 2045, + 1983, 1911, 1840, 1773, 1711, 1638, 1572, 1539, + 1512, 1456, 1381, 1314, 1248, 1178, 1112, 1042, + 980, 936, 887, 833, 809, 817, 825, 832, + 859, 909, 961, 1014, 1085, 1169, 1246, 1316, + 1375, 1420, 1468, 1524, 1575, 1623, 1672, 1715, + 1746, 1773, 1802, 1822, 1833, 1823, 1807, 1794, + 1778, 1761, 1754, 1754, 1768, 1792, 1804, 1818, + 1845, 1882, 1918, 1951, 1984, 2014, 2036, 2047, + 2062, 2071, 2068, 2066, 2068, 2068, 2064, 2063, + 2077, 2103, 2118, 2120, 2135, 2152, 2149, 2139, + 2148, 2171, 2185, 2192, 2211, 2254, 2303, 2353, + 2404, 2436, 2463, 2510, 2546, 2562, 2586, 2620, + 2648, 2674, 2701, 2718, 2744, 2786, 2828, 2847, + 2860, 2897, 2940, 2944, 2953, 2989, 3012, 3010, + 3010, 3007, 2977, 2931, 2881, 2830, 2764, 2696, + 2632, 2553, 2463, 2383, 2308, 2227, 2147, 2068, + 1981, 1885, 1804, 1738, 1656, 1584, 1538, 1514, + 1501, 1484, 1482, 1504, 1534, 1573, 1613, 1649, + 1691, 1734, 1762, 1782, 1814, 1847, 1865, 1877, + 1896, 1922, 1940, 1954, 1973, 1997, 2022, 2036, + 2039, 2043, 2052, 2057, 2055, 2059, 2061, 2064, + 2065, 2076, 2094, 2119, 2139, 2155, 2175, 2187, + 2186, 2175, 2156, 2131, 2096, 2051, 1997, 1944, + 1877, 1783, 1686, 1620, 1554, 1449, 1335, 1249, + 1153, 1045, 978, 932, 869, 820, 804, 793, + 790, 821, 881, 942, 1009, 1099, 1189, 1267, + 1349, 1437, 1508, 1563, 1617, 1660, 1676, 1686, + 1705, 1723, 1722, 1712, 1703, 1688, 1666, 1651, + 1646, 1636, 1634, 1650, 1663, 1682, 1726, 1772, + 1822, 1888, 1957, 2014, 2065, 2121, 2172, 2209, + 2237, 2255, 2252, 2240, 2225, 2204, 2169, 2139, + 2119, 2081, 2047, 2036, 2029, 2002, 1986, 2001, + 2023, 2039, 2065, 2114, 2155, 2197, 2257, 2326, + 2387, 2446, 2502, 2539, 2590, 2671, 2725, 2742, + 2786, 2852, 2893, 2909, 2931, 2955, 2967, 2974, + 2990, 3006, 3012, 3030, 3055, 3078, 3110, 3146, + 3172, 3187, 3175, 3122, 3050, 2998, 2952, 2876, + 2779, 2702, 2649, 2594, 2518, 2453, 2423, 2375, + 2289, 2205, 2122, 2041, 1980, 1915, 1848, 1793, + 1727, 1661, 1602, 1558, 1544, 1537, 1531, 1556, + 1597, 1638, 1679, 1727, 1763, 1782, 1783, 1771, + 1775, 1793, 1826, 1875, 1938, 2019, 2096, 2144, + 2174, 2207, 2230, 2232, 2226, 2229, 2232, 2235, + 2238, 2249, 2267, 2275, 2267, 2261, 2266, 2270, + 2278, 2291, 2310, 2326, 2314, 2272, 2217, 2158, + 2089, 2015, 1952, 1906, 1868, 1820, 1771, 1747, + 1731, 1670, 1566, 1474, 1385, 1287, 1202, 1122, + 1035, 976, 956, 932, 901, 904, 930, 952, + 991, 1055, 1130, 1195, 1253, 1314, 1372, 1419, + 1463, 1505, 1539, 1569, 1616, 1675, 1730, 1765, + 1786, 1802, 1815, 1814, 1802, 1780, 1758, 1764, + 1780, 1789, 1814, 1862, 1914, 1967, 2019, 2068, + 2111, 2153, 2194, 2211, 2219, 2230, 2220, 2196, + 2171, 2142, 2109, 2083, 2068, 2048, 2031, 2030, + 2039, 2044, 2040, 2048, 2071, 2099, 2123, 2159, + 2208, 2266, 2333, 2404, 2458, 2498, 2553, 2617, + 2651, 2660, 2681, 2704, 2706, 2691, 2674, 2667, + 2662, 2652, 2653, 2663, 2680, 2704, 2738, 2777, + 2833, 2895, 2936, 2970, 3020, 3065, 3101, 3148, + 3207, 3260, 3300, 3332, 3338, 3311, 3244, 3157, + 3055, 2947, 2826, 2691, 2553, 2429, 2328, 2240, + 2156, 2069, 1987, 1916, 1854, 1798, 1759, 1717, + 1672, 1653, 1667, 1676, 1669, 1679, 1708, 1740, + 1781, 1833, 1874, 1906, 1930, 1941, 1929, 1913, + 1895, 1866, 1836, 1814, 1812, 1829, 1856, 1895, + 1946, 1994, 2042, 2084, 2128, 2170, 2203, 2235, + 2266, 2292, 2311, 2320, 2325, 2338, 2348, 2342, + 2331, 2325, 2320, 2301, 2262, 2216, 2163, 2097, + 2025, 1953, 1890, 1838, 1796, 1768, 1755, 1738, + 1678, 1583, 1524, 1524, 1492, 1387, 1313, 1302, + 1264, 1200, 1181, 1187, 1175, 1151, 1115, 1105, + 1128, 1150, 1177, 1219, 1268, 1316, 1358, 1394, + 1436, 1476, 1523, 1577, 1629, 1681, 1720, 1745, + 1779, 1820, 1839, 1841, 1836, 1835, 1843, 1849, + 1852, 1870, 1909, 1941, 1944, 1944, 1968, 1999, + 2008, 2017, 2038, 2055, 2055, 2050, 2057, 2070, + 2073, 2060, 2049, 2050, 2058, 2059, 2054, 2064, + 2087, 2092, 2088, 2084, 2103, 2136, 2159, 2183, + 2222, 2267, 2310, 2349, 2391, 2434, 2465, 2475, + 2489, 2517, 2542, 2564, 2576, 2602, 2640, 2683, + 2727, 2763, 2792, 2822, 2893, 2982, 3023, 3033, + 3073, 3122, 3156, 3207, 3257, 3268, 3288, 3328, + 3359, 3391, 3399, 3342, 3235, 3125, 3034, 2927, + 2795, 2671, 2547, 2464, 2432, 2398, 2365, 2327, + 2260, 2199, 2151, 2078, 2010, 1966, 1924, 1892, + 1861, 1812, 1760, 1710, 1682, 1660, 1624, 1618, + 1643, 1664, 1687, 1723, 1746, 1744, 1728, 1693, + 1662, 1659, 1673, 1709, 1777, 1874, 1986, 2078, + 2131, 2162, 2187, 2193, 2185, 2180, 2179, 2174, + 2171, 2187, 2212, 2224, 2217, 2197, 2177, 2170, + 2173, 2182, 2197, 2213, 2218, 2200, 2168, 2126, + 2074, 2021, 1980, 1956, 1951, 1960, 1976, 1994, + 1990, 1953, 1870, 1770, 1693, 1623, 1514, 1393, + 1338, 1331, 1292, 1241, 1226, 1199, 1124, 1047, + 1013, 1026, 1043, 1046, 1072, 1135, 1198, 1244, + 1300, 1372, 1438, 1487, 1540, 1604, 1674, 1726, + 1742, 1749, 1765, 1768, 1732, 1679, 1657, 1657, + 1664, 1678, 1705, 1744, 1778, 1791, 1795, 1820, + 1856, 1881, 1907, 1952, 1996, 2032, 2074, 2104, + 2119, 2124, 2110, 2079, 2046, 2023, 2009, 1982, + 1947, 1923, 1905, 1880, 1860, 1867, 1885, 1908, + 1937, 1991, 2068, 2132, 2179, 2234, 2293, 2334, + 2370, 2401, 2419, 2438, 2479, 2513, 2518, 2531, + 2549, 2544, 2525, 2524, 2537, 2549, 2556, 2573, + 2607, 2654, 2705, 2766, 2848, 2924, 2965, 3009, + 3095, 3191, 3244, 3263, 3285, 3322, 3360, 3369, + 3358, 3366, 3377, 3362, 3309, 3223, 3100, 2971, + 2853, 2705, 2544, 2429, 2334, 2258, 2244, 2247, + 2249, 2259, 2246, 2209, 2162, 2093, 2036, 1997, + 1927, 1841, 1792, 1772, 1753, 1701, 1644, 1621, + 1614, 1607, 1606, 1603, 1600, 1609, 1609, 1587, + 1573, 1569, 1570, 1597, 1651, 1730, 1838, 1959, + 2065, 2153, 2212, 2247, 2253, 2234, 2202, 2168, + 2139, 2119, 2113, 2118, 2127, 2127, 2128, 2135, + 2136, 2143, 2153, 2172, 2190, 2190, 2179, 2166, + 2147, 2123, 2095, 2068, 2062, 2066, 2078, 2096, + 2113, 2110, 2076, 2028, 1963, 1880, 1789, 1692, + 1585, 1439, 1286, 1214, 1227, 1225, 1179, 1161, + 1195, 1237, 1278, 1329, 1359, 1366, 1356, 1329, + 1322, 1337, 1354, 1373, 1427, 1494, 1557, 1610, + 1653, 1676, 1670, 1652, 1633, 1618, 1592, 1550, + 1524, 1539, 1592, 1648, 1708, 1783, 1849, 1916, + 1987, 2036, 2066, 2101, 2110, 2080, 2044, 2026, + 2007, 1983, 1963, 1957, 1956, 1956, 1944, 1929, + 1928, 1926, 1899, 1866, 1847, 1847, 1861, 1889, + 1921, 1962, 2034, 2115, 2179, 2234, 2301, 2358, + 2384, 2393, 2392, 2381, 2362, 2343, 2330, 2339, + 2362, 2383, 2408, 2442, 2475, 2524, 2594, 2642, + 2654, 2663, 2705, 2764, 2806, 2840, 2899, 2984, + 3073, 3150, 3210, 3274, 3351, 3398, 3413, 3414, + 3426, 3448, 3427, 3394, 3394, 3422, 3435, 3389, + 3293, 3187, 3082, 2982, 2890, 2789, 2677, 2584, + 2551, 2552, 2545, 2534, 2520, 2465, 2386, 2306, + 2218, 2135, 2067, 1985, 1891, 1796, 1711, 1655, + 1602, 1532, 1459, 1434, 1451, 1476, 1514, 1567, + 1615, 1641, 1652, 1656, 1658, 1666, 1684, 1714, + 1771, 1860, 1952, 2039, 2107, 2133, 2122, 2096, + 2060, 2029, 2009, 1992, 1984, 2002, 2044, 2093, + 2131, 2166, 2195, 2222, 2254, 2291, 2333, 2381, + 2411, 2416, 2396, 2362, 2316, 2259, 2200, 2145, + 2107, 2091, 2088, 2089, 2084, 2057, 2020, 1972, + 1921, 1875, 1833, 1805, 1787, 1760, 1725, 1711, + 1724, 1723, 1665, 1582, 1539, 1528, 1519, 1470, + 1395, 1321, 1257, 1221, 1211, 1204, 1206, 1241, + 1307, 1386, 1481, 1564, 1612, 1640, 1645, 1639, + 1637, 1644, 1652, 1669, 1688, 1710, 1743, 1777, + 1792, 1785, 1773, 1763, 1752, 1748, 1750, 1751, + 1761, 1784, 1804, 1820, 1848, 1890, 1937, 1973, + 1999, 2027, 2053, 2064, 2054, 2025, 1990, 1950, + 1912, 1883, 1867, 1856, 1844, 1858, 1887, 1904, + 1929, 1966, 1997, 2011, 2021, 2044, 2090, 2135, + 2170, 2194, 2221, 2265, 2308, 2339, 2360, 2365, + 2374, 2383, 2393, 2411, 2432, 2433, 2417, 2442, + 2509, 2565, 2589, 2630, 2706, 2777, 2825, 2879, + 2951, 3017, 3067, 3106, 3145, 3206, 3269, 3305, + 3331, 3370, 3399, 3399, 3409, 3429, 3426, 3423, + 3438, 3448, 3428, 3388, 3318, 3224, 3143, 3055, + 2938, 2822, 2753, 2717, 2689, 2666, 2655, 2661, + 2657, 2613, 2524, 2431, 2341, 2221, 2102, 2012, + 1921, 1819, 1714, 1615, 1549, 1530, 1516, 1486, + 1483, 1518, 1560, 1594, 1627, 1650, 1647, 1627, + 1606, 1601, 1617, 1644, 1689, 1759, 1844, 1919, + 1969, 1991, 1983, 1960, 1934, 1899, 1879, 1887, + 1909, 1937, 1996, 2073, 2145, 2204, 2262, 2319, + 2371, 2416, 2452, 2479, 2500, 2503, 2474, 2425, + 2365, 2308, 2251, 2209, 2191, 2197, 2208, 2216, + 2229, 2240, 2232, 2203, 2160, 2115, 2081, 2062, + 2057, 2063, 2082, 2102, 2109, 2102, 2086, 2055, + 2006, 1946, 1855, 1713, 1552, 1432, 1352, 1247, + 1135, 1105, 1156, 1213, 1273, 1373, 1474, 1529, + 1555, 1553, 1526, 1488, 1435, 1396, 1396, 1421, + 1447, 1484, 1523, 1547, 1561, 1565, 1553, 1534, + 1524, 1516, 1511, 1525, 1554, 1587, 1630, 1687, + 1742, 1811, 1896, 1976, 2036, 2089, 2132, 2128, + 2082, 2033, 1984, 1932, 1874, 1837, 1834, 1856, + 1881, 1912, 1958, 2005, 2033, 2043, 2056, 2062, + 2060, 2052, 2051, 2059, 2071, 2088, 2103, 2109, + 2114, 2124, 2127, 2114, 2101, 2088, 2075, 2049, + 2015, 1989, 1971, 1978, 2007, 2040, 2083, 2137, + 2211, 2308, 2398, 2456, 2487, 2520, 2553, 2590, + 2637, 2610, 2541, 2576, 2666, 2721, 2798, 2921, + 3018, 3073, 3113, 3155, 3193, 3195, 3196, 3234, + 3295, 3344, 3386, 3442, 3477, 3483, 3516, 3567, + 3562, 3505, 3425, 3332, 3226, 3113, 3003, 2915, + 2846, 2762, 2686, 2652, 2632, 2626, 2646, 2648, + 2600, 2514, 2408, 2265, 2114, 1969, 1837, 1697, + 1544, 1430, 1392, 1388, 1372, 1366, 1399, 1443, + 1472, 1489, 1481, 1450, 1434, 1427, 1410, 1403, + 1418, 1449, 1494, 1555, 1620, 1690, 1760, 1808, + 1831, 1839, 1830, 1823, 1830, 1841, 1857, 1901, + 1974, 2050, 2131, 2226, 2331, 2429, 2521, 2589, + 2625, 2644, 2641, 2605, 2553, 2498, 2446, 2401, + 2368, 2349, 2345, 2357, 2375, 2392, 2406, 2406, + 2386, 2341, 2282, 2228, 2182, 2144, 2109, 2078, + 2060, 2044, 2018, 1989, 1961, 1934, 1897, 1845, + 1788, 1732, 1671, 1601, 1516, 1439, 1390, 1356, + 1315, 1272, 1251, 1253, 1265, 1276, 1291, 1306, + 1319, 1320, 1325, 1343, 1362, 1369, 1373, 1381, + 1393, 1409, 1439, 1474, 1514, 1554, 1591, 1634, + 1669, 1688, 1684, 1682, 1694, 1712, 1736, 1770, + 1812, 1866, 1925, 1980, 2018, 2044, 2056, 2048, + 2034, 2023, 2012, 1992, 1969, 1961, 1960, 1964, + 1961, 1956, 1950, 1952, 1952, 1947, 1946, 1939, + 1924, 1908, 1891, 1874, 1865, 1863, 1854, 1854, + 1864, 1870, 1863, 1855, 1852, 1846, 1824, 1794, + 1780, 1781, 1785, 1791, 1802, 1816, 1839, 1868, + 1903, 1943, 1974, 1996, 2020, 2039, 2066, 2101, + 2126, 2145, 2173, 2219, 2276, 2326, 2383, 2457, + 2529, 2596, 2678, 2775, 2858, 2928, 3002, 3073, + 3156, 3217, 3222, 3232, 3276, 3292, 3278, 3276, + 3286, 3298, 3326, 3372, 3409, 3426, 3448, 3477, + 3507, 3517, 3507, 3499, 3475, 3430, 3384, 3331, + 3252, 3169, 3102, 3032, 2937, 2838, 2773, 2714, + 2632, 2546, 2452, 2363, 2276, 2179, 2062, 1935, + 1831, 1751, 1652, 1538, 1472, 1461, 1462, 1453, + 1460, 1505, 1543, 1560, 1562, 1537, 1486, 1430, + 1380, 1344, 1329, 1335, 1370, 1432, 1511, 1599, + 1677, 1734, 1790, 1847, 1884, 1926, 1987, 2058, + 2126, 2195, 2258, 2320, 2373, 2411, 2448, 2487, + 2526, 2572, 2614, 2641, 2658, 2661, 2637, 2591, + 2545, 2506, 2478, 2464, 2477, 2514, 2556, 2588, + 2604, 2602, 2572, 2518, 2446, 2365, 2292, 2233, + 2181, 2132, 2089, 2049, 2002, 1947, 1891, 1842, + 1802, 1771, 1752, 1737, 1724, 1714, 1703, 1677, + 1641, 1606, 1585, 1577, 1578, 1594, 1610, 1607, + 1584, 1557, 1530, 1489, 1431, 1367, 1306, 1285, + 1323, 1372, 1373, 1384, 1451, 1526, 1581, 1625, + 1663, 1702, 1742, 1767, 1791, 1811, 1811, 1794, + 1771, 1771, 1786, 1799, 1812, 1831, 1854, 1872, + 1884, 1894, 1914, 1926, 1917, 1921, 1956, 1998, + 2021, 2032, 2043, 2061, 2074, 2051, 2014, 1986, + 1959, 1926, 1888, 1848, 1817, 1794, 1764, 1740, + 1734, 1741, 1755, 1765, 1781, 1802, 1810, 1809, + 1808, 1798, 1776, 1754, 1729, 1708, 1694, 1692, + 1680, 1667, 1657, 1655, 1647, 1641, 1651, 1658, + 1673, 1705, 1741, 1766, 1792, 1835, 1890, 1935, + 1957, 1977, 2017, 2055, 2080, 2109, 2140, 2164, + 2188, 2224, 2263, 2305, 2344, 2396, 2466, 2534, + 2617, 2713, 2807, 2896, 2988, 3086, 3178, 3240, + 3270, 3278, 3263, 3229, 3190, 3154, 3122, 3091, + 3079, 3114, 3189, 3260, 3320, 3390, 3475, 3555, + 3606, 3610, 3599, 3605, 3578, 3521, 3455, 3383, + 3306, 3208, 3112, 3042, 2970, 2890, 2812, 2744, + 2699, 2661, 2598, 2528, 2484, 2433, 2374, 2329, + 2285, 2244, 2187, 2104, 2015, 1908, 1774, 1629, + 1506, 1424, 1369, 1336, 1349, 1409, 1490, 1561, + 1624, 1652, 1664, 1676, 1661, 1644, 1666, 1708, + 1753, 1807, 1861, 1918, 1961, 1974, 1972, 1982, + 2004, 2041, 2097, 2170, 2258, 2338, 2399, 2453, + 2491, 2511, 2525, 2541, 2584, 2645, 2696, 2737, + 2767, 2767, 2730, 2658, 2561, 2472, 2398, 2340, + 2309, 2314, 2344, 2376, 2398, 2402, 2387, 2353, + 2298, 2240, 2195, 2154, 2115, 2075, 2035, 1984, + 1919, 1833, 1744, 1672, 1617, 1581, 1569, 1581, + 1606, 1630, 1642, 1640, 1628, 1607, 1581, 1567, + 1578, 1602, 1643, 1691, 1733, 1760, 1766, 1759, + 1733, 1704, 1681, 1673, 1688, 1724, 1778, 1837, + 1898, 1950, 1994, 2018, 2006, 1947, 1860, 1802, + 1808, 1852, 1877, 1871, 1876, 1905, 1928, 1927, + 1913, 1887, 1844, 1813, 1817, 1858, 1912, 1934, + 1926, 1913, 1900, 1874, 1832, 1788, 1751, 1724, + 1708, 1705, 1715, 1720, 1702, 1674, 1656, 1661, + 1676, 1684, 1686, 1701, 1723, 1732, 1718, 1693, + 1667, 1641, 1611, 1590, 1586, 1595, 1614, 1630, + 1644, 1658, 1660, 1638, 1616, 1619, 1628, 1629, + 1638, 1662, 1703, 1733, 1745, 1760, 1780, 1787, + 1779, 1769, 1774, 1787, 1798, 1794, 1791, 1788, + 1786, 1790, 1795, 1810, 1831, 1853, 1884, 1930, + 1974, 2000, 2014, 2016, 2009, 1999, 1991, 1991, + 1995, 2005, 2030, 2059, 2084, 2107, 2125, 2147, + 2175, 2207, 2246, 2290, 2337, 2392, 2451, 2507, + 2555, 2598, 2638, 2667, 2690, 2719, 2744, 2751, + 2748, 2745, 2745, 2760, 2783, 2827, 2871, 2902, + 2943, 3006, 3067, 3102, 3129, 3176, 3221, 3233, + 3258, 3285, 3304, 3307, 3285, 3257, 3210, 3162, + 3135, 3116, 3096, 3072, 3061, 3066, 3069, 3044, + 3013, 2994, 2960, 2933, 2904, 2868, 2849, 2832, + 2808, 2778, 2711, 2622, 2529, 2419, 2281, 2128, + 1981, 1840, 1737, 1683, 1663, 1682, 1732, 1810, + 1909, 2005, 2075, 2105, 2088, 2029, 1944, 1831, + 1726, 1639, 1568, 1521, 1501, 1511, 1545, 1591, + 1631, 1669, 1715, 1770, 1836, 1901, 1958, 2015, + 2062, 2089, 2103, 2105, 2089, 2074, 2069, 2074, + 2094, 2116, 2134, 2150, 2150, 2128, 2089, 2045, + 2016, 2010, 2029, 2077, 2155, 2245, 2333, 2399, + 2435, 2435, 2393, 2327, 2242, 2154, 2072, 1999, + 1945, 1904, 1870, 1845, 1828, 1820, 1829, 1846, + 1880, 1921, 1966, 2007, 2030, 2033, 2009, 1959, + 1893, 1818, 1749, 1706, 1681, 1674, 1689, 1707, + 1726, 1736, 1732, 1724, 1711, 1701, 1702, 1719, + 1750, 1792, 1844, 1893, 1928, 1950, 1957, 1952, + 1938, 1923, 1907, 1889, 1877, 1865, 1862, 1864, + 1867, 1866, 1850, 1822, 1803, 1810, 1830, 1855, + 1887, 1930, 1989, 2050, 2084, 2070, 2027, 1966, + 1895, 1822, 1755, 1707, 1691, 1694, 1722, 1770, + 1814, 1842, 1859, 1856, 1841, 1830, 1820, 1814, + 1803, 1791, 1782, 1769, 1750, 1730, 1705, 1676, + 1653, 1648, 1652, 1649, 1649, 1652, 1651, 1647, + 1635, 1625, 1628, 1632, 1641, 1667, 1695, 1713, + 1724, 1715, 1695, 1674, 1649, 1621, 1594, 1576, + 1580, 1597, 1617, 1645, 1685, 1719, 1738, 1755, + 1776, 1797, 1812, 1810, 1801, 1798, 1806, 1810, + 1805, 1790, 1780, 1790, 1806, 1817, 1832, 1843, + 1868, 1901, 1919, 1932, 1942, 1950, 1961, 1968, + 1973, 1983, 1991, 1993, 1994, 1993, 1983, 1976, + 1976, 1979, 1987, 2000, 2010, 2033, 2072, 2108, + 2148, 2196, 2244, 2299, 2353, 2397, 2440, 2468, + 2478, 2473, 2451, 2426, 2426, 2449, 2477, 2503, + 2537, 2609, 2715, 2815, 2883, 2932, 2965, 2970, + 2953, 2930, 2929, 2967, 3017, 3056, 3089, 3121, + 3185, 3277, 3343, 3378, 3378, 3376, 3385, 3349, + 3291, 3264, 3246, 3209, 3174, 3163, 3193, 3258, + 3315, 3361, 3385, 3377, 3372, 3372, 3338, 3251, + 3163, 3068, 2932, 2807, 2675, 2534, 2433, 2362, + 2322, 2314, 2331, 2364, 2376, 2350, 2292, 2214, + 2120, 2012, 1907, 1840, 1802, 1771, 1764, 1746, + 1706, 1661, 1587, 1504, 1444, 1419, 1420, 1455, + 1516, 1579, 1640, 1699, 1727, 1725, 1703, 1664, + 1628, 1624, 1655, 1699, 1741, 1783, 1822, 1836, + 1818, 1792, 1780, 1799, 1857, 1940, 2039, 2144, + 2251, 2331, 2360, 2349, 2315, 2264, 2199, 2150, + 2137, 2145, 2177, 2222, 2254, 2275, 2288, 2285, + 2271, 2257, 2249, 2257, 2272, 2281, 2286, 2269, + 2227, 2166, 2100, 2037, 1978, 1938, 1924, 1930, + 1954, 1988, 2010, 2017, 2007, 1985, 1947, 1910, + 1885, 1872, 1877, 1884, 1894, 1899, 1897, 1885, + 1866, 1840, 1814, 1807, 1810, 1823, 1842, 1870, + 1901, 1926, 1941, 1952, 1960, 1968, 1977, 1987, + 2003, 2022, 2040, 2058, 2069, 2068, 2065, 2062, + 2061, 2068, 2082, 2107, 2141, 2176, 2213, 2243, + 2261, 2262, 2234, 2179, 2126, 2097, 2086, 2073, + 2058, 2058, 2082, 2107, 2107, 2088, 2059, 2022, + 1981, 1951, 1924, 1896, 1875, 1861, 1863, 1873, + 1875, 1868, 1861, 1852, 1834, 1817, 1803, 1788, + 1766, 1729, 1687, 1655, 1637, 1615, 1587, 1579, + 1605, 1641, 1678, 1710, 1739, 1767, 1773, 1767, + 1752, 1738, 1706, 1677, 1654, 1649, 1664, 1682, + 1694, 1707, 1738, 1773, 1797, 1815, 1836, 1858, + 1880, 1882, 1877, 1879, 1877, 1869, 1852, 1843, + 1840, 1840, 1844, 1852, 1862, 1872, 1883, 1890, + 1894, 1892, 1896, 1906, 1916, 1923, 1931, 1937, + 1941, 1948, 1950, 1941, 1932, 1931, 1928, 1921, + 1916, 1910, 1905, 1913, 1931, 1961, 1990, 2008, + 2024, 2042, 2056, 2063, 2043, 2011, 1982, 1956, + 1936, 1927, 1932, 1950, 1979, 2012, 2046, 2082, + 2113, 2128, 2137, 2142, 2148, 2161, 2180, 2196, + 2213, 2248, 2299, 2350, 2405, 2460, 2499, 2530, + 2546, 2550, 2556, 2556, 2547, 2548, 2577, 2640, + 2720, 2786, 2846, 2921, 3004, 3063, 3069, 3056, + 3055, 3065, 3067, 3060, 3049, 3054, 3077, 3103, + 3126, 3137, 3145, 3161, 3187, 3206, 3211, 3231, + 3246, 3242, 3228, 3203, 3182, 3176, 3157, 3118, + 3075, 3031, 3006, 2990, 2952, 2903, 2849, 2812, + 2790, 2763, 2745, 2712, 2653, 2579, 2502, 2404, + 2267, 2098, 1929, 1827, 1771, 1732, 1734, 1804, + 1919, 2028, 2098, 2107, 2069, 1992, 1851, 1667, + 1499, 1371, 1291, 1254, 1250, 1289, 1363, 1435, + 1495, 1544, 1583, 1627, 1676, 1733, 1789, 1827, + 1845, 1849, 1833, 1798, 1746, 1692, 1667, 1686, + 1750, 1843, 1955, 2066, 2162, 2232, 2266, 2261, + 2230, 2198, 2180, 2188, 2219, 2271, 2335, 2398, + 2437, 2442, 2422, 2386, 2341, 2290, 2242, 2209, + 2207, 2215, 2226, 2232, 2230, 2232, 2228, 2219, + 2214, 2219, 2226, 2229, 2216, 2188, 2141, 2071, + 1991, 1905, 1834, 1782, 1761, 1775, 1819, 1878, + 1938, 1990, 2025, 2038, 2028, 2001, 1958, 1917, + 1876, 1841, 1811, 1792, 1783, 1781, 1782, 1793, + 1813, 1841, 1874, 1912, 1946, 1977, 1996, 2002, + 2000, 1987, 1971, 1955, 1947, 1952, 1966, 1985, + 2007, 2032, 2052, 2065, 2076, 2081, 2080, 2083, + 2090, 2103, 2120, 2139, 2159, 2181, 2201, 2211, + 2215, 2214, 2204, 2192, 2175, 2156, 2135, 2117, + 2102, 2086, 2077, 2075, 2081, 2084, 2078, 2081, + 2093, 2099, 2076, 2020, 1937, 1824, 1714, 1648, + 1607, 1576, 1560, 1579, 1647, 1740, 1800, 1814, + 1801, 1770, 1725, 1675, 1627, 1576, 1531, 1481, + 1439, 1424, 1430, 1437, 1449, 1470, 1511, 1561, + 1622, 1687, 1744, 1780, 1781, 1758, 1726, 1704, + 1679, 1638, 1611, 1619, 1643, 1675, 1713, 1751, + 1786, 1810, 1824, 1833, 1846, 1858, 1865, 1864, + 1862, 1858, 1856, 1856, 1859, 1858, 1851, 1842, + 1840, 1843, 1843, 1842, 1842, 1845, 1838, 1830, + 1827, 1836, 1849, 1863, 1877, 1888, 1902, 1916, + 1915, 1893, 1865, 1837, 1810, 1797, 1799, 1806, + 1817, 1834, 1864, 1897, 1929, 1960, 1981, 2007, + 2031, 2035, 2034, 2028, 2019, 2006, 1982, 1964, + 1965, 1983, 2006, 2033, 2067, 2104, 2144, 2179, + 2199, 2203, 2195, 2192, 2185, 2176, 2171, 2173, + 2194, 2222, 2244, 2259, 2284, 2315, 2342, 2376, + 2405, 2415, 2426, 2436, 2443, 2460, 2474, 2481, + 2488, 2505, 2544, 2598, 2652, 2706, 2760, 2798, + 2814, 2836, 2865, 2865, 2833, 2807, 2795, 2803, + 2827, 2847, 2877, 2928, 2958, 2979, 3006, 3042, + 3081, 3090, 3065, 3050, 3061, 3071, 3063, 3036, + 3006, 2987, 2962, 2932, 2920, 2919, 2895, 2866, + 2855, 2855, 2853, 2828, 2756, 2623, 2409, 2184, + 2063, 1996, 1882, 1807, 1871, 2060, 2301, 2485, + 2555, 2552, 2477, 2278, 1995, 1698, 1429, 1241, + 1139, 1114, 1204, 1368, 1522, 1640, 1719, 1756, + 1761, 1742, 1745, 1784, 1820, 1830, 1820, 1789, + 1722, 1606, 1446, 1308, 1235, 1253, 1354, 1533, + 1763, 1996, 2199, 2322, 2338, 2264, 2138, 2010, + 1902, 1827, 1805, 1859, 1970, 2091, 2185, 2220, + 2213, 2189, 2150, 2102, 2083, 2113, 2184, 2253, + 2304, 2335, 2342, 2316, 2258, 2188, 2128, 2099, + 2117, 2163, 2209, 2240, 2237, 2199, 2137, 2062, + 1982, 1911, 1879, 1900, 1971, 2061, 2149, 2224, + 2266, 2259, 2213, 2139, 2046, 1958, 1890, 1844, + 1823, 1821, 1826, 1839, 1859, 1879, 1897, 1923, + 1966, 2014, 2061, 2091, 2106, 2103, 2069, 2004, + 1927, 1856, 1808, 1787, 1785, 1809, 1867, 1943, + 2022, 2090, 2145, 2185, 2208, 2215, 2211, 2201, + 2186, 2172, 2156, 2140, 2126, 2120, 2121, 2132, + 2154, 2184, 2218, 2253, 2282, 2309, 2320, 2319, + 2308, 2289, 2271, 2258, 2243, 2230, 2231, 2233, + 2225, 2217, 2211, 2196, 2178, 2162, 2141, 2114, + 2090, 2078, 2077, 2063, 2049, 2059, 2070, 2077, + 2073, 2050, 2013, 1985, 1942, 1879, 1823, 1787, + 1762, 1756, 1764, 1774, 1792, 1795, 1793, 1805, + 1809, 1801, 1789, 1770, 1752, 1739, 1712, 1678, + 1656, 1643, 1633, 1629, 1646, 1681, 1722, 1753, + 1776, 1804, 1824, 1830, 1822, 1805, 1784, 1763, + 1740, 1727, 1731, 1745, 1762, 1776, 1805, 1843, + 1870, 1883, 1901, 1915, 1917, 1915, 1908, 1901, + 1899, 1893, 1873, 1862, 1859, 1864, 1870, 1877, + 1892, 1910, 1927, 1939, 1945, 1944, 1940, 1938, + 1932, 1922, 1911, 1904, 1908, 1915, 1919, 1923, + 1931, 1939, 1944, 1947, 1953, 1964, 1973, 1977, + 1986, 2006, 2027, 2033, 2031, 2040, 2061, 2078, + 2085, 2087, 2099, 2114, 2124, 2130, 2140, 2153, + 2165, 2178, 2196, 2223, 2250, 2268, 2279, 2292, + 2310, 2333, 2344, 2344, 2344, 2346, 2347, 2352, + 2350, 2345, 2346, 2361, 2383, 2408, 2426, 2436, + 2455, 2474, 2476, 2473, 2484, 2485, 2479, 2479, + 2477, 2470, 2467, 2461, 2456, 2464, 2470, 2482, + 2504, 2522, 2537, 2556, 2561, 2556, 2547, 2534, + 2522, 2509, 2485, 2473, 2487, 2502, 2512, 2513, + 2527, 2553, 2558, 2535, 2528, 2544, 2556, 2542, + 2518, 2513, 2521, 2527, 2520, 2500, 2497, 2511, + 2517, 2501, 2467, 2427, 2396, 2367, 2310, 2253, + 2226, 2226, 2250, 2280, 2302, 2331, 2358, 2366, + 2357, 2320, 2263, 2197, 2131, 2069, 2016, 1979, + 1949, 1933, 1934, 1943, 1951, 1964, 1982, 2007, + 2036, 2056, 2066, 2068, 2057, 2030, 1980, 1911, + 1844, 1795, 1766, 1751, 1754, 1781, 1832, 1887, + 1936, 1974, 2007, 2027, 2032, 2025, 2006, 1989, + 1976, 1963, 1948, 1934, 1918, 1915, 1914, 1919, + 1931, 1953, 1990, 2033, 2069, 2096, 2117, 2127, + 2125, 2111, 2084, 2056, 2040, 2029, 2023, 2025, + 2032, 2038, 2046, 2057, 2067, 2073, 2077, 2083, + 2095, 2107, 2113, 2121, 2123, 2122, 2121, 2117, + 2109, 2102, 2101, 2100, 2102, 2104, 2103, 2104, + 2104, 2101, 2096, 2093, 2091, 2093, 2100, 2108, + 2121, 2134, 2141, 2137, 2130, 2118, 2103, 2085, + 2068, 2055, 2047, 2042, 2046, 2052, 2059, 2069, + 2080, 2094, 2103, 2113, 2120, 2120, 2119, 2110, + 2098, 2084, 2072, 2058, 2047, 2040, 2039, 2044, + 2064, 2075, 2086, 2092, 2089, 2095, 2104, 2112, + 2113, 2104, 2082, 2056, 2033, 2026, 2027, 2025, + 2025, 2023, 2018, 2018, 2010, 1989, 1975, 1966, + 1946, 1919, 1910, 1920, 1932, 1939, 1939, 1939, + 1943, 1925, 1878, 1815, 1771, 1740, 1694, 1656, + 1659, 1689, 1722, 1751, 1766, 1779, 1792, 1791, + 1778, 1756, 1730, 1697, 1667, 1642, 1629, 1615, + 1589, 1580, 1583, 1593, 1621, 1656, 1696, 1743, + 1775, 1796, 1810, 1810, 1797, 1762, 1719, 1681, + 1649, 1632, 1627, 1640, 1670, 1702, 1741, 1785, + 1821, 1848, 1865, 1875, 1882, 1877, 1856, 1835, + 1815, 1796, 1775, 1749, 1738, 1742, 1756, 1774, + 1799, 1834, 1869, 1896, 1916, 1931, 1929, 1918, + 1905, 1888, 1869, 1852, 1842, 1849, 1860, 1872, + 1889, 1910, 1933, 1954, 1974, 1990, 2007, 2021, + 2029, 2028, 2034, 2041, 2042, 2045, 2058, 2072, + 2082, 2092, 2113, 2137, 2156, 2171, 2183, 2201, + 2225, 2242, 2248, 2260, 2279, 2300, 2322, 2337, + 2350, 2369, 2385, 2396, 2395, 2397, 2412, 2430, + 2446, 2459, 2471, 2493, 2516, 2539, 2555, 2570, + 2589, 2606, 2626, 2650, 2658, 2659, 2672, 2697, + 2709, 2714, 2721, 2737, 2762, 2772, 2768, 2775, + 2799, 2820, 2818, 2803, 2790, 2789, 2780, 2753, + 2717, 2681, 2647, 2577, 2477, 2416, 2401, 2371, + 2325, 2324, 2389, 2484, 2552, 2565, 2540, 2494, + 2418, 2288, 2121, 1974, 1863, 1782, 1728, 1721, + 1757, 1808, 1862, 1900, 1913, 1916, 1922, 1923, + 1922, 1918, 1907, 1895, 1866, 1812, 1734, 1642, + 1550, 1471, 1429, 1439, 1501, 1606, 1729, 1852, + 1956, 2028, 2050, 2026, 1979, 1920, 1854, 1789, + 1754, 1754, 1777, 1803, 1819, 1830, 1846, 1863, + 1880, 1905, 1951, 2014, 2077, 2127, 2174, 2199, + 2191, 2146, 2082, 2012, 1948, 1913, 1908, 1928, + 1967, 2013, 2062, 2107, 2139, 2153, 2149, 2143, + 2144, 2152, 2162, 2179, 2203, 2220, 2218, 2197, + 2166, 2128, 2089, 2058, 2039, 2040, 2058, 2085, + 2114, 2144, 2169, 2176, 2163, 2141, 2124, 2113, + 2099, 2085, 2077, 2071, 2061, 2044, 2021, 1995, + 1970, 1945, 1927, 1926, 1942, 1970, 2004, 2038, + 2065, 2087, 2093, 2090, 2081, 2063, 2039, 2018, + 2001, 1994, 1993, 1996, 2001, 2009, 2017, 2026, + 2039, 2057, 2080, 2107, 2130, 2151, 2170, 2180, + 2182, 2172, 2152, 2128, 2104, 2084, 2072, 2073, + 2079, 2094, 2116, 2139, 2159, 2174, 2187, 2194, + 2195, 2190, 2186, 2185, 2182, 2172, 2161, 2153, + 2139, 2125, 2116, 2109, 2103, 2101, 2104, 2118, + 2141, 2162, 2177, 2188, 2189, 2185, 2173, 2158, + 2145, 2129, 2114, 2099, 2091, 2085, 2077, 2070, + 2065, 2058, 2056, 2052, 2051, 2062, 2071, 2077, + 2080, 2079, 2072, 2059, 2042, 2019, 1997, 1981, + 1970, 1959, 1958, 1961, 1970, 1976, 1976, 1977, + 1979, 1976, 1974, 1969, 1960, 1954, 1952, 1951, + 1949, 1948, 1941, 1937, 1933, 1927, 1923, 1923, + 1927, 1930, 1931, 1932, 1920, 1892, 1884, 1894, + 1895, 1884, 1871, 1875, 1890, 1907, 1909, 1885, + 1865, 1864, 1874, 1884, 1883, 1878, 1870, 1865, + 1858, 1846, 1829, 1823, 1829, 1832, 1834, 1849, + 1874, 1902, 1917, 1920, 1920, 1929, 1941, 1948, + 1947, 1938, 1939, 1946, 1950, 1954, 1960, 1971, + 1979, 1989, 1998, 2011, 2026, 2046, 2066, 2079, + 2083, 2080, 2083, 2086, 2086, 2076, 2060, 2049, + 2052, 2060, 2067, 2076, 2081, 2089, 2101, 2114, + 2124, 2128, 2128, 2129, 2126, 2125, 2127, 2126, + 2121, 2117, 2109, 2098, 2093, 2096, 2109, 2119, + 2123, 2130, 2141, 2159, 2170, 2172, 2169, 2168, + 2175, 2172, 2163, 2165, 2168, 2170, 2170, 2169, + 2169, 2177, 2185, 2189, 2182, 2186, 2193, 2199, + 2206, 2218, 2224, 2217, 2215, 2212, 2209, 2205, + 2202, 2198, 2193, 2193, 2200, 2207, 2208, 2205, + 2208, 2208, 2205, 2207, 2209, 2208, 2208, 2212, + 2215, 2224, 2234, 2239, 2242, 2240, 2240, 2243, + 2239, 2233, 2238, 2245, 2241, 2242, 2243, 2243, + 2244, 2242, 2241, 2242, 2247, 2253, 2257, 2260, + 2268, 2274, 2271, 2262, 2258, 2256, 2252, 2244, + 2231, 2226, 2225, 2224, 2222, 2218, 2214, 2211, + 2208, 2209, 2212, 2213, 2215, 2218, 2220, 2220, + 2216, 2208, 2199, 2191, 2178, 2165, 2151, 2144, + 2140, 2137, 2131, 2127, 2128, 2127, 2123, 2118, + 2111, 2108, 2101, 2093, 2086, 2080, 2071, 2063, + 2052, 2039, 2028, 2016, 2007, 1998, 1990, 1987, + 1985, 1987, 1990, 1992, 1995, 1995, 1992, 1986, + 1979, 1973, 1966, 1955, 1945, 1938, 1929, 1926, + 1922, 1919, 1918, 1923, 1925, 1929, 1936, 1942, + 1944, 1946, 1947, 1945, 1942, 1937, 1934, 1930, + 1925, 1923, 1924, 1928, 1932, 1938, 1944, 1950, + 1959, 1969, 1974, 1979, 1984, 1985, 1983, 1983, + 1983, 1981, 1980, 1975, 1975, 1972, 1976, 1981, + 1983, 1986, 1987, 1989, 1990, 1990, 1992, 1993, + 1992, 1996, 1998, 1998, 1995, 1994, 1993, 1991, + 1988, 1982, 1977, 1973, 1970, 1968, 1965, 1963, + 1966, 1968, 1969, 1971, 1974, 1979, 1984, 1985, + 1987, 1988, 1985, 1979, 1973, 1965, 1957, 1954, + 1950, 1947, 1948, 1948, 1952, 1959, 1966, 1974, + 1980, 1986, 1990, 1992, 1993, 1994, 1992, 1987, + 1979, 1975, 1976, 1977, 1973, 1973, 1977, 1986, + 1995, 2004, 2008, 2018, 2026, 2025, 2026, 2024, + 2021, 2019, 2013, 2009, 2006, 2005, 2007, 2007, + 2011, 2018, 2028, 2038, 2047, 2056, 2063, 2074, + 2083, 2087, 2087, 2089, 2090, 2087, 2086, 2085, + 2090, 2094, 2094, 2105, 2118, 2127, 2131, 2136, + 2145, 2153, 2156, 2155, 2150, 2152, 2156, 2158, + 2155, 2154, 2158, 2165, 2167, 2165, 2166, 2170, + 2177, 2184, 2185, 2190, 2195, 2199, 2202, 2200, + 2198, 2197, 2199, 2199, 2196, 2193, 2197, 2202, + 2203, 2203, 2206, 2208, 2208, 2209, 2210, 2210, + 2210, 2212, 2213, 2214, 2214, 2215, 2215, 2214, + 2216, 2217, 2212, 2208, 2212, 2214, 2213, 2215, + 2216, 2222, 2226, 2226, 2229, 2225, 2221, 2224, + 2222, 2215, 2208, 2203, 2196, 2192, 2184, 2175, + 2170, 2165, 2163, 2159, 2154, 2150, 2146, 2142, + 2138, 2137, 2133, 2130, 2126, 2124, 2121, 2113, + 2104, 2094, 2087, 2081, 2075, 2064, 2058, 2054, + 2052, 2049, 2045, 2044, 2042, 2039, 2038, 2032, + 2028, 2025, 2022, 2020, 2015, 2008, 1999, 1993, + 1988, 1982, 1974, 1970, 1972, 1972, 1975, 1977, + 1977, 1980, 1980, 1976, 1973, 1973, 1970, 1966, + 1962, 1961, 1957, 1955, 1954, 1955, 1956, 1956, + 1958, 1961, 1969, 1975, 1978, 1981, 1983, 1984, + 1988, 1985, 1982, 1981, 1980, 1980, 1982, 1985, + 1990, 1997, 2003, 2010, 2015, 2021, 2027, 2030, + 2033, 2035, 2036, 2039, 2042, 2044, 2045, 2049, + 2050, 2050, 2052, 2055, 2056, 2058, 2061, 2066, + 2070, 2069, 2073, 2074, 2076, 2079, 2081, 2079, + 2077, 2076, 2074, 2075, 2074, 2072, 2070, 2070, + 2070, 2069, 2066, 2064, 2062, 2063, 2060, 2059, + 2060, 2061, 2061, 2057, 2055, 2053, 2049, 2043, + 2036, 2027, 2021, 2012, 2010, 1999, 1994, 1992, + 1987, 1980, 1972, 1973, 1972, 1968, 1965, 1965, + 1966, 1967, 1963, 1958, 1954, 1947, 1945, 1940, + 1935, 1933, 1930, 1929, 1931, 1933, 1933, 1933, + 1933, 1934, 1935, 1936, 1934, 1932, 1934, 1934, + 1933, 1935, 1933, 1932, 1934, 1933, 1930, 1928, + 1931, 1930, 1931, 1932, 1931, 1934, 1932, 1932, + 1932, 1934, 1937, 1936, 1937, 1940, 1943, 1942, + 1946, 1945, 1944, 1944, 1942, 1944, 1946, 1948, + 1947, 1949, 1953, 1956, 1958, 1961, 1964, 1968, + 1970, 1971, 1975, 1976, 1979, 1981, 1982, 1985, + 1988, 1990, 1992, 1997, 2002, 2009, 2013, 2018, + 2027, 2033, 2039, 2042, 2049, 2054, 2061, 2062, + 2062, 2066, 2069, 2076, 2080, 2084, 2089, 2094, + 2099, 2105, 2110, 2114, 2120, 2125, 2130, 2137, + 2141, 2146, 2152, 2159, 2164, 2168, 2172, 2177, + 2182, 2186, 2187, 2192, 2197, 2201, 2205, 2210, + 2218, 2220, 2224, 2228, 2232, 2238, 2243, 2246, + 2249, 2252, 2250, 2248, 2248, 2246, 2249, 2250, + 2252, 2252, 2252, 2258, 2262, 2264, 2268, 2271, + 2272, 2274, 2271, 2269, 2268, 2268, 2264, 2262, + 2261, 2261, 2255, 2251, 2249, 2248, 2248, 2243, + 2241, 2244, 2246, 2249, 2248, 2247, 2246, 2246, + 2245, 2240, 2238, 2237, 2241, 2240, 2240, 2239, + 2240, 2240, 2238, 2236, 2234, 2233, 2230, 2226, + 2222, 2222, 2219, 2215, 2213, 2209, 2204, 2201, + 2193, 2185, 2182, 2175, 2169, 2164, 2161, 2154, + 2150, 2143, 2134, 2132, 2127, 2122, 2114, 2109, + 2104, 2097, 2092, 2085, 2077, 2068, 2060, 2054, + 2049, 2045, 2039, 2035, 2033, 2033, 2031, 2029, + 2027, 2023, 2023, 2018, 2015, 2013, 2010, 2008, + 2008, 2005, 2001, 2002, 1997, 1996, 1993, 1991, + 1991, 1995, 1996, 1996, 1997, 1998, 1999, 1999, + 1995, 1994, 1998, 1996, 1996, 1997, 1999, 2001, + 2002, 2006, 2009, 2011, 2012, 2015, 2017, 2020, + 2023, 2031, 2035, 2039, 2041, 2042, 2047, 2049, + 2048, 2049, 2052, 2056, 2058, 2060, 2064, 2068, + 2071, 2073, 2071, 2073, 2077, 2079, 2077, 2078, + 2077, 2077, 2076, 2073, 2073, 2071, 2069, 2068, + 2069, 2066, 2068, 2070, 2069, 2070, 2068, 2070, + 2067, 2067, 2064, 2062, 2059, 2056, 2050, 2048, + 2047, 2044, 2041, 2040, 2038, 2038, 2036, 2036, + 2035, 2035, 2035, 2033, 2035, 2032, 2030, 2027, + 2024, 2019, 2015, 2014, 2013, 2011, 2011, 2011, + 2011, 2010, 2012, 2012, 2009, 2009, 2005, 2004, + 2002, 1997, 1995, 1991, 1990, 1989, 1985, 1983, + 1982, 1982, 1980, 1978, 1978, 1980, 1980, 1980, + 1984, 1986, 1984, 1984, 1986, 1987, 1987, 1986, + 1987, 1986, 1987, 1988, 1989, 1989, 1987, 1990, + 1992, 1996, 1998, 2002, 2007, 2011, 2015, 2018, + 2021, 2026, 2028, 2028, 2028, 2026, 2026, 2025, + 2024, 2024, 2024, 2025, 2027, 2033, 2033, 2034, + 2038, 2040, 2043, 2041, 2044, 2043, 2042, 2040, + 2036, 2036, 2038, 2040, 2043, 2044, 2045, 2048, + 2049, 2055, 2058, 2059, 2061, 2064, 2064, 2064, + 2064, 2064, 2063, 2064, 2064, 2064, 2065, 2066, + 2067, 2070, 2074, 2076, 2078, 2077, 2079, 2074, + 2075, 2074, 2071, 2073, 2073, 2074, 2075, 2077, + 2079, 2079, 2080, 2080, 2079, 2083, 2087, 2091, + 2093, 2093, 2097, 2098, 2100, 2105, 2108, 2107, + 2109, 2111, 2112, 2116, 2119, 2121, 2123, 2126, + 2131, 2134, 2138, 2140, 2143, 2144, 2148, 2149, + 2151, 2152, 2152, 2154, 2152, 2155, 2156, 2157, + 2158, 2162, 2165, 2165, 2167, 2169, 2171, 2170, + 2173, 2171, 2172, 2174, 2174, 2171, 2168, 2169, + 2168, 2163, 2162, 2164, 2166, 2167, 2169, 2165, + 2167, 2166, 2165, 2165, 2165, 2162, 2160, 2160, + 2159, 2156, 2153, 2152, 2152, 2146, 2143, 2141, + 2139, 2136, 2133, 2129, 2125, 2120, 2114, 2111, + 2108, 2103, 2100, 2092, 2091, 2091, 2087, 2080, + 2076, 2076, 2073, 2068, 2065, 2061, 2056, 2053, + 2050, 2044, 2039, 2036, 2032, 2028, 2024, 2024, + 2021, 2018, 2017, 2017, 2013, 2007, 2006, 2001, + 1996, 1997, 1992, 1990, 1988, 1982, 1979, 1977, + 1973, 1970, 1967, 1965, 1963, 1961, 1960, 1958, + 1954, 1955, 1951, 1949, 1947, 1941, 1937, 1935, + 1935, 1934, 1934, 1931, 1933, 1935, 1936, 1936, + 1936, 1937, 1939, 1939, 1942, 1943, 1946, 1945, + 1944, 1945, 1946, 1948, 1949, 1950, 1952, 1949, + 1948, 1948, 1947, 1946, 1946, 1949, 1949, 1949, + 1952, 1954, 1956, 1955, 1953, 1954, 1954, 1955, + 1957, 1953, 1952, 1950, 1948, 1948, 1948, 1948, + 1947, 1949, 1949, 1947, 1946, 1948, 1951, 1950, + 1951, 1953, 1953, 1952, 1955, 1955, 1953, 1951, + 1952, 1953, 1951, 1950, 1950, 1953, 1954, 1953, + 1954, 1951, 1952, 1953, 1953, 1952, 1953, 1954, + 1956, 1955, 1954, 1955, 1953, 1953, 1953, 1951, + 1951, 1951, 1950, 1954, 1955, 1956, 1956, 1957, + 1956, 1961, 1964, 1965, 1969, 1970, 1974, 1978, + 1980, 1981, 1981, 1983, 1983, 1986, 1987, 1992, + 1997, 2000, 2002, 2006, 2011, 2016, 2020, 2027, + 2031, 2033, 2039, 2044, 2046, 2049, 2053, 2058, + 2059, 2060, 2061, 2064, 2067, 2072, 2077, 2081, + 2086, 2090, 2096, 2100, 2102, 2104, 2108, 2111, + 2115, 2115, 2116, 2118, 2120, 2119, 2119, 2119, + 2118, 2119, 2119, 2120, 2120, 2120, 2124, 2128, + 2127, 2127, 2127, 2127, 2129, 2127, 2125, 2124, + 2124, 2125, 2124, 2125, 2123, 2122, 2123, 2122, + 2121, 2122, 2125, 2128, 2129, 2132, 2134, 2133, + 2134, 2136, 2135, 2137, 2136, 2134, 2137, 2137, + 2138, 2139, 2137, 2134, 2139, 2139, 2141, 2142, + 2145, 2150, 2152, 2154, 2156, 2159, 2159, 2160, + 2160, 2159, 2160, 2160, 2159, 2160, 2163, 2166, + 2166, 2166, 2165, 2166, 2168, 2169, 2171, 2174, + 2178, 2176, 2176, 2176, 2177, 2177, 2176, 2174, + 2174, 2177, 2181, 2181, 2182, 2183, 2186, 2188, + 2189, 2191, 2190, 2191, 2188, 2186, 2186, 2185, + 2183, 2185, 2186, 2184, 2183, 2183, 2182, 2183, + 2180, 2180, 2177, 2175, 2175, 2172, 2168, 2165, + 2165, 2165, 2163, 2162, 2162, 2158, 2158, 2154, + 2150, 2146, 2143, 2138, 2139, 2134, 2130, 2124, + 2122, 2117, 2116, 2109, 2104, 2099, 2097, 2089, + 2084, 2079, 2072, 2068, 2064, 2061, 2055, 2048, + 2043, 2041, 2034, 2032, 2028, 2022, 2019, 2012, + 2008, 2005, 2001, 1996, 1991, 1989, 1988, 1985, + 1982, 1978, 1974, 1972, 1970, 1967, 1964, 1960, + 1961, 1959, 1955, 1952, 1951, 1949, 1949, 1947, + 1944, 1945, 1944, 1944, 1942, 1941, 1940, 1937, + 1934, 1931, 1932, 1931, 1931, 1932, 1932, 1930, + 1929, 1927, 1926, 1926, 1928, 1931, 1933, 1935, + 1935, 1935, 1937, 1938, 1940, 1941, 1937, 1938, + 1940, 1940, 1942, 1942, 1943, 1945, 1947, 1948, + 1950, 1954, 1953, 1955, 1957, 1959, 1961, 1965, + 1965, 1965, 1966, 1968, 1971, 1971, 1972, 1972, + 1974, 1975, 1975, 1978, 1980, 1980, 1982, 1983, + 1983, 1984, 1986, 1988, 1992, 1993, 1994, 1997, + 1996, 1994, 1994, 1998, 1999, 2002, 2004, 2007, + 2009, 2010, 2012, 2013, 2017, 2020, 2022, 2024, + 2027, 2027, 2030, 2034, 2037, 2039, 2041, 2045, + 2049, 2050, 2052, 2055, 2055, 2057, 2060, 2062, + 2067, 2072, 2075, 2077, 2078, 2082, 2085, 2089, + 2090, 2094, 2095, 2098, 2099, 2103, 2107, 2108, + 2111, 2113, 2115, 2115, 2117, 2116, 2117, 2118, + 2120, 2121, 2124, 2125, 2126, 2126, 2127, 2129, + 2129, 2129, 2129, 2131, 2129, 2129, 2129, 2128, + 2128, 2126, 2127, 2127, 2128, 2128, 2126, 2126, + 2125, 2126, 2125, 2124, 2121, 2120, 2119, 2118, + 2118, 2118, 2116, 2114, 2114, 2116, 2115, 2115, + 2111, 2110, 2110, 2110, 2107, 2108, 2108, 2106, + 2109, 2109, 2110, 2110, 2109, 2108, 2107, 2103, + 2102, 2102, 2102, 2101, 2099, 2101, 2098, 2096, + 2093, 2093, 2094, 2093, 2094, 2095, 2095, 2097, + 2094, 2090, 2091, 2088, 2084, 2083, 2083, 2082, + 2079, 2076, 2076, 2076, 2076, 2073, 2073, 2071, + 2068, 2069, 2068, 2066, 2063, 2063, 2063, 2065, + 2064, 2063, 2062, 2063, 2065, 2065, 2068, 2068, + 2066, 2068, 2066, 2062, 2064, 2067, 2063, 2063, + 2063, 2063, 2064, 2061, 2060, 2062, 2061, 2061, + 2059, 2061, 2060, 2057, 2059, 2059, 2058, 2058, + 2055, 2053, 2054, 2052, 2047, 2044, 2041, 2042, + 2040, 2041, 2041, 2042, 2039, 2039, 2040, 2042, + 2042, 2040, 2040, 2036, 2036, 2037, 2035, 2034, + 2034, 2032, 2031, 2028, 2027, 2026, 2023, 2025, + 2026, 2028, 2027, 2027, 2028, 2026, 2026, 2027, + 2025, 2022, 2019, 2016, 2011, 2010, 2008, 2008, + 2004, 2001, 1999, 1998, 1996, 1997, 1994, 1992, + 1993, 1990, 1989, 1985, 1984, 1983, 1980, 1979, + 1975, 1970, 1969, 1971, 1970, 1969, 1969, 1969, + 1970, 1971, 1973, 1975, 1974, 1974, 1974, 1975, + 1972, 1974, 1974, 1974, 1976, 1972, 1973, 1973, + 1973, 1973, 1969, 1972, 1972, 1977, 1981, 1984, + 1987, 1989, 1989, 1990, 1991, 1991, 1990, 1991, + 1989, 1987, 1985, 1988, 1987, 1986, 1987, 1988, + 1989, 1988, 1992, 1993, 1992, 1994, 1995, 1995, + 1994, 1993, 1991, 1994, 1992, 1990, 1992, 1990, + 1994, 1994, 1997, 1997, 1999, 2001, 2002, 2003, + 2003, 2003, 2005, 2003, 2000, 2000, 2001, 2003, + 2004, 2004, 2002, 2002, 2003, 2002, 2002, 2002, + 2003, 2002, 2001, 2005, 2003, 2001, 2001, 2003, + 2002, 2001, 2001, 2000, 2002, 2000, 2002, 2002, + 2002, 2003, 2002, 2005, 2004, 2004, 2008, 2007, + 2008, 2010, 2013, 2018, 2019, 2020, 2021, 2022, + 2023, 2023, 2024, 2024, 2022, 2022, 2023, 2025, + 2026, 2026, 2029, 2030, 2030, 2032, 2032, 2034, + 2032, 2033, 2031, 2033, 2035, 2036, 2037, 2037, + 2036, 2035, 2038, 2040, 2040, 2040, 2039, 2039, + 2040, 2041, 2040, 2040, 2039, 2041, 2040, 2039, + 2041, 2039, 2038, 2038, 2041, 2042, 2042, 2044, + 2042, 2042, 2040, 2042, 2044, 2043, 2043, 2045, + 2045, 2044, 2047, 2048, 2048, 2049, 2050, 2049, + 2051, 2052, 2053, 2056, 2055, 2055, 2056, 2056, + 2059, 2056, 2058, 2056, 2055, 2056, 2054, 2058, + 2059, 2059, 2059, 2058, 2057, 2058, 2056, 2056, + 2059, 2060, 2060, 2062, 2064, 2064, 2063, 2065, + 2065, 2066, 2064, 2065, 2067, 2064, 2064, 2064, + 2066, 2064, 2066, 2064, 2064, 2066, 2065, 2065, + 2064, 2064, 2063, 2064, 2063, 2063, 2064, 2063, + 2064, 2066, 2066, 2068, 2068, 2063, 2062, 2062, + 2063, 2065, 2065, 2063, 2062, 2064, 2064, 2067, + 2064, 2065, 2066, 2062, 2063, 2064, 2064, 2065, + 2066, 2064, 2066, 2069, 2069, 2070, 2070, 2070, + 2068, 2069, 2071, 2073, 2074, 2077, 2076, 2079, + 2080, 2082, 2082, 2083, 2083, 2082, 2082, 2081, + 2083, 2083, 2080, 2081, 2081, 2083, 2083, 2083, + 2083, 2080, 2081, 2084, 2085, 2084, 2085, 2085, + 2083, 2082, 2080, 2081, 2080, 2080, 2078, 2079, + 2077, 2076, 2076, 2076, 2078, 2076, 2077, 2078, + 2080, 2080, 2082, 2084, 2082, 2082, 2082, 2081, + 2082, 2082, 2083, 2083, 2084, 2085, 2086, 2086, + 2084, 2085, 2086, 2087, 2087, 2089, 2088, 2085, + 2086, 2089, 2088, 2087, 2086, 2086, 2086, 2090, + 2089, 2089, 2090, 2092, 2094, 2095, 2095, 2097, + 2098, 2099, 2100, 2099, 2101, 2104, 2102, 2101, + 2101, 2101, 2103, 2102, 2099, 2096, 2097, 2098, + 2097, 2097, 2099, 2099, 2100, 2100, 2102, 2105, + 2104, 2100, 2099, 2096, 2097, 2095, 2092, 2094, + 2092, 2089, 2089, 2088, 2088, 2085, 2085, 2083, + 2082, 2081, 2080, 2081, 2082, 2082, 2080, 2080, + 2080, 2079, 2080, 2078, 2076, 2074, 2073, 2073, + 2073, 2072, 2071, 2067, 2067, 2069, 2070, 2072, + 2074, 2077, 2078, 2078, 2080, 2078, 2076, 2076, + 2073, 2073, 2071, 2070, 2071, 2069, 2069, 2069, + 2069, 2068, 2069, 2069, 2068, 2068, 2068, 2069, + 2068, 2066, 2064, 2064, 2063, 2062, 2061, 2055, + 2058, 2059, 2057, 2056, 2055, 2058, 2057, 2055, + 2054, 2055, 2056, 2055, 2055, 2055, 2052, 2053, + 2055, 2054, 2055, 2052, 2051, 2051, 2050, 2049, + 2049, 2050, 2048, 2049, 2049, 2049, 2050, 2052, + 2052, 2052, 2052, 2053, 2054, 2057, 2057, 2058, + 2058, 2058, 2061, 2061, 2062, 2064, 2065, 2066, + 2068, 2067, 2070, 2071, 2073, 2075, 2075, 2076, + 2078, 2078, 2077, 2076, 2080, 2077, 2079, 2080, + 2081, 2079, 2076, 2075, 2074, 2077, 2075, 2071, + 2071, 2070, 2070, 2073, 2073, 2076, 2074, 2071, + 2072, 2072, 2071, 2072, 2069, 2066, 2064, 2062, + 2061, 2062, 2063, 2062, 2064, 2062, 2060, 2062, + 2062, 2061, 2061, 2060, 2056, 2057, 2057, 2055, + 2056, 2056, 2055, 2056, 2057, 2057, 2058, 2059, + 2060, 2059, 2062, 2065, 2067, 2068, 2067, 2067, + 2067, 2066, 2066, 2065, 2063, 2060, 2064, 2067, + 2067, 2065, 2063, 2062, 2063, 2063, 2061, 2061, + 2060, 2060, 2059, 2059, 2061, 2060, 2064, 2064, + 2063, 2062, 2061, 2061, 2060, 2060, 2059, 2057, + 2056, 2055, 2056, 2058, 2058, 2060, 2058, 2060, + 2060, 2057, 2056, 2055, 2055, 2054, 2052, 2051, + 2052, 2048, 2048, 2050, 2051, 2046, 2044, 2043, + 2045, 2045, 2042, 2044, 2044, 2045, 2046, 2048, + 2047, 2049, 2045, 2043, 2042, 2042, 2040, 2039, + 2040, 2039, 2042, 2041, 2042, 2044, 2043, 2041, + 2040, 2039, 2036, 2038, 2039, 2040, 2042, 2043, + 2042, 2042, 2043, 2043, 2042, 2042, 2041, 2042, + 2041, 2044, 2044, 2041, 2042, 2043, 2040, 2041, + 2040, 2038, 2038, 2036, 2034, 2034, 2035, 2032, + 2032, 2031, 2032, 2031, 2029, 2030, 2029, 2029, + 2027, 2025, 2024, 2025, 2022, 2021, 2016, 2012, + 2012, 2014, 2014, 2014, 2013, 2011, 2010, 2008, + 2010, 2009, 2008, 2007, 2006, 2008, 2009, 2010, + 2011, 2008, 2009, 2011, 2010, 2012, 2012, 2011, + 2011, 2008, 2010, 2012, 2012, 2014, 2014, 2013, + 2007, 2012, 2017, 2018, 2016, 2013, 2011, 2015, + 2016, 2018, 2020, 2019, 2018, 2020, 2021, 2023, + 2024, 2023, 2026, 2024, 2025, 2027, 2027, 2026, + 2025, 2026, 2026, 2024, 2025, 2024, 2019, 2017, + 2015, 2012, 2010, 2009, 2010, 2010, 2008, 2005, + 2007, 2008, 2004, 2002, 1999, 1995, 1994, 1997, + 1997, 1997, 1996, 1995, 2000, 2001, 1998, 1998, + 1994, 1994, 1993, 1993, 1990, 1991, 1991, 1991, + 1996, 1993, 1995, 1995, 1997, 1994, 1994, 1994, + 1993, 1993, 1990, 1990, 1992, 1994, 1996, 1998, + 1998, 1998, 2000, 2002, 2001, 2001, 2000, 1998, + 2003, 2004, 2002, 2003, 2006, 2006, 2007, 2004, + 2002, 2001, 2000, 2000, 2002, 2001, 2002, 2003, + 2003, 2005, 2002, 2003, 2004, 2004, 2003, 1999, + 1996, 1998, 2000, 2001, 2001, 2000, 2001, 2003, + 2007, 2006, 2006, 2006, 2007, 2005, 2009, 2008, + 2008, 2011, 2011, 2017, 2016, 2016, 2019, 2021, + 2022, 2023, 2020, 2019, 2021, 2022, 2022, 2019, + 2020, 2021, 2022, 2021, 2025, 2027, 2025, 2025, + 2026, 2028, 2029, 2031, 2029, 2030, 2033, 2034, + 2034, 2031, 2030, 2032, 2033, 2032, 2033, 2032, + 2032, 2033, 2033, 2033, 2034, 2033, 2033, 2035, + 2034, 2032, 2033, 2034, 2030, 2028, 2026, 2026, + 2029, 2028, 2028, 2027, 2029, 2031, 2033, 2034, + 2034, 2033, 2032, 2034, 2034, 2032, 2031, 2034, + 2032, 2034, 2030, 2032, 2033, 2031, 2032, 2031, + 2030, 2031, 2031, 2030, 2029, 2028, 2027, 2028, + 2029, 2029, 2027, 2027, 2027, 2028, 2029, 2025, + 2024, 2022, 2022, 2025, 2026, 2027, 2026, 2027, + 2030, 2032, 2030, 2030, 2028, 2029, 2028, 2027, + 2028, 2030, 2032, 2030, 2032, 2033, 2032, 2031, + 2030, 2033, 2031, 2031, 2034, 2033, 2039, 2039, + 2039, 2041, 2043, 2043, 2041, 2039, 2038, 2038, + 2039, 2040, 2041, 2040, 2044, 2044, 2043, 2044, + 2044, 2047, 2049, 2045, 2046, 2046, 2044, 2046, + 2046, 2046, 2047, 2043, 2040, 2041, 2040, 2041, + 2045, 2044, 2044, 2046, 2043, 2042, 2042, 2041, + 2041, 2041, 2042, 2043, 2043, 2044, 2044, 2042, + 2042, 2044, 2044, 2044, 2046, 2045, 2046, 2046, + 2044, 2043, 2044, 2041, 2040, 2042, 2043, 2042, + 2043, 2047, 2046, 2048, 2045, 2045, 2046, 2046, + 2045, 2046, 2046, 2044, 2042, 2042, 2043, 2045, + 2047, 2046, 2046, 2048, 2048, 2049, 2050, 2049, + 2047, 2047, 2048, 2050, 2050, 2049, 2050, 2050, + 2051, 2050, 2048, 2048, 2047, 2044, 2044, 2043, + 2042, 2043, 2041, 2040, 2041, 2039, 2038, 2038, + 2038, 2038, 2039, 2036, 2034, 2034, 2031, 2031, + 2031, 2029, 2028, 2027, 2028, 2028, 2026, 2025, + 2027, 2030, 2028, 2027, 2025, 2024, 2023, 2020, + 2021, 2020, 2018, 2021, 2021, 2020, 2018, 2020, + 2019, 2021, 2026, 2027, 2027, 2027, 2028, 2027, + 2028, 2026, 2029, 2026, 2025, 2028, 2029, 2030, + 2033, 2034, 2034, 2034, 2036, 2036, 2039, 2041, + 2041, 2040, 2039, 2036, 2033, 2030, 2032, 2031, + 2029, 2034, 2039, 2044, 2048, 2051, 2054, 2055, + 2054, 2057, 2059, 2056, 2053, 2050, 2048, 2044, + 2037, 2033, 2030, 2026, 2027, 2028, 2031, 2037, + 2042, 2046, 2051, 2051, 2056, 2056, 2052, 2048, + 2044, 2037, 2029, 2023, 2014, 2007, 2003, 2002, + 2001, 1999, 1952, 1835, 1745, 1700, 1674, 1683, + 1730, 1806, 1892, 1979, 2053, 2095, 2102, 2106, + 2121, 2130, 2119, 2100, 2071, 2028, 1984, 1947, + 1918, 1900, 1904, 1935, 1979, 2022, 2068, 2117, + 2154, 2185, 2200, 2203, 2195, 2171, 2138, 2103, + 2079, 2045, 2012, 2001, 2006, 2014, 2025, 2046, + 2071, 2087, 2104, 2123, 2137, 2145, 2147, 2156, + 2150, 2130, 2105, 2082, 2044, 2005, 1982, 1967, + 1967, 1976, 1996, 1991, 1900, 1837, 1827, 1801, + 1808, 1817, 1847, 1897, 1932, 1965, 1973, 1967, + 1969, 2007, 2030, 2021, 2003, 1972, 1936, 1895, + 1870, 1845, 1822, 1827, 1856, 1892, 1915, 1937, + 1964, 1985, 2006, 2025, 2041, 2046, 2029, 2015, + 2001, 1988, 1969, 1936, 1912, 1908, 1909, 1918, + 1931, 1948, 1974, 2003, 2029, 2050, 2066, 2074, + 2075, 2065, 2045, 2027, 2012, 1990, 1967, 1957, + 1960, 1970, 1981, 1996, 2015, 2026, 2040, 2054, + 2058, 2051, 2049, 2056, 2058, 2049, 2029, 2008, + 1991, 1985, 1983, 1975, 1951, 1915, 1878, 1859, + 1850, 1841, 1846, 1863, 1891, 1923, 1957, 1977, + 1975, 1960, 1953, 1956, 1965, 1970, 1964, 1957, + 1943, 1933, 1923, 1910, 1898, 1892, 1897, 1914, + 1945, 1973, 2000, 2018, 2031, 2040, 2038, 2026, + 2002, 1975, 1954, 1945, 1942, 1938, 1941, 1951, + 1964, 1971, 1972, 1970, 1979, 1989, 1996, 2004, + 2013, 2012, 2009, 2022, 2016, 1991, 1975, 1980, + 1974, 1947, 1934, 1950, 1976, 2002, 2023, 2035, + 2041, 2047, 2053, 2046, 2030, 2021, 2017, 2011, + 2015, 2021, 2010, 1991, 1984, 1996, 2011, 2016, + 2013, 2008, 2006, 2017, 2024, 2023, 2026, 2032, + 2031, 2030, 2029, 2025, 2004, 1987, 1996, 2021, + 2041, 2042, 2035, 2033, 2031, 2026, 2011, 1998, + 1989, 1977, 1963, 1956, 1957, 1951, 1941, 1935, + 1939, 1951, 1956, 1956, 1952, 1948, 1950, 1950, + 1945, 1938, 1908, 1840, 1792, 1779, 1765, 1742, + 1726, 1745, 1771, 1801, 1839, 1877, 1904, 1924, + 1950, 1965, 1975, 1976, 1957, 1929, 1906, 1900, + 1888, 1864, 1847, 1846, 1861, 1881, 1909, 1945, + 1986, 2019, 2043, 2056, 2062, 2055, 2026, 2000, + 1988, 1976, 1954, 1935, 1934, 1950, 1972, 1984, + 1998, 2022, 2047, 2060, 2063, 2064, 2062, 2057, + 2046, 2040, 2033, 2016, 2000, 1991, 1978, 1969, + 1972, 1995, 2016, 2028, 2051, 2070, 2071, 2066, + 2059, 2044, 2023, 2007, 2003, 1999, 1984, 1970, + 1965, 1963, 1962, 1970, 1982, 1988, 1993, 1996, + 2001, 2005, 2000, 2001, 1999, 1991, 1984, 1972, + 1960, 1944, 1929, 1920, 1919, 1935, 1958, 1974, + 1980, 1991, 2005, 2018, 2015, 1997, 1984, 1971, + 1956, 1948, 1945, 1940, 1945, 1963, 1973, 1972, + 1975, 1981, 1986, 1988, 1995, 2009, 2020, 2032, + 2035, 2026, 2008, 1991, 1973, 1962, 1964, 1971, + 1981, 1999, 2025, 2050, 2063, 2068, 2062, 2052, + 2044, 2038, 2033, 2028, 2027, 2028, 2031, 2031, + 2033, 2029, 2021, 2019, 2017, 2021, 2031, 2044, + 2058, 2068, 2075, 2074, 2067, 2056, 2044, 2031, + 2015, 2002, 2000, 1997, 2001, 2010, 2012, 2025, + 2035, 2041, 2044, 2046, 2048, 2043, 2039, 2035, + 2036, 2032, 2025, 2016, 2004, 1989, 1982, 1983, + 1989, 1998, 2008, 2021, 2032, 2036, 2037, 2035, + 2031, 2021, 2012, 2011, 2008, 2002, 1999, 2000, + 2001, 2003, 2011, 2021, 2025, 2024, 2027, 2033, + 2036, 2036, 2038, 2039, 2042, 2040, 2037, 2034, + 2027, 2019, 2013, 2012, 2013, 2018, 2030, 2043, + 2057, 2067, 2074, 2075, 2069, 2060, 2051, 2044, + 2036, 2030, 2031, 2033, 2037, 2040, 2043, 2043, + 2048, 2053, 2054, 2054, 2061, 2069, 2066, 2060, + 2059, 2056, 2052, 2050, 2054, 2057, 2053, 2055, + 2055, 2059, 2060, 2063, 2067, 2069, 2068, 2070, + 2067, 2058, 2047, 2043, 2042, 2039, 2040, 2047, + 2051, 2050, 2052, 2055, 2058, 2056, 2055, 2053, + 2053, 2049, 2047, 2045, 2040, 2036, 2031, 2028, + 2026, 2026, 2032, 2039, 2047, 2053, 2058, 2061, + 2060, 2062, 2056, 2046, 2043, 2040, 2040, 2037, + 2036, 2037, 2041, 2042, 2044, 2048, 2048, 2050, + 2056, 2062, 2066, 2068, 2071, 2072, 2070, 2069, + 2066, 2057, 2048, 2044, 2044, 2047, 2050, 2055, + 2061, 2067, 2072, 2078, 2083, 2085, 2088, 2087, + 2084, 2083, 2076, 2071, 2067, 2062, 2060, 2060, + 2058, 2056, 2059, 2065, 2073, 2079, 2088, 2089, + 2093, 2097, 2097, 2092, 2084, 2078, 2074, 2067, + 2060, 2058, 2056, 2058, 2058, 2065, 2067, 2073, + 2077, 2081, 2080, 2074, 2072, 2069, 2067, 2063, + 2062, 2059, 2061, 2060, 2057, 2055, 2054, 2057, + 2061, 2065, 2067, 2065, 2063, 2063, 2061, 2058, + 2053, 2052, 2050, 2051, 2053, 2057, 2059, 2061, + 2060, 2058, 2060, 2058, 2061, 2068, 2071, 2070, + 2066, 2069, 2067, 2061, 2055, 2052, 2054, 2054, + 2055, 2056, 2061, 2063, 2065, 2066, 2071, 2076, + 2080, 2082, 2081, 2080, 2075, 2068, 2058, 2048, + 2040, 2036, 2035, 2040, 2050, 2059, 2070, 2083, + 2092, 2097, 2094, 2091, 2087, 2077, 2070, 2062, + 2054, 2049, 2048, 2048, 2046, 2044, 2051, 2058, + 2067, 2075, 2088, 2091, 2085, 2077, 2068, 2063, + 2056, 2056, 2062, 2064, 2061, 2056, 2051, 2046, + 2044, 2047, 2050, 2057, 2063, 2064, 2061, 2056, + 2057, 2059, 2063, 2068, 2068, 2068, 2063, 2054, + 2043, 2036, 2033, 2035, 2039, 2045, 2048, 2051, + 2049, 2047, 2048, 2046, 2052, 2057, 2058, 2058, + 2054, 2046, 2040, 2039, 2036, 2037, 2041, 2045, + 2049, 2052, 2049, 2042, 2030, 2022, 2020, 2022, + 2029, 2039, 2048, 2058, 2064, 2062, 2056, 2045, + 2040, 2036, 2032, 2029, 2024, 2020, 2014, 2012, + 2016, 2023, 2034, 2043, 2051, 2053, 2052, 2048, + 2041, 2034, 2030, 2028, 2027, 2024, 2016, 2008, + 2003, 2001, 2003, 2009, 2019, 2026, 2032, 2033, + 2033, 2032, 2033, 2036, 2038, 2038, 2034, 2035, + 2031, 2029, 2024, 2023, 2024, 2027, 2027, 2026, + 2020, 2017, 2018, 2022, 2026, 2031, 2038, 2039, + 2038, 2039, 2038, 2036, 2030, 2024, 2022, 2020, + 2016, 2012, 2011, 2011, 2013, 2018, 2025, 2028, + 2026, 2024, 2018, 2014, 2008, 2003, 2001, 2007, + 2014, 2025, 2029, 2026, 2019, 2008, 1999, 1990, + 1985, 1984, 1989, 1995, 2007, 2015, 2015, 2015, + 2014, 2013, 2012, 2016, 2016, 2015, 2014, 2008, + 2001, 1991, 1987, 1984, 1986, 1989, 1995, 2004, + 2009, 2011, 2010, 2006, 2000, 1996, 1997, 1996, + 2000, 2000, 1999, 2002, 2001, 2000, 1997, 1994, + 1989, 1988, 1986, 1981, 1977, 1979, 1982, 1986, + 1990, 1998, 2000, 2002, 2001, 2000, 1993, 1983, + 1977, 1970, 1963, 1960, 1963, 1962, 1965, 1966, + 1967, 1969, 1968, 1972, 1976, 1979, 1983, 1984, + 1985, 1986, 1982, 1975, 1969, 1963, 1960, 1958, + 1961, 1965, 1969, 1972, 1976, 1980, 1983, 1988, + 1989, 1990, 1991, 1990, 1986, 1984, 1983, 1980, + 1974, 1972, 1973, 1977, 1984, 1992, 1997, 2000, + 2005, 2009, 2009, 2003, 1998, 1992, 1986, 1983, + 1977, 1973, 1969, 1968, 1974, 1977, 1984, 1992, + 1998, 2004, 2001, 1996, 1990, 1986, 1984, 1982, + 1982, 1986, 1988, 1990, 1988, 1986, 1984, 1984, + 1983, 1984, 1988, 1993, 1998, 2003, 2005, 2001, + 1996, 1991, 1986, 1983, 1979, 1982, 1983, 1986, + 1991, 1992, 1990, 1986, 1984, 1980, 1982, 1982, + 1984, 1986, 1984, 1987, 1987, 1982, 1984, 1986, + 1983, 1984, 1985, 1987, 1986, 1985, 1982, 1982, + 1984, 1985, 1988, 1986, 1988, 1990, 1991, 1992, + 1993, 1992, 1991, 1991, 1988, 1987, 1990, 1991, + 1994, 1997, 2001, 2001, 1999, 1995, 1988, 1984, + 1980, 1976, 1976, 1982, 1985, 1987, 1989, 1991, + 1993, 1993, 1996, 1999, 2003, 2005, 2004, 2004, + 2002, 1998, 1994, 1989, 1986, 1984, 1983, 1984, + 1983, 1981, 1985, 1986, 1986, 1986, 1988, 1992, + 1997, 2000, 1999, 1996, 1991, 1991, 1988, 1982, + 1983, 1980, 1981, 1984, 1984, 1985, 1985, 1989, + 1991, 1994, 1999, 1996, 1994, 1989, 1988, 1988, + 1979, 1980, 1979, 1980, 1979, 1980, 1982, 1984, + 1985, 1986, 1988, 1988, 1992, 1991, 1989, 1987, + 1988, 1987, 1987, 1991, 1994, 1999, 2003, 2001, + 2000, 1999, 1996, 1991, 1990, 1990, 1991, 1990, + 1992, 1994, 1993, 1997, 1997, 2002, 2009, 2016, + 2022, 2025, 2028, 2027, 2024, 2024, 2024, 2022, + 2025, 2024, 2022, 2021, 2019, 2017, 2014, 2017, + 2020, 2023, 2026, 2030, 2034, 2036, 2033, 2032, + 2030, 2029, 2027, 2021, 2019, 2017, 2016, 2019, + 2027, 2031, 2033, 2035, 2032, 2030, 2024, 2022, + 2016, 2015, 2017, 2014, 2013, 2013, 2012, 2012, + 2014, 2017, 2023, 2029, 2033, 2036, 2037, 2034, + 2032, 2029, 2029, 2029, 2030, 2030, 2032, 2030, + 2026, 2021, 2019, 2021, 2027, 2033, 2038, 2040, + 2044, 2047, 2043, 2038, 2035, 2033, 2031, 2030, + 2030, 2030, 2031, 2033, 2038, 2039, 2038, 2037, + 2039, 2038, 2037, 2035, 2036, 2039, 2042, 2043, + 2041, 2042, 2042, 2040, 2036, 2037, 2040, 2040, + 2042, 2046, 2049, 2046, 2044, 2044, 2043, 2040, + 2036, 2039, 2042, 2045, 2048, 2043, 2040, 2037, + 2036, 2034, 2033, 2032, 2032, 2032, 2036, 2037, + 2040, 2041, 2042, 2043, 2047, 2051, 2051, 2049, + 2047, 2043, 2035, 2031, 2027, 2025, 2026, 2024, + 2030, 2034, 2036, 2038, 2039, 2045, 2052, 2054, + 2055, 2054, 2053, 2052, 2051, 2048, 2046, 2044, + 2048, 2048, 2046, 2046, 2047, 2046, 2047, 2048, + 2049, 2051, 2051, 2052, 2051, 2052, 2052, 2055, + 2062, 2064, 2067, 2068, 2066, 2068, 2067, 2066, + 2069, 2069, 2070, 2072, 2071, 2071, 2067, 2062, + 2061, 2063, 2064, 2067, 2067, 2067, 2071, 2071, + 2074, 2079, 2080, 2081, 2080, 2078, 2074, 2072, + 2068, 2062, 2060, 2061, 2064, 2065, 2069, 2073, + 2076, 2081, 2084, 2089, 2091, 2094, 2093, 2093, + 2090, 2086, 2085, 2081, 2081, 2081, 2082, 2082, + 2081, 2081, 2080, 2078, 2080, 2084, 2086, 2090, + 2096, 2095, 2095, 2093, 2091, 2085, 2086, 2088, + 2088, 2090, 2091, 2091, 2089, 2088, 2089, 2088, + 2087, 2089, 2089, 2092, 2096, 2099, 2102, 2101, + 2100, 2102, 2102, 2098, 2096, 2092, 2089, 2086, + 2084, 2086, 2093, 2097, 2105, 2111, 2115, 2116, + 2114, 2112, 2111, 2112, 2113, 2116, 2114, 2119, + 2124, 2127, 2122, 2115, 2114, 2111, 2111, 2112, + 2114, 2115, 2118, 2123, 2127, 2131, 2133, 2135, + 2136, 2135, 2131, 2130, 2130, 2131, 2130, 2129, + 2131, 2135, 2136, 2139, 2139, 2137, 2133, 2130, + 2126, 2124, 2129, 2129, 2129, 2126, 2126, 2128, + 2128, 2126, 2127, 2127, 2132, 2134, 2131, 2129, + 2126, 2124, 2122, 2119, 2115, 2112, 2110, 2111, + 2112, 2114, 2114, 2116, 2115, 2118, 2121, 2125, + 2126, 2124, 2124, 2120, 2118, 2115, 2113, 2110, + 2111, 2111, 2109, 2108, 2110, 2112, 2115, 2119, + 2121, 2123, 2123, 2121, 2121, 2120, 2123, 2124, + 2125, 2127, 2128, 2129, 2127, 2124, 2119, 2114, + 2112, 2110, 2111, 2114, 2114, 2118, 2123, 2126, + 2127, 2125, 2126, 2130, 2131, 2133, 2130, 2128, + 2125, 2120, 2118, 2117, 2116, 2119, 2129, 2132, + 2133, 2134, 2131, 2132, 2131, 2134, 2137, 2139, + 2140, 2139, 2138, 2133, 2130, 2126, 2123, 2123, + 2127, 2128, 2130, 2134, 2133, 2134, 2137, 2140, + 2142, 2144, 2144, 2141, 2136, 2133, 2128, 2121, + 2118, 2120, 2127, 2129, 2134, 2138, 2138, 2138, + 2134, 2133, 2131, 2133, 2134, 2131, 2126, 2121, + 2115, 2108, 2109, 2114, 2120, 2128, 2136, 2141, + 2142, 2142, 2143, 2139, 2139, 2139, 2137, 2135, + 2128, 2123, 2116, 2110, 2108, 2108, 2110, 2116, + 2119, 2122, 2128, 2129, 2126, 2123, 2125, 2127, + 2130, 2128, 2124, 2119, 2113, 2106, 2104, 2105, + 2107, 2110, 2115, 2118, 2118, 2118, 2118, 2115, + 2114, 2115, 2115, 2115, 2114, 2112, 2111, 2111, + 2110, 2112, 2115, 2116, 2117, 2119, 2116, 2115, + 2112, 2111, 2110, 2108, 2107, 2105, 2106, 2106, + 2106, 2106, 2106, 2106, 2107, 2108, 2108, 2107, + 2110, 2113, 2115, 2113, 2108, 2103, 2094, 2086, + 2084, 2086, 2087, 2084, 2085, 2089, 2090, 2091, + 2096, 2100, 2103, 2105, 2110, 2108, 2105, 2098, + 2093, 2091, 2087, 2089, 2094, 2099, 2101, 2101, + 2097, 2094, 2093, 2090, 2096, 2104, 2109, 2110, + 2108, 2104, 2102, 2102, 2104, 2108, 2113, 2117, + 2120, 2119, 2118, 2118, 2113, 2115, 2119, 2120, + 2125, 2126, 2121, 2117, 2111, 2108, 2110, 2112, + 2116, 2121, 2127, 2129, 2130, 2127, 2128, 2128, + 2130, 2134, 2137, 2136, 2133, 2129, 2124, 2119, + 2115, 2115, 2117, 2121, 2127, 2131, 2132, 2132, + 2131, 2131, 2135, 2138, 2140, 2138, 2136, 2130, + 2124, 2122, 2123, 2125, 2132, 2138, 2144, 2147, + 2147, 2146, 2144, 2144, 2143, 2143, 2144, 2143, + 2138, 2133, 2127, 2121, 2118, 2121, 2128, 2135, + 2143, 2151, 2154, 2152, 2151, 2147, 2143, 2142, + 2142, 2139, 2135, 2134, 2133, 2133, 2134, 2135, + 2136, 2140, 2144, 2143, 2143, 2144, 2144, 2144, + 2144, 2145, 2148, 2146, 2145, 2144, 2143, 2139, + 2139, 2138, 2139, 2140, 2141, 2144, 2149, 2152, + 2155, 2157, 2158, 2160, 2160, 2160, 2157, 2156, + 2153, 2151, 2152, 2152, 2149, 2148, 2148, 2147, + 2149, 2152, 2158, 2161, 2165, 2164, 2165, 2166, + 2166, 2164, 2161, 2163, 2163, 2163, 2160, 2157, + 2157, 2156, 2153, 2155, 2159, 2162, 2163, 2166, + 2171, 2171, 2170, 2166, 2161, 2157, 2153, 2153, + 2155, 2155, 2152, 2153, 2155, 2157, 2159, 2160, + 2165, 2168, 2167, 2167, 2161, 2156, 2154, 2152, + 2152, 2154, 2155, 2157, 2156, 2159, 2156, 2157, + 2157, 2158, 2159, 2163, 2169, 2166, 2162, 2158, + 2154, 2153, 2151, 2148, 2152, 2158, 2156, 2155, + 2157, 2159, 2156, 2154, 2154, 2157, 2156, 2158, + 2160, 2158, 2156, 2153, 2151, 2149, 2146, 2150, + 2155, 2156, 2159, 2160, 2161, 2163, 2166, 2168, + 2168, 2169, 2170, 2169, 2164, 2157, 2152, 2150, + 2150, 2148, 2150, 2155, 2162, 2165, 2170, 2172, + 2177, 2181, 2184, 2184, 2182, 2180, 2175, 2171, + 2164, 2160, 2156, 2157, 2161, 2162, 2164, 2167, + 2165, 2163, 2165, 2165, 2167, 2169, 2171, 2172, + 2172, 2171, 2170, 2170, 2173, 2176, 2172, 2171, + 2171, 2171, 2165, 2160, 2153, 2154, 2159, 2167, + 2170, 2170, 2171, 2173, 2172, 2170, 2169, 2171, + 2174, 2176, 2180, 2179, 2174, 2170, 2168, 2168, + 2167, 2167, 2168, 2169, 2171, 2169, 2169, 2171, + 2173, 2177, 2179, 2185, 2189, 2191, 2188, 2181, + 2179, 2178, 2176, 2179, 2182, 2183, 2178, 2177, + 2172, 2165, 2159, 2158, 2164, 2168, 2169, 2173, + 2173, 2170, 2173, 2175, 2177, 2179, 2185, 2189, + 2193, 2190, 2186, 2183, 2180, 2182, 2182, 2184, + 2188, 2188, 2185, 2180, 2174, 2172, 2171, 2170, + 2173, 2178, 2178, 2178, 2176, 2177, 2177, 2179, + 2184, 2188, 2194, 2199, 2200, 2198, 2193, 2188, + 2182, 2177, 2175, 2172, 2172, 2172, 2174, 2173, + 2175, 2173, 2179, 2186, 2190, 2197, 2200, 2201, + 2196, 2190, 2185, 2180, 2176, 2174, 2169, 2167, + 2164, 2162, 2158, 2157, 2158, 2162, 2169, 2177, + 2185, 2190, 2192, 2192, 2186, 2180, 2175, 2173, + 2169, 2166, 2165, 2162, 2158, 2153, 2152, 2155, + 2161, 2168, 2176, 2185, 2185, 2184, 2181, 2180, + 2176, 2174, 2175, 2177, 2181, 2185, 2185, 2179, + 2177, 2172, 2169, 2170, 2172, 2174, 2175, 2176, + 2172, 2170, 2171, 2174, 2179, 2185, 2191, 2198, + 2203, 2202, 2197, 2190, 2190, 2190, 2188, 2190, + 2188, 2183, 2178, 2173, 2168, 2167, 2166, 2173, + 2180, 2188, 2199, 2202, 2205, 2202, 2201, 2195, + 2192, 2191, 2190, 2189, 2186, 2182, 2179, 2177, + 2175, 2176, 2178, 2185, 2189, 2193, 2196, 2195, + 2197, 2195, 2192, 2193, 2194, 2196, 2196, 2189, + 2183, 2181, 2180, 2182, 2185, 2190, 2198, 2201, + 2206, 2203, 2198, 2192, 2186, 2185, 2182, 2179, + 2178, 2179, 2175, 2175, 2180, 2186, 2191, 2195, + 2199, 2201, 2199, 2196, 2190, 2190, 2185, 2184, + 2182, 2179, 2177, 2170, 2164, 2162, 2162, 2165, + 2169, 2173, 2180, 2186, 2191, 2193, 2194, 2193, + 2193, 2192, 2190, 2186, 2185, 2182, 2175, 2172, + 2171, 2171, 2172, 2174, 2179, 2180, 2182, 2188, + 2190, 2191, 2192, 2192, 2192, 2190, 2188, 2190, + 2188, 2185, 2183, 2182, 2181, 2179, 2178, 2178, + 2175, 2175, 2175, 2176, 2179, 2180, 2183, 2182, + 2179, 2179, 2178, 2177, 2179, 2180, 2187, 2188, + 2192, 2194, 2194, 2193, 2191, 2192, 2192, 2188, + 2185, 2183, 2183, 2182, 2180, 2184, 2186, 2191, + 2195, 2199, 2200, 2203, 2201, 2201, 2203, 2206, + 2208, 2207, 2209, 2205, 2198, 2193, 2186, 2185, + 2183, 2188, 2190, 2194, 2198, 2199, 2200, 2199, + 2200, 2202, 2203, 2204, 2202, 2202, 2200, 2192, + 2186, 2183, 2177, 2174, 2172, 2166, 2164, 2161, + 2160, 2158, 2158, 2160, 2161, 2167, 2169, 2169, + 2165, 2162, 2160, 2161, 2161, 2162, 2164, 2167, + 2167, 2165, 2161, 2156, 2155, 2150, 2146, 2147, + 2150, 2152, 2156, 2158, 2161, 2164, 2166, 2166, + 2165, 2165, 2163, 2163, 2161, 2159, 2158, 2157, + 2160, 2157, 2158, 2156, 2153, 2148, 2147, 2150, + 2154, 2155, 2159, 2162, 2166, 2165, 2165, 2166, + 2164, 2163, 2158, 2154, 2152, 2151, 2151, 2151, + 2148, 2147, 2147, 2147, 2148, 2149, 2154, 2158, + 2162, 2165, 2166, 2170, 2172, 2172, 2172, 2169, + 2169, 2166, 2164, 2162, 2160, 2159, 2159, 2162, + 2166, 2167, 2168, 2170, 2172, 2172, 2174, 2175, + 2177, 2178, 2183, 2185, 2181, 2179, 2176, 2174, + 2169, 2164, 2162, 2163, 2161, 2165, 2165, 2165, + 2169, 2171, 2173, 2175, 2177, 2178, 2177, 2177, + 2176, 2174, 2174, 2176, 2177, 2177, 2177, 2174, + 2173, 2170, 2167, 2167, 2170, 2173, 2179, 2182, + 2182, 2183, 2183, 2185, 2188, 2190, 2192, 2194, + 2193, 2193, 2192, 2191, 2190, 2191, 2194, 2194, + 2196, 2201, 2203, 2202, 2198, 2198, 2199, 2205, + 2208, 2214, 2218, 2220, 2218, 2220, 2218, 2219, + 2220, 2219, 2218, 2216, 2213, 2212, 2214, 2210, + 2210, 2212, 2213, 2215, 2217, 2216, 2217, 2218, + 2220, 2223, 2223, 2226, 2228, 2228, 2224, 2223, + 2220, 2219, 2218, 2219, 2218, 2216, 2216, 2218, + 2221, 2221, 2225, 2230, 2238, 2245, 2250, 2250, + 2250, 2249, 2241, 2237, 2235, 2232, 2230, 2227, + 2227, 2230, 2230, 2231, 2235, 2238, 2238, 2240, + 2244, 2246, 2244, 2243, 2244, 2246, 2247, 2246, + 2243, 2239, 2237, 2233, 2231, 2230, 2231, 2231, + 2234, 2237, 2240, 2243, 2242, 2239, 2238, 2240, + 2243, 2242, 2243, 2246, 2250, 2253, 2251, 2249, + 2251, 2250, 2249, 2249, 2249, 2247, 2247, 2247, + 2247, 2246, 2246, 2248, 2249, 2251, 2253, 2254, + 2256, 2258, 2258, 2261, 2261, 2260, 2261, 2258, + 2257, 2252, 2251, 2252, 2247, 2245, 2244, 2243, + 2245, 2241, 2239, 2239, 2241, 2241, 2242, 2243, + 2246, 2244, 2241, 2237, 2235, 2235, 2232, 2231, + 2231, 2232, 2230, 2230, 2229, 2230, 2233, 2233, + 2233, 2237, 2239, 2239, 2238, 2237, 2239, 2242, + 2244, 2244, 2245, 2243, 2236, 2232, 2227, 2223, + 2225, 2226, 2230, 2232, 2235, 2234, 2234, 2234, + 2235, 2240, 2240, 2245, 2248, 2249, 2245, 2239, + 2235, 2231, 2226, 2224, 2223, 2219, 2218, 2217, + 2217, 2217, 2221, 2223, 2227, 2230, 2232, 2233, + 2231, 2231, 2228, 2226, 2226, 2224, 2219, 2218, + 2216, 2211, 2211, 2213, 2217, 2218, 2221, 2223, + 2226, 2231, 2235, 2242, 2248, 2251, 2251, 2253, + 2254, 2259, 2259, 2254, 2255, 2254, 2250, 2246, + 2241, 2238, 2232, 2231, 2234, 2239, 2241, 2243, + 2248, 2250, 2254, 2256, 2259, 2262, 2264, 2263, + 2261, 2255, 2251, 2246, 2240, 2233, 2230, 2233, + 2232, 2228, 2224, 2223, 2222, 2221, 2223, 2227, + 2230, 2235, 2234, 2232, 2230, 2231, 2230, 2232, + 2232, 2232, 2229, 2227, 2228, 2225, 2224, 2224, + 2227, 2229, 2227, 2228, 2227, 2228, 2230, 2230, + 2229, 2231, 2233, 2233, 2231, 2226, 2226, 2223, + 2223, 2223, 2225, 2228, 2227, 2228, 2226, 2226, + 2224, 2221, 2223, 2224, 2225, 2227, 2229, 2227, + 2228, 2225, 2224, 2223, 2226, 2224, 2224, 2226, + 2225, 2226, 2226, 2226, 2225, 2224, 2225, 2227, + 2225, 2223, 2223, 2227, 2227, 2226, 2227, 2226, + 2226, 2225, 2226, 2228, 2227, 2229, 2229, 2232, + 2231, 2232, 2230, 2233, 2232, 2232, 2231, 2230, + 2231, 2230, 2230, 2231, 2231, 2233, 2234, 2235, + 2235, 2231, 2228, 2227, 2226, 2224, 2222, 2222, + 2222, 2224, 2221, 2220, 2217, 2215, 2213, 2214, + 2215, 2216, 2215, 2212, 2211, 2209, 2211, 2212, + 2209, 2211, 2212, 2210, 2206, 2203, 2199, 2197, + 2198, 2199, 2203, 2207, 2210, 2212, 2214, 2216, + 2219, 2220, 2222, 2224, 2226, 2227, 2223, 2217, + 2212, 2206, 2203, 2197, 2193, 2193, 2195, 2199, + 2203, 2209, 2213, 2216, 2218, 2223, 2225, 2227, + 2228, 2222, 2219, 2214, 2213, 2213, 2213, 2210, + 2210, 2207, 2207, 2206, 2204, 2201, 2204, 2207, + 2209, 2212, 2214, 2216, 2215, 2211, 2206, 2204, + 2203, 2199, 2200, 2198, 2199, 2202, 2200, 2199, + 2198, 2198, 2198, 2200, 2201, 2199, 2201, 2199, + 2198, 2193, 2192, 2191, 2190, 2190, 2192, 2192, + 2192, 2191, 2191, 2191, 2193, 2193, 2194, 2193, + 2192, 2192, 2188, 2185, 2182, 2181, 2177, 2177, + 2178, 2175, 2176, 2174, 2175, 2172, 2173, 2172, + 2172, 2172, 2170, 2169, 2164, 2158, 2153, 2149, + 2144, 2143, 2138, 2134, 2132, 2135, 2138, 2137, + 2138, 2140, 2144, 2147, 2148, 2149, 2150, 2147, + 2144, 2143, 2141, 2139, 2136, 2134, 2132, 2132, + 2133, 2132, 2131, 2136, 2138, 2142, 2146, 2146, + 2147, 2146, 2148, 2147, 2142, 2140, 2139, 2138, + 2138, 2133, 2130, 2126, 2122, 2121, 2123, 2124, + 2123, 2125, 2127, 2128, 2126, 2125, 2123, 2120, + 2117, 2112, 2110, 2107, 2104, 2102, 2096, 2092, + 2091, 2091, 2087, 2086, 2087, 2089, 2090, 2089, + 2087, 2086, 2088, 2090, 2094, 2095, 2095, 2093, + 2089, 2085, 2081, 2078, 2077, 2075, 2075, 2074, + 2073, 2073, 2069, 2066, 2065, 2064, 2064, 2062, + 2064, 2064, 2065, 2067, 2067, 2067, 2066, 2067, + 2065, 2064, 2064, 2062, 2059, 2055, 2053, 2053, + 2055, 2054, 2055, 2054, 2054, 2050, 2050, 2051, + 2051, 2051, 2052, 2055, 2059, 2060, 2058, 2058, + 2052, 2049, 2047, 2044, 2044, 2046, 2045, 2050, + 2051, 2052, 2051, 2052, 2055, 2053, 2055, 2056, + 2052, 2051, 2052, 2049, 2046, 2045, 2046, 2044, + 2043, 2043, 2043, 2041, 2042, 2043, 2045, 2047, + 2049, 2050, 2049, 2049, 2047, 2046, 2045, 2041, + 2042, 2041, 2041, 2038, 2039, 2038, 2036, 2036, + 2033, 2029, 2030, 2028, 2029, 2033, 2030, 2032, + 2031, 2030, 2030, 2030, 2029, 2028, 2031, 2030, + 2031, 2028, 2028, 2029, 2025, 2022, 2019, 2017, + 2013, 2011, 2010, 2009, 2011, 2012, 2013, 2016, + 2017, 2019, 2020, 2019, 2018, 2012, 2011, 2012, + 2012, 2013, 2009, 2008, 2007, 2008, 2008, 2011, + 2012, 2009, 2008, 2007, 2006, 2004, 2003, 2002, + 2003, 2001, 2001, 2001, 2002, 2002, 2005, 2004, + 2005, 2003, 2000, 2000, 1998, 1997, 1996, 1994, + 1990, 1987, 1983, 1985, 1985, 1988, 1991, 1994, + 1999, 2000, 1999, 1997, 1998, 1997, 1994, 1994, + 1993, 1990, 1988, 1985, 1979, 1977, 1977, 1977, + 1979, 1981, 1978, 1980, 1979, 1982, 1981, 1981, + 1983, 1983, 1983, 1984, 1983, 1985, 1983, 1977, + 1976, 1976, 1977, 1976, 1977, 1979, 1977, 1976, + 1971, 1966, 1965, 1963, 1962, 1965, 1968, 1967, + 1968, 1967, 1967, 1963, 1965, 1964, 1965, 1967, + 1969, 1968, 1964, 1962, 1960, 1957, 1955, 1953, + 1949, 1949, 1948, 1949, 1950, 1951, 1953, 1957, + 1963, 1964, 1963, 1965, 1960, 1959, 1957, 1951, + 1948, 1946, 1943, 1941, 1941, 1940, 1937, 1936, + 1939, 1939, 1941, 1944, 1944, 1945, 1945, 1946, + 1944, 1945, 1941, 1940, 1940, 1940, 1941, 1939, + 1935, 1936, 1936, 1934, 1933, 1934, 1935, 1937, + 1936, 1934, 1938, 1938, 1938, 1938, 1939, 1938, + 1938, 1939, 1939, 1940, 1937, 1936, 1932, 1933, + 1933, 1934, 1932, 1933, 1933, 1936, 1937, 1936, + 1941, 1944, 1946, 1948, 1952, 1954, 1953, 1950, + 1949, 1947, 1946, 1943, 1942, 1939, 1940, 1940, + 1940, 1938, 1939, 1940, 1940, 1940, 1942, 1945, + 1949, 1949, 1947, 1946, 1947, 1944, 1939, 1937, + 1938, 1936, 1936, 1939, 1937, 1938, 1937, 1935, + 1934, 1935, 1933, 1932, 1930, 1932, 1932, 1932, + 1933, 1933, 1936, 1938, 1942, 1945, 1947, 1948, + 1948, 1952, 1951, 1949, 1947, 1947, 1948, 1946, + 1945, 1945, 1945, 1946, 1944, 1945, 1948, 1952, + 1958, 1959, 1962, 1964, 1965, 1963, 1964, 1960, + 1957, 1956, 1951, 1947, 1943, 1942, 1938, 1939, + 1935, 1937, 1939, 1940, 1943, 1946, 1949, 1950, + 1948, 1947, 1948, 1948, 1947, 1943, 1938, 1939, + 1938, 1937, 1934, 1935, 1933, 1934, 1936, 1940, + 1941, 1942, 1943, 1943, 1946, 1944, 1944, 1944, + 1945, 1946, 1946, 1945, 1946, 1945, 1944, 1942, + 1939, 1936, 1937, 1935, 1935, 1936, 1935, 1937, + 1938, 1939, 1938, 1939, 1938, 1940, 1938, 1937, + 1936, 1935, 1932, 1929, 1926, 1925, 1921, 1921, + 1918, 1915, 1912, 1915, 1916, 1915, 1917, 1918, + 1921, 1925, 1927, 1924, 1921, 1918, 1920, 1918, + 1917, 1920, 1924, 1923, 1925, 1925, 1923, 1922, + 1923, 1926, 1929, 1929, 1932, 1936, 1937, 1936, + 1934, 1934, 1932, 1934, 1933, 1932, 1932, 1927, + 1926, 1926, 1926, 1927, 1925, 1924, 1923, 1923, + 1922, 1923, 1921, 1921, 1921, 1922, 1922, 1923, + 1922, 1923, 1925, 1926, 1927, 1927, 1927, 1928, + 1926, 1925, 1922, 1921, 1922, 1922, 1922, 1922, + 1920, 1921, 1921, 1918, 1919, 1919, 1923, 1924, + 1929, 1931, 1934, 1932, 1931, 1932, 1931, 1932, + 1933, 1931, 1931, 1930, 1931, 1932, 1930, 1930, + 1931, 1930, 1932, 1932, 1931, 1932, 1932, 1928, + 1928, 1930, 1931, 1932, 1932, 1933, 1932, 1930, + 1929, 1927, 1925, 1924, 1924, 1924, 1925, 1924, + 1925, 1927, 1927, 1927, 1924, 1925, 1928, 1927, + 1926, 1925, 1923, 1925, 1926, 1927, 1924, 1922, + 1921, 1919, 1921, 1918, 1917, 1918, 1921, 1922, + 1926, 1928, 1928, 1928, 1927, 1928, 1929, 1931, + 1931, 1930, 1932, 1932, 1928, 1930, 1928, 1927, + 1929, 1931, 1934, 1937, 1937, 1937, 1936, 1938, + 1938, 1939, 1937, 1938, 1937, 1937, 1936, 1933, + 1932, 1932, 1931, 1930, 1931, 1930, 1930, 1930, + 1932, 1932, 1932, 1934, 1936, 1937, 1937, 1936, + 1935, 1936, 1938, 1938, 1938, 1937, 1934, 1937, + 1934, 1928, 1930, 1928, 1930, 1930, 1932, 1934, + 1939, 1940, 1939, 1944, 1943, 1945, 1945, 1943, + 1940, 1940, 1942, 1939, 1942, 1938, 1936, 1935, + 1933, 1930, 1934, 1932, 1929, 1930, 1929, 1931, + 1929, 1927, 1928, 1926, 1925, 1923, 1920, 1920, + 1916, 1915, 1915, 1913, 1912, 1913, 1914, 1914, + 1911, 1911, 1909, 1907, 1909, 1909, 1907, 1909, + 1908, 1907, 1908, 1908, 1910, 1912, 1912, 1910, + 1910, 1913, 1912, 1915, 1916, 1913, 1914, 1911, + 1912, 1911, 1911, 1912, 1913, 1913, 1913, 1914, + 1916, 1916, 1914, 1912, 1911, 1909, 1909, 1907, + 1903, 1903, 1904, 1906, 1907, 1909, 1911, 1912, + 1913, 1912, 1913, 1913, 1912, 1914, 1913, 1913, + 1911, 1909, 1907, 1907, 1907, 1911, 1914, 1917, + 1920, 1922, 1925, 1927, 1928, 1929, 1927, 1927, + 1926, 1927, 1928, 1926, 1927, 1928, 1929, 1934, + 1937, 1938, 1939, 1940, 1941, 1940, 1938, 1937, + 1934, 1933, 1933, 1932, 1930, 1928, 1927, 1928, + 1928, 1928, 1930, 1934, 1936, 1934, 1936, 1938, + 1940, 1937, 1938, 1936, 1934, 1930, 1928, 1927, + 1929, 1928, 1925, 1928, 1930, 1932, 1936, 1940, + 1942, 1944, 1944, 1940, 1944, 1943, 1944, 1942, + 1941, 1941, 1942, 1941, 1943, 1944, 1946, 1950, + 1950, 1953, 1950, 1949, 1947, 1945, 1946, 1946, + 1946, 1948, 1950, 1948, 1946, 1946, 1947, 1946, + 1946, 1948, 1948, 1950, 1951, 1949, 1949, 1949, + 1948, 1944, 1942, 1946, 1945, 1946, 1944, 1949, + 1950, 1952, 1954, 1956, 1957, 1955, 1954, 1953, + 1952, 1949, 1948, 1949, 1950, 1951, 1955, 1956, + 1960, 1962, 1963, 1962, 1963, 1965, 1966, 1970, + 1970, 1969, 1967, 1964, 1962, 1959, 1958, 1957, + 1956, 1956, 1956, 1960, 1960, 1963, 1964, 1965, + 1965, 1966, 1964, 1963, 1962, 1960, 1959, 1958, + 1958, 1957, 1957, 1958, 1955, 1954, 1956, 1956, + 1956, 1957, 1957, 1958, 1959, 1959, 1957, 1958, + 1961, 1960, 1957, 1956, 1954, 1957, 1958, 1959, + 1958, 1957, 1961, 1961, 1963, 1959, 1960, 1963, + 1963, 1963, 1964, 1965, 1965, 1966, 1965, 1967, + 1965, 1967, 1968, 1966, 1971, 1971, 1970, 1969, + 1970, 1971, 1971, 1972, 1971, 1972, 1970, 1970, + 1969, 1967, 1967, 1966, 1967, 1971, 1972, 1974, + 1977, 1976, 1976, 1975, 1974, 1974, 1974, 1973, + 1971, 1972, 1973, 1973, 1973, 1974, 1974, 1975, + 1977, 1979, 1979, 1977, 1979, 1980, 1978, 1978, + 1976, 1976, 1975, 1975, 1974, 1973, 1971, 1974, + 1976, 1977, 1978, 1977, 1977, 1976, 1980, 1981, + 1977, 1977, 1977, 1976, 1975, 1977, 1975, 1974, + 1969, 1970, 1969, 1969, 1965, 1965, 1965, 1966, + 1968, 1967, 1970, 1971, 1972, 1973, 1974, 1973, + 1972, 1975, 1978, 1977, 1976, 1976, 1978, 1978, + 1979, 1981, 1980, 1980, 1981, 1980, 1981, 1980, + 1980, 1981, 1979, 1979, 1977, 1979, 1980, 1982, + 1983, 1984, 1985, 1987, 1992, 1994, 1996, 1997, + 1993, 1992, 1990, 1990, 1989, 1989, 1987, 1987, + 1988, 1986, 1988, 1992, 1993, 1993, 1993, 1994, + 1994, 1997, 1999, 2001, 2003, 2000, 1999, 1996, + 1997, 1996, 1996, 1995, 1996, 1996, 1994, 1994, + 1995, 1998, 1999, 2000, 2001, 2001, 2001, 2001, + 1999, 2001, 2004, 2003, 2006, 2008, 2005, 2007, + 2008, 2007, 2005, 2005, 2001, 2001, 2002, 2000, + 2001, 2002, 2000, 2001, 2003, 2001, 1997, 1994, + 1995, 1999, 2001, 2003, 2008, 2005, 2003, 2002, + 2001, 2001, 2000, 1999, 2000, 2001, 1998, 1997, + 1997, 1996, 1996, 1994, 1994, 1995, 1995, 1997, + 1996, 1996, 1999, 2001, 2001, 2003, 2006, 2004, + 2005, 2003, 2004, 2000, 1999, 1997, 1997, 1997, + 1994, 1994, 1993, 1993, 1994, 1996, 1995, 1994, + 1992, 1993, 1991, 1991, 1990, 1992, 1991, 1987, + 1986, 1986, 1985, 1984, 1986, 1982, 1980, 1979, + 1976, 1978, 1973, 1977, 1978, 1978, 1979, 1980, + 1981, 1981, 1983, 1982, 1983, 1985, 1982, 1985, + 1985, 1983, 1982, 1980, 1980, 1982, 1981, 1984, + 1986, 1986, 1986, 1986, 1984, 1982, 1984, 1987, + 1988, 1990, 1990, 1988, 1986, 1985, 1985, 1984, + 1983, 1983, 1984, 1986, 1986, 1986, 1986, 1986, + 1985, 1985, 1984, 1987, 1987, 1988, 1985, 1983, + 1981, 1979, 1980, 1976, 1974, 1977, 1978, 1979, + 1981, 1981, 1980, 1981, 1980, 1983, 1985, 1987, + 1986, 1984, 1983, 1981, 1980, 1978, 1980, 1978, + 1979, 1979, 1975, 1975, 1975, 1973, 1972, 1971, + 1971, 1969, 1971, 1970, 1970, 1969, 1966, 1964, + 1964, 1964, 1965, 1966, 1968, 1968, 1966, 1968, + 1967, 1967, 1968, 1964, 1962, 1964, 1962, 1963, + 1960, 1960, 1959, 1961, 1964, 1963, 1966, 1966, + 1968, 1969, 1971, 1968, 1967, 1969, 1969, 1969, + 1970, 1968, 1966, 1964, 1966, 1964, 1962, 1964, + 1964, 1962, 1961, 1961, 1958, 1957, 1958, 1958, + 1959, 1957, 1956, 1958, 1958, 1959, 1960, 1960, + 1961, 1960, 1961, 1958, 1958, 1956, 1955, 1954, + 1951, 1949, 1948, 1950, 1951, 1952, 1953, 1954, + 1955, 1955, 1956, 1957, 1958, 1956, 1954, 1954, + 1954, 1951, 1948, 1946, 1946, 1946, 1945, 1946, + 1946, 1946, 1946, 1946, 1946, 1946, 1945, 1943, + 1945, 1944, 1941, 1940, 1939, 1941, 1941, 1938, + 1939, 1941, 1944, 1941, 1941, 1939, 1938, 1939, + 1936, 1931, 1931, 1933, 1932, 1932, 1931, 1932, + 1933, 1933, 1934, 1934, 1936, 1937, 1934, 1935, + 1933, 1932, 1931, 1930, 1928, 1927, 1927, 1927, + 1928, 1930, 1928, 1928, 1930, 1930, 1930, 1930, + 1930, 1929, 1927, 1925, 1924, 1922, 1922, 1923, + 1918, 1917, 1915, 1916, 1917, 1916, 1916, 1915, + 1914, 1915, 1917, 1918, 1920, 1918, 1916, 1917, + 1916, 1914, 1912, 1913, 1914, 1913, 1914, 1914, + 1912, 1909, 1908, 1910, 1912, 1912, 1913, 1914, + 1914, 1913, 1912, 1914, 1914, 1915, 1914, 1913, + 1912, 1910, 1910, 1909, 1905, 1906, 1910, 1910, + 1910, 1906, 1908, 1905, 1903, 1906, 1908, 1908, + 1909, 1910, 1906, 1905, 1905, 1905, 1905, 1905, + 1907, 1907, 1908, 1910, 1911, 1911, 1909, 1910, + 1910, 1909, 1907, 1905, 1903, 1903, 1904, 1905, + 1907, 1905, 1905, 1906, 1906, 1907, 1909, 1909, + 1911, 1911, 1911, 1910, 1910, 1907, 1907, 1907, + 1906, 1905, 1903, 1902, 1905, 1903, 1906, 1907, + 1907, 1909, 1907, 1908, 1910, 1907, 1907, 1908, + 1908, 1905, 1904, 1903, 1903, 1903, 1904, 1905, + 1907, 1908, 1907, 1907, 1906, 1904, 1907, 1905, + 1905, 1906, 1903, 1902, 1901, 1901, 1901, 1898, + 1896, 1895, 1895, 1895, 1894, 1896, 1897, 1900, + 1896, 1896, 1898, 1897, 1898, 1901, 1900, 1899, + 1901, 1901, 1901, 1899, 1899, 1899, 1898, 1901, + 1903, 1904, 1904, 1905, 1906, 1905, 1903, 1903, + 1907, 1906, 1907, 1908, 1908, 1911, 1909, 1908, + 1911, 1911, 1913, 1916, 1917, 1915, 1915, 1913, + 1913, 1912, 1913, 1915, 1915, 1914, 1916, 1915, + 1917, 1918, 1916, 1918, 1920, 1920, 1922, 1921, + 1922, 1920, 1919, 1916, 1916, 1917, 1917, 1917, + 1918, 1921, 1920, 1921, 1919, 1920, 1922, 1921, + 1920, 1922, 1922, 1922, 1921, 1918, 1918, 1918, + 1919, 1919, 1919, 1919, 1919, 1920, 1920, 1925, + 1925, 1923, 1922, 1922, 1922, 1923, 1922, 1923, + 1922, 1919, 1919, 1919, 1919, 1920, 1919, 1921, + 1921, 1921, 1920, 1921, 1920, 1921, 1921, 1920, + 1921, 1924, 1924, 1923, 1922, 1923, 1921, 1923, + 1923, 1922, 1923, 1922, 1923, 1920, 1917, 1918, + 1916, 1917, 1921, 1922, 1922, 1923, 1925, 1925, + 1926, 1925, 1928, 1926, 1925, 1928, 1927, 1926, + 1926, 1925, 1925, 1925, 1922, 1923, 1923, 1925, + 1927, 1925, 1924, 1925, 1926, 1926, 1924, 1926, + 1924, 1922, 1925, 1925, 1925, 1925, 1925, 1926, + 1925, 1925, 1925, 1925, 1925, 1925, 1925, 1926, + 1927, 1926, 1926, 1926, 1926, 1926, 1927, 1926, + 1924, 1927, 1927, 1929, 1928, 1926, 1926, 1926, + 1925, 1926, 1926, 1927, 1931, 1932, 1932, 1932, + 1933, 1931, 1931, 1931, 1929, 1928, 1928, 1930, + 1931, 1931, 1931, 1931, 1931, 1929, 1932, 1932, + 1932, 1933, 1930, 1932, 1933, 1936, 1936, 1935, + 1933, 1932, 1930, 1931, 1931, 1932, 1932, 1932, + 1935, 1934, 1934, 1937, 1937, 1937, 1938, 1935, + 1935, 1935, 1935, 1936, 1937, 1937, 1939, 1941, + 1942, 1942, 1942, 1942, 1944, 1943, 1944, 1944, + 1943, 1943, 1944, 1946, 1949, 1949, 1947, 1947, + 1945, 1945, 1946, 1943, 1942, 1947, 1944, 1943, + 1942, 1942, 1943, 1944, 1945, 1946, 1949, 1949, + 1948, 1951, 1949, 1950, 1950, 1948, 1949, 1944, + 1945, 1946, 1946, 1946, 1944, 1945, 1949, 1950, + 1953, 1953, 1954, 1954, 1954, 1953, 1954, 1957, + 1955, 1957, 1958, 1956, 1955, 1953, 1953, 1952, + 1951, 1953, 1954, 1955, 1955, 1955, 1952, 1953, + 1954, 1951, 1953, 1952, 1953, 1956, 1957, 1957, + 1955, 1954, 1957, 1950, 1948, 1950, 1949, 1951, + 1950, 1947, 1946, 1943, 1943, 1942, 1942, 1944, + 1944, 1947, 1948, 1947, 1947, 1949, 1949, 1949, + 1951, 1950, 1946, 1945, 1945, 1945, 1942, 1939, + 1943, 1943, 1943, 1943, 1944, 1947, 1945, 1943, + 1944, 1946, 1947, 1949, 1949, 1948, 1949, 1951, + 1947, 1946, 1944, 1943, 1945, 1944, 1943, 1942, + 1940, 1940, 1939, 1940, 1941, 1939, 1939, 1939, + 1942, 1943, 1943, 1942, 1943, 1944, 1947, 1946, + 1946, 1948, 1946, 1944, 1943, 1941, 1941, 1940, + 1941, 1942, 1944, 1944, 1945, 1944, 1945, 1946, + 1943, 1945, 1945, 1946, 1944, 1945, 1945, 1947, + 1947, 1946, 1942, 1942, 1940, 1938, 1937, 1936, + 1936, 1936, 1936, 1936, 1936, 1937, 1937, 1939, + 1940, 1942, 1941, 1940, 1938, 1938, 1938, 1939, + 1938, 1935, 1936, 1935, 1934, 1934, 1933, 1934, + 1934, 1934, 1933, 1932, 1933, 1933, 1933, 1929, + 1928, 1929, 1929, 1928, 1928, 1929, 1927, 1928, + 1929, 1929, 1928, 1930, 1931, 1929, 1927, 1927, + 1925, 1926, 1926, 1928, 1928, 1927, 1925, 1923, + 1923, 1924, 1925, 1924, 1927, 1929, 1930, 1928, + 1927, 1929, 1928, 1927, 1927, 1927, 1926, 1927, + 1928, 1927, 1930, 1930, 1929, 1930, 1926, 1927, + 1929, 1932, 1933, 1933, 1931, 1929, 1927, 1927, + 1925, 1926, 1928, 1928, 1928, 1925, 1926, 1927, + 1929, 1929, 1932, 1931, 1930, 1929, 1928, 1928, + 1926, 1926, 1925, 1927, 1927, 1927, 1924, 1924, + 1923, 1923, 1922, 1923, 1925, 1921, 1921, 1920, + 1922, 1923, 1921, 1921, 1921, 1918, 1918, 1916, + 1916, 1915, 1914, 1913, 1913, 1913, 1911, 1910, + 1910, 1909, 1908, 1908, 1908, 1909, 1912, 1911, + 1909, 1909, 1907, 1908, 1910, 1907, 1907, 1906, + 1907, 1906, 1905, 1902, 1902, 1900, 1899, 1900, + 1900, 1901, 1901, 1901, 1902, 1902, 1901, 1901, + 1898, 1898, 1899, 1900, 1899, 1899, 1898, 1896, + 1895, 1895, 1893, 1892, 1893, 1890, 1890, 1889, + 1889, 1891, 1891, 1893, 1894, 1897, 1898, 1898, + 1897, 1899, 1898, 1897, 1897, 1896, 1896, 1895, + 1892, 1891, 1891, 1888, 1889, 1893, 1893, 1895, + 1895, 1896, 1899, 1902, 1900, 1899, 1899, 1900, + 1901, 1901, 1901, 1900, 1901, 1901, 1903, 1900, + 1902, 1903, 1904, 1902, 1902, 1903, 1902, 1901, + 1902, 1903, 1902, 1900, 1900, 1896, 1892, 1891, + 1897, 1899, 1902, 1908, 1907, 1914, 1916, 1917, + 1918, 1918, 1917, 1912, 1904, 1898, 1891, 1886, + 1885, 1884, 1886, 1885, 1888, 1894, 1900, 1911, + 1917, 1923, 1927, 1931, 1930, 1927, 1920, 1915, + 1911, 1902, 1894, 1887, 1883, 1883, 1887, 1891, + 1894, 1900, 1906, 1915, 1922, 1925, 1930, 1931, + 1931, 1925, 1921, 1915, 1907, 1901, 1898, 1895, + 1891, 1893, 1897, 1901, 1905, 1912, 1921, 1923, + 1929, 1934, 1936, 1937, 1934, 1932, 1928, 1924, + 1918, 1915, 1910, 1908, 1908, 1910, 1910, 1910, + 1914, 1918, 1922, 1925, 1928, 1927, 1929, 1927, + 1930, 1929, 1928, 1927, 1924, 1922, 1921, 1921, + 1921, 1921, 1918, 1918, 1920, 1920, 1920, 1920, + 1922, 1927, 1931, 1930, 1932, 1933, 1933, 1937, + 1935, 1935, 1935, 1932, 1930, 1929, 1928, 1926, + 1926, 1926, 1927, 1928, 1930, 1933, 1936, 1939, + 1941, 1945, 1945, 1947, 1946, 1942, 1939, 1935, + 1932, 1929, 1928, 1928, 1927, 1929, 1931, 1935, + 1936, 1938, 1939, 1942, 1945, 1946, 1949, 1949, + 1946, 1946, 1943, 1939, 1937, 1934, 1935, 1934, + 1934, 1934, 1933, 1935, 1938, 1940, 1942, 1942, + 1944, 1943, 1944, 1943, 1944, 1944, 1943, 1943, + 1942, 1941, 1941, 1941, 1941, 1941, 1942, 1943, + 1942, 1943, 1945, 1946, 1947, 1947, 1948, 1950, + 1949, 1948, 1947, 1945, 1947, 1949, 1949, 1948, + 1950, 1952, 1948, 1950, 1954, 1952, 1952, 1955, + 1955, 1956, 1956, 1955, 1957, 1956, 1956, 1957, + 1960, 1958, 1959, 1960, 1959, 1960, 1963, 1964, + 1963, 1963, 1962, 1964, 1964, 1964, 1964, 1965, + 1967, 1967, 1966, 1964, 1965, 1962, 1961, 1961, + 1962, 1960, 1962, 1961, 1961, 1962, 1963, 1966, + 1968, 1969, 1967, 1968, 1967, 1967, 1966, 1967, + 1969, 1967, 1968, 1966, 1967, 1967, 1968, 1966, + 1966, 1969, 1970, 1973, 1972, 1974, 1978, 1976, + 1976, 1977, 1979, 1978, 1975, 1974, 1972, 1972, + 1971, 1969, 1969, 1970, 1971, 1972, 1974, 1976, + 1979, 1980, 1979, 1980, 1981, 1982, 1982, 1982, + 1980, 1978, 1980, 1980, 1978, 1976, 1977, 1979, + 1979, 1977, 1978, 1979, 1981, 1982, 1986, 1987, + 1988, 1989, 1989, 1994, 1993, 1995, 1994, 1993, + 1993, 1994, 1997, 1997, 1995, 1993, 1993, 1993, + 1995, 1995, 1997, 1996, 2000, 2002, 2001, 2001, + 2000, 2002, 2002, 2001, 2000, 2001, 2001, 2000, + 2001, 1998, 1998, 1998, 1998, 1997, 1997, 1998, + 1996, 1996, 1997, 1998, 2000, 1999, 2000, 2000, + 2000, 2003, 2002, 2001, 2001, 2002, 2004, 2005, + 2002, 2001, 2001, 2001, 2001, 1998, 2000, 1999, + 2000, 2000, 1998, 1999, 2001, 2000, 2002, 2004, + 2005, 2007, 2006, 2006, 2004, 2004, 2004, 2003, + 2003, 2001, 2001, 2000, 2000, 1999, 1999, 1998, + 1996, 1998, 1998, 1998, 1996, 1997, 1996, 1994, + 1995, 1995, 1994, 1997, 1997, 1997, 2002, 2002, + 2000, 2000, 1999, 2000, 1998, 2000, 2001, 2001, + 2001, 1999, 1998, 1998, 1999, 1999, 1999, 2000, + 2003, 2006, 2006, 2008, 2006, 2004, 2006, 2007, + 2008, 2007, 2007, 2006, 2005, 2007, 2006, 2010, + 2009, 2007, 2008, 2010, 2011, 2011, 2012, 2013, + 2012, 2014, 2011, 2012, 2014, 2013, 2015, 2013, + 2015, 2013, 2012, 2014, 2014, 2012, 2013, 2010, + 2010, 2012, 2013, 2014, 2014, 2011, 2013, 2014, + 2013, 2011, 2010, 2011, 2009, 2009, 2008, 2008, + 2007, 2006, 2005, 2005, 2004, 2005, 2005, 2004, + 2004, 2003, 2003, 2004, 2006, 2007, 2008, 2007, + 2008, 2010, 2011, 2009, 2008, 2006, 2007, 2007, + 2007, 2005, 2005, 2006, 2005, 2007, 2009, 2008, + 2008, 2008, 2008, 2007, 2006, 2004, 2004, 2005, + 2004, 2004, 2003, 2003, 2002, 2002, 2001, 2000, + 2000, 1999, 2000, 1997, 2000, 2000, 1999, 1999, + 2000, 2002, 2002, 2004, 2003, 2003, 2003, 2003, + 2002, 2003, 2006, 2007, 2007, 2009, 2007, 2006, + 2005, 2005, 2004, 2002, 2001, 2001, 2002, 2000, + 1999, 1996, 1999, 2000, 1999, 2001, 2001, 2000, + 1998, 2000, 2001, 2001, 2001, 2001, 2000, 1999, + 1998, 1998, 2000, 2000, 2000, 1999, 1998, 1996, + 1994, 1992, 1992, 1993, 1994, 1993, 1995, 1994, + 1993, 1998, 1999, 1996, 1994, 1995, 1995, 1996, + 1994, 1994, 1995, 1995, 1994, 1994, 1992, 1992, + 1993, 1992, 1992, 1993, 1994, 1994, 1994, 1996, + 1996, 1996, 1996, 1996, 1995, 1997, 1997, 1998, + 2001, 2000, 2000, 1998, 1999, 2000, 1999, 2000, + 1999, 1998, 1998, 1997, 1999, 2001, 2000, 2000, + 2001, 1998, 1998, 1997, 1998, 1998, 1998, 1998, + 1998, 1997, 1994, 1995, 1997, 1997, 1995, 1996, + 1995, 1993, 1995, 1994, 1997, 1995, 1995, 1994, + 1997, 1997, 1996, 1998, 1999, 1998, 1997, 1999, + 1999, 1999, 1999, 1998, 1997, 1995, 1998, 1999, + 1999, 1997, 1998, 1999, 1998, 1999, 2000, 2000, + 1998, 1998, 1997, 1992, 1994, 1996, 1993, 1994, + 1993, 1995, 1995, 1997, 1994, 1995, 1995, 1995, + 1994, 1993, 1993, 1992, 1991, 1993, 1992, 1993, + 1992, 1991, 1993, 1991, 1992, 1992, 1991, 1992, + 1989, 1990, 1990, 1992, 1990, 1991, 1991, 1991, + 1989, 1991, 1989, 1990, 1989, 1990, 1991, 1990, + 1990, 1990, 1990, 1990, 1991, 1993, 1991, 1991, + 1991, 1992, 1993, 1994, 1993, 1994, 1994, 1994, + 1995, 1995, 2000, 2000, 1999, 2001, 2000, 1997, + 1999, 1998, 1996, 1997, 1996, 1996, 1996, 1995, + 1997, 1997, 1997, 1996, 1995, 1997, 1997, 1999, + 1999, 2000, 1999, 1999, 2000, 2001, 2000, 2002, + 2005, 2004, 2007, 2006, 2006, 2005, 2005, 2006, + 2006, 2008, 2007, 2008, 2009, 2009, 2011, 2013, + 2013, 2013, 2017, 2017, 2019, 2020, 2019, 2021, + 2021, 2021, 2022, 2022, 2023, 2022, 2024, 2023, + 2027, 2025, 2027, 2027, 2026, 2029, 2029, 2027, + 2029, 2030, 2029, 2029, 2031, 2029, 2028, 2030, + 2029, 2033, 2032, 2035, 2032, 2031, 2032, 2027, + 2031, 2030, 2029, 2030, 2030, 2029, 2030, 2034, + 2033, 2033, 2036, 2038, 2038, 2039, 2038, 2040, + 2040, 2041, 2040, 2040, 2039, 2040, 2040, 2043, + 2044, 2044, 2044, 2044, 2045, 2047, 2045, 2047, + 2048, 2047, 2048, 2048, 2049, 2051, 2051, 2051, + 2051, 2054, 2052, 2049, 2051, 2051, 2049, 2050, + 2050, 2050, 2052, 2050, 2052, 2052, 2051, 2051, + 2051, 2050, 2051, 2050, 2052, 2053, 2053, 2052, + 2054, 2053, 2052, 2053, 2054, 2052, 2056, 2057, + 2057, 2056, 2057, 2056, 2056, 2057, 2057, 2056, + 2056, 2056, 2059, 2058, 2058, 2059, 2059, 2059, + 2059, 2061, 2059, 2059, 2059, 2062, 2062, 2061, + 2062, 2061, 2062, 2063, 2063, 2064, 2064, 2064, + 2064, 2062, 2061, 2061, 2061, 2061, 2059, 2058, + 2059, 2061, 2062, 2059, 2059, 2061, 2060, 2059, + 2060, 2060, 2062, 2062, 2064, 2067, 2064, 2066, + 2067, 2066, 2066, 2066, 2067, 2067, 2066, 2066, + 2066, 2066, 2069, 2068, 2066, 2069, 2067, 2067, + 2069, 2069, 2070, 2069, 2071, 2072, 2074, 2072, + 2071, 2073, 2073, 2073, 2071, 2073, 2076, 2073, + 2071, 2072, 2074, 2072, 2075, 2073, 2074, 2077, + 2079, 2080, 2081, 2084, 2083, 2083, 2082, 2086, + 2087, 2086, 2086, 2086, 2088, 2089, 2088, 2088, + 2088, 2088, 2090, 2090, 2090, 2090, 2093, 2093, + 2093, 2094, 2093, 2097, 2098, 2096, 2096, 2094, + 2095, 2096, 2096, 2092, 2095, 2097, 2094, 2096, + 2095, 2097, 2097, 2095, 2095, 2097, 2097, 2097, + 2095, 2094, 2097, 2097, 2098, 2097, 2096, 2096, + 2096, 2099, 2100, 2100, 2098, 2099, 2099, 2099, + 2102, 2104, 2103, 2103, 2105, 2104, 2105, 2104, + 2106, 2107, 2107, 2106, 2107, 2109, 2110, 2110, + 2111, 2113, 2115, 2113, 2114, 2116, 2114, 2116, + 2113, 2114, 2112, 2112, 2112, 2111, 2114, 2114, + 2112, 2112, 2112, 2115, 2116, 2115, 2114, 2112, + 2113, 2114, 2114, 2114, 2114, 2114, 2114, 2112, + 2113, 2115, 2113, 2115, 2114, 2115, 2117, 2115, + 2116, 2116, 2117, 2118, 2116, 2116, 2117, 2117, + 2117, 2118, 2118, 2120, 2121, 2120, 2117, 2116, + 2118, 2120, 2121, 2120, 2120, 2122, 2121, 2124, + 2122, 2120, 2123, 2121, 2121, 2123, 2121, 2121, + 2121, 2119, 2119, 2118, 2115, 2117, 2119, 2117, + 2116, 2115, 2115, 2115, 2114, 2113, 2112, 2113, + 2111, 2111, 2111, 2112, 2110, 2111, 2111, 2111, + 2111, 2111, 2112, 2111, 2111, 2112, 2111, 2110, + 2111, 2113, 2113, 2111, 2111, 2109, 2110, 2109, + 2107, 2109, 2110, 2112, 2111, 2112, 2109, 2109, + 2110, 2110, 2109, 2112, 2112, 2110, 2108, 2108, + 2108, 2109, 2107, 2108, 2112, 2111, 2109, 2108, + 2109, 2111, 2112, 2108, 2106, 2107, 2108, 2107, + 2107, 2106, 2106, 2107, 2107, 2107, 2107, 2109, + 2109, 2112, 2111, 2108, 2106, 2108, 2108, 2105, + 2106, 2107, 2106, 2107, 2105, 2104, 2105, 2105, + 2104, 2104, 2103, 2102, 2101, 2100, 2098, 2099, + 2098, 2098, 2098, 2097, 2099, 2099, 2097, 2094, + 2095, 2097, 2094, 2094, 2090, 2092, 2093, 2093, + 2094, 2094, 2094, 2093, 2094, 2094, 2094, 2093, + 2090, 2093, 2092, 2089, 2092, 2091, 2092, 2088, + 2088, 2090, 2088, 2087, 2087, 2088, 2087, 2088, + 2086, 2087, 2087, 2088, 2089, 2085, 2085, 2086, + 2088, 2087, 2086, 2088, 2087, 2085, 2085, 2086, + 2087, 2086, 2085, 2084, 2085, 2085, 2087, 2089, + 2091, 2091, 2086, 2086, 2085, 2083, 2083, 2082, + 2081, 2084, 2085, 2085, 2082, 2081, 2082, 2080, + 2082, 2084, 2082, 2082, 2082, 2079, 2080, 2080, + 2079, 2078, 2077, 2076, 2076, 2075, 2076, 2076, + 2077, 2074, 2077, 2077, 2075, 2075, 2075, 2074, + 2074, 2074, 2075, 2075, 2072, 2073, 2071, 2072, + 2072, 2070, 2070, 2068, 2070, 2068, 2069, 2068, + 2067, 2068, 2069, 2066, 2063, 2065, 2067, 2065, + 2065, 2065, 2064, 2064, 2062, 2063, 2062, 2061, + 2061, 2060, 2063, 2060, 2059, 2058, 2055, 2058, + 2059, 2059, 2061, 2058, 2057, 2057, 2058, 2058, + 2058, 2057, 2056, 2054, 2054, 2055, 2056, 2058, + 2058, 2058, 2054, 2058, 2060, 2059, 2056, 2056, + 2055, 2056, 2058, 2057, 2057, 2057, 2056, 2056, + 2057, 2058, 2058, 2058, 2058, 2058, 2058, 2058, + 2059, 2059, 2059, 2060, 2061, 2060, 2059, 2059, + 2060, 2061, 2062, 2063, 2065, 2063, 2062, 2061, + 2062, 2063, 2064, 2064, 2061, 2061, 2062, 2065, + 2067, 2065, 2068, 2065, 2066, 2066, 2066, 2067, + 2068, 2069, 2070, 2068, 2068, 2068, 2066, 2066, + 2066, 2068, 2070, 2068, 2071, 2070, 2068, 2067, + 2066, 2068, 2069, 2068, 2067, 2069, 2067, 2067, + 2070, 2069, 2068, 2067, 2066, 2066, 2068, 2069, + 2069, 2069, 2069, 2071, 2071, 2069, 2070, 2070, + 2067, 2070, 2072, 2073, 2074, 2073, 2068, 2069, + 2071, 2073, 2075, 2077, 2080, 2078, 2079, 2078, + 2078, 2078, 2078, 2077, 2076, 2078, 2076, 2079, + 2079, 2079, 2078, 2079, 2080, 2079, 2081, 2080, + 2082, 2084, 2084, 2085, 2085, 2086, 2088, 2089, + 2087, 2087, 2088, 2090, 2090, 2090, 2091, 2092, + 2093, 2093, 2092, 2094, 2093, 2095, 2093, 2093, + 2093, 2094, 2093, 2095, 2096, 2097, 2095, 2092, + 2097, 2093, 2093, 2094, 2096, 2095, 2092, 2092, + 2093, 2093, 2093, 2095, 2093, 2092, 2092, 2090, + 2090, 2091, 2091, 2092, 2094, 2095, 2096, 2094, + 2096, 2097, 2094, 2097, 2096, 2094, 2096, 2096, + 2096, 2097, 2097, 2097, 2094, 2095, 2097, 2098, + 2100, 2099, 2099, 2099, 2098, 2100, 2100, 2097, + 2099, 2100, 2101, 2100, 2100, 2102, 2102, 2100, + 2100, 2100, 2102, 2103, 2106, 2104, 2102, 2101, + 2101, 2101, 2099, 2100, 2102, 2103, 2103, 2103, + 2102, 2101, 2103, 2105, 2104, 2106, 2104, 2105, + 2105, 2105, 2105, 2102, 2101, 2102, 2103, 2103, + 2103, 2102, 2101, 2102, 2103, 2101, 2105, 2102, + 2103, 2104, 2104, 2103, 2104, 2104, 2103, 2105, + 2103, 2102, 2103, 2103, 2105, 2104, 2101, 2100, + 2099, 2099, 2100, 2101, 2101, 2099, 2100, 2100, + 2101, 2103, 2104, 2104, 2105, 2103, 2103, 2104, + 2103, 2103, 2102, 2100, 2100, 2101, 2101, 2100, + 2101, 2099, 2098, 2099, 2099, 2102, 2101, 2099, + 2099, 2098, 2100, 2103, 2103, 2104, 2107, 2106, + 2108, 2107, 2105, 2107, 2104, 2104, 2105, 2105, + 2104, 2104, 2107, 2107, 2107, 2108, 2107, 2108, + 2108, 2109, 2110, 2111, 2112, 2111, 2110, 2110, + 2111, 2110, 2111, 2112, 2113, 2114, 2114, 2112, + 2112, 2112, 2116, 2116, 2115, 2116, 2116, 2118, + 2119, 2120, 2119, 2121, 2122, 2120, 2122, 2125, + 2125, 2124, 2124, 2125, 2124, 2123, 2123, 2123, + 2121, 2122, 2122, 2125, 2124, 2123, 2124, 2126, + 2123, 2125, 2126, 2126, 2125, 2125, 2124, 2125, + 2125, 2124, 2126, 2126, 2127, 2127, 2125, 2127, + 2126, 2128, 2128, 2126, 2127, 2129, 2129, 2131, + 2131, 2131, 2131, 2132, 2130, 2130, 2132, 2132, + 2132, 2130, 2132, 2132, 2134, 2136, 2136, 2137, + 2139, 2138, 2138, 2136, 2136, 2136, 2135, 2132, + 2133, 2132, 2133, 2133, 2132, 2134, 2132, 2133, + 2136, 2131, 2132, 2133, 2133, 2135, 2134, 2134, + 2133, 2132, 2132, 2133, 2135, 2133, 2133, 2132, + 2133, 2133, 2133, 2134, 2135, 2136, 2135, 2133, + 2135, 2137, 2136, 2136, 2137, 2136, 2139, 2138, + 2137, 2138, 2137, 2139, 2138, 2138, 2139, 2139, + 2137, 2137, 2139, 2136, 2132, 2134, 2134, 2132, + 2130, 2132, 2132, 2129, 2128, 2126, 2126, 2128, + 2129, 2128, 2127, 2128, 2128, 2127, 2129, 2130, + 2130, 2128, 2128, 2128, 2129, 2129, 2131, 2132, + 2130, 2128, 2129, 2130, 2128, 2127, 2128, 2128, + 2128, 2128, 2129, 2131, 2131, 2132, 2132, 2132, + 2131, 2132, 2131, 2130, 2130, 2132, 2131, 2127, + 2130, 2127, 2127, 2127, 2128, 2124, 2123, 2124, + 2124, 2124, 2124, 2125, 2124, 2122, 2121, 2121, + 2119, 2120, 2119, 2118, 2117, 2118, 2118, 2114, + 2114, 2113, 2113, 2115, 2112, 2114, 2114, 2111, + 2111, 2111, 2111, 2109, 2110, 2110, 2109, 2108, + 2111, 2113, 2110, 2110, 2107, 2109, 2108, 2106, + 2108, 2106, 2107, 2106, 2108, 2109, 2109, 2108, + 2108, 2109, 2108, 2107, 2110, 2108, 2104, 2103, + 2105, 2106, 2104, 2104, 2103, 2103, 2102, 2102, + 2102, 2103, 2103, 2101, 2102, 2101, 2103, 2106, + 2105, 2102, 2104, 2103, 2102, 2100, 2101, 2102, + 2099, 2101, 2102, 2104, 2102, 2101, 2101, 2101, + 2103, 2102, 2103, 2105, 2103, 2104, 2102, 2102 +}; diff --git a/keyboards/planck/keymaps/synth_wavetable/config.h b/keyboards/planck/keymaps/synth_wavetable/config.h new file mode 100644 index 000000000000..930b26b00016 --- /dev/null +++ b/keyboards/planck/keymaps/synth_wavetable/config.h @@ -0,0 +1,56 @@ +/* +Copyright 2020 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 . +*/ + +#pragma once + +#ifdef AUDIO_ENABLE + #define AUDIO_PIN A5 + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/synth_wavetable/keymap.c b/keyboards/planck/keymaps/synth_wavetable/keymap.c new file mode 100644 index 000000000000..f23c426014a3 --- /dev/null +++ b/keyboards/planck/keymaps/synth_wavetable/keymap.c @@ -0,0 +1,321 @@ +/* Copyright 2019 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 . + */ + +#include QMK_KEYBOARD_H + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +void matrix_scan_user(void) { + +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} + +#include "wavetable.h" + +float dac_if[8] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; +uint8_t dac_morph = 0; + + +uint16_t dac_value_generate(void) { + uint16_t value = AUDIO_DAC_OFF_VALUE; + uint8_t active_tones = audio_get_number_of_active_tones(); + if (active_tones > AUDIO_MAX_SIMULTANEOUS_TONES) + active_tones = AUDIO_MAX_SIMULTANEOUS_TONES; + + if (active_tones > 0) { + uint16_t value_avg = 0; + for (uint8_t i = 0; i < active_tones; i++) { + dac_if[i] = dac_if[i] + + ((audio_get_frequency(i) * AUDIO_DAC_BUFFER_SIZE) / AUDIO_DAC_SAMPLE_RATE) + * 2/3; // necessary to adjust for the gpt-timer frequency (three times the sample rate) and the dac-conversion beeing called twice per sample + + // Needed because % doesn't work with floats + while (dac_if[i] >= (AUDIO_DAC_BUFFER_SIZE)) + dac_if[i] = dac_if[i] - AUDIO_DAC_BUFFER_SIZE; + + // #define AUDIO_DAC_MORPH_SPEED 372 + // #define AUDIO_DAC_MORPH_SPEED_COMPUTED (AUDIO_DAC_SAMPLE_RATE / AUDIO_DAC_WAVETABLE_CUSTOM_LENGTH * (1000 / AUDIO_DAC_MORPH_SPEED)) + + uint16_t dac_i = (uint16_t)dac_if[i]; + // value_avg += dac_buffer_custom[dac_morph_flipped][dac_i] / active_tones / 2 * ((dac_morph >= 63) ? 6400 - dac_morph_counter : dac_morph_counter) / 6400; + // value_avg += dac_buffer_custom[dac_morph_flipped + 1][dac_i] / active_tones / 2 * ((dac_morph >= 63) ? dac_morph_counter : 6400 - dac_morph_counter) / 6400; + + // value_avg += dac_wavetable_custom[dac_morph][dac_i] / active_tones / 2 * (AUDIO_DAC_MORPH_SPEED_COMPUTED - dac_morph_counter) / AUDIO_DAC_MORPH_SPEED_COMPUTED; + // value_avg += dac_wavetable_custom[dac_morph + 1][dac_i] / active_tones / 2 * dac_morph_counter / AUDIO_DAC_MORPH_SPEED_COMPUTED; + value_avg += dac_wavetable_custom[dac_morph][dac_i] / active_tones; + } + value = value_avg; + + // dac_morph_counter++; + // if (dac_morph_counter >= AUDIO_DAC_MORPH_SPEED_COMPUTED) { + // dac_morph_counter = 0; + // dac_morph = (dac_morph + 1) % 125; + // dac_morph_flipped = ((dac_morph >= 63) ? (125 - dac_morph) : dac_morph); + // dac_morph = (dac_morph + 1) % (AUDIO_DAC_WAVETABLE_CUSTOM_LENGTH - 1); + // } + } + return value; +} + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (clockwise) { + dac_morph = (dac_morph + 1) % AUDIO_DAC_WAVETABLE_CUSTOM_LENGTH; + } else { + if (dac_morph == 0) + dac_morph = (AUDIO_DAC_WAVETABLE_CUSTOM_LENGTH - 1); + else + dac_morph--; + } + return true; +} diff --git a/keyboards/planck/keymaps/synth_wavetable/rules.mk b/keyboards/planck/keymaps/synth_wavetable/rules.mk new file mode 100644 index 000000000000..ebfcda221435 --- /dev/null +++ b/keyboards/planck/keymaps/synth_wavetable/rules.mk @@ -0,0 +1,2 @@ +AUDIO_ENABLE = yes +AUDIO_DRIVER = dac_additive diff --git a/keyboards/planck/keymaps/synth_wavetable/wavetable.h b/keyboards/planck/keymaps/synth_wavetable/wavetable.h new file mode 100644 index 000000000000..89a0eefcbb7e --- /dev/null +++ b/keyboards/planck/keymaps/synth_wavetable/wavetable.h @@ -0,0 +1,2197 @@ +/* +Copyright 2020 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 . +*/ + +#define AUDIO_DAC_WAVETABLE_CUSTOM_LENGTH 64 + +static const dacsample_t dac_wavetable_custom[64][256] = { + { + 3038, 4095, 3745, 3945, 3779, 3889, 3782, 3850, + 3775, 3817, 3766, 3788, 3755, 3762, 3743, 3738, + 3729, 3716, 3715, 3695, 3700, 3676, 3683, 3658, + 3667, 3642, 3649, 3626, 3632, 3611, 3614, 3596, + 3596, 3581, 3579, 3567, 3561, 3552, 3544, 3537, + 3528, 3522, 3511, 3507, 3495, 3491, 3479, 3476, + 3464, 3460, 3449, 3444, 3433, 3428, 3419, 3412, + 3404, 3397, 3389, 3382, 3374, 3366, 3359, 3351, + 3345, 3336, 3330, 3322, 3314, 3307, 3299, 3293, + 3285, 3279, 3270, 3265, 3255, 3251, 3241, 3237, + 3227, 3223, 3213, 3208, 3200, 3194, 3187, 3179, + 3173, 3165, 3161, 3150, 3149, 3136, 3137, 3121, + 3125, 3107, 3112, 3093, 3099, 3080, 3086, 3068, + 3072, 3056, 3058, 3045, 3043, 3036, 3027, 3027, + 3010, 3019, 2992, 3013, 2974, 3007, 2955, 3002, + 2935, 2999, 2913, 2998, 2886, 3006, 2842, 3067, + 2464, 221, 205, 228, 215, 260, 231, 285, + 249, 307, 270, 326, 291, 344, 313, 359, + 335, 374, 357, 388, 378, 403, 399, 416, + 419, 431, 438, 445, 457, 460, 475, 476, + 492, 492, 509, 508, 525, 524, 540, 541, + 555, 558, 571, 574, 586, 591, 601, 607, + 616, 624, 631, 639, 647, 656, 662, 671, + 677, 687, 692, 702, 708, 718, 723, 733, + 738, 748, 753, 763, 768, 777, 783, 792, + 798, 806, 812, 820, 827, 834, 842, 848, + 857, 862, 872, 875, 887, 888, 901, 902, + 915, 915, 929, 929, 943, 942, 956, 956, + 969, 971, 981, 986, 992, 1001, 1003, 1017, + 1013, 1032, 1023, 1048, 1033, 1064, 1043, 1079, + 1054, 1093, 1065, 1106, 1078, 1118, 1092, 1127, + 1109, 1132, 1130, 1132, 1160, 1118, 1217, 1036 + }, + { + 2048, 2049, 2056, 2071, 2096, 2130, 2174, 2225, + 2280, 2337, 2392, 2444, 2490, 2529, 2559, 2581, + 2593, 2597, 2594, 2589, 2585, 2588, 2603, 2635, + 2685, 2755, 2842, 2943, 3050, 3157, 3258, 3347, + 3423, 3485, 3535, 3577, 3612, 3641, 3665, 3682, + 3692, 3694, 3692, 3689, 3690, 3700, 3724, 3761, + 3811, 3867, 3924, 3972, 4005, 4019, 4013, 3993, + 3964, 3936, 3915, 3906, 3912, 3931, 3959, 3990, + 4020, 4043, 4059, 4067, 4068, 4063, 4051, 4030, + 3997, 3946, 3875, 3782, 3671, 3546, 3419, 3299, + 3197, 3120, 3072, 3053, 3062, 3091, 3133, 3180, + 3224, 3257, 3276, 3277, 3259, 3221, 3163, 3084, + 2986, 2870, 2741, 2607, 2474, 2351, 2245, 2161, + 2102, 2069, 2058, 2067, 2091, 2124, 2160, 2195, + 2222, 2239, 2245, 2238, 2219, 2191, 2155, 2116, + 2077, 2042, 2014, 1995, 1987, 1991, 2003, 2023, + 2048, 2074, 2101, 2124, 2144, 2158, 2166, 2170, + 2172, 2175, 2181, 2195, 2221, 2260, 2315, 2384, + 2465, 2555, 2648, 2740, 2826, 2903, 2971, 3029, + 3076, 3114, 3142, 3159, 3167, 3167, 3160, 3153, + 3150, 3157, 3180, 3222, 3283, 3362, 3452, 3546, + 3636, 3715, 3777, 3823, 3854, 3874, 3889, 3905, + 3923, 3944, 3968, 3989, 4007, 4019, 4026, 4030, + 4033, 4040, 4051, 4066, 4081, 4090, 4086, 4063, + 4019, 3956, 3878, 3794, 3716, 3651, 3606, 3586, + 3589, 3612, 3647, 3688, 3728, 3760, 3781, 3787, + 3780, 3757, 3718, 3661, 3584, 3485, 3366, 3230, + 3085, 2938, 2801, 2683, 2589, 2525, 2492, 2486, + 2503, 2537, 2580, 2624, 2663, 2691, 2703, 2698, + 2674, 2633, 2574, 2500, 2415, 2322, 2228, 2139, + 2059, 1994, 1945, 1914, 1900, 1901, 1913, 1933, + 1957, 1983, 2006, 2025, 2038, 2046, 2049, 2048 + }, + { + 2048, 2053, 2074, 2119, 2191, 2291, 2416, 2559, + 2710, 2860, 3000, 3124, 3225, 3301, 3350, 3371, + 3364, 3334, 3288, 3234, 3182, 3144, 3127, 3137, + 3173, 3231, 3304, 3378, 3441, 3483, 3495, 3475, + 3423, 3344, 3243, 3128, 3002, 2867, 2726, 2581, + 2433, 2286, 2142, 2001, 1865, 1731, 1597, 1460, + 1317, 1171, 1023, 881, 750, 637, 546, 476, + 423, 380, 341, 300, 254, 205, 154, 109, + 75, 56, 55, 72, 105, 153, 217, 296, + 395, 513, 651, 806, 972, 1139, 1299, 1444, + 1572, 1680, 1772, 1855, 1935, 2018, 2110, 2212, + 2323, 2442, 2563, 2680, 2786, 2877, 2944, 2982, + 2986, 2951, 2877, 2771, 2640, 2498, 2360, 2238, + 2145, 2087, 2069, 2088, 2140, 2215, 2303, 2392, + 2469, 2524, 2550, 2543, 2505, 2437, 2346, 2241, + 2132, 2031, 1949, 1893, 1870, 1878, 1915, 1974, + 2048, 2128, 2206, 2276, 2332, 2371, 2394, 2402, + 2403, 2404, 2417, 2449, 2510, 2603, 2728, 2882, + 3056, 3236, 3410, 3564, 3690, 3783, 3842, 3868, + 3864, 3833, 3777, 3700, 3604, 3495, 3378, 3261, + 3150, 3048, 2958, 2877, 2801, 2723, 2637, 2536, + 2420, 2289, 2146, 1997, 1847, 1698, 1552, 1410, + 1271, 1133, 999, 870, 748, 637, 536, 446, + 364, 288, 216, 150, 92, 49, 29, 37, + 76, 144, 235, 339, 444, 541, 623, 689, + 741, 784, 826, 874, 933, 1009, 1101, 1209, + 1330, 1461, 1598, 1739, 1877, 2007, 2123, 2219, + 2291, 2338, 2364, 2374, 2378, 2385, 2404, 2443, + 2503, 2585, 2684, 2794, 2904, 3004, 3084, 3136, + 3154, 3133, 3070, 2965, 2823, 2650, 2458, 2261, + 2075, 1914, 1787, 1701, 1656, 1649, 1675, 1726, + 1791, 1861, 1927, 1981, 2020, 2043, 2051, 2050 + }, + { + 2048, 2051, 2065, 2095, 2144, 2212, 2298, 2397, + 2504, 2612, 2716, 2811, 2894, 2961, 3011, 3042, + 3055, 3052, 3036, 3014, 2996, 2988, 3001, 3040, + 3108, 3204, 3324, 3459, 3598, 3728, 3841, 3930, + 3992, 4029, 4045, 4045, 4032, 4009, 3975, 3930, + 3874, 3809, 3738, 3665, 3596, 3534, 3481, 3436, + 3397, 3357, 3312, 3255, 3184, 3099, 3003, 2900, + 2795, 2693, 2595, 2503, 2413, 2325, 2235, 2143, + 2048, 1950, 1850, 1750, 1651, 1554, 1460, 1370, + 1287, 1215, 1159, 1122, 1105, 1107, 1124, 1147, + 1168, 1179, 1172, 1143, 1091, 1019, 931, 836, + 741, 655, 584, 535, 510, 514, 549, 618, + 721, 856, 1019, 1201, 1388, 1569, 1730, 1862, + 1956, 2012, 2029, 2013, 1971, 1911, 1844, 1779, + 1725, 1690, 1676, 1686, 1719, 1771, 1838, 1913, + 1989, 2059, 2115, 2152, 2167, 2161, 2136, 2097, + 2048, 1994, 1942, 1894, 1856, 1829, 1813, 1805, + 1803, 1800, 1788, 1762, 1715, 1643, 1544, 1420, + 1276, 1120, 962, 811, 675, 558, 463, 390, + 337, 304, 290, 294, 316, 353, 399, 447, + 489, 517, 526, 513, 479, 430, 375, 322, + 283, 264, 269, 297, 345, 405, 473, 542, + 612, 682, 754, 829, 910, 996, 1086, 1179, + 1273, 1366, 1459, 1553, 1649, 1747, 1848, 1949, + 2048, 2141, 2227, 2305, 2375, 2440, 2505, 2574, + 2649, 2733, 2825, 2923, 3023, 3122, 3215, 3300, + 3373, 3433, 3476, 3499, 3496, 3465, 3403, 3313, + 3200, 3073, 2945, 2829, 2735, 2672, 2644, 2652, + 2691, 2756, 2836, 2921, 3000, 3062, 3101, 3111, + 3090, 3036, 2950, 2835, 2695, 2539, 2375, 2214, + 2069, 1947, 1855, 1795, 1766, 1765, 1786, 1824, + 1871, 1920, 1965, 2003, 2029, 2044, 2050, 2049 + }, + { + 2048, 2061, 2117, 2228, 2396, 2610, 2844, 3065, + 3240, 3343, 3358, 3283, 3125, 2900, 2629, 2337, + 2048, 1783, 1558, 1379, 1241, 1136, 1049, 971, + 900, 843, 815, 838, 930, 1103, 1358, 1680, + 2048, 2435, 2816, 3170, 3479, 3729, 3908, 4008, + 4025, 3959, 3819, 3616, 3364, 3076, 2757, 2413, + 2048, 1667, 1285, 922, 601, 347, 175, 92, + 93, 168, 304, 490, 722, 998, 1315, 1668, + 2048, 2437, 2818, 3173, 3483, 3736, 3919, 4021, + 4035, 3956, 3788, 3544, 3247, 2924, 2605, 2309, + 2048, 1819, 1614, 1422, 1234, 1050, 878, 733, + 633, 597, 635, 751, 939, 1186, 1471, 1768, + 2048, 2280, 2443, 2523, 2523, 2457, 2354, 2241, + 2146, 2087, 2067, 2081, 2113, 2142, 2149, 2118, + 2048, 1944, 1824, 1711, 1629, 1601, 1637, 1740, + 1896, 2080, 2261, 2404, 2481, 2478, 2394, 2243, + 2048, 1835, 1634, 1468, 1354, 1299, 1300, 1342, + 1408, 1479, 1540, 1586, 1625, 1670, 1744, 1865, + 2048, 2292, 2585, 2903, 3215, 3491, 3707, 3846, + 3899, 3864, 3745, 3550, 3296, 2999, 2682, 2360, + 2048, 1749, 1462, 1186, 917, 661, 432, 250, + 137, 112, 184, 351, 600, 912, 1268, 1651, + 2048, 2444, 2828, 3184, 3496, 3749, 3932, 4040, + 4072, 4031, 3919, 3739, 3493, 3185, 2828, 2441, + 2048, 1675, 1346, 1074, 862, 705, 592, 516, + 476, 475, 524, 632, 806, 1046, 1343, 1684, + 2048, 2412, 2755, 3051, 3279, 3421, 3468, 3421, + 3295, 3116, 2914, 2717, 2543, 2398, 2277, 2166, + 2048, 1909, 1744, 1557, 1361, 1178, 1031, 940, + 919, 975, 1102, 1284, 1497, 1708, 1886, 2004, + 2048, 2018, 1931, 1812, 1689, 1590, 1536, 1534, + 1585, 1676, 1786, 1894, 1981, 2035, 2056, 2053 + }, + { + 2048, 2072, 2162, 2326, 2531, 2717, 2808, 2744, + 2504, 2112, 1636, 1162, 781, 560, 536, 708, + 1040, 1468, 1922, 2340, 2681, 2929, 3082, 3144, + 3108, 2958, 2676, 2261, 1739, 1174, 654, 273, + 103, 179, 496, 1009, 1653, 2344, 2997, 3529, + 3874, 3994, 3882, 3563, 3082, 2497, 1866, 1246, + 698, 284, 64, 82, 347, 829, 1459, 2145, + 2795, 3334, 3712, 3900, 3885, 3668, 3262, 2702, + 2048, 1375, 770, 310, 56, 39, 261, 696, + 1287, 1952, 2594, 3120, 3458, 3578, 3497, 3260, + 2927, 2549, 2159, 1774, 1409, 1084, 836, 709, + 741, 951, 1327, 1819, 2353, 2844, 3211, 3395, + 3374, 3170, 2846, 2488, 2179, 1975, 1891, 1901, + 1956, 2008, 2027, 2015, 1996, 2006, 2073, 2203, + 2370, 2529, 2630, 2636, 2539, 2368, 2176, 2032, + 1989, 2070, 2251, 2471, 2649, 2712, 2622, 2385, + 2048, 1681, 1362, 1153, 1086, 1157, 1334, 1565, + 1803, 2019, 2207, 2378, 2545, 2706, 2837, 2892, + 2819, 2583, 2185, 1674, 1130, 653, 328, 216, + 337, 675, 1182, 1782, 2392, 2928, 3328, 3557, + 3606, 3490, 3229, 2845, 2359, 1803, 1223, 690, + 283, 77, 118, 409, 910, 1551, 2247, 2916, + 3483, 3886, 4077, 4031, 3750, 3266, 2640, 1948, + 1273, 689, 261, 35, 43, 291, 753, 1368, + 2048, 2691, 3210, 3550, 3691, 3645, 3437, 3096, + 2649, 2126, 1569, 1033, 587, 298, 216, 362, + 722, 1248, 1866, 2486, 3015, 3375, 3519, 3446, + 3200, 2855, 2490, 2166, 1911, 1723, 1584, 1478, + 1404, 1379, 1435, 1593, 1858, 2201, 2566, 2885, + 3090, 3140, 3027, 2785, 2480, 2196, 2006, 1951, + 2026, 2183, 2350, 2459, 2469, 2375, 2208, 2022, + 1871, 1793, 1798, 1865, 1955, 2028, 2061, 2057 + }, + { + 2048, 1736, 1511, 1423, 1476, 1630, 1822, 1987, + 2083, 2101, 2063, 2006, 1968, 1967, 2000, 2045, + 2073, 2061, 2011, 1944, 1899, 1908, 1981, 2099, + 2218, 2291, 2292, 2226, 2129, 2054, 2044, 2111, + 2237, 2375, 2471, 2480, 2385, 2198, 1962, 1735, + 1574, 1515, 1563, 1694, 1861, 2022, 2148, 2232, + 2282, 2305, 2299, 2254, 2154, 1996, 1798, 1599, + 1449, 1393, 1464, 1664, 1967, 2319, 2651, 2890, + 2979, 2896, 2660, 2325, 1964, 1648, 1430, 1334, + 1360, 1494, 1707, 1967, 2238, 2480, 2658, 2740, + 2709, 2561, 2310, 1987, 1639, 1327, 1114, 1056, + 1181, 1476, 1889, 2335, 2720, 2967, 3034, 2923, + 2673, 2345, 2010, 1727, 1537, 1455, 1475, 1580, + 1747, 1955, 2184, 2411, 2607, 2733, 2751, 2632, + 2378, 2025, 1643, 1320, 1132, 1123, 1287, 1573, + 1902, 2192, 2386, 2461, 2433, 2339, 2225, 2123, + 2048, 1993, 1946, 1898, 1854, 1834, 1865, 1966, + 2133, 2334, 2512, 2611, 2593, 2463, 2263, 2058, + 1913, 1862, 1902, 1996, 2088, 2130, 2099, 2001, + 1871, 1755, 1694, 1710, 1795, 1918, 2036, 2111, + 2130, 2104, 2062, 2034, 2032, 2044, 2044, 2008, + 1930, 1832, 1756, 1745, 1830, 2008, 2250, 2502, + 2700, 2790, 2741, 2556, 2273, 1955, 1672, 1483, + 1414, 1463, 1600, 1789, 1998, 2202, 2383, 2519, + 2590, 2574, 2460, 2253, 1979, 1682, 1414, 1233, + 1183, 1291, 1551, 1925, 2344, 2723, 2981, 3065, + 2964, 2707, 2356, 1983, 1656, 1424, 1315, 1335, + 1468, 1686, 1950, 2223, 2467, 2652, 2748, 2736, + 2601, 2347, 2004, 1624, 1283, 1058, 1009, 1154, + 1466, 1873, 2285, 2614, 2801, 2826, 2710, 2501, + 2259, 2036, 1862, 1751, 1697, 1692, 1733, 1822, + 1963, 2154, 2374, 2582, 2721, 2742, 2619, 2369 + }, + { + 2048, 2099, 2228, 2259, 1999, 1514, 1195, 1450, + 2280, 3163, 3424, 2780, 1605, 678, 618, 1447, + 2593, 3312, 3203, 2425, 1510, 990, 1120, 1807, + 2685, 3258, 3119, 2226, 1045, 353, 712, 2001, + 3423, 4031, 3396, 1899, 483, 41, 848, 2389, + 3692, 3949, 3033, 1544, 405, 291, 1255, 2722, + 3811, 3831, 2719, 1136, 90, 268, 1555, 3114, + 3964, 3614, 2324, 895, 183, 617, 1954, 3388, + 4020, 3424, 1949, 514, 27, 798, 2345, 3693, + 3997, 3089, 1590, 481, 425, 1338, 2538, 3274, + 3197, 2470, 1563, 978, 1033, 1728, 2698, 3356, + 3224, 2300, 1137, 500, 836, 1934, 3058, 3478, + 2986, 2018, 1282, 1194, 1621, 2108, 2314, 2242, + 2102, 2039, 2030, 2009, 2004, 2101, 2286, 2386, + 2222, 1832, 1496, 1506, 1876, 2312, 2478, 2313, + 2077, 2067, 2276, 2385, 2108, 1542, 1143, 1321, + 2048, 2836, 3127, 2729, 1951, 1338, 1247, 1633, + 2172, 2537, 2581, 2321, 1874, 1441, 1300, 1669, + 2465, 3215, 3317, 2530, 1269, 374, 507, 1646, + 3076, 3872, 3523, 2269, 928, 339, 820, 2008, + 3150, 3579, 3074, 1933, 812, 393, 1006, 2361, + 3636, 3973, 3084, 1503, 242, 106, 1176, 2779, + 3923, 3906, 2735, 1128, 88, 267, 1552, 3134, + 4033, 3701, 2345, 796, 14, 497, 1947, 3438, + 4019, 3364, 1958, 721, 380, 1054, 2279, 3324, + 3589, 2905, 1647, 566, 367, 1237, 2668, 3752, + 3780, 2721, 1257, 332, 511, 1607, 2838, 3413, + 3085, 2234, 1489, 1248, 1506, 2001, 2450, 2652, + 2503, 2030, 1460, 1167, 1432, 2176, 2932, 3161, + 2674, 1808, 1170, 1163, 1680, 2239, 2430, 2258, + 2059, 2108, 2334, 2426, 2195, 1777, 1510, 1606, + 1957, 2266, 2327, 2193, 2057, 2033, 2068, 2069 + }, + { + 2048, 2119, 2229, 2372, 2541, 2724, 2909, 3085, + 3240, 3368, 3466, 3533, 3571, 3581, 3566, 3529, + 3473, 3403, 3326, 3251, 3188, 3144, 3128, 3145, + 3195, 3276, 3382, 3503, 3628, 3747, 3850, 3932, + 3992, 4032, 4055, 4067, 4071, 4069, 4061, 4047, + 4025, 3996, 3965, 3934, 3910, 3898, 3902, 3922, + 3956, 3998, 4040, 4074, 4093, 4093, 4074, 4041, + 4002, 3964, 3935, 3920, 3921, 3936, 3961, 3991, + 4020, 4044, 4062, 4073, 4078, 4078, 4073, 4060, + 4035, 3994, 3932, 3848, 3744, 3626, 3504, 3389, + 3291, 3220, 3180, 3174, 3198, 3247, 3313, 3388, + 3462, 3527, 3577, 3607, 3615, 3598, 3553, 3479, + 3374, 3240, 3081, 2904, 2720, 2541, 2379, 2245, + 2146, 2087, 2069, 2088, 2140, 2218, 2311, 2410, + 2503, 2580, 2633, 2654, 2639, 2585, 2492, 2361, + 2199, 2014, 1817, 1619, 1435, 1273, 1142, 1045, + 984, 959, 967, 1005, 1067, 1148, 1238, 1328, + 1408, 1468, 1498, 1493, 1450, 1369, 1254, 1113, + 956, 796, 643, 508, 397, 311, 251, 214, + 196, 195, 211, 240, 283, 334, 391, 445, + 489, 515, 519, 496, 449, 380, 299, 215, + 137, 74, 31, 7, 0, 3, 10, 16, + 18, 14, 8, 2, 0, 2, 8, 16, + 23, 25, 22, 13, 4, 0, 7, 31, + 76, 139, 215, 296, 371, 432, 472, 486, + 476, 445, 398, 345, 291, 244, 207, 183, + 172, 177, 199, 241, 305, 395, 510, 648, + 800, 958, 1109, 1242, 1347, 1416, 1448, 1443, + 1404, 1338, 1255, 1164, 1077, 1002, 947, 918, + 919, 954, 1024, 1129, 1268, 1436, 1624, 1822, + 2017, 2197, 2351, 2472, 2554, 2597, 2602, 2571, + 2510, 2427, 2331, 2232, 2141, 2070, 2027, 2018 + }, + { + 2048, 2055, 2083, 2142, 2236, 2366, 2526, 2705, + 2891, 3068, 3227, 3358, 3455, 3515, 3537, 3522, + 3473, 3396, 3302, 3199, 3101, 3015, 2946, 2896, + 2859, 2827, 2789, 2734, 2652, 2541, 2399, 2232, + 2048, 1853, 1656, 1461, 1273, 1094, 929, 779, + 649, 541, 454, 384, 327, 277, 229, 182, + 139, 106, 93, 108, 158, 244, 363, 506, + 666, 832, 999, 1165, 1330, 1499, 1674, 1857, + 2048, 2243, 2440, 2635, 2825, 3005, 3173, 3324, + 3453, 3552, 3614, 3635, 3614, 3558, 3476, 3382, + 3291, 3215, 3159, 3125, 3110, 3105, 3100, 3084, + 3048, 2986, 2897, 2783, 2647, 2497, 2341, 2188, + 2048, 1931, 1846, 1799, 1790, 1815, 1863, 1922, + 1978, 2017, 2030, 2012, 1962, 1885, 1789, 1687, + 1592, 1517, 1473, 1467, 1501, 1574, 1678, 1805, + 1940, 2069, 2176, 2249, 2282, 2272, 2224, 2146, + 2048, 1941, 1837, 1745, 1672, 1623, 1598, 1591, + 1596, 1599, 1590, 1558, 1495, 1398, 1269, 1117, + 956, 802, 670, 575, 523, 516, 554, 630, + 738, 873, 1027, 1196, 1372, 1550, 1724, 1890, + 2048, 2198, 2346, 2498, 2659, 2833, 3019, 3210, + 3398, 3573, 3724, 3847, 3939, 4004, 4046, 4069, + 4078, 4071, 4048, 4005, 3939, 3852, 3743, 3618, + 3479, 3331, 3173, 3006, 2830, 2642, 2446, 2245, + 2048, 1860, 1690, 1539, 1406, 1286, 1172, 1057, + 936, 808, 676, 546, 425, 322, 242, 192, + 172, 186, 235, 319, 438, 590, 769, 965, + 1166, 1356, 1526, 1668, 1779, 1864, 1931, 1988, + 2048, 2117, 2202, 2304, 2419, 2541, 2659, 2764, + 2845, 2893, 2899, 2857, 2767, 2633, 2463, 2272, + 2078, 1899, 1750, 1642, 1579, 1563, 1587, 1643, + 1721, 1807, 1890, 1961, 2012, 2041, 2052, 2050 + }, + { + 2048, 2060, 2109, 2207, 2360, 2560, 2787, 3015, + 3217, 3368, 3451, 3458, 3391, 3257, 3067, 2840, + 2593, 2344, 2110, 1900, 1717, 1554, 1404, 1253, + 1093, 924, 753, 596, 475, 410, 418, 507, + 673, 905, 1189, 1509, 1849, 2196, 2537, 2858, + 3146, 3391, 3587, 3732, 3830, 3884, 3899, 3876, + 3811, 3695, 3524, 3294, 3012, 2689, 2345, 1999, + 1666, 1358, 1077, 824, 599, 404, 246, 133, + 75, 80, 151, 285, 478, 721, 1006, 1323, + 1660, 2000, 2324, 2612, 2847, 3019, 3127, 3181, + 3197, 3192, 3179, 3165, 3148, 3119, 3064, 2972, + 2833, 2647, 2419, 2162, 1894, 1634, 1404, 1223, + 1109, 1072, 1113, 1222, 1379, 1556, 1726, 1867, + 1965, 2019, 2035, 2029, 2021, 2027, 2060, 2127, + 2222, 2333, 2441, 2526, 2569, 2558, 2487, 2361, + 2197, 2016, 1849, 1723, 1659, 1666, 1742, 1876, + 2048, 2234, 2412, 2562, 2670, 2729, 2742, 2718, + 2674, 2627, 2591, 2574, 2575, 2583, 2581, 2548, + 2465, 2322, 2116, 1859, 1568, 1267, 977, 719, + 508, 354, 266, 245, 291, 396, 550, 737, + 945, 1165, 1394, 1634, 1891, 2170, 2472, 2790, + 3109, 3408, 3667, 3870, 4007, 4077, 4082, 4030, + 3923, 3765, 3559, 3306, 3013, 2689, 2347, 1998, + 1653, 1320, 1006, 719, 468, 266, 126, 61, + 76, 167, 322, 524, 752, 993, 1237, 1486, + 1741, 2008, 2289, 2582, 2875, 3157, 3411, 3623, + 3780, 3872, 3893, 3841, 3715, 3523, 3282, 3013, + 2740, 2489, 2276, 2107, 1979, 1879, 1791, 1699, + 1592, 1467, 1331, 1196, 1082, 1005, 980, 1015, + 1109, 1256, 1438, 1635, 1821, 1973, 2068, 2097, + 2059, 1967, 1844, 1713, 1601, 1526, 1499, 1525, + 1594, 1694, 1805, 1908, 1988, 2036, 2055, 2053 + }, + { + 2048, 2072, 2095, 2075, 2062, 2149, 2347, 2534, + 2584, 2527, 2537, 2732, 3017, 3166, 3074, 2884, + 2844, 3021, 3223, 3212, 2982, 2782, 2838, 3104, + 3321, 3317, 3206, 3252, 3548, 3896, 4028, 3910, + 3782, 3875, 4095, 4095, 4095, 3855, 3719, 3863, + 4080, 4065, 3759, 3424, 3355, 3556, 3739, 3649, + 3342, 3105, 3136, 3332, 3412, 3231, 2919, 2715, + 2707, 2768, 2724, 2551, 2362, 2259, 2219, 2157, + 2048, 1944, 1881, 1811, 1665, 1473, 1350, 1361, + 1417, 1359, 1150, 949, 947, 1145, 1329, 1300, + 1095, 955, 1044, 1254, 1316, 1103, 782, 627, + 713, 835, 759, 498, 306, 386, 653, 834, + 792, 690, 804, 1192, 1608, 1771, 1678, 1603, + 1778, 2118, 2309, 2159, 1822, 1629, 1734, 1954, + 1990, 1762, 1493, 1456, 1681, 1943, 2022, 1925, + 1847, 1930, 2119, 2249, 2238, 2153, 2095, 2080, + 2048, 1973, 1912, 1915, 1938, 1892, 1763, 1668, + 1723, 1885, 1968, 1842, 1593, 1438, 1481, 1578, + 1487, 1150, 775, 614, 689, 765, 627, 325, + 123, 191, 407, 501, 366, 185, 212, 466, + 698, 671, 436, 273, 366, 584, 630, 389, + 77, 8, 248, 539, 586, 384, 215, 329, + 667, 935, 929, 753, 682, 863, 1169, 1364, + 1361, 1292, 1331, 1505, 1700, 1812, 1863, 1934, + 2048, 2147, 2196, 2244, 2360, 2521, 2615, 2582, + 2519, 2589, 2834, 3096, 3182, 3084, 3009, 3147, + 3446, 3657, 3604, 3387, 3271, 3380, 3552, 3521, + 3228, 2893, 2770, 2865, 2939, 2800, 2540, 2436, + 2621, 2923, 3052, 2930, 2780, 2860, 3153, 3370, + 3268, 2930, 2671, 2689, 2844, 2820, 2484, 2039, + 1804, 1875, 2038, 2026, 1804, 1593, 1602, 1812, + 2013, 2049, 1961, 1906, 1958, 2053, 2091, 2066 + }, + { + 2048, 2070, 2146, 2287, 2483, 2702, 2900, 3027, + 3040, 2918, 2664, 2307, 1895, 1485, 1132, 876, + 736, 714, 794, 950, 1160, 1403, 1672, 1964, + 2279, 2614, 2955, 3279, 3551, 3731, 3784, 3687, + 3434, 3043, 2547, 1997, 1446, 948, 545, 265, + 123, 122, 252, 500, 850, 1280, 1768, 2284, + 2795, 3265, 3654, 3930, 4065, 4046, 3875, 3567, + 3152, 2664, 2143, 1626, 1146, 731, 405, 187, + 94, 136, 319, 637, 1073, 1592, 2150, 2693, + 3169, 3530, 3746, 3807, 3720, 3514, 3223, 2886, + 2537, 2196, 1875, 1578, 1306, 1063, 862, 723, + 671, 729, 908, 1201, 1584, 2009, 2421, 2763, + 2992, 3084, 3043, 2896, 2687, 2466, 2275, 2142, + 2070, 2044, 2037, 2021, 1974, 1892, 1789, 1690, + 1628, 1627, 1697, 1828, 1989, 2140, 2238, 2252, + 2173, 2016, 1819, 1633, 1508, 1484, 1577, 1776, + 2048, 2343, 2610, 2807, 2911, 2919, 2849, 2726, + 2581, 2434, 2291, 2147, 1986, 1794, 1565, 1306, + 1043, 816, 670, 645, 766, 1034, 1430, 1909, + 2417, 2895, 3293, 3576, 3726, 3744, 3643, 3442, + 3162, 2819, 2430, 2008, 1570, 1139, 742, 413, + 189, 97, 158, 374, 732, 1201, 1741, 2303, + 2842, 3316, 3692, 3947, 4067, 4047, 3887, 3596, + 3191, 2697, 2150, 1590, 1066, 621, 297, 117, + 94, 220, 475, 826, 1240, 1683, 2127, 2551, + 2937, 3270, 3535, 3711, 3780, 3723, 3531, 3209, + 2779, 2282, 1770, 1302, 930, 693, 608, 664, + 834, 1076, 1345, 1606, 1836, 2031, 2199, 2355, + 2509, 2665, 2811, 2922, 2971, 2931, 2792, 2562, + 2271, 1966, 1698, 1514, 1444, 1491, 1632, 1826, + 2020, 2164, 2228, 2200, 2097, 1953, 1809, 1705, + 1663, 1689, 1767, 1869, 1964, 2029, 2055, 2053 + }, + { + 2048, 2561, 2882, 1925, 1133, 2097, 3797, 4088, + 2776, 1767, 2291, 3280, 3257, 2487, 2059, 2126, + 2101, 1630, 1064, 1182, 1941, 2104, 1196, 546, + 1140, 2073, 2181, 1769, 1821, 2365, 2600, 2511, + 2925, 3644, 3507, 2704, 2607, 3268, 3505, 3065, + 2629, 2418, 2195, 2003, 2003, 1859, 1066, 110, + 157, 1030, 1220, 450, 80, 694, 1448, 1721, + 1786, 2100, 2633, 2799, 2270, 1758, 2203, 3394, + 4094, 3495, 2357, 2200, 3036, 3279, 2512, 2047, + 2132, 1482, 103, 0, 966, 2027, 1434, 250, + 475, 1883, 2525, 1973, 1589, 1913, 2175, 1995, + 1842, 2221, 3014, 3437, 3043, 2581, 2900, 3549, + 3502, 2694, 2013, 1982, 2001, 1505, 1262, 2009, + 2685, 2173, 1503, 2031, 3013, 2982, 2080, 1531, + 1740, 2035, 2040, 2150, 2357, 2095, 1711, 2170, + 3093, 3197, 2417, 1724, 1547, 1653, 1797, 1905, + 2048, 2242, 2334, 2300, 2332, 2628, 3225, 3649, + 3156, 2071, 1676, 2141, 2380, 2129, 2035, 2014, + 1542, 1048, 1384, 2197, 2109, 877, 120, 825, + 1656, 1357, 856, 1254, 1923, 2056, 2093, 2657, + 3405, 3542, 2994, 2621, 2942, 3334, 3120, 2552, + 2206, 2220, 2250, 1874, 1385, 1543, 1973, 1423, + 198, 29, 1125, 1695, 806, 0, 263, 1560, + 2130, 2050, 2522, 3231, 2971, 2280, 2656, 3851, + 4095, 3374, 2153, 1810, 2357, 2798, 2562, 2088, + 1879, 1846, 1581, 940, 509, 921, 1484, 1011, + 31, 79, 1132, 1898, 1978, 1988, 2205, 2327, + 2334, 2625, 3035, 2727, 1825, 1636, 2371, 2727, + 2323, 2121, 2341, 2265, 1886, 1866, 2171, 1986, + 1120, 626, 1239, 2015, 1854, 1326, 1485, 2132, + 2467, 2287, 2008, 2142, 2522, 2233, 1167, 733, + 1793, 3076, 2860, 1469, 909, 1947, 2928, 2560 + }, + { + 2048, 2504, 2795, 1937, 1211, 2093, 3713, 4049, + 2790, 1746, 2327, 3617, 3862, 2964, 2133, 1958, + 2048, 1906, 1540, 1495, 1969, 2095, 1253, 469, + 957, 2084, 2288, 1309, 413, 609, 1420, 1878, + 2048, 2416, 2641, 2415, 2445, 3116, 3618, 3425, + 3094, 3057, 2976, 2556, 2157, 2260, 2607, 2510, + 2048, 1846, 1730, 1126, 470, 562, 1118, 1256, + 707, 0, 0, 657, 1800, 2252, 1982, 1778, + 2048, 2337, 2178, 2155, 3149, 4095, 3814, 2019, + 1613, 3417, 4095, 4095, 2914, 2060, 2283, 2403, + 2048, 2008, 2319, 1963, 931, 522, 1245, 2190, + 2418, 1813, 1007, 831, 1340, 1749, 1701, 1701, + 2048, 2283, 2008, 1749, 2382, 3485, 3459, 2102, + 1281, 1916, 2557, 2061, 1334, 1451, 2031, 2222, + 2048, 2033, 2105, 1834, 1584, 1987, 2435, 1916, + 981, 920, 1695, 2348, 2505, 2404, 2271, 2175, + 2048, 1874, 1791, 1820, 1787, 1507, 926, 477, + 918, 2022, 2475, 1928, 1548, 1878, 2145, 2009, + 2048, 2386, 2390, 1952, 2002, 3023, 3848, 3333, + 2518, 3030, 4095, 4095, 2947, 2084, 2100, 2270, + 2048, 1702, 1663, 1726, 1412, 921, 893, 1364, + 1762, 1577, 771, 85, 433, 1479, 2005, 1899, + 2048, 2447, 2401, 2251, 3043, 4095, 4095, 3226, + 1627, 2142, 3851, 4095, 3076, 2212, 2305, 2408, + 2048, 1782, 2003, 2215, 1703, 660, 90, 449, + 1182, 1559, 1324, 832, 814, 1398, 1831, 1842, + 2048, 2517, 2569, 2216, 2218, 2717, 3036, 2810, + 2563, 2830, 3111, 2643, 1890, 1817, 2179, 2205, + 2048, 2021, 1715, 1061, 879, 1567, 2270, 1959, + 932, 554, 1292, 2021, 1905, 1587, 1757, 2076, + 2048, 1774, 1737, 2244, 2760, 2283, 1035, 637, + 1788, 3057, 2821, 1509, 1006, 1957, 2836, 2504 + }, + { + 2048, 2448, 2705, 1949, 1297, 2089, 3594, 3952, + 2776, 1740, 2347, 3840, 4095, 3348, 2198, 1801, + 1994, 2206, 2113, 1926, 2015, 2073, 1535, 882, + 1140, 2082, 2300, 1162, 0, 0, 565, 1339, + 1170, 960, 1385, 1871, 1992, 2142, 2460, 2617, + 2629, 2757, 2854, 2594, 2196, 2427, 3507, 4095, + 3938, 2920, 2662, 3067, 3099, 2608, 2195, 2028, + 1786, 1282, 808, 955, 1777, 2367, 1886, 688, + 1, 586, 1725, 1880, 843, 258, 1065, 2058, + 2132, 2013, 2527, 3003, 2625, 2061, 2503, 3589, + 3621, 2244, 1338, 2198, 3558, 3686, 2746, 1947, + 1842, 2145, 2321, 2155, 1950, 1904, 1660, 1024, + 593, 1060, 2140, 2565, 1577, 323, 565, 1997, + 2685, 2145, 1719, 2040, 2341, 2179, 2045, 2244, + 2355, 2087, 1946, 2350, 2626, 2116, 1633, 2182, + 3093, 3120, 2374, 1774, 1637, 1732, 1850, 1936, + 2048, 2199, 2274, 2250, 2281, 2539, 3089, 3542, + 3156, 2073, 1590, 2184, 2670, 2289, 1876, 2152, + 2553, 2428, 2091, 2069, 2066, 1520, 887, 1098, + 1656, 1132, 0, 0, 782, 1984, 1924, 1117, + 690, 1029, 1618, 1893, 1959, 2147, 2351, 2330, + 2206, 2379, 3157, 4095, 4095, 3062, 2159, 2793, + 3897, 3778, 2732, 2273, 2711, 2971, 2487, 2018, + 2130, 2013, 1044, 328, 923, 1791, 1414, 226, + 0, 708, 1938, 2310, 1670, 958, 958, 1461, + 1879, 2035, 2162, 2506, 2870, 2767, 2466, 2936, + 4064, 4095, 3409, 2348, 2278, 2767, 2907, 2584, + 2334, 2371, 2327, 2100, 2069, 2158, 1901, 1584, + 1772, 1935, 1261, 335, 403, 1472, 2281, 1965, + 1120, 944, 1561, 2033, 1989, 1946, 2085, 2015, + 1628, 1297, 1503, 2326, 2936, 2317, 964, 610, + 1793, 3007, 2766, 1557, 1113, 1967, 2741, 2447 + }, + { + 2048, 2391, 2614, 1962, 1390, 2084, 3441, 3798, + 2733, 1749, 2349, 3933, 4095, 3601, 2245, 1678, + 1949, 2480, 2673, 2383, 2069, 2045, 1963, 1657, + 1630, 2067, 2213, 1389, 126, 0, 478, 1190, + 807, 179, 564, 1450, 1580, 1095, 969, 1325, + 1647, 1798, 1949, 2078, 2078, 2176, 2736, 3459, + 3495, 2877, 2778, 3608, 4095, 3832, 3049, 2830, + 3286, 3873, 3912, 3170, 2242, 1891, 2097, 2250, + 2048, 1830, 1948, 1965, 1182, 208, 570, 2072, + 2449, 693, 0, 0, 845, 2027, 1506, 582, + 844, 1928, 2383, 1996, 1740, 1958, 2133, 2012, + 1906, 2171, 2762, 3132, 2879, 2533, 2914, 3805, + 4095, 3243, 1950, 1562, 2441, 3329, 3017, 2076, + 1754, 2015, 2102, 2047, 2244, 2409, 2068, 1514, + 1479, 1988, 2180, 1686, 1404, 1975, 2465, 1917, + 1062, 1061, 1753, 2291, 2407, 2322, 2217, 2143, + 2048, 1917, 1853, 1872, 1843, 1611, 1109, 674, + 1004, 2023, 2508, 1904, 1355, 1759, 2273, 1890, + 1114, 1014, 1626, 2105, 2060, 1990, 2239, 2366, + 2228, 2562, 3518, 3922, 3105, 2107, 2178, 3174, + 3968, 3797, 3010, 2570, 2795, 3051, 2841, 2406, + 2157, 2164, 2183, 1932, 1602, 1703, 1995, 1593, + 632, 402, 1233, 1703, 667, 0, 0, 882, + 2436, 1965, 539, 279, 1239, 1921, 1852, 1776, + 2048, 2247, 2081, 1919, 2319, 3168, 3686, 3445, + 2847, 2530, 2827, 3508, 3758, 3148, 2545, 2893, + 3591, 3482, 2690, 2150, 2095, 2087, 1943, 1859, + 1850, 1637, 1317, 1517, 2233, 2422, 1719, 1252, + 1659, 1911, 1215, 442, 674, 1620, 2200, 2001, + 1621, 1677, 1967, 2049, 2087, 2327, 2405, 1960, + 1272, 921, 1332, 2380, 3036, 2331, 957, 652, + 1807, 2930, 2695, 1612, 1229, 1978, 2645, 2391 + }, + { + 2048, 2334, 2522, 1976, 1490, 2079, 3258, 3593, + 2665, 1773, 2333, 3889, 4095, 3697, 2269, 1604, + 1919, 2679, 3113, 2768, 2118, 2017, 2415, 2552, + 2260, 2045, 2060, 1896, 1377, 998, 1204, 1514, + 1170, 558, 718, 1443, 1509, 781, 350, 647, + 1021, 1071, 1139, 1531, 1928, 1784, 1177, 880, + 1264, 1772, 1926, 2007, 2266, 2439, 2386, 2410, + 2792, 3438, 3834, 3414, 2357, 1705, 2214, 3417, + 4094, 3520, 2379, 2228, 3421, 4095, 3464, 2029, + 1806, 2675, 3147, 2715, 2168, 2047, 1957, 1561, + 1396, 1948, 2471, 1943, 827, 498, 1262, 2186, + 2411, 1809, 922, 606, 1091, 1557, 1271, 647, + 593, 1304, 2100, 2265, 1910, 1752, 1973, 2052, + 1898, 2005, 2283, 2056, 1407, 1270, 2012, 2828, + 2791, 2119, 1898, 2432, 2701, 2118, 1653, 2168, + 2934, 2918, 2303, 1839, 1742, 1817, 1905, 1968, + 2048, 2156, 2211, 2195, 2221, 2422, 2863, 3260, + 2987, 2070, 1612, 2188, 2750, 2353, 1795, 2236, + 3268, 3558, 2766, 1923, 2007, 2675, 2881, 2459, + 2139, 2121, 1934, 1615, 1678, 2021, 1977, 1347, + 690, 653, 1185, 1519, 1188, 713, 799, 1352, + 1768, 1592, 799, 53, 282, 1342, 1981, 1671, + 1281, 1501, 1912, 2039, 2186, 2693, 3057, 2588, + 1814, 2110, 3494, 4095, 3331, 2323, 2700, 3882, + 4095, 3396, 2161, 1766, 2478, 3411, 3618, 3112, + 2529, 2271, 2311, 2368, 2218, 2019, 1965, 1767, + 1212, 861, 1236, 1839, 1861, 1367, 1080, 1309, + 1542, 1252, 897, 1342, 2261, 2426, 1753, 1413, + 1772, 1963, 1600, 1328, 1568, 1949, 2059, 2054, + 2265, 2525, 2397, 2065, 2176, 2648, 2657, 1920, + 1034, 696, 1245, 2400, 3050, 2324, 1016, 763, + 1831, 2827, 2610, 1674, 1353, 1989, 2548, 2334 + }, + { + 2048, 2277, 2428, 1990, 1595, 2073, 3049, 3342, + 2572, 1810, 2299, 3712, 4095, 3626, 2267, 1589, + 1909, 2769, 3349, 2999, 2150, 1997, 2763, 3291, + 2819, 2024, 1903, 2466, 2932, 2799, 2368, 2132, + 2048, 1862, 1745, 1856, 1832, 1442, 1103, 1156, + 1308, 1252, 1212, 1508, 1905, 1682, 615, 0, + 1, 1020, 1235, 461, 0, 472, 1211, 1424, + 1100, 697, 708, 1259, 1913, 2154, 2014, 1912, + 2048, 2193, 2114, 2104, 2644, 3339, 3110, 2029, + 1740, 3127, 4095, 4095, 3180, 2068, 2650, 3863, + 3750, 2248, 1351, 2193, 3506, 3666, 2770, 1935, + 1786, 2199, 2674, 2737, 2430, 2203, 2224, 2222, + 2048, 1929, 2068, 2203, 1867, 1232, 1199, 2013, + 2590, 2151, 1589, 2033, 2980, 3075, 2091, 1155, + 1243, 1973, 2195, 1680, 1441, 1984, 2396, 1944, + 1293, 1318, 1836, 2218, 2295, 2234, 2162, 2111, + 2048, 1960, 1917, 1928, 1907, 1741, 1373, 1032, + 1249, 2028, 2432, 1921, 1395, 1755, 2298, 1853, + 727, 320, 1170, 2212, 2107, 1013, 427, 1035, + 1715, 1412, 760, 855, 1561, 2029, 2021, 1936, + 2048, 2221, 2244, 2215, 2391, 2686, 2742, 2490, + 2249, 2419, 3196, 4095, 4095, 3026, 2157, 2808, + 4050, 4086, 2953, 2398, 3348, 4095, 4095, 2977, + 1750, 2109, 3132, 3289, 2604, 2133, 2179, 2229, + 2048, 1914, 2025, 2135, 1861, 1261, 870, 1014, + 1435, 1663, 1397, 758, 436, 929, 1494, 1001, + 0, 0, 711, 1758, 1825, 1337, 1158, 1447, + 1683, 1541, 1408, 1710, 2133, 2168, 1981, 1969, + 2048, 2061, 2217, 2563, 2680, 2320, 1914, 2105, + 2836, 3225, 2727, 2076, 2234, 2841, 2792, 1901, + 951, 652, 1252, 2385, 2978, 2298, 1136, 936, + 1864, 2700, 2513, 1742, 1484, 2000, 2449, 2277 + }, + { + 2048, 2220, 2334, 2004, 1704, 2067, 2818, 3053, + 2460, 1858, 2251, 3414, 4031, 3396, 2240, 1636, + 1919, 2736, 3335, 3028, 2158, 1991, 2907, 3645, + 3117, 2011, 1802, 2860, 4086, 4095, 3365, 2704, + 2925, 3282, 2971, 2401, 2313, 2568, 2620, 2422, + 2252, 2173, 2097, 2033, 2032, 1982, 1693, 1304, + 1264, 1583, 1622, 1093, 632, 815, 1302, 1412, + 933, 196, 0, 488, 1712, 2406, 1877, 671, + 1, 568, 1709, 1859, 557, 0, 319, 2073, + 2409, 947, 0, 0, 1270, 2035, 1732, 1227, + 1396, 1984, 2220, 2022, 1893, 2003, 2090, 2030, + 1975, 2111, 2427, 2640, 2519, 2335, 2587, 3208, + 3502, 2962, 1965, 1594, 2464, 3628, 3486, 2101, + 1295, 1914, 2598, 2064, 1043, 989, 2005, 2899, + 2791, 2114, 1918, 2362, 2555, 2100, 1766, 2130, + 2640, 2614, 2210, 1917, 1860, 1907, 1962, 2000, + 2048, 2113, 2146, 2137, 2154, 2281, 2567, 2837, + 2675, 2063, 1737, 2152, 2593, 2298, 1828, 2222, + 3268, 3696, 2916, 1879, 1984, 3221, 3994, 3348, + 2509, 3013, 4095, 4095, 3169, 2103, 2157, 2910, + 3405, 3203, 2647, 2357, 2471, 2597, 2469, 2233, + 2103, 2106, 2115, 1990, 1824, 1873, 2020, 1808, + 1281, 1126, 1573, 1837, 1154, 17, 0, 1100, + 2397, 1964, 283, 0, 655, 1759, 1382, 204, + 0, 692, 1932, 2342, 1581, 491, 132, 630, + 1328, 1655, 1467, 1039, 941, 1374, 1757, 1575, + 1212, 1292, 1716, 1996, 2024, 2028, 2100, 2143, + 2148, 2260, 2435, 2338, 1942, 1826, 2252, 2573, + 2323, 2152, 2746, 3548, 3505, 2575, 1821, 2134, + 3142, 3559, 2864, 2080, 2248, 2864, 2784, 1908, + 1034, 795, 1352, 2336, 2826, 2253, 1312, 1163, + 1903, 2555, 2406, 1814, 1620, 2012, 2350, 2220 + }, + { + 2048, 2162, 2239, 2018, 1817, 2061, 2571, 2735, + 2332, 1916, 2190, 3018, 3473, 3030, 2190, 1738, + 1949, 2585, 3073, 2846, 2140, 1999, 2806, 3502, + 3055, 2012, 1798, 2909, 4095, 4095, 3680, 2913, + 3288, 3935, 3590, 2702, 2599, 3294, 3674, 3370, + 3014, 2978, 2933, 2572, 2176, 2355, 3177, 3803, + 3495, 2741, 2573, 3035, 3287, 2966, 2522, 2392, + 2561, 2764, 2748, 2454, 2116, 1994, 2064, 2115, + 2048, 1975, 2014, 2019, 1744, 1382, 1493, 2057, + 2214, 1451, 509, 482, 1366, 2035, 1658, 822, + 844, 1898, 2597, 1926, 735, 474, 1281, 2179, + 2390, 1822, 969, 628, 1067, 1516, 1146, 273, + 0, 841, 2149, 2578, 1584, 370, 585, 1996, + 2756, 2169, 1562, 2033, 2887, 2910, 2081, 1383, + 1479, 1997, 2143, 1819, 1683, 2010, 2245, 1990, + 1639, 1660, 1937, 2135, 2174, 2142, 2105, 2080, + 2048, 2004, 1982, 1987, 1976, 1890, 1695, 1508, + 1615, 2037, 2265, 1974, 1655, 1865, 2210, 1916, + 1114, 762, 1356, 2185, 2101, 1041, 329, 863, + 1613, 1105, 0, 0, 800, 1983, 1912, 910, + 127, 281, 1047, 1476, 1166, 733, 851, 1391, + 1784, 1613, 829, 23, 149, 1226, 1961, 1482, + 632, 672, 1462, 1829, 1265, 533, 635, 1534, + 2209, 2015, 1481, 1408, 1764, 2004, 1982, 1957, + 2048, 2114, 2059, 2003, 2143, 2453, 2663, 2596, + 2379, 2260, 2417, 2799, 3016, 2744, 2406, 2754, + 3591, 3831, 3101, 2291, 2248, 2738, 2991, 2750, + 2524, 2799, 3150, 2742, 1829, 1638, 2389, 2851, + 2436, 2185, 2913, 3805, 3668, 2608, 1817, 2132, + 3078, 3425, 2768, 2075, 2215, 2713, 2634, 1939, + 1272, 1106, 1533, 2258, 2607, 2193, 1531, 1433, + 1948, 2394, 2291, 1890, 1760, 2024, 2249, 2162 + }, + { + 2048, 2105, 2143, 2033, 1932, 2054, 2312, 2396, + 2192, 1980, 2121, 2551, 2793, 2565, 2123, 1882, + 1994, 2341, 2615, 2495, 2100, 2020, 2490, 2908, + 2654, 2026, 1892, 2594, 3514, 3739, 3149, 2645, + 2925, 3416, 3196, 2548, 2482, 3061, 3413, 3196, + 2917, 2917, 2909, 2579, 2184, 2389, 3368, 4095, + 3938, 3011, 2828, 3622, 4095, 3770, 3023, 2835, + 3362, 4095, 4095, 3707, 2396, 1681, 2219, 3427, + 4094, 3530, 2389, 2240, 3598, 4095, 3939, 2019, + 1621, 3410, 4095, 4095, 3221, 2068, 2626, 3750, + 3621, 2232, 1405, 2183, 3439, 3644, 2793, 1924, + 1740, 2243, 2953, 3201, 2820, 2454, 2719, 3335, + 3502, 2881, 1979, 1697, 2347, 3111, 2958, 2079, + 1621, 1976, 2331, 2056, 1572, 1565, 2029, 2411, + 2355, 2074, 1997, 2168, 2238, 2067, 1946, 2077, + 2256, 2244, 2103, 2003, 1984, 2000, 2019, 2032, + 2048, 2069, 2080, 2078, 2084, 2127, 2226, 2321, + 2268, 2053, 1935, 2086, 2252, 2144, 1961, 2118, + 2553, 2751, 2430, 1970, 2017, 2626, 3049, 2749, + 2309, 2624, 3428, 3604, 2854, 2090, 2139, 2833, + 3405, 3329, 2793, 2485, 2742, 3116, 3052, 2617, + 2285, 2453, 3232, 4095, 4062, 2961, 2148, 2746, + 3897, 3959, 2917, 2395, 3395, 4095, 4095, 3220, + 1635, 2142, 3978, 4095, 3496, 2342, 2719, 3896, + 4095, 3406, 2164, 1747, 2533, 3703, 4095, 3653, + 2897, 2533, 2807, 3457, 3716, 3158, 2579, 3029, + 4064, 4095, 3279, 2318, 2260, 2748, 2965, 2704, + 2476, 2700, 2973, 2612, 1875, 1734, 2302, 2630, + 2323, 2143, 2632, 3208, 3096, 2403, 1904, 2099, + 2667, 2862, 2468, 2063, 2143, 2420, 2372, 1988, + 1628, 1543, 1774, 2158, 2340, 2123, 1781, 1732, + 1997, 2223, 2170, 1968, 1903, 2036, 2149, 2105 + }, + { + 2048, 2081, 2108, 2062, 2033, 2108, 2213, 2231, + 2171, 2169, 2313, 2495, 2523, 2399, 2282, 2198, + 2086, 2082, 2304, 2509, 2430, 2273, 2364, 2557, + 2495, 2238, 2211, 2647, 3262, 3494, 3182, 2884, + 3081, 3340, 3015, 2465, 2546, 3166, 3465, 3191, + 2875, 2836, 2831, 2605, 2347, 2539, 3295, 3937, + 3765, 3197, 3214, 3747, 3836, 3319, 3028, 3351, + 3799, 3942, 3782, 3381, 2828, 2390, 2345, 2780, + 3431, 3666, 3188, 2747, 3186, 3917, 3676, 2669, + 2404, 3379, 4095, 4095, 3542, 2912, 2971, 3195, + 2856, 2177, 2097, 2766, 3226, 2929, 2452, 2338, + 2369, 2329, 2435, 2739, 2953, 2972, 2976, 3055, + 3070, 2820, 2318, 1989, 2255, 2794, 2819, 2258, + 1859, 1983, 2135, 1924, 1650, 1723, 2062, 2302, + 2263, 2109, 2092, 2194, 2176, 2011, 1965, 2133, + 2271, 2208, 2073, 2013, 2010, 2007, 2008, 2025, + 2048, 2062, 2073, 2093, 2113, 2126, 2178, 2283, + 2302, 2132, 1953, 2000, 2163, 2178, 2096, 2181, + 2443, 2593, 2437, 2158, 2152, 2515, 2813, 2693, + 2533, 2857, 3355, 3288, 2694, 2318, 2490, 2851, + 3034, 3022, 2962, 2951, 2919, 2748, 2575, 2643, + 2816, 2840, 2969, 3484, 3859, 3453, 2747, 2699, + 3236, 3489, 3234, 3128, 3642, 4095, 4095, 3247, + 2351, 2675, 3676, 3893, 3199, 2870, 3422, 3924, + 3615, 2867, 2387, 2435, 2850, 3295, 3533, 3569, + 3399, 2991, 2695, 2959, 3443, 3394, 2993, 3131, + 3787, 3963, 3300, 2558, 2412, 2676, 2811, 2651, + 2532, 2756, 2984, 2622, 1895, 1703, 2209, 2582, + 2419, 2303, 2653, 3027, 2911, 2454, 2158, 2257, + 2522, 2573, 2384, 2295, 2416, 2406, 2088, 1777, + 1737, 1830, 1894, 1984, 2097, 2096, 1974, 1898, + 1956, 2060, 2088, 2032, 2001, 2056, 2110, 2082 + }, + { + 2048, 1781, 1533, 1328, 1188, 1124, 1143, 1240, + 1403, 1614, 1851, 2091, 2309, 2484, 2597, 2633, + 2583, 2447, 2234, 1964, 1663, 1365, 1105, 912, + 811, 812, 918, 1116, 1384, 1696, 2022, 2334, + 2610, 2832, 2990, 3078, 3096, 3046, 2937, 2779, + 2588, 2381, 2175, 1988, 1831, 1709, 1621, 1557, + 1503, 1443, 1361, 1248, 1094, 899, 665, 395, + 95, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 166, 384, 583, 766, + 938, 1107, 1283, 1476, 1697, 1953, 2250, 2587, + 2956, 3344, 3735, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 3719, 3312, 2947, 2640, 2399, 2226, 2113, + 2048, 2012, 1986, 1950, 1884, 1773, 1608, 1389, + 1126, 836, 546, 284, 83, 0, 0, 59, + 274, 587, 976, 1413, 1868, 2312, 2719, 3070, + 3346, 3538, 3638, 3645, 3564, 3409, 3198, 2956, + 2709, 2483, 2299, 2168, 2094, 2069, 2080, 2107, + 2131, 2132, 2096, 2015, 1884, 1704, 1477, 1212, + 917, 605, 291, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 195, 562, 935, 1298, 1639, 1951, 2228, 2469, + 2677, 2855, 3015, 3168, 3329, 3511, 3729, 3991, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 3769, 3464, 3233, 3077, 2987, 2951, + 2950, 2961, 2963, 2934, 2858, 2727, 2540, 2308 + }, + { + 2048, 1952, 1949, 1768, 1386, 1123, 1378, 2211, + 3175, 3594, 3098, 1985, 1073, 1108, 2177, 3602, + 4095, 4052, 2791, 1493, 964, 1374, 2192, 2654, + 2372, 1590, 934, 876, 1388, 2030, 2357, 2278, + 2048, 1963, 2047, 2045, 1726, 1193, 892, 1244, + 2221, 3244, 3550, 2777, 1292, 0, 0, 118, + 983, 1287, 636, 0, 0, 0, 0, 779, + 1546, 1488, 916, 452, 518, 1050, 1650, 1981, + 2048, 2115, 2382, 2741, 2875, 2608, 2181, 2155, + 2966, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 3621, 2562, 2500, 3327, + 4095, 4095, 4095, 3627, 2872, 2516, 2453, 2357, + 2048, 1668, 1511, 1672, 1890, 1743, 1060, 167, + 0, 121, 1263, 2408, 2778, 2135, 981, 181, + 286, 1100, 1823, 1683, 543, 0, 0, 0, + 0, 565, 1406, 1588, 1422, 1356, 1574, 1898, + 2048, 1971, 1925, 2214, 2846, 3444, 3531, 2971, + 2159, 1763, 2181, 3173, 3984, 3916, 2897, 1582, + 883, 1282, 2447, 3481, 3584, 2644, 1282, 365, + 373, 1108, 1940, 2337, 2229, 1947, 1840, 1956, + 2048, 1886, 1553, 1420, 1810, 2663, 3513, 3854, + 3587, 3151, 3191, 3999, 4095, 4095, 4095, 4095, + 3032, 2330, 2796, 4021, 4095, 4095, 4095, 3178, + 2396, 2381, 2873, 3295, 3253, 2807, 2325, 2091, + 2048, 1899, 1453, 865, 538, 744, 1328, 1772, + 1624, 918, 212, 166, 965, 2085, 2614, 1931, + 204, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 808, 1588, 1863, 1805, 1795, + 2048, 2419, 2597, 2452, 2221, 2322, 2954, 3842, + 4095, 4095, 3540, 2958, 3201, 4095, 4095, 4095, + 4095, 4095, 3278, 2418, 2608, 3384, 3934, 3743, + 2950, 2165, 1934, 2315, 2887, 3143, 2906, 2416 + }, + { + 2048, 2249, 2630, 3002, 3260, 3501, 3941, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4049, 4012, 4008, 3770, 3277, 2720, 2299, + 2048, 1828, 1484, 998, 506, 139, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 970, 2325, 2665, 2012, 1093, + 817, 1633, 3210, 4095, 4095, 4095, 3150, 1878, + 1285, 1384, 1706, 1717, 1236, 549, 159, 400, + 1194, 2129, 2764, 2912, 2708, 2426, 2253, 2169, + 2048, 1826, 1593, 1502, 1589, 1683, 1506, 908, + 47, 0, 0, 0, 0, 102, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 276, 753, 1285, 1720, + 2048, 2395, 2870, 3414, 3810, 3864, 3601, 3308, + 3340, 3843, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 3704, 3989, 4095, + 4095, 4095, 4095, 4051, 2637, 2334, 3235, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 3282, 2286, 2136, 2589, 3105, 3255, + 2981, 2548, 2276, 2280, 2418, 2463, 2320, 2109 + }, + { + 2048, 1981, 2022, 2010, 1837, 1586, 1497, 1768, + 2349, 2925, 3133, 2858, 2376, 2189, 2660, 3701, + 4095, 4095, 4095, 3995, 3304, 3429, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 3832, 3750, 3782, 3652, 3274, 2774, 2342, + 2048, 1790, 1424, 922, 427, 127, 60, 23, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 24, 0, 0, 0, + 0, 0, 22, 745, 854, 467, 36, 0, + 431, 1118, 1677, 1894, 1833, 1725, 1753, 1908, + 2048, 2060, 1990, 1997, 2183, 2459, 2576, 2336, + 1788, 1254, 1108, 1472, 2077, 2413, 2102, 1214, + 260, 0, 244, 1107, 1727, 1510, 430, 0, + 0, 0, 0, 788, 1040, 227, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 40, 66, 241, 660, 1203, 1688, + 2048, 2376, 2811, 3365, 3880, 4095, 4095, 4066, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 3805, 3597, 3930, 4095, 4095, + 4026, 3378, 2835, 2600, 2608, 2634, 2512, 2264 + }, + { + 2048, 1979, 2009, 1964, 1767, 1541, 1505, 1758, + 2132, 2275, 1927, 1182, 498, 415, 1153, 2399, + 3472, 3777, 3230, 2333, 1819, 2110, 2990, 3747, + 3706, 2764, 1532, 945, 1611, 3353, 4095, 4095, + 4095, 4095, 3789, 3389, 3945, 4095, 4095, 4095, + 3758, 2753, 2668, 3694, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4055, 3294, + 2817, 2815, 3125, 3395, 3363, 3026, 2587, 2249, + 2048, 1864, 1579, 1221, 950, 892, 965, 883, + 359, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 25, 0, 0, 0, + 0, 0, 272, 531, 159, 0, 0, 0, + 112, 1003, 1620, 1819, 1749, 1675, 1747, 1917, + 2048, 2087, 2137, 2350, 2744, 3124, 3204, 2846, + 2219, 1720, 1692, 2143, 2708, 2905, 2525, 1832, + 1408, 1721, 2721, 3800, 4095, 3433, 1879, 361, + 0, 227, 1372, 2263, 2247, 1378, 370, 51, + 733, 1941, 2725, 2320, 702, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 265, 688, 265, 0, 0, 0, 0, 0, + 349, 696, 720, 703, 872, 1233, 1620, 1885, + 2048, 2262, 2651, 3160, 3571, 3694, 3553, 3408, + 3559, 4089, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 3630, 3510, 3867, 4095, 4095, + 3651, 3107, 2795, 2789, 2907, 2897, 2658, 2307 + }, + { + 2048, 1872, 1766, 1689, 1616, 1562, 1560, 1621, + 1701, 1715, 1605, 1390, 1179, 1103, 1224, 1486, + 1746, 1869, 1832, 1740, 1752, 1968, 2344, 2724, + 2953, 2991, 2957, 3045, 3380, 3923, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4063, + 3723, 3511, 3391, 3280, 3110, 2869, 2590, 2314, + 2048, 1762, 1431, 1059, 683, 332, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 538, 940, 1218, 1401, 1552, 1714, 1886, + 2048, 2191, 2340, 2527, 2752, 2966, 3097, 3104, + 3013, 2909, 2869, 2903, 2942, 2891, 2712, 2471, + 2305, 2325, 2529, 2785, 2913, 2805, 2509, 2198, + 2051, 2125, 2315, 2419, 2288, 1922, 1470, 1113, + 925, 814, 584, 80, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 138, 382, 682, 1035, 1400, 1738, + 2048, 2359, 2699, 3058, 3393, 3664, 3881, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4019, 3703, 3441, 3199, 2929, 2620, 2307 + }, + { + 2048, 2324, 2624, 2954, 3284, 3568, 3796, 4005, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 3881, 3732, + 3693, 3578, 3283, 2863, 2500, 2370, 2510, 2788, + 2985, 2945, 2673, 2325, 2089, 2063, 2189, 2312, + 2292, 2097, 1816, 1580, 1463, 1441, 1421, 1321, + 1138, 950, 855, 909, 1092, 1337, 1585, 1816, + 2048, 2293, 2541, 2762, 2946, 3128, 3378, 3746, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4031, 3757, 3452, 3099, 2725, 2371, + 2048, 1733, 1398, 1043, 710, 449, 268, 119, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 62, 277, 623, 1009, 1254, 1223, 941, + 599, 434, 584, 993, 1456, 1759, 1818, 1730, + 1683, 1824, 2153, 2532, 2794, 2860, 2799, 2761, + 2873, 3137, 3439, 3623, 3604, 3411, 3161, 2970, + 2880, 2853, 2815, 2720, 2581, 2438, 2318, 2203, + 2048, 1821, 1537, 1244, 981, 748, 506, 225, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 108, 359, 569, 812, 1113, 1444, 1762 + }, + { + 2048, 2136, 2184, 2258, 2362, 2450, 2495, 2543, + 2698, 3031, 3494, 3907, 4050, 3808, 3252, 2597, + 2059, 1711, 1452, 1102, 565, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 427, + 900, 1324, 1741, 2214, 2763, 3334, 3848, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 3382, 2375, 1392, 392, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 195, 503, 850, 1247, 1656, + 2048, 2448, 2907, 3435, 3967, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 3718, 2480, 1360, + 481, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 806, 1558, 2292, 3019, 3707, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4046, 3131, 2308, 1533, 749, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 74, 551, 1028, 1482, 1838 + }, + { + 2048, 1652, 1202, 705, 224, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1214, 2449, 3595, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 3911, 3359, 2788, 2223, 1730, 1342, + 1019, 683, 285, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 236, 1269, 2189, 2856, 3287, + 3595, 3868, 4095, 4095, 4063, 3715, 3216, 2650, + 2048, 1375, 591, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 386, 1403, 2358, 3256, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 3807, 3002, 2267, 1658, 1199, + 849, 542, 257, 54, 38, 267, 673, 1087, + 1334, 1350, 1222, 1104, 1090, 1126, 1049, 726, + 188, 0, 0, 0, 282, 1093, 1794, 2245, + 2504, 2743, 3095, 3544, 3939, 4095, 4046, 3813, + 3592, 3498, 3518, 3536, 3436, 3179, 2817, 2428 + }, + { + 2048, 824, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 661, 1505, 2315, 3100, 3819, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 3826, 3648, + 3469, 3194, 2815, 2426, 2146, 2043, 2107, 2294, + 2591, 3033, 3661, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 3630, 2887, + 2048, 1109, 133, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 354, 1368, 2393, 3450, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 3514, + 3057, 2966, 3065, 3137, 3087, 2988, 3006, 3240, + 3624, 3948, 4002, 3708, 3173, 2605, 2182, 1954, + 1859, 1803, 1751, 1735, 1808, 1977, 2194, 2399, + 2590, 2832, 3206, 3724, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 3196 + }, + { + 2048, 1477, 923, 367, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 223, 940, 1648, 2184, 2491, 2611, + 2612, 2516, 2290, 1898, 1357, 736, 105, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 774, 1727, 2702, 3715, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4050, 2990, + 2048, 1224, 481, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 174, 807, + 1142, 1166, 1034, 944, 978, 1044, 964, 629, + 117, 0, 0, 0, 571, 1314, 1898, 2238, + 2420, 2586, 2817, 3071, 3233, 3221, 3048, 2808, + 2590, 2413, 2220, 1944, 1572, 1160, 775, 428, + 63, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 442, 1643, 2875, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 3458, 2696 + }, + { + 1987, 2084, 2164, 2206, 2261, 2413, 2694, 3034, + 3296, 3367, 3248, 3051, 2909, 2853, 2781, 2527, + 2008, 1320, 710, 426, 552, 949, 1342, 1506, + 1401, 1175, 1033, 1084, 1263, 1404, 1385, 1232, + 1112, 1214, 1614, 2226, 2867, 3375, 3694, 3867, + 3964, 4006, 3959, 3788, 3507, 3183, 2884, 2610, + 2289, 1846, 1285, 729, 350, 262, 431, 704, + 918, 1027, 1128, 1368, 1808, 2329, 2693, 2698, + 2326, 1780, 1359, 1274, 1522, 1915, 2227, 2346, + 2336, 2355, 2510, 2771, 2994, 3032, 2852, 2551, + 2286, 2163, 2180, 2259, 2327, 2370, 2421, 2501, + 2577, 2576, 2454, 2250, 2071, 2006, 2043, 2054, + 1878, 1451, 867, 332, 27, 0, 107, 208, + 231, 284, 575, 1246, 2243, 3308, 4095, 4095, + 4095, 4095, 4032, 3954, 3931, 3821, 3535, 3119, + 2706, 2412, 2246, 2115, 1902, 1565, 1157, 778, + 494, 300, 155, 42, 6, 113, 382, 742, + 1067, 1277, 1411, 1619, 2051, 2729, 3500, 4095, + 4095, 4095, 4046, 3783, 3614, 3452, 3122, 2520, + 1730, 1003, 607, 659, 1051, 1532, 1869, 1985, + 1967, 1963, 2057, 2209, 2308, 2272, 2117, 1938, + 1825, 1796, 1793, 1750, 1652, 1552, 1515, 1550, + 1597, 1579, 1488, 1407, 1460, 1699, 2044, 2314, + 2354, 2157, 1892, 1802, 2033, 2537, 3104, 3508, + 3666, 3670, 3698, 3846, 4036, 4048, 3685, 2913, + 1911, 960, 286, 0, 0, 0, 0, 0, + 0, 147, 539, 957, 1333, 1674, 2033, 2442, + 2863, 3202, 3389, 3436, 3433, 3474, 3572, 3638, + 3555, 3291, 2949, 2712, 2705, 2888, 3052, 2955, + 2488, 1760, 1030, 544, 377, 414, 461, 408, + 315, 362, 697, 1307, 2009, 2557, 2796, 2743, + 2546, 2367, 2278, 2242, 2188, 2087, 1981, 1939 + }, + { + 1039, 1027, 1033, 1037, 1091, 1279, 1630, 2072, + 2464, 2687, 2739, 2725, 2771, 2905, 3017, 2936, + 2574, 2024, 1528, 1331, 1517, 1944, 2340, 2478, + 2320, 2016, 1776, 1709, 1757, 1756, 1587, 1283, + 1014, 971, 1234, 1723, 2254, 2669, 2915, 3034, + 3099, 3131, 3097, 2959, 2732, 2482, 2273, 2105, + 1904, 1591, 1168, 753, 518, 570, 873, 1271, + 1597, 1802, 1979, 2275, 2746, 3274, 3619, 3578, + 3135, 2494, 1955, 1731, 1825, 2052, 2188, 2131, + 1946, 1798, 1799, 1925, 2035, 1988, 1752, 1429, + 1176, 1099, 1197, 1389, 1600, 1810, 2049, 2332, + 2619, 2831, 2916, 2907, 2904, 2991, 3150, 3247, + 3121, 2703, 2088, 1482, 1069, 890, 832, 736, + 544, 371, 432, 878, 1662, 2532, 3179, 3416, + 3281, 2985, 2759, 2699, 2735, 2721, 2567, 2313, + 2086, 1997, 2048, 2137, 2143, 2013, 1796, 1585, + 1442, 1357, 1286, 1211, 1176, 1247, 1446, 1704, + 1900, 1956, 1920, 1945, 2188, 2677, 3264, 3709, + 3827, 3613, 3229, 2878, 2649, 2456, 2125, 1549, + 811, 162, 0, 34, 558, 1180, 1666, 1933, + 2065, 2206, 2436, 2712, 2921, 2977, 2896, 2770, + 2689, 2670, 2656, 2579, 2427, 2254, 2126, 2054, + 1981, 1834, 1605, 1382, 1292, 1391, 1602, 1747, + 1675, 1382, 1041, 895, 1094, 1592, 2178, 2628, + 2857, 2957, 3102, 3389, 3733, 3912, 3723, 3129, + 2301, 1517, 997, 790, 788, 838, 859, 880, + 983, 1211, 1522, 1827, 2061, 2234, 2405, 2611, + 2821, 2948, 2928, 2779, 2599, 2489, 2466, 2445, + 2313, 2039, 1728, 1562, 1664, 1990, 2326, 2427, + 2176, 1673, 1173, 911, 958, 1189, 1406, 1491, + 1501, 1612, 1969, 2562, 3205, 3657, 3764, 3549, + 3166, 2782, 2476, 2220, 1948, 1639, 1342, 1132 + }, + { + 1698, 1773, 1820, 1816, 1815, 1903, 2116, 2392, + 2597, 2628, 2490, 2304, 2205, 2228, 2272, 2169, + 1833, 1355, 971, 922, 1281, 1894, 2479, 2798, + 2801, 2627, 2480, 2462, 2511, 2466, 2208, 1776, + 1348, 1125, 1199, 1500, 1857, 2122, 2250, 2295, + 2330, 2380, 2410, 2380, 2296, 2217, 2198, 2224, + 2211, 2068, 1786, 1475, 1299, 1363, 1630, 1944, + 2144, 2189, 2181, 2278, 2549, 2887, 3065, 2889, + 2353, 1666, 1131, 962, 1157, 1527, 1841, 1982, + 2007, 2066, 2260, 2552, 2792, 2830, 2629, 2287, + 1964, 1769, 1707, 1708, 1706, 1696, 1719, 1805, + 1925, 2010, 2017, 1983, 2010, 2181, 2472, 2743, + 2823, 2630, 2245, 1862, 1651, 1641, 1709, 1686, + 1512, 1300, 1266, 1568, 2165, 2818, 3229, 3226, + 2861, 2359, 1962, 1777, 1742, 1715, 1608, 1457, + 1384, 1491, 1769, 2102, 2355, 2461, 2455, 2417, + 2397, 2382, 2320, 2194, 2048, 1959, 1955, 1980, + 1926, 1730, 1454, 1267, 1336, 1700, 2220, 2658, + 2831, 2730, 2511, 2367, 2375, 2435, 2358, 2023, + 1500, 1023, 850, 1085, 1613, 2178, 2549, 2649, + 2573, 2476, 2453, 2475, 2444, 2289, 2036, 1789, + 1645, 1623, 1668, 1707, 1722, 1757, 1865, 2044, + 2221, 2309, 2288, 2232, 2258, 2417, 2627, 2712, + 2523, 2064, 1519, 1141, 1095, 1348, 1705, 1955, + 2024, 2014, 2106, 2397, 2804, 3100, 3075, 2682, + 2080, 1535, 1250, 1262, 1450, 1650, 1772, 1839, + 1932, 2093, 2286, 2428, 2466, 2419, 2361, 2343, + 2345, 2295, 2138, 1899, 1684, 1592, 1641, 1740, + 1769, 1688, 1589, 1642, 1956, 2475, 2974, 3197, + 3021, 2542, 2014, 1673, 1595, 1665, 1693, 1573, + 1374, 1286, 1466, 1913, 2451, 2843, 2941, 2767, + 2472, 2218, 2076, 2006, 1933, 1822, 1711, 1662 + }, + { + 951, 1041, 1085, 1054, 1021, 1103, 1347, 1669, + 1899, 1910, 1721, 1488, 1376, 1423, 1500, 1419, + 1094, 642, 321, 349, 753, 1341, 1831, 2037, + 1960, 1750, 1562, 1452, 1366, 1237, 1069, 945, + 951, 1087, 1258, 1350, 1327, 1264, 1269, 1380, + 1513, 1528, 1361, 1099, 939, 1036, 1369, 1732, + 1872, 1675, 1249, 858, 734, 921, 1266, 1546, + 1625, 1531, 1394, 1318, 1305, 1277, 1174, 1031, + 951, 1020, 1222, 1444, 1575, 1591, 1567, 1596, + 1677, 1700, 1527, 1134, 670, 385, 457, 862, + 1374, 1722, 1768, 1592, 1406, 1385, 1534, 1707, + 1733, 1556, 1274, 1043, 960, 994, 1037, 1015, + 951, 937, 1038, 1229, 1416, 1527, 1581, 1669, + 1851, 2065, 2134, 1893, 1335, 659, 170, 85, + 396, 890, 1303, 1500, 1536, 1575, 1725, 1943, + 2073, 1978, 1660, 1262, 960, 843, 868, 927, + 951, 961, 1025, 1167, 1326, 1408, 1377, 1312, + 1354, 1580, 1907, 2126, 2039, 1619, 1047, 603, + 477, 654, 940, 1131, 1161, 1133, 1213, 1471, + 1812, 2042, 2014, 1735, 1354, 1049, 908, 902, + 951, 1013, 1113, 1284, 1493, 1630, 1585, 1354, + 1076, 946, 1074, 1384, 1664, 1714, 1501, 1184, + 992, 1051, 1290, 1503, 1517, 1324, 1085, 997, + 1139, 1416, 1637, 1659, 1485, 1235, 1041, 957, + 951, 979, 1052, 1225, 1522, 1860, 2071, 2010, + 1671, 1215, 870, 775, 884, 1023, 1040, 933, + 855, 983, 1356, 1820, 2126, 2104, 1784, 1371, + 1096, 1056, 1176, 1291, 1286, 1169, 1031, 957, + 951, 965, 974, 1026, 1205, 1538, 1928, 2188, + 2167, 1868, 1455, 1139, 1023, 1036, 1006, 822, + 548, 389, 540, 1025, 1653, 2139, 2287, 2105, + 1769, 1482, 1334, 1279, 1213, 1092, 962, 905 + }, + { + 1705, 1810, 1851, 1793, 1729, 1803, 2071, 2426, + 2667, 2650, 2412, 2142, 2026, 2092, 2194, 2142, + 1878, 1538, 1355, 1478, 1855, 2278, 2533, 2547, + 2396, 2204, 2035, 1868, 1680, 1526, 1535, 1796, + 2245, 2669, 2834, 2657, 2271, 1930, 1811, 1898, + 2008, 1966, 1754, 1523, 1462, 1641, 1955, 2217, + 2316, 2290, 2266, 2334, 2459, 2523, 2444, 2257, + 2078, 1988, 1947, 1828, 1555, 1212, 1025, 1198, + 1745, 2444, 2971, 3109, 2878, 2489, 2168, 2005, + 1934, 1849, 1722, 1631, 1671, 1844, 2041, 2131, + 2083, 1993, 1996, 2131, 2293, 2317, 2134, 1851, + 1684, 1783, 2103, 2422, 2511, 2311, 1976, 1746, + 1770, 1998, 2247, 2350, 2274, 2104, 1943, 1812, + 1670, 1504, 1397, 1492, 1864, 2416, 2903, 3085, + 2900, 2499, 2127, 1942, 1906, 1857, 1671, 1393, + 1204, 1277, 1622, 2075, 2421, 2546, 2502, 2421, + 2390, 2384, 2319, 2163, 1991, 1920, 1988, 2095, + 2069, 1827, 1472, 1246, 1355, 1799, 2359, 2743, + 2786, 2547, 2232, 2025, 1959, 1943, 1880, 1778, + 1740, 1857, 2100, 2330, 2406, 2306, 2136, 2031, + 2025, 2022, 1899, 1644, 1407, 1399, 1716, 2238, + 2693, 2843, 2653, 2299, 2026, 1965, 2060, 2150, + 2116, 1973, 1823, 1744, 1719, 1672, 1577, 1518, + 1634, 1988, 2472, 2859, 2956, 2749, 2409, 2151, + 2067, 2064, 1966, 1691, 1341, 1139, 1254, 1663, + 2166, 2528, 2639, 2553, 2401, 2267, 2141, 1983, + 1813, 1736, 1849, 2129, 2405, 2467, 2232, 1832, + 1528, 1525, 1816, 2191, 2399, 2335, 2094, 1881, + 1829, 1916, 2015, 2029, 1982, 1987, 2122, 2343, + 2512, 2511, 2349, 2146, 2017, 1964, 1877, 1655, + 1335, 1111, 1198, 1657, 2314, 2862, 3060, 2889, + 2534, 2226, 2079, 2041, 1987, 1858, 1710, 1647 + }, + { + 1144, 1198, 1236, 1220, 1256, 1498, 1990, 2580, + 3014, 3122, 2948, 2697, 2556, 2538, 2499, 2288, + 1909, 1529, 1341, 1403, 1593, 1730, 1729, 1658, + 1647, 1748, 1886, 1951, 1934, 1974, 2238, 2746, + 3301, 3592, 3419, 2835, 2106, 1518, 1195, 1071, + 1019, 992, 1053, 1274, 1625, 1966, 2173, 2255, + 2364, 2643, 3076, 3449, 3501, 3131, 2477, 1826, + 1399, 1224, 1171, 1115, 1063, 1132, 1407, 1829, + 2218, 2417, 2426, 2383, 2429, 2573, 2682, 2623, + 2404, 2187, 2145, 2298, 2464, 2405, 2021, 1449, + 964, 779, 913, 1222, 1552, 1858, 2191, 2580, + 2940, 3119, 3034, 2771, 2536, 2481, 2566, 2577, + 2302, 1726, 1061, 603, 523, 776, 1178, 1581, + 1963, 2380, 2832, 3200, 3316, 3115, 2717, 2344, + 2153, 2114, 2064, 1872, 1576, 1354, 1362, 1583, + 1829, 1895, 1741, 1524, 1469, 1683, 2078, 2463, + 2706, 2818, 2888, 2952, 2932, 2709, 2273, 1779, + 1455, 1419, 1570, 1669, 1535, 1206, 921, 932, + 1318, 1939, 2561, 3025, 3314, 3477, 3507, 3315, + 2831, 2128, 1439, 1019, 968, 1161, 1361, 1415, + 1373, 1414, 1672, 2096, 2486, 2665, 2620, 2502, + 2475, 2571, 2672, 2636, 2436, 2180, 2004, 1932, + 1854, 1648, 1325, 1058, 1048, 1351, 1804, 2147, + 2226, 2111, 2030, 2171, 2533, 2940, 3191, 3203, + 3032, 2762, 2401, 1897, 1248, 607, 235, 329, + 867, 1593, 2194, 2507, 2599, 2661, 2815, 3011, + 3087, 2937, 2613, 2279, 2058, 1930, 1775, 1516, + 1222, 1063, 1161, 1467, 1789, 1956, 1962, 1964, + 2128, 2464, 2797, 2915, 2746, 2427, 2187, 2161, + 2286, 2380, 2302, 2060, 1775, 1545, 1360, 1148, + 909, 781, 967, 1553, 2391, 3157, 3555, 3510, + 3184, 2829, 2581, 2401, 2164, 1816, 1448, 1202 + }, + { + 1925, 1987, 2037, 2030, 2087, 2379, 2938, 3577, + 4008, 4060, 3804, 3468, 3236, 3108, 2955, 2685, + 2367, 2173, 2208, 2399, 2553, 2539, 2413, 2363, + 2529, 2862, 3172, 3307, 3296, 3312, 3486, 3756, + 3894, 3697, 3168, 2517, 1999, 1727, 1646, 1657, + 1757, 2044, 2579, 3251, 3804, 4014, 3875, 3595, + 3425, 3440, 3489, 3352, 2942, 2387, 1919, 1686, + 1669, 1770, 1951, 2282, 2827, 3495, 4031, 4095, + 3856, 3301, 2843, 2698, 2822, 2999, 3038, 2922, + 2758, 2633, 2515, 2313, 2030, 1824, 1908, 2356, + 3005, 3555, 3790, 3733, 3585, 3526, 3555, 3514, + 3265, 2837, 2405, 2130, 2020, 1959, 1854, 1773, + 1899, 2352, 3045, 3709, 4087, 4095, 3946, 3756, + 3596, 3363, 2942, 2375, 1873, 1658, 1780, 2087, + 2371, 2544, 2685, 2914, 3234, 3491, 3522, 3319, + 3071, 3005, 3182, 3441, 3524, 3300, 2864, 2435, + 2170, 2058, 1994, 1936, 1977, 2245, 2744, 3288, + 3627, 3647, 3473, 3352, 3437, 3649, 3745, 3534, + 3032, 2435, 1947, 1640, 1475, 1427, 1580, 2054, + 2846, 3729, 4095, 4095, 4095, 3589, 3154, 2933, + 2832, 2696, 2486, 2300, 2249, 2320, 2381, 2328, + 2214, 2227, 2517, 3033, 3531, 3760, 3659, 3396, + 3207, 3191, 3247, 3196, 2970, 2671, 2458, 2387, + 2361, 2244, 2030, 1884, 2007, 2447, 3035, 3516, + 3751, 3802, 3831, 3907, 3919, 3679, 3119, 2392, + 1780, 1490, 1521, 1726, 1974, 2266, 2682, 3223, + 3730, 3979, 3863, 3510, 3189, 3093, 3188, 3257, + 3105, 2732, 2320, 2068, 2025, 2094, 2168, 2258, + 2472, 2868, 3331, 3627, 3592, 3289, 2979, 2914, + 3137, 3451, 3591, 3433, 3059, 2642, 2283, 1965, + 1659, 1444, 1506, 1980, 2784, 3620, 4095, 4095, + 4031, 3737, 3527, 3366, 3117, 2724, 2293, 2000 + }, + { + 1117, 1190, 1253, 1255, 1331, 1665, 2274, 2933, + 3330, 3305, 2964, 2552, 2241, 2014, 1766, 1479, + 1282, 1326, 1599, 1899, 1996, 1843, 1635, 1631, + 1925, 2370, 2721, 2850, 2827, 2790, 2766, 2626, + 2237, 1641, 1080, 811, 903, 1198, 1477, 1667, + 1883, 2264, 2785, 3234, 3381, 3179, 2793, 2430, + 2150, 1848, 1419, 930, 618, 693, 1149, 1751, + 2236, 2511, 2678, 2865, 3054, 3086, 2829, 2351, + 1891, 1661, 1666, 1723, 1652, 1461, 1331, 1421, + 1704, 1986, 2103, 2083, 2115, 2351, 2733, 3031, + 3045, 2777, 2407, 2101, 1865, 1577, 1177, 795, + 677, 970, 1568, 2188, 2594, 2767, 2863, 3009, + 3154, 3114, 2775, 2226, 1695, 1355, 1187, 1058, + 907, 856, 1104, 1712, 2486, 3090, 3293, 3127, + 2813, 2546, 2345, 2112, 1804, 1533, 1464, 1633, + 1869, 1930, 1727, 1422, 1300, 1520, 1986, 2451, + 2733, 2842, 2898, 2949, 2891, 2584, 2038, 1467, + 1139, 1151, 1352, 1496, 1473, 1406, 1518, 1908, + 2452, 2917, 3161, 3218, 3188, 3073, 2747, 2108, + 1260, 527, 249, 531, 1175, 1844, 2318, 2594, + 2782, 2923, 2935, 2732, 2377, 2080, 2022, 2176, + 2305, 2168, 1744, 1261, 1006, 1094, 1405, 1735, + 1989, 2229, 2534, 2852, 3006, 2864, 2498, 2159, + 2059, 2181, 2288, 2137, 1700, 1186, 861, 839, + 1049, 1375, 1794, 2366, 3076, 3715, 3966, 3636, + 2834, 1923, 1265, 989, 979, 1051, 1142, 1323, + 1650, 2041, 2319, 2386, 2341, 2398, 2670, 3025, + 3174, 2917, 2326, 1687, 1277, 1163, 1220, 1308, + 1418, 1633, 1980, 2323, 2461, 2326, 2084, 2016, + 2271, 2723, 3066, 3059, 2705, 2198, 1730, 1347, + 999, 697, 596, 878, 1557, 2395, 3041, 3286, + 3189, 2978, 2823, 2694, 2448, 2022, 1538, 1203 + }, + { + 1117, 1190, 1253, 1255, 1331, 1665, 2274, 2933, + 3330, 3305, 2964, 2552, 2241, 2014, 1766, 1479, + 1282, 1326, 1599, 1899, 1996, 1843, 1635, 1631, + 1925, 2370, 2721, 2850, 2827, 2790, 2766, 2626, + 2237, 1641, 1080, 811, 903, 1198, 1477, 1667, + 1883, 2264, 2785, 3234, 3381, 3179, 2793, 2430, + 2150, 1848, 1419, 930, 618, 693, 1149, 1751, + 2236, 2511, 2678, 2865, 3054, 3086, 2829, 2351, + 1891, 1661, 1666, 1723, 1652, 1461, 1331, 1421, + 1704, 1986, 2103, 2083, 2115, 2351, 2733, 3031, + 3045, 2777, 2407, 2101, 1865, 1577, 1177, 795, + 677, 970, 1568, 2188, 2594, 2767, 2863, 3009, + 3154, 3114, 2775, 2226, 1695, 1355, 1187, 1058, + 907, 856, 1104, 1712, 2486, 3090, 3293, 3127, + 2813, 2546, 2345, 2112, 1804, 1533, 1464, 1633, + 1869, 1930, 1727, 1422, 1300, 1520, 1986, 2451, + 2733, 2842, 2898, 2949, 2891, 2584, 2038, 1467, + 1139, 1151, 1352, 1496, 1473, 1406, 1518, 1908, + 2452, 2917, 3161, 3218, 3188, 3073, 2747, 2108, + 1260, 527, 249, 531, 1175, 1844, 2318, 2594, + 2782, 2923, 2935, 2732, 2377, 2080, 2022, 2176, + 2305, 2168, 1744, 1261, 1006, 1094, 1405, 1735, + 1989, 2229, 2534, 2852, 3006, 2864, 2498, 2159, + 2059, 2181, 2288, 2137, 1700, 1186, 861, 839, + 1049, 1375, 1794, 2366, 3076, 3715, 3966, 3636, + 2834, 1923, 1265, 989, 979, 1051, 1142, 1323, + 1650, 2041, 2319, 2386, 2341, 2398, 2670, 3025, + 3174, 2917, 2326, 1687, 1277, 1163, 1220, 1308, + 1418, 1633, 1980, 2323, 2461, 2326, 2084, 2016, + 2271, 2723, 3066, 3059, 2705, 2198, 1730, 1347, + 999, 697, 596, 878, 1557, 2395, 3041, 3286, + 3189, 2978, 2823, 2694, 2448, 2022, 1538, 1203 + }, + { + 1718, 1921, 1999, 1656, 1132, 1032, 1712, 2848, + 3643, 3512, 2596, 1623, 1246, 1506, 1915, 2017, + 1844, 1803, 2145, 2612, 2653, 2019, 1111, 688, + 1190, 2308, 3242, 3398, 2864, 2229, 1969, 2022, + 1965, 1564, 1094, 1081, 1711, 2557, 2915, 2470, + 1625, 1150, 1483, 2345, 3029, 3067, 2612, 2185, + 2096, 2139, 1883, 1234, 647, 732, 1629, 2782, + 3379, 3061, 2216, 1596, 1624, 2069, 2372, 2248, + 1953, 1942, 2320, 2666, 2456, 1648, 817, 673, + 1391, 2432, 3022, 2838, 2248, 1891, 2042, 2394, + 2450, 2085, 1692, 1745, 2251, 2681, 2470, 1618, + 757, 605, 1314, 2340, 2962, 2917, 2559, 2405, + 2574, 2687, 2333, 1581, 995, 1097, 1825, 2543, + 2617, 2016, 1334, 1217, 1764, 2469, 2751, 2515, + 2186, 2209, 2546, 2708, 2296, 1481, 909, 1099, + 1922, 2684, 2761, 2163, 1491, 1343, 1761, 2265, + 2393, 2177, 2070, 2401, 2954, 3126, 2538, 1473, + 689, 746, 1508, 2285, 2490, 2151, 1804, 1902, + 2355, 2664, 2482, 2010, 1796, 2145, 2747, 2934, + 2340, 1301, 593, 739, 1553, 2355, 2620, 2417, + 2233, 2394, 2701, 2669, 2100, 1381, 1161, 1710, + 2604, 3073, 2700, 1796, 1093, 1072, 1566, 2017, + 2081, 1946, 2065, 2586, 3118, 3090, 2358, 1432, + 1049, 1496, 2335, 2804, 2518, 1780, 1244, 1274, + 1656, 1913, 1860, 1810, 2187, 2986, 3642, 3514, + 2517, 1276, 618, 874, 1639, 2210, 2240, 1983, + 1918, 2192, 2465, 2316, 1768, 1353, 1601, 2477, + 3320, 3416, 2637, 1569, 968, 1111, 1625, 1943, + 1888, 1782, 2016, 2544, 2867, 2552, 1738, 1103, + 1261, 2175, 3150, 3442, 2895, 2013, 1437, 1358, + 1450, 1342, 1089, 1143, 1827, 2881, 3588, 3398, + 2455, 1508, 1250, 1731, 2377, 2578, 2246, 1815 + }, + { + 1956, 2312, 2492, 2158, 1587, 1440, 2075, 3103, + 3686, 3310, 2251, 1289, 964, 1148, 1318, 1207, + 1102, 1470, 2337, 3132, 3196, 2466, 1596, 1370, + 1972, 2846, 3266, 3016, 2500, 2211, 2166, 1932, + 1202, 279, 0, 514, 1825, 2970, 3298, 2911, + 2460, 2438, 2721, 2794, 2395, 1846, 1708, 2128, + 2613, 2496, 1639, 644, 310, 889, 1878, 2537, + 2593, 2411, 2483, 2835, 2993, 2546, 1687, 1118, + 1375, 2266, 3014, 2986, 2268, 1526, 1315, 1565, + 1757, 1572, 1273, 1419, 2191, 3093, 3371, 2751, + 1734, 1144, 1359, 2019, 2463, 2416, 2209, 2316, + 2752, 2995, 2547, 1529, 660, 598, 1311, 2116, + 2356, 2015, 1666, 1816, 2379, 2798, 2684, 2258, + 2113, 2543, 3164, 3261, 2510, 1347, 574, 613, + 1161, 1574, 1564, 1455, 1755, 2519, 3211, 3232, + 2567, 1849, 1757, 2343, 2992, 3048, 2449, 1737, + 1454, 1580, 1619, 1216, 628, 520, 1267, 2504, + 3408, 3450, 2855, 2318, 2281, 2532, 2517, 2013, + 1407, 1298, 1822, 2459, 2530, 1902, 1140, 958, + 1517, 2286, 2609, 2356, 2002, 2057, 2485, 2743, + 2396, 1643, 1184, 1516, 2413, 3111, 3038, 2338, + 1674, 1530, 1760, 1837, 1500, 1087, 1183, 1941, + 2834, 3122, 2577, 1723, 1337, 1707, 2410, 2796, + 2657, 2373, 2410, 2734, 2807, 2177, 1045, 176, + 210, 1065, 2032, 2466, 2362, 2242, 2514, 3006, + 3170, 2727, 2032, 1745, 2140, 2771, 2886, 2175, + 1096, 437, 583, 1209, 1704, 1825, 1894, 2338, + 3102, 3601, 3299, 2321, 1415, 1285, 1930, 2673, + 2829, 2339, 1732, 1513, 1639, 1648, 1264, 805, + 906, 1822, 3065, 3773, 3486, 2550, 1755, 1582, + 1830, 1959, 1751, 1543, 1806, 2530, 3118, 2944, + 2015, 1030, 751, 1302, 2097, 2453, 2239, 1915 + }, + { + 1964, 2362, 2559, 2189, 1568, 1414, 2067, 3059, + 3526, 3046, 2033, 1276, 1149, 1327, 1288, 987, + 936, 1584, 2708, 3521, 3425, 2621, 1903, 1856, + 2309, 2599, 2335, 1808, 1611, 1918, 2247, 1998, + 1166, 443, 549, 1503, 2603, 3140, 3062, 2903, + 3077, 3364, 3157, 2203, 1000, 375, 684, 1474, + 1982, 1920, 1700, 1887, 2497, 2950, 2717, 1961, + 1425, 1673, 2496, 3112, 2972, 2281, 1721, 1683, + 1882, 1764, 1217, 782, 1086, 2110, 3112, 3324, + 2695, 1899, 1625, 1901, 2178, 2031, 1671, 1687, + 2317, 3076, 3199, 2439, 1367, 825, 1111, 1751, + 2065, 1899, 1721, 2001, 2610, 2919, 2518, 1731, + 1353, 1830, 2779, 3352, 3069, 2250, 1598, 1445, + 1472, 1203, 669, 468, 1120, 2420, 3528, 3741, + 3144, 2457, 2266, 2453, 2438, 1916, 1254, 1094, + 1614, 2272, 2351, 1722, 1001, 913, 1554, 2336, + 2649, 2506, 2458, 2890, 3503, 3576, 2750, 1475, + 615, 626, 1170, 1560, 1528, 1462, 1874, 2718, + 3334, 3129, 2236, 1437, 1396, 2018, 2602, 2606, + 2183, 1928, 2145, 2474, 2310, 1544, 781, 764, + 1596, 2598, 2979, 2593, 2012, 1853, 2129, 2320, + 2047, 1576, 1549, 2236, 3140, 3434, 2781, 1683, + 980, 1029, 1443, 1618, 1441, 1379, 1878, 2749, + 3283, 2983, 2126, 1531, 1738, 2479, 2991, 2808, + 2197, 1776, 1790, 1858, 1476, 702, 214, 644, + 1885, 3131, 3627, 3348, 2903, 2803, 2914, 2686, + 1876, 935, 595, 1104, 1936, 2317, 2009, 1510, + 1471, 1978, 2486, 2467, 2030, 1820, 2285, 3129, + 3560, 3092, 2049, 1221, 1077, 1352, 1459, 1214, + 1058, 1522, 2535, 3375, 3355, 2530, 1651, 1420, + 1826, 2259, 2233, 1913, 1866, 2338, 2895, 2850, + 2036, 1061, 736, 1277, 2114, 2503, 2272, 1916 + }, + { + 1639, 1664, 1562, 1341, 1360, 1915, 2829, 3528, + 3547, 2949, 2219, 1761, 1548, 1288, 877, 621, + 938, 1861, 2903, 3446, 3282, 2734, 2268, 2022, + 1771, 1321, 868, 873, 1570, 2635, 3406, 3454, + 2920, 2299, 1919, 1689, 1347, 896, 694, 1077, + 1938, 2737, 2992, 2720, 2385, 2390, 2662, 2769, + 2419, 1793, 1356, 1365, 1621, 1732, 1581, 1463, + 1732, 2345, 2832, 2753, 2162, 1583, 1512, 1960, + 2502, 2750, 2711, 2665, 2725, 2631, 2028, 958, + 0, 0, 496, 1736, 2834, 3458, 3723, 3841, + 3752, 3184, 2069, 822, 110, 289, 1094, 1902, + 2304, 2395, 2518, 2782, 2906, 2557, 1804, 1148, + 1076, 1597, 2255, 2598, 2593, 2554, 2689, 2805, + 2511, 1715, 836, 485, 898, 1731, 2409, 2656, + 2660, 2728, 2863, 2746, 2156, 1334, 853, 1093, + 1868, 2596, 2846, 2685, 2489, 2460, 2405, 2012, + 1304, 722, 730, 1335, 2064, 2430, 2399, 2364, + 2665, 3183, 3442, 3110, 2344, 1619, 1245, 1108, + 918, 647, 646, 1270, 2402, 3433, 3752, 3276, + 2479, 1920, 1759, 1753, 1669, 1610, 1864, 2469, + 3015, 2959, 2167, 1103, 447, 518, 1081, 1689, + 2157, 2652, 3327, 3959, 4051, 3323, 2069, 966, + 513, 658, 980, 1199, 1437, 1979, 2804, 3469, + 3484, 2808, 1918, 1372, 1319, 1472, 1526, 1535, + 1822, 2522, 3289, 3542, 3008, 2017, 1205, 958, + 1133, 1343, 1427, 1594, 2085, 2776, 3197, 2987, + 2297, 1689, 1605, 1967, 2306, 2280, 2009, 1884, + 2086, 2358, 2294, 1817, 1301, 1203, 1573, 2011, + 2103, 1872, 1753, 2114, 2839, 3420, 3451, 2996, + 2439, 2029, 1639, 1019, 242, 0, 205, 1436, + 2883, 3816, 3952, 3559, 3062, 2600, 2024, 1278, + 664, 643, 1346, 2343, 2958, 2854, 2286, 1788 + }, + { + 1664, 1710, 1621, 1407, 1442, 2003, 2873, 3465, + 3372, 2745, 2084, 1708, 1489, 1146, 713, 612, + 1202, 2315, 3312, 3633, 3266, 2647, 2153, 1768, + 1286, 760, 609, 1212, 2410, 3513, 3856, 3344, + 2445, 1678, 1182, 798, 495, 559, 1284, 2512, + 3601, 3926, 3426, 2610, 2030, 1793, 1607, 1266, + 968, 1098, 1726, 2439, 2713, 2438, 2006, 1863, + 2044, 2194, 2047, 1785, 1847, 2396, 3057, 3245, + 2741, 1890, 1225, 956, 880, 784, 811, 1334, + 2449, 3684, 4095, 4001, 3035, 2052, 1429, 1079, + 781, 592, 827, 1619, 2608, 3172, 2997, 2384, + 1932, 1937, 2162, 2183, 1912, 1690, 1855, 2317, + 2620, 2441, 1951, 1617, 1681, 1910, 1901, 1595, + 1381, 1666, 2386, 3011, 3069, 2603, 2079, 1865, + 1879, 1787, 1488, 1298, 1590, 2308, 2924, 2932, + 2348, 1676, 1389, 1493, 1645, 1637, 1660, 2042, + 2762, 3350, 3316, 2665, 1904, 1532, 1564, 1603, + 1355, 1002, 995, 1531, 2303, 2818, 2898, 2809, + 2868, 3011, 2849, 2155, 1229, 689, 883, 1548, + 2098, 2207, 2062, 2049, 2261, 2408, 2227, 1862, + 1767, 2190, 2838, 3128, 2766, 2035, 1479, 1347, + 1410, 1328, 1118, 1157, 1721, 2593, 3217, 3234, + 2828, 2472, 2390, 2340, 1956, 1257, 718, 808, + 1498, 2286, 2699, 2716, 2652, 2684, 2608, 2120, + 1299, 686, 820, 1690, 2713, 3260, 3186, 2822, + 2502, 2202, 1692, 990, 515, 722, 1593, 2569, + 3045, 2906, 2541, 2359, 2356, 2214, 1783, 1351, + 1368, 1923, 2586, 2811, 2473, 1952, 1679, 1683, + 1634, 1326, 1011, 1176, 1997, 3075, 3770, 3769, + 3287, 2713, 2162, 1452, 521, 0, 0, 704, + 2221, 3469, 3925, 3689, 3199, 2718, 2167, 1448, + 794, 672, 1285, 2261, 2912, 2846, 2291, 1798 + }, + { + 1007, 1856, 3088, 3141, 1847, 693, 1019, 2402, + 3221, 2669, 1652, 1511, 2265, 2661, 1926, 902, + 1029, 2441, 3641, 3260, 1719, 730, 1238, 2375, + 2679, 1956, 1422, 1994, 3006, 3042, 1827, 706, + 1023, 2433, 3287, 2649, 1408, 1118, 2052, 2925, + 2601, 1546, 1185, 2010, 2913, 2633, 1438, 857, + 1747, 3148, 3408, 2207, 934, 975, 2063, 2745, + 2291, 1564, 1775, 2782, 3198, 2211, 766, 519, + 1815, 3231, 3271, 2120, 1291, 1679, 2511, 2481, + 1542, 991, 1744, 3042, 3318, 2172, 930, 1040, + 2298, 3130, 2564, 1398, 1127, 2028, 2866, 2544, + 1544, 1280, 2202, 3139, 2764, 1349, 530, 1323, + 2864, 3450, 2579, 1454, 1382, 2157, 2479, 1781, + 1038, 1485, 2882, 3653, 2796, 1178, 554, 1486, + 2736, 2860, 1960, 1411, 1992, 2872, 2739, 1593, + 829, 1472, 2813, 3235, 2228, 1036, 1114, 2328, + 3157, 2624, 1479, 1185, 2020, 2769, 2363, 1324, + 1121, 2227, 3406, 3187, 1710, 604, 1030, 2335, + 2953, 2368, 1638, 1880, 2743, 2873, 1777, 620, + 857, 2375, 3534, 3105, 1716, 1022, 1666, 2595, + 2523, 1612, 1201, 1986, 3034, 2956, 1739, 846, + 1407, 2768, 3270, 2302, 1044, 990, 2114, 2978, + 2598, 1645, 1484, 2330, 2945, 2295, 996, 656, + 1854, 3341, 3494, 2243, 1092, 1233, 2166, 2501, + 1839, 1266, 1837, 3059, 3406, 2261, 808, 665, + 1934, 3095, 2878, 1764, 1266, 1962, 2817, 2600, + 1538, 1039, 1834, 2968, 2975, 1770, 819, 1333, + 2738, 3371, 2522, 1266, 1073, 1987, 2681, 2254, + 1408, 1483, 2608, 3416, 2742, 1172, 431, 1320, + 2771, 3183, 2343, 1540, 1807, 2599, 2598, 1556, + 737, 1323, 2823, 3559, 2693, 1261, 902, 1879, + 2844, 2605, 1599, 1244, 2041, 2919, 2658, 1531 + }, + { + 1940, 2558, 3310, 3167, 1867, 350, 0, 1062, + 2800, 3765, 3383, 2325, 1683, 1824, 2122, 1810, + 973, 562, 1363, 3030, 4095, 3948, 2338, 733, + 312, 1081, 2042, 2327, 2055, 2043, 2730, 3541, + 3433, 2069, 354, 0, 660, 2465, 3674, 3555, + 2627, 1952, 1980, 2174, 1778, 840, 310, 1054, + 2820, 4095, 4095, 2750, 1016, 328, 870, 1758, + 2102, 1931, 2002, 2773, 3699, 3704, 2351, 483, + 0, 332, 2127, 3511, 3617, 2819, 2147, 2119, + 2272, 1849, 837, 165, 780, 2548, 4095, 4095, + 3056, 1293, 441, 815, 1624, 1964, 1795, 1856, + 2655, 3707, 3898, 2665, 738, 0, 137, 1836, + 3299, 3559, 2871, 2228, 2206, 2400, 2025, 983, + 161, 577, 2243, 3964, 4095, 3212, 1509, 607, + 911, 1683, 1987, 1722, 1634, 2344, 3478, 3919, + 2958, 1144, 0, 179, 1657, 3024, 3299, 2677, + 2126, 2247, 2633, 2411, 1352, 294, 368, 1792, + 3522, 4095, 3306, 1795, 924, 1157, 1829, 2014, + 1589, 1330, 1958, 3199, 3921, 3260, 1583, 231, + 275, 1525, 2778, 3042, 2448, 1949, 2189, 2781, + 2774, 1790, 573, 315, 1429, 3049, 3826, 3210, + 1931, 1202, 1494, 2155, 2234, 1577, 1016, 1432, + 2711, 3741, 3497, 2102, 754, 565, 1507, 2523, + 2671, 2061, 1640, 2072, 2958, 3236, 2353, 953, + 300, 1029, 2487, 3382, 3051, 2056, 1509, 1878, + 2532, 2499, 1601, 718, 888, 2167, 3485, 3671, + 2604, 1315, 927, 1562, 2316, 2308, 1645, 1274, + 1887, 3079, 3677, 2945, 1400, 361, 677, 1927, + 2902, 2843, 2138, 1788, 2244, 2901, 2778, 1670, + 489, 408, 1648, 3195, 3762, 3008, 1804, 1276, + 1670, 2211, 2062, 1311, 912, 1616, 3052, 3976, + 3474, 1900, 566, 489, 1470, 2418, 2532, 2072 + }, + { + 2305, 1950, 1626, 1814, 2468, 2972, 2698, 1651, + 599, 493, 1629, 3299, 4095, 3750, 2036, 322, + 0, 716, 2337, 3494, 3539, 2733, 1873, 1551, + 1713, 1874, 1704, 1400, 1477, 2176, 3100, 3465, + 2796, 1444, 411, 557, 1859, 3357, 3885, 3012, + 1398, 273, 466, 1773, 3173, 3670, 3055, 1956, + 1225, 1225, 1645, 1927, 1865, 1776, 2102, 2843, + 3423, 3156, 1941, 508, 0, 771, 2528, 3975, + 4081, 2811, 1147, 304, 788, 2069, 3085, 3132, + 2367, 1558, 1356, 1763, 2238, 2291, 1965, 1758, + 2067, 2709, 3020, 2475, 1275, 311, 477, 1870, + 3595, 4095, 3648, 1838, 238, 0, 953, 2472, + 3385, 3239, 2444, 1786, 1701, 1974, 2076, 1773, + 1386, 1465, 2176, 3031, 3252, 2491, 1234, 486, + 945, 2362, 3668, 3808, 2604, 928, 25, 542, + 2045, 3415, 3744, 2992, 1892, 1252, 1307, 1669, + 1826, 1700, 1681, 2158, 2993, 3517, 3093, 1773, + 411, 53, 1073, 2800, 3984, 3764, 2346, 833, + 342, 1140, 2499, 3344, 3124, 2182, 1357, 1230, + 1687, 2150, 2196, 1957, 1926, 2378, 2991, 3078, + 2252, 913, 57, 492, 2102, 3831, 4095, 3481, + 1632, 203, 113, 1246, 2634, 3287, 2946, 2155, + 1671, 1781, 2137, 2202, 1837, 1454, 1587, 2295, + 3011, 3008, 2101, 926, 482, 1281, 2841, 3994, + 3798, 2312, 588, 0, 597, 2192, 3484, 3681, + 2895, 1901, 1409, 1511, 1759, 1733, 1500, 1531, + 2148, 3075, 3557, 3017, 1650, 404, 259, 1409, + 3036, 3917, 3390, 1883, 571, 434, 1497, 2873, + 3520, 3065, 2014, 1233, 1196, 1675, 2076, 2072, + 1891, 2018, 2606, 3204, 3117, 2089, 689, 0, + 611, 2318, 3929, 4095, 3162, 1386, 241, 446, + 1669, 2875, 3209, 2628, 1811, 1479, 1772, 2227 + }, + { + 2335, 1960, 1685, 1991, 2665, 2957, 2364, 1256, + 1187, 675, 1385, 2969, 4095, 3891, 2178, 296, + 0, 858, 2528, 3499, 3277, 2384, 1687, 1864, + 1755, 1891, 1800, 1493, 1474, 2117, 3086, 3446, + 2627, 1190, 321, 799, 2247, 3423, 3310, 3107, + 1738, 395, 255, 1464, 3033, 3737, 3149, 1995, + 1297, 1347, 1704, 1834, 1723, 1823, 2108, 2639, + 3261, 3208, 2125, 617, 0, 748, 2661, 4066, + 3914, 2447, 933, 547, 1394, 1601, 2804, 3229, + 2646, 1734, 1332, 1636, 2113, 2142, 1819, 1735, + 2218, 2881, 2971, 2189, 1720, 621, 355, 1441, + 3232, 4095, 3802, 1959, 273, 50, 1212, 2640, + 3225, 2756, 1910, 2316, 1840, 1897, 2026, 1814, + 1434, 1470, 2204, 3124, 3256, 2304, 984, 435, + 1171, 2551, 3314, 3642, 2920, 1289, 77, 298, + 1775, 3318, 3760, 2948, 1844, 1312, 1466, 1796, + 1872, 1825, 1577, 1917, 2711, 3406, 3216, 1970, + 487, 10, 1148, 2954, 3986, 3485, 1998, 851, + 972, 994, 2116, 3181, 3271, 2421, 1473, 1207, + 1641, 2110, 2109, 1863, 1914, 2408, 2823, 2479, + 2808, 1550, 347, 282, 1634, 3479, 4095, 3526, + 1607, 217, 326, 1591, 2839, 3159, 2604, 1942, + 1762, 1656, 1999, 2221, 1988, 1609, 1694, 2407, + 3070, 2862, 1756, 638, 549, 1686, 3126, 3294, + 3719, 2662, 912, 0, 407, 2032, 3459, 3612, + 2747, 1800, 1467, 1676, 1899, 1861, 1595, 1503, + 1915, 2795, 3437, 3078, 1735, 392, 309, 1631, + 3271, 3888, 3033, 1515, 651, 866, 1341, 2604, + 3487, 3253, 2196, 1262, 1125, 1617, 2009, 1977, + 1857, 2125, 2738, 3044, 2446, 2512, 1180, 155, + 433, 2025, 3791, 4095, 3137, 1246, 193, 622, + 1932, 2950, 3001, 2393, 2115, 1507, 1558, 1991 + }, + { + 2299, 1606, 1862, 2187, 2600, 3114, 2824, 819, + 742, 762, 1777, 2857, 3979, 4095, 2607, 70, + 0, 1274, 2290, 3296, 3402, 2624, 1883, 2093, + 1423, 1682, 1942, 1277, 1503, 2618, 2805, 3895, + 2249, 1512, 0, 904, 1903, 3739, 3659, 3477, + 1378, 119, 643, 1169, 2648, 4095, 3128, 2162, + 1306, 1460, 1690, 1974, 1373, 1684, 1967, 3108, + 3257, 3304, 2323, 309, 7, 529, 2826, 4095, + 3817, 2606, 606, 565, 1564, 1755, 2924, 3206, + 2565, 1884, 1147, 1262, 2231, 2237, 2195, 2100, + 1944, 2626, 3225, 1916, 1444, 924, 395, 1723, + 3132, 4095, 3586, 1748, 42, 268, 1482, 2742, + 3110, 2570, 2025, 2385, 1828, 2180, 1616, 1958, + 1380, 1703, 2019, 3249, 3581, 2116, 685, 199, + 1554, 2900, 3289, 3588, 2850, 1045, 0, 597, + 1989, 3292, 3640, 3076, 1633, 1156, 1650, 2200, + 1884, 1603, 1349, 2034, 2754, 3521, 3437, 1599, + 744, 0, 1040, 3065, 4095, 3458, 1782, 963, + 997, 977, 1824, 3559, 3467, 2488, 1558, 699, + 1750, 1983, 2306, 1793, 2240, 2704, 2237, 2629, + 2939, 1330, 530, 545, 1391, 3086, 4095, 3624, + 1583, 443, 206, 1788, 2457, 3132, 2913, 1810, + 1654, 1539, 2375, 2330, 2305, 1378, 1366, 2269, + 3182, 3207, 1447, 648, 813, 1931, 3069, 3286, + 3459, 2647, 833, 0, 589, 2201, 3797, 3585, + 2499, 1455, 1353, 2169, 2045, 1862, 1599, 1248, + 1735, 3087, 3519, 3073, 1783, 586, 403, 1230, + 3053, 4030, 3230, 1553, 814, 1012, 1239, 2409, + 3612, 3022, 2454, 988, 1344, 1690, 2015, 2311, + 1661, 1882, 2970, 3096, 2259, 2286, 1362, 415, + 382, 2202, 4077, 4095, 2592, 1052, 470, 805, + 2008, 3117, 3179, 2167, 1896, 1466, 1818, 2081 + }, + { + 1966, 2056, 2324, 2444, 1716, 1440, 1465, 1652, + 1875, 2034, 2094, 2076, 2037, 2105, 2583, 1888, + 994, 1008, 1565, 2138, 2414, 2398, 2270, 2152, + 2001, 1726, 1370, 1159, 1325, 1872, 2502, 2825, + 2599, 1908, 1177, 1358, 1754, 1897, 1956, 1973, + 1965, 1970, 2000, 2020, 1980, 1914, 1867, 1698, + 1633, 1822, 2021, 2054, 1931, 1831, 1905, 2094, + 2140, 1824, 1297, 1964, 2188, 1828, 1576, 2128, + 2255, 1961, 1600, 1533, 1823, 2209, 2347, 2115, + 1705, 1447, 1526, 1839, 2117, 2168, 2035, 1919, + 1948, 2041, 1998, 1724, 1392, 1362, 1896, 2811, + 2122, 1739, 1726, 1901, 2062, 2040, 1867, 1669, + 1531, 1527, 1740, 2238, 2702, 2377, 1984, 1563, + 1305, 1376, 1742, 2165, 2333, 2139, 1788, 1624, + 1819, 2208, 2414, 2176, 1596, 1106, 1087, 1600, + 2354, 2838, 2758, 2219, 1598, 1247, 1250, 1468, + 1734, 2029, 2451, 2851, 2030, 1593, 1481, 1600, + 1808, 1954, 2009, 2012, 1969, 1886, 1800, 1768, + 1812, 1937, 2247, 2475, 1925, 1398, 1223, 1479, + 1957, 2335, 2421, 2267, 2054, 1870, 1614, 1148, + 1402, 2051, 2361, 2381, 2151, 1806, 1621, 1674, + 1793, 1900, 1995, 2059, 2054, 1959, 1750, 1419, + 1732, 2123, 2329, 2207, 1857, 1571, 1594, 1896, + 2180, 2116, 1639, 1438, 1959, 2116, 2093, 2051, + 2049, 2037, 1956, 1739, 1214, 911, 2104, 2666, + 2618, 2292, 1979, 1758, 1557, 1351, 1268, 1485, + 2014, 2601, 2861, 2571, 1885, 1233, 989, 1278, + 1853, 2301, 2449, 2380, 2080, 1765, 1562, 1513, + 1617, 1930, 2552, 2071, 1735, 1723, 1797, 1809, + 1807, 1898, 2059, 2111, 2091, 2188, 1924, 1185, + 1048, 1869, 2546, 2656, 2239, 1647, 1338, 1500, + 1926, 2232, 2194, 1935, 1853, 1585, 1647, 1843 + }, + { + 1659, 2675, 2749, 995, 2173, 1940, 1758, 1737, + 1805, 1884, 1945, 2020, 2163, 2406, 1786, 2321, + 991, 844, 1698, 2413, 2642, 2402, 2020, 1879, + 1873, 1701, 1340, 1179, 1629, 2362, 2546, 2823, + 2611, 635, 1054, 2099, 1830, 1970, 2091, 2189, + 2174, 2003, 1706, 1379, 1301, 1802, 2504, 3525, + 1931, 631, 1107, 1894, 2188, 2207, 2261, 2251, + 1696, 718, 3108, 1636, 1614, 2164, 1962, 1527, + 2214, 2001, 1463, 1379, 1962, 2680, 2826, 2236, + 1296, 814, 1099, 1902, 2559, 2590, 2142, 1841, + 1891, 2012, 1954, 1594, 1161, 1342, 2876, 1538, + 2388, 2161, 1968, 1905, 1876, 1872, 1781, 1648, + 1622, 1774, 2024, 1808, 1350, 3460, 2891, 1498, + 1072, 1273, 1372, 1966, 2476, 2263, 1679, 1448, + 1930, 2703, 2997, 2280, 930, 682, 802, 982, + 2550, 3717, 3622, 2527, 1167, 573, 651, 1194, + 2057, 3027, 3472, 328, 2460, 2176, 1868, 1735, + 1734, 1783, 1780, 1757, 1784, 1880, 2039, 2201, + 2229, 2073, 1483, 1629, 2971, 1691, 851, 1072, + 1864, 2609, 2790, 2451, 1961, 1515, 1103, 1847, + 2014, 1647, 1888, 2020, 2063, 2184, 2102, 1878, + 1874, 1891, 1808, 1635, 1480, 1540, 2049, 3897, + 1024, 1088, 2025, 2385, 2069, 1655, 1649, 2000, + 2132, 1527, 1310, 2922, 1737, 1758, 1870, 1969, + 2088, 2176, 2080, 1699, 1295, 1033, 1600, 2820, + 2718, 2287, 1985, 1875, 1713, 1312, 1028, 1302, + 2030, 2858, 3103, 2414, 1614, 1352, 673, 1103, + 3016, 3299, 1642, 303, 1899, 2475, 2407, 2217, + 2137, 2046, 0, 2298, 2414, 2355, 2160, 1584, + 1115, 1349, 2022, 3000, 3585, 1751, 1024, 1398, + 0, 1191, 3177, 3342, 3377, 2277, 1124, 914, + 1094, 1158, 1371, 2973, 3320, 3253, 614, 540 + }, + { + 2099, 2469, 2236, 702, 2306, 2265, 1928, 1672, + 1726, 1987, 2127, 1964, 1717, 1825, 1554, 2705, + 1775, 1502, 1837, 2050, 2091, 1947, 1738, 1739, + 1928, 2072, 2002, 1816, 1805, 1889, 1699, 2154, + 2518, 1076, 1654, 2496, 1911, 1823, 1821, 1849, + 1867, 1940, 2050, 1998, 1745, 1642, 1760, 2739, + 1747, 1219, 1994, 2375, 1945, 1549, 1785, 2277, + 2037, 959, 3051, 1449, 1562, 2284, 2050, 1433, + 2072, 2097, 1863, 1753, 1851, 1981, 1988, 1929, + 1821, 1824, 1884, 1978, 2013, 1910, 1751, 1793, + 1972, 2055, 2014, 1821, 1560, 1700, 2938, 1246, + 1937, 1827, 1891, 2013, 2000, 1913, 1785, 1739, + 1875, 2124, 2270, 1727, 862, 2745, 2341, 1478, + 1641, 2081, 1896, 1913, 2030, 1912, 1750, 1767, + 1969, 2110, 2036, 1726, 1441, 2175, 2393, 1596, + 1717, 1928, 1974, 1960, 1874, 1981, 1892, 1671, + 1728, 2290, 2824, 56, 2531, 2354, 1939, 1671, + 1684, 1912, 2091, 2064, 1866, 1685, 1736, 2015, + 2225, 2101, 1361, 1380, 2857, 1977, 1503, 1703, + 2007, 2108, 1943, 1793, 1857, 1922, 1671, 2226, + 2096, 1558, 1797, 1981, 2008, 2034, 1869, 1668, + 1813, 2043, 2128, 1982, 1677, 1472, 1753, 3561, + 869, 1194, 2258, 2509, 1963, 1436, 1561, 2174, + 2442, 1702, 1200, 2655, 1589, 1862, 2067, 1960, + 1757, 1756, 1974, 2111, 2016, 1591, 1633, 2335, + 2028, 1730, 1723, 1922, 2063, 1955, 1810, 1841, + 1901, 1979, 1939, 1732, 1897, 2363, 1614, 1272, + 2407, 2579, 1525, 879, 2556, 2497, 1674, 1351, + 1926, 2700, 844, 2684, 1928, 1498, 1787, 2108, + 2115, 1928, 1585, 1766, 2412, 1472, 1850, 2833, + 998, 1559, 2529, 2010, 2009, 1560, 1460, 2158, + 2552, 1961, 1049, 1816, 2175, 2885, 1132, 1374 + }, + { + 2298, 2981, 1544, 1907, 2114, 2357, 2312, 2031, + 1922, 2051, 2257, 2329, 2136, 1889, 1951, 2330, + 2524, 1904, 1503, 2689, 2381, 1845, 1847, 2222, + 2478, 2244, 1733, 1671, 2468, 3711, 0, 2679, + 2483, 2319, 2099, 1806, 1780, 2394, 3172, 907, + 2428, 2019, 1976, 3332, 949, 2022, 2567, 2323, + 1942, 1935, 2190, 2256, 2131, 2022, 2136, 2259, + 2068, 1982, 2103, 2405, 2424, 1147, 2599, 2418, + 2080, 1906, 1999, 2236, 2336, 2151, 1935, 1952, + 2363, 2253, 1921, 2191, 2200, 1994, 1982, 2335, + 2577, 1839, 774, 4095, 1331, 2647, 760, 2895, + 2687, 1875, 1701, 2040, 2404, 2410, 2086, 1796, + 1879, 2320, 2724, 2512, 11, 3311, 3102, 1436, + 1248, 3032, 2012, 2081, 2195, 1962, 2073, 2353, + 2250, 1298, 3430, 1288, 2013, 2392, 2304, 2042, + 1870, 2446, 1774, 2216, 2566, 1933, 1739, 2235, + 2345, 2240, 2076, 1867, 2092, 2289, 2236, 2183, + 2067, 1880, 1944, 2478, 2615, 1919, 1406, 1820, + 3158, 2882, 1131, 777, 3423, 2936, 1687, 1391, + 1985, 2647, 2670, 1894, 950, 3538, 1441, 2122, + 2405, 2205, 1920, 1914, 2189, 2417, 2283, 1842, + 1983, 2034, 2172, 2886, 2024, 916, 2464, 2887, + 2448, 1253, 1916, 2446, 2377, 2219, 2125, 1761, + 1342, 3767, 1742, 1619, 2008, 2362, 2340, 2127, + 1995, 1992, 2119, 2263, 2278, 2123, 1862, 1684, + 3480, 1143, 1973, 2577, 2351, 1813, 1654, 2372, + 3429, 458, 2493, 2385, 2266, 2090, 1932, 2110, + 1759, 3261, 1250, 2307, 2104, 1810, 2959, 1710, + 1826, 2277, 2319, 2116, 2022, 2111, 2165, 2106, + 2081, 2200, 2374, 2014, 1103, 3510, 1988, 1764, + 1659, 2400, 2848, 1755, 1832, 1996, 2283, 2580, + 2140, 1399, 2388, 2249, 2290, 2145, 2045, 1628 + }, + { + 1924, 2444, 2813, 2991, 2986, 2843, 2628, 2452, + 2434, 2498, 2306, 1709, 1257, 1437, 1788, 1893, + 1862, 1859, 1900, 1934, 1937, 2067, 2535, 3037, + 2605, 1507, 2993, 4095, 2387, 1241, 1643, 1400, + 1577, 1690, 1700, 1583, 1320, 1297, 897, 4095, + 1859, 4095, 3945, 1699, 4095, 2586, 839, 274, + 2773, 861, 522, 638, 3159, 670, 3569, 3585, + 2275, 2822, 3052, 2773, 1831, 1291, 2065, 1950, + 1808, 1722, 1680, 1706, 1839, 2112, 2552, 3205, + 3077, 2986, 9, 2037, 2278, 2969, 1623, 247, + 814, 3418, 3028, 3659, 3881, 1185, 3474, 610, + 706, 1054, 1511, 1892, 2219, 2487, 2671, 2743, + 2690, 2535, 2346, 2195, 2099, 2027, 1929, 1766, + 1551, 1422, 1955, 3456, 1602, 1469, 1901, 2533, + 2937, 2774, 2129, 1705, 2157, 2768, 2283, 1411, + 1188, 1551, 2052, 2447, 2685, 2751, 2625, 2315, + 1913, 1593, 1500, 1659, 1967, 2259, 2430, 2493, + 2525, 2565, 2554, 2374, 1960, 1424, 1070, 1200, + 1881, 2674, 2940, 2849, 2779, 2370, 1681, 1327, + 1582, 2205, 2654, 2062, 1522, 2701, 2513, 2191, + 1971, 1869, 1866, 1953, 2125, 2366, 2612, 2655, + 1259, 2467, 2051, 1394, 2036, 1824, 2313, 2528, + 2549, 2764, 2979, 100, 3505, 2383, 1098, 570, + 3751, 1455, 1648, 1943, 2152, 2304, 2368, 2476, + 2677, 2783, 2720, 2510, 2188, 1792, 1355, 904, + 494, 1440, 749, 4095, 3212, 2926, 4095, 1520, + 2034, 1383, 1679, 1814, 1792, 1641, 1368, 1075, + 3968, 1321, 4081, 1908, 2868, 2153, 433, 2197, + 2089, 1958, 1946, 1979, 2098, 2196, 2320, 2614, + 2993, 3269, 3108, 2003, 630, 616, 1624, 1690, + 1185, 1322, 1960, 2600, 3081, 3429, 3627, 3562, + 3123, 2349, 1527, 976, 714, 658, 869, 1345 + }, + { + 1978, 2287, 2526, 2669, 2687, 2577, 2388, 2225, + 2197, 2323, 2481, 2505, 2388, 2223, 1976, 1694, + 1507, 1450, 1453, 1439, 1427, 1561, 2010, 2746, + 3403, 3628, 4078, 3807, 2389, 899, 1003, 1447, + 1671, 1739, 1691, 1522, 1184, 554, 648, 3083, + 3818, 3891, 3918, 3834, 3555, 2432, 1470, 767, + 771, 762, 962, 883, 941, 1513, 3249, 4000, + 3729, 3335, 2717, 2321, 2333, 2123, 1688, 1383, + 1269, 1282, 1383, 1574, 1866, 2260, 2766, 3457, + 4095, 3462, 1413, 1042, 1071, 1153, 780, 812, + 1586, 3041, 4083, 3878, 3731, 3467, 2518, 32, + 304, 967, 1415, 1780, 2103, 2382, 2594, 2715, + 2729, 2642, 2496, 2374, 2319, 2292, 2230, 2098, + 1878, 1568, 1256, 1339, 1443, 1902, 2434, 2940, + 3241, 3172, 2728, 2140, 1745, 1611, 1490, 1512, + 1766, 2091, 2349, 2503, 2567, 2543, 2416, 2195, + 1936, 1741, 1692, 1804, 2010, 2210, 2339, 2400, + 2437, 2471, 2465, 2345, 2074, 1728, 1483, 1520, + 1888, 2416, 2792, 2848, 2593, 2085, 1562, 1321, + 1470, 1907, 2449, 2909, 2959, 2629, 2217, 1945, + 1799, 1740, 1744, 1802, 1916, 2092, 2334, 2643, + 2867, 2610, 1676, 1174, 1590, 2542, 2417, 2057, + 2012, 2246, 2772, 2886, 2961, 2174, 1527, 927, + 1176, 1434, 1980, 2292, 2408, 2433, 2521, 2716, + 2869, 2872, 2728, 2479, 2159, 1797, 1417, 1020, + 551, 0, 965, 3313, 4095, 4095, 4036, 1891, + 1026, 1725, 2085, 2203, 2157, 1975, 1642, 1080, + 858, 1439, 3279, 3362, 2978, 2705, 2345, 2051, + 1614, 1552, 1722, 1899, 1989, 2034, 2174, 2497, + 2904, 3160, 3029, 2405, 1550, 993, 950, 1074, + 1350, 1848, 2358, 2732, 2971, 3126, 3193, 3108, + 2807, 2308, 1746, 1299, 1076, 1091, 1304, 1631 + }, + { + 1974, 2482, 2875, 3104, 3130, 2965, 2685, 2444, + 2398, 2432, 1941, 1529, 1311, 1281, 1417, 1638, + 1741, 1802, 1867, 1875, 1834, 1943, 2424, 3078, + 2950, 3018, 3414, 3767, 1893, 292, 1172, 1495, + 1619, 1650, 1618, 1519, 1311, 830, 542, 2902, + 3970, 3585, 3716, 4095, 3246, 2351, 1679, 1158, + 715, 432, 429, 557, 1153, 2006, 2746, 3118, + 3104, 2866, 2619, 2497, 2500, 2536, 2518, 2417, + 2251, 2029, 1729, 1335, 915, 637, 609, 848, + 1492, 2361, 3139, 3618, 3787, 3748, 3570, 3205, + 2516, 1447, 246, 0, 141, 0, 1344, 3608, + 3264, 2852, 2669, 2550, 2442, 2336, 2235, 2148, + 2085, 2047, 2016, 1955, 1850, 1735, 1654, 1631, + 1679, 1810, 2036, 2349, 2723, 2936, 2377, 1778, + 1434, 1578, 2217, 2631, 2160, 1995, 2078, 2414, + 2843, 2278, 1754, 1414, 1251, 1265, 1475, 1865, + 2337, 2726, 2890, 2798, 2540, 2262, 2057, 1923, + 1798, 1655, 1563, 1640, 1947, 2381, 2691, 2628, + 2133, 1456, 1160, 1408, 1536, 2233, 2960, 3266, + 3025, 2384, 1601, 1562, 1834, 1990, 2038, 2014, + 1962, 1916, 1895, 1901, 1924, 1944, 1932, 1833, + 1534, 1899, 2945, 3446, 3179, 2286, 1999, 2217, + 2057, 1587, 814, 1088, 1536, 1786, 1929, 2092, + 2305, 2494, 2576, 2539, 2454, 2421, 2474, 2546, + 2514, 2299, 1938, 1557, 1276, 1131, 1077, 1094, + 1249, 1656, 2360, 3211, 3866, 3997, 3421, 2169, + 772, 1352, 1724, 1879, 1916, 1860, 1692, 1325, + 485, 1603, 3374, 3302, 2657, 2380, 2388, 2362, + 1822, 1674, 1777, 1871, 1880, 1838, 1921, 2255, + 2723, 3033, 2863, 2051, 920, 840, 1432, 1622, + 1483, 1466, 2179, 2729, 3087, 3321, 3428, 3313, + 2880, 2155, 1339, 723, 458, 499, 853, 1398 + }, + { + 2279, 2196, 2046, 1841, 1621, 1468, 1478, 1682, + 1981, 2172, 2058, 1578, 1603, 1950, 2077, 2075, + 2013, 1946, 1898, 1848, 1763, 1631, 1488, 1448, + 1612, 1884, 2125, 2292, 2378, 2372, 2259, 2020, + 1630, 1020, 0, 1267, 2810, 2483, 2166, 2366, + 3306, 2194, 1046, 725, 1498, 1846, 1907, 1695, + 1498, 1747, 2090, 2433, 2596, 2448, 2018, 1500, + 1142, 1098, 1352, 1750, 2108, 2310, 2340, 2238, + 2048, 1801, 1550, 1398, 1482, 1896, 2603, 1967, + 1676, 1600, 1639, 1732, 1835, 1922, 2015, 2173, + 2124, 2066, 1991, 1537, 1367, 1433, 1626, 1856, + 2058, 2186, 2208, 2120, 1947, 1754, 1650, 1828, + 2055, 1266, 1253, 1769, 2332, 2499, 2108, 1342, + 1447, 2148, 2385, 2317, 2024, 1567, 936, 850, + 1389, 2093, 2694, 2927, 2690, 2117, 1485, 1062, + 1250, 1474, 1423, 1730, 2003, 2236, 2408, 2460, + 2333, 2031, 1654, 1353, 1243, 1334, 1540, 1754, + 1927, 2090, 2286, 2487, 2568, 2383, 1892, 1253, + 771, 729, 1201, 1984, 2690, 2961, 2668, 1948, + 1188, 1675, 1847, 1892, 1871, 1789, 1633, 1343, + 592, 1891, 3408, 2563, 2227, 1999, 1802, 1619, + 1456, 1343, 1324, 1459, 1807, 2286, 2475, 2255, + 2021, 1904, 1852, 1813, 1759, 1681, 1589, 1523, + 1555, 1773, 2269, 2057, 1921, 1968, 2072, 2100, + 2003, 1824, 1657, 1561, 1535, 1547, 1591, 1712, + 1955, 2290, 2567, 2580, 2192, 1458, 763, 1698, + 1995, 1819, 1036, 1630, 2202, 2731, 2993, 1909, + 1342, 1142, 1288, 1852, 2834, 1816, 1329, 1438, + 1885, 2275, 2331, 2041, 1606, 1686, 1699, 1684, + 1779, 1942, 2064, 2106, 2069, 1940, 1660, 1087, + 1472, 2026, 2215, 2204, 2118, 1966, 1691, 1679, + 1969, 2028, 1853, 1400, 1193, 1701, 2076, 2258 + }, + { + 2084, 2007, 2033, 2179, 2411, 2617, 2660, 2466, + 2097, 1732, 1555, 1632, 1858, 2024, 1955, 1623, + 1136, 625, 1234, 1712, 2121, 2454, 2702, 2873, + 2976, 3011, 2962, 2795, 2457, 1905, 1840, 2225, + 2377, 2208, 1524, 1695, 2066, 2151, 2080, 1907, + 1634, 1214, 462, 498, 1595, 2495, 3312, 2586, + 2206, 2032, 2016, 2142, 2357, 2511, 2491, 2398, + 2385, 2535, 2903, 2783, 2397, 2106, 1917, 1809, + 1778, 1839, 1977, 2104, 2076, 1772, 1187, 711, + 1265, 1519, 1606, 1578, 1443, 1129, 1080, 2214, + 3585, 4095, 3795, 3636, 3792, 3998, 2811, 1929, + 1447, 1217, 1030, 812, 683, 851, 1401, 2164, + 2767, 2855, 2327, 1433, 643, 374, 758, 1597, + 2511, 3177, 3493, 3554, 3493, 3321, 2894, 2032, + 1194, 1977, 2284, 2397, 2397, 2311, 2145, 1894, + 1549, 1075, 625, 1121, 1481, 1663, 1693, 1674, + 1732, 1935, 2244, 2554, 2771, 2876, 2920, 2957, + 2974, 2899, 2671, 2325, 2013, 1910, 2072, 2352, + 2441, 2048, 1087, 0, 824, 1237, 1469, 1617, + 1714, 1765, 1732, 1478, 1188, 3153, 4095, 4095, + 4095, 4095, 2770, 981, 1235, 1454, 1479, 1428, + 1319, 1132, 794, 25, 829, 2188, 2980, 3127, + 2836, 2442, 2205, 2192, 2294, 2361, 2327, 2242, + 2205, 2259, 2350, 2372, 2259, 2048, 1854, 1787, + 1878, 2061, 2231, 2314, 2296, 2191, 1991, 1659, + 1187, 672, 673, 528, 1256, 2661, 4095, 3440, + 3037, 2800, 2620, 2461, 2317, 2194, 2102, 2051, + 2043, 2043, 1976, 1822, 1654, 1532, 1474, 1475, + 1527, 1611, 1700, 1786, 1889, 2036, 2231, 2419, + 2501, 2470, 2431, 2455, 2562, 2770, 3156, 4014, + 3029, 1936, 1119, 505, 696, 858, 752, 640, + 1462, 2286, 2867, 3090, 3001, 2745, 2465, 2238 + }, + { + 2258, 2290, 2417, 2658, 2973, 3251, 3352, 3201, + 2860, 2505, 2321, 2374, 2560, 2670, 2531, 2115, + 1533, 918, 1416, 1778, 2070, 2285, 2419, 2481, + 2484, 2428, 2301, 2070, 1683, 1099, 1019, 1408, + 1581, 1450, 821, 1063, 1519, 1701, 1738, 1680, + 1529, 1233, 605, 763, 1977, 2985, 3901, 3262, + 2954, 2837, 2860, 3007, 3224, 3362, 3307, 3161, + 3080, 3146, 3416, 3186, 2682, 2266, 1948, 1710, + 1551, 1488, 1510, 1531, 1408, 1023, 374, 0, + 375, 619, 716, 717, 629, 380, 412, 1642, + 3121, 4054, 3575, 3547, 3836, 4095, 3115, 2355, + 1985, 1857, 1758, 1612, 1539, 1743, 2310, 3072, + 3653, 3701, 3115, 2145, 1264, 891, 1160, 1875, + 2659, 3193, 3376, 3306, 3120, 2831, 2298, 1343, + 426, 1147, 1410, 1497, 1491, 1418, 1284, 1084, + 807, 416, 63, 669, 1147, 1455, 1615, 1727, + 1916, 2244, 2672, 3091, 3406, 3595, 3708, 3795, + 3846, 3786, 3554, 3185, 2831, 2670, 2758, 2948, + 2936, 2432, 1352, 17, 838, 1124, 1232, 1261, + 1248, 1198, 1078, 750, 403, 2327, 4029, 3456, + 3518, 3701, 2009, 284, 617, 927, 1055, 1114, + 1122, 1056, 839, 191, 1111, 2580, 3472, 3709, + 3495, 3163, 2973, 2990, 3104, 3167, 3111, 2988, + 2897, 2881, 2890, 2819, 2605, 2285, 1977, 1794, + 1770, 1840, 1904, 1887, 1779, 1596, 1331, 949, + 441, 0, 0, 0, 537, 1988, 3802, 2902, + 2585, 2443, 2365, 2314, 2281, 2269, 2286, 2340, + 2430, 2519, 2531, 2443, 2327, 2244, 2207, 2214, + 2255, 2312, 2359, 2388, 2421, 2486, 2589, 2678, + 2654, 2515, 2366, 2282, 2284, 2393, 2689, 3468, + 2415, 1266, 411, 0, 0, 127, 46, 0, + 852, 1745, 2408, 2723, 2735, 2585, 2416, 2301 + }, + { + 2185, 2170, 2249, 2442, 2711, 2942, 2998, 2803, + 2420, 2025, 1803, 1822, 1976, 2058, 1894, 1457, + 857, 229, 718, 1076, 1368, 1587, 1730, 1806, + 1827, 1793, 1693, 1493, 1141, 595, 558, 991, + 1213, 1133, 558, 855, 1367, 1607, 1703, 1705, + 1613, 1376, 806, 1021, 2290, 3352, 4095, 3728, + 3467, 3392, 3454, 3636, 3884, 4049, 4017, 3890, + 3822, 3896, 4095, 3941, 3432, 3007, 2675, 2419, + 2238, 2150, 2142, 2130, 1971, 1548, 856, 289, + 769, 966, 1015, 968, 831, 532, 515, 1697, + 3129, 4016, 3493, 3422, 3671, 3972, 2878, 2086, + 1687, 1532, 1411, 1246, 1156, 1348, 1907, 2662, + 3242, 3290, 2708, 1746, 875, 515, 800, 1533, + 2337, 2892, 3098, 3053, 2893, 2630, 2124, 1196, + 307, 1055, 1344, 1457, 1476, 1428, 1316, 1137, + 880, 506, 170, 789, 1280, 1597, 1765, 1883, + 2074, 2404, 2832, 3249, 3559, 3741, 3847, 3925, + 3966, 3894, 3649, 3267, 2899, 2723, 2796, 2972, + 2944, 2425, 1330, 0, 789, 1062, 1158, 1176, + 1153, 1095, 966, 632, 279, 2200, 3899, 3324, + 3385, 3569, 1879, 157, 493, 808, 941, 1006, + 1021, 961, 751, 110, 1038, 2513, 3413, 3656, + 3448, 3122, 2937, 2959, 3077, 3143, 3090, 2969, + 2878, 2864, 2872, 2800, 2584, 2262, 1951, 1765, + 1737, 1804, 1864, 1844, 1732, 1545, 1277, 892, + 383, 0, 0, 0, 479, 1933, 3751, 2856, + 2546, 2411, 2343, 2302, 2281, 2282, 2313, 2383, + 2489, 2596, 2626, 2558, 2462, 2398, 2382, 2409, + 2471, 2548, 2614, 2662, 2712, 2794, 2912, 3014, + 3002, 2872, 2730, 2651, 2655, 2764, 3057, 3829, + 2767, 1607, 736, 79, 241, 388, 280, 179, + 1024, 1882, 2507, 2783, 2752, 2559, 2345, 2185 + } +}; diff --git a/keyboards/planck/keymaps/tehwalris/config.h b/keyboards/planck/keymaps/tehwalris/config.h new file mode 100644 index 000000000000..8bcacb05f377 --- /dev/null +++ b/keyboards/planck/keymaps/tehwalris/config.h @@ -0,0 +1,39 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#ifdef AUDIO_ENABLE + // #define STARTUP_SONG SONG(PLANCK_SOUND) + #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif diff --git a/keyboards/planck/keymaps/tehwalris/keymap.c b/keyboards/planck/keymaps/tehwalris/keymap.c new file mode 100644 index 000000000000..243748cfec77 --- /dev/null +++ b/keyboards/planck/keymaps/tehwalris/keymap.c @@ -0,0 +1,127 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + DVORAK, + OVL_L, // Left overlay + OVL_R, // Right overlay + OVL_C, // Corner overlay + OVL_N, // Number overlay + OVL_F, // F-key overlay +}; + +enum planck_keycodes { + UMLT_A = SAFE_RANGE, + UMLT_O, + UMLT_U, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, OSL(OVL_C), + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT , + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT , + KC_LGUI, MO(OVL_N), KC_LCTL, KC_RCTL, KC_BSPC, MO(OVL_L), MO(OVL_R), KC_SPC, KC_LALT, MO(OVL_F), KC_RALT, KC_RGUI +), + +[OVL_L] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RGHT, _______, + _______, KC_UNDS, KC_MINS, KC_BSLS, KC_SLSH, KC_PLUS, KC_DLR, KC_LEFT, KC_EQL, KC_LCBR, KC_RCBR, _______, + _______, KC_SCLN, _______, _______, _______, _______, _______, _______, KC_GRV, KC_HASH, KC_PIPE, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[OVL_R] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_EXLM, KC_CIRC, KC_QUES, KC_PERC, KC_AMPR, KC_ASTR, _______, + _______, KC_TILD, KC_AT, KC_DOWN, KC_UP, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[OVL_C] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, _______, + _______, UMLT_A, UMLT_O, _______, UMLT_U, _______, _______, KC_HOME, _______, _______, _______, _______, + _______, _______, _______, KC_PGDN, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, KC_DEL, _______, _______, KC_INS, _______, _______, _______, _______ +), + +[OVL_N] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, + _______, KC_PLUS, KC_UNDS, KC_LPRN, KC_RPRN, _______, _______, KC_4, KC_5, KC_6, _______, _______, + _______, KC_ASTR, KC_SLSH, _______, _______, _______, _______, KC_1, KC_2, KC_3, KC_EQL, _______, + _______, _______, _______, _______, _______, _______, _______, KC_0, _______, _______, _______, _______ +), + +[OVL_F] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, KC_F7, KC_F8, KC_F9, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_F4, KC_F5, KC_F6, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_F10, KC_F11, KC_F12, _______, _______ +) + +}; + +static bool is_left_shift_pressed = false; +static bool is_right_shift_pressed = false; + +// This will only work on linux with xkbmap option "compose:prsc" +void press_umlaut_of(uint16_t keycode) { + bool is_shift_pressed = (is_left_shift_pressed || is_right_shift_pressed); + register_code(KC_PRINT_SCREEN); + unregister_code(KC_PRINT_SCREEN); + if (!is_shift_pressed) { + register_code(KC_LSFT); + } + register_code(KC_QUOT); + unregister_code(KC_QUOT); + if (!is_shift_pressed) { + unregister_code(KC_LSFT); + } + register_code(keycode); + unregister_code(keycode); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_LSFT: + is_left_shift_pressed = record->event.pressed; + break; + case KC_RSFT: + is_right_shift_pressed = record->event.pressed; + break; + case UMLT_A: + if (record->event.pressed) { + press_umlaut_of(KC_A); + } + break; + case UMLT_O: + if (record->event.pressed) { + press_umlaut_of(KC_O); + } + break; + case UMLT_U: + if (record->event.pressed) { + press_umlaut_of(KC_U); + } + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/that_canadian/keymap.c b/keyboards/planck/keymaps/that_canadian/keymap.c new file mode 100644 index 000000000000..9f3a415fa33e --- /dev/null +++ b/keyboards/planck/keymaps/that_canadian/keymap.c @@ -0,0 +1,208 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 + +#define _LOWER 2 +#define _RAISE 3 + +#define _FUNCTION 15 +#define _ADJUST 16 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE +}; + +// Defines for task manager and such +#define CALTDEL LCTL(LALT(KC_DEL)) +#define TSKMGR LCTL(LSFT(KC_ESC)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Func | A | S | D | F | G | H | J | K | L | ; | Enter| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | ` | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + MO(_FUNCTION), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + OSM(MOD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, + KC_LCTL, KC_GRV, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | Esc | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | Mute | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | |Lower | Bksp | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_MUTE, _______, KC_PIPE, + _______, _______, _______, _______, _______, KC_BSPC, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | 4 | 5 | 6 | + | F5 | F6 | - | = | [ | ] |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |Enter | 7 | 8 | 9 | - | F11 | F12 |ISO # |ISO / | Mute | | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | , | 0 | . |Lower | Bksp | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, KC_4, KC_5, KC_6, KC_PLUS, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, + KC_ENT, KC_7, KC_8, KC_9, KC_MINS, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_MUTE, _______, KC_BSLS, + _______, KC_COMM, KC_0, KC_DOT, _______, KC_BSPC, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * |Taskmg| | | | | | | | | | |caltde| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | QK_BOOT| + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + TSKMGR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CALTDEL, + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT +), + +/* Function + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | Up | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | Left | Down |Right | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Caps | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_FUNCTION] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user(void) +{ + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user(void) +{ + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif diff --git a/keyboards/planck/keymaps/that_canadian/readme.md b/keyboards/planck/keymaps/that_canadian/readme.md new file mode 100644 index 000000000000..267b4f94f8c2 --- /dev/null +++ b/keyboards/planck/keymaps/that_canadian/readme.md @@ -0,0 +1,2 @@ +# That-Canadian personal planck layout + diff --git a/keyboards/planck/keymaps/tk/config.h b/keyboards/planck/keymaps/tk/config.h new file mode 100644 index 000000000000..213d7345b456 --- /dev/null +++ b/keyboards/planck/keymaps/tk/config.h @@ -0,0 +1,64 @@ +/* Copyright 2020 Tushar Khan + * + * 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 . + */ + +#pragma once + +#define ENCODER_RESOLUTION 4 // dependent on rotary encoder + +#define TAP_CODE_DELAY 10 // delay between key press and release on `tapcode(kc)` + +#define TAPPING_TERM 200 // mod tap tap-window + +// oneshot keys -- + +#define ONESHOT_TAP_TOGGLE 25 // taps to toggle a one-shot layer/key persistence + +#define ONESHOT_TIMEOUT 500 // one-shot layer/key timeout + +// dynamic macros -- + +// you can store HALF of this number of keypresses in both macros together +#define DYNAMIC_MACRO_SIZE 256 + +// mouse keys -- + +#define MK_3_SPEED + +// mouse speeds + +// cursor offset per movement +#define MK_C_OFFSET_1 4 +#define MK_C_OFFSET_2 16 + +// time between cursor movements (ms) +#define MK_C_INTERVAL_1 16 // 16 ms = 60 Hz refresh rate +#define MK_C_INTERVAL_2 16 + +// scroll speeds + +// scroll steps per scroll action +#define MK_W_OFFSET_1 1 +#define MK_W_OFFSET_2 4 + +// time between scroll steps (ms) +#define MK_W_INTERVAL_1 16 +#define MK_W_INTERVAL_2 16 + + +// audio -- + +#define AUDIO_CLICKY +#define AUDIO_CLICKY_FREQ_RANDOMNESS 1 diff --git a/keyboards/planck/keymaps/tk/keymap.c b/keyboards/planck/keymaps/tk/keymap.c new file mode 100644 index 000000000000..cb512b73a386 --- /dev/null +++ b/keyboards/planck/keymaps/tk/keymap.c @@ -0,0 +1,691 @@ +/* Copyright 2020 Tushar Khan + * + * 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 QMK_KEYBOARD_H +#include "muse.h" + + +/* + ██████╗ ███████╗███████╗██╗███╗ ██╗██╗████████╗██╗ ██████╗ ███╗ ██╗███████╗ + ██╔══██╗██╔════╝██╔════╝██║████╗ ██║██║╚══██╔══╝██║██╔═══██╗████╗ ██║██╔════╝ + ██║ ██║█████╗ █████╗ ██║██╔██╗ ██║██║ ██║ ██║██║ ██║██╔██╗ ██║███████╗ + ██║ ██║██╔══╝ ██╔══╝ ██║██║╚██╗██║██║ ██║ ██║██║ ██║██║╚██╗██║╚════██║ + ██████╔╝███████╗██║ ██║██║ ╚████║██║ ██║ ██║╚██████╔╝██║ ╚████║███████║ + ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝ +*/ + + +#define LCTL_MASK (get_mods() & MOD_BIT(KC_LCTL)) +#define RCTL_MASK (get_mods() & MOD_BIT(KC_RCTL)) +#define CTL_MASK (LCTL_MASK || RCTL_MASK) +#define LSFT_MASK (get_mods() & MOD_BIT(KC_LSFT)) +#define RSFT_MASK (get_mods() & MOD_BIT(KC_RSFT)) +#define SFT_MASK (LSFT_MASK || RSFT_MASK) +#define LALT_MASK (get_mods() & MOD_BIT(KC_LALT)) +#define RALT_MASK (get_mods() & MOD_BIT(KC_RALT)) +#define ALT_MASK (LALT_MASK || RALT_MASK) + +// Layers + +enum planck_layers { + _BASE, + _LOWER1, + _RAISE1, + _LOWER2, + _RAISE2, + _HYPER, + _ROTOR, +}; + +#define BASE TO(_BASE) +#define HYPER MO(_HYPER) +#define R_MODES MO(_ROTOR) + +#define LOWER1 OSL(_LOWER1) +#define LOWER2 OSL(_LOWER2) +#define RAISE1 OSL(_RAISE1) +#define RAISE2 OSL(_RAISE2) + +// Custom keycodes + +#define CTL_TAB MT(MOD_LCTL, KC_TAB) +#define SH_ESC MT(MOD_LSFT, KC_ESC) +#define SH_QUOT MT(MOD_RSFT, KC_QUOT) + +enum keycodes { + ROTARY = SAFE_RANGE, + PANIC, // backspace on tap, delete on tap with RSHIFT + + // rotary modes + R_VOL, R_MEDIA, R_BRI, R_SC_V, R_SC_H, R_AR_V, R_AR_H, + + // command-line macros + DEL_LN, // [delete line] + EMAIL, // [email address] + PHONE, // [phone number] + GT_CMT, // git commit -m '' + SHEBANG, // #!/usr/bin/env + CHMOD, // chmod 744 *sh + PY_VENV, // source *env*/bin/activate +}; + +// Rotary encoder states + +enum encoder_states { + VOLUME, // volume up/down, toggle mute + MEDIA, // media next/previous, play/pause + BRIGHTNESS, // brightness up/down + SCROLL_V, // scroll up/down, middle click + SCROLL_H, // scroll right/left, middle click + ARROW_V, // arrow up/down + ARROW_H, // arrow left/right +}; + +enum encoder_states rotary_state = VOLUME; + +// Songs + +#ifdef AUDIO_ENABLE +// feedback songs +float confirm_song[][2] = SONG(MARIO_COIN); +float reject_song[][2] = SONG(MARIO_BUMP); + +// dynamic macro songs +float dmacro_recs_song[][2] = SONG(MARIO_CAVE_1); +float dmacro_rece_song[][2] = SONG(MARIO_CAVE_2); +float dmacro_play_song[][2] = SONG(MARIO_PIPE); + +// layer toggle songs +float base_song[][2] = SONG(MARIO_BUMP); +float hyper_song[][2] = SONG(MARIO_POWERUP_BLOCK); +float rotary_song[][2] = SONG(MARIO_POWERUP); +float raise1_song[][2] = SONG(MARIO_POWERUP_BLOCK); +float raise2_song[][2] = SONG(MARIO_POWERUP); +float lower1_song[][2] = SONG(MARIO_POWERUP_BLOCK); +float lower2_song[][2] = SONG(MARIO_POWERUP); + +// shortcut songs +float caps_on_song[][2] = SONG(MARIO_CAVE_1); +float caps_off_song[][2] = SONG(MARIO_CAVE_2); +float save_song[][2] = SONG(MARIO_COIN); +float cut_song[][2] = SONG(MARIO_STOMP); +float copy_song[][2] = SONG(MARIO_STOMP); +float paste_song[][2] = SONG(MARIO_FIREBALL); +float undo_song[][2] = SONG(MARIO_KICK); +float redo_song[][2] = SONG(MARIO_ONEUP); +#endif + + +/* +██╗ ██╗███████╗██╗ ██╗███╗ ███╗ █████╗ ██████╗ ███████╗ +██║ ██╔╝██╔════╝╚██╗ ██╔╝████╗ ████║██╔══██╗██╔══██╗██╔════╝ +█████╔╝ █████╗ ╚████╔╝ ██╔████╔██║███████║██████╔╝███████╗ +██╔═██╗ ██╔══╝ ╚██╔╝ ██║╚██╔╝██║██╔══██║██╔═══╝ ╚════██║ +██║ ██╗███████╗ ██║ ██║ ╚═╝ ██║██║ ██║██║ ███████║ +╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚══════╝ +*/ + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Base + + |-----------------------------------------------------------------------------------------------| + | Rotary| Q | W | E | R | T | Y | U | I | O | P | Panic | + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + | Tab | A | S | D | F | G | H | J | K | L | ; | Enter | + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + | Esc | Z | X | C | V | B | N | M | , | . | / | ' | + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + | HYPER | Caps | Meta | Super | LOWER1| Space | RAISE1|DM1 Ply|DM2 Ply|DM1 Rec|DM2 Rec| + |-----------------------------------------------------------------------------------------------| + + * PANIC: BACKSPACE on tap, DELETE on tap with RSHIFT + * TAB: CTRL on hold + * ESC and ': SHIFT on hold + + */ + + [_BASE] = LAYOUT_planck_grid( + ROTARY, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, PANIC, + CTL_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + SH_ESC, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SH_QUOT, + HYPER, KC_CAPS, KC_LALT, KC_LGUI, LOWER1, KC_SPACE, KC_SPACE, RAISE1, DM_PLY1, DM_PLY2, DM_REC1, DM_REC2 + ), + + /* Hyper - keyboard adjustments and function keys + + |-----------------------------------------------------------------------------------------------| + | ROTARY| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | Reset | + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + |T Audio| F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 |T Music| + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + |T Click| F21 | F22 | F23 | F24 | | | | | | |C Music| + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + | xXx | Wake | Sleep |PrntScr| xXx | BASE | xXx | | | | | + |-----------------------------------------------------------------------------------------------| + + */ + [_HYPER] = LAYOUT_planck_grid( + R_MODES, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, QK_BOOT, + AU_TOGG, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, MU_TOGG, + CK_TOGG, KC_F21, KC_F22, KC_F23, KC_F24, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_NEXT, + XXXXXXX, KC_WAKE, KC_SLEP, KC_PSCR, XXXXXXX, BASE, BASE, XXXXXXX, _______, _______, _______, _______ + ), + + /* Rotary - change rotary encoder mode + + |-----------------------------------------------------------------------------------------------| + | | | | | | | |scrll h|scrll v|scrll v|scrll h| | + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | | | | | | |arrow h|arrow v|arrow v|arrow h| | + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | | | | vol | bright| | media | | | | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | | | | xXx | BASE | xXx | | | | | + |-----------------------------------------------------------------------------------------------| + + */ + [_ROTOR] = LAYOUT_planck_grid( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, R_SC_H, R_SC_V, R_SC_V, R_SC_H, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, R_AR_H, R_AR_V, R_AR_V, R_AR_H, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, R_VOL, R_BRI, XXXXXXX, R_MEDIA, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BASE, BASE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), + + /* Lower I - numbers and brackets + + |-----------------------------------------------------------------------------------------------| + | | 1 | 2 | 3 | $ | * | / | | | | | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | 4 | 5 | 6 | . | + | = | [ | ] | { | } | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | 7 | 8 | 9 | 0 | - | _ | ( | ) | < | > | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | | | | LOWER2| BASE | RAISE1| | | | | + |-----------------------------------------------------------------------------------------------| + + * The following symbols are found on other layers: $ * / + * It is recommended to not primarily use this layer for those symbols + * They are merely on this layer for numerical-typing convenience + + */ + [_LOWER1] = LAYOUT_planck_grid( + _______, KC_1, KC_2, KC_3, KC_DLR, KC_ASTR, KC_SLSH, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_EQL, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______, + _______, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_UNDS, KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, _______, + _______, _______, _______, _______, LOWER2, BASE, BASE, RAISE1, _______, _______, _______, _______ + ), + + /* Lower II - macros + + |-----------------------------------------------------------------------------------------------| + | | | | email | | | | | | | phone | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | | g stat| del ln| | | | | | | | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | CHMOD | | g cmt |py venv| | | | | | | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | | | | xXx | BASE | RAISE1| | | | | + |-----------------------------------------------------------------------------------------------| + + * DO NOT INCLUDE DESTRUCTIVE MACROS + + */ + [_LOWER2] = LAYOUT_planck_grid( + _______, XXXXXXX, XXXXXXX, EMAIL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, PHONE, _______, + _______, XXXXXXX, SHEBANG, DEL_LN, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, CHMOD, XXXXXXX, GT_CMT, PY_VENV, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, _______, _______, _______, XXXXXXX, BASE, BASE, RAISE1, _______, _______, _______, _______ + ), + + /* Raise I - symbols and movement + + |-----------------------------------------------------------------------------------------------| + | | ! | @ | # | | | | S lt | S up | S dn | S rt | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | $ | % | ^ | | | | Left | Down | Up | Right | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | & | * | ( | ) | | | ~ | ` | | | \ | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | | | | LOWER1| BASE | RAISE2| | | | | + |-----------------------------------------------------------------------------------------------| + + * It is not recomended to use the ( ) symbols on this layer + * They are merely here for uniformity + + */ + [_RAISE1] = LAYOUT_planck_grid( + _______, KC_EXLM, KC_AT, KC_HASH, XXXXXXX, XXXXXXX, XXXXXXX, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, _______, + _______, KC_DLR, KC_PERC, KC_CIRC, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, + _______, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, XXXXXXX, XXXXXXX, KC_TILD, KC_GRV, KC_PIPE, KC_BSLS, _______, + _______, _______, _______, _______, LOWER1, BASE, BASE, RAISE2, _______, _______, _______, _______ + ), + + /* Raise II - mouse navigation + + |-----------------------------------------------------------------------------------------------| + | | | | | | | | S lt | S up | S dn | S rt | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | | | | | | | M lt | M dn | M up | M rt | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | | | | | | | L Ck | R ck | Slow | Fast | | + |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + | | | | | LOWER1| BASE | xXx | | | | | + |-----------------------------------------------------------------------------------------------| + + */ + [_RAISE2] = LAYOUT_planck_grid( + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, _______, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BTN1, KC_BTN2, KC_ACL1, KC_ACL2, _______, + _______, _______, _______, _______, LOWER1, BASE, BASE, XXXXXXX, _______, _______, _______, _______ + ), + +}; + + +/* + ██████╗██╗ ██╗███████╗████████╗ ██████╗ ███╗ ███╗ ██╗ ██████╗ ██████╗ ██╗ ██████╗ +██╔════╝██║ ██║██╔════╝╚══██╔══╝██╔═══██╗████╗ ████║ ██║ ██╔═══██╗██╔════╝ ██║██╔════╝ +██║ ██║ ██║███████╗ ██║ ██║ ██║██╔████╔██║ ██║ ██║ ██║██║ ███╗██║██║ +██║ ██║ ██║╚════██║ ██║ ██║ ██║██║╚██╔╝██║ ██║ ██║ ██║██║ ██║██║██║ +╚██████╗╚██████╔╝███████║ ██║ ╚██████╔╝██║ ╚═╝ ██║ ███████╗╚██████╔╝╚██████╔╝██║╚██████╗ + ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ +*/ + + +// Keyboard initialization + +void keyboard_post_init_user(void) { + clicky_off(); +} + +// Dynamic macros + +static bool prerecord_clicky = false; + +void dynamic_macro_record_start_user(int8_t direction) { + prerecord_clicky = is_clicky_on(); + if (!prerecord_clicky) { + clicky_on(); + } + + #ifdef AUDIO_ENABLE + PLAY_SONG(dmacro_recs_song); + #endif +} + +void dynamic_macro_record_end_user(int8_t direction) { + if (!prerecord_clicky) { + clicky_off(); + } + + #ifdef AUDIO_ENABLE + PLAY_SONG(dmacro_rece_song); + #endif +} + +void dynamic_macro_play_user(int8_t direction) { + #ifdef AUDIO_ENABLE + PLAY_SONG(dmacro_play_song); + #endif +} + +// Layers + +layer_state_t layer_state_set_user(layer_state_t state) { + // play layer activation audio + #ifdef AUDIO_ENABLE + switch (get_highest_layer(state)) { + case _BASE: + // enabling base layer song breaks a lot of other songs including + // - macro recording start song + // - rotary feedback songs + + // PLAY_SONG(base_song); + break; + case _HYPER: + PLAY_SONG(hyper_song); + break; + case _ROTOR: + PLAY_SONG(rotary_song); + break; + case _LOWER1: + PLAY_SONG(lower1_song); + break; + case _LOWER2: + PLAY_SONG(lower2_song); + break; + case _RAISE1: + PLAY_SONG(raise1_song); + break; + case _RAISE2: + PLAY_SONG(raise2_song); + break; + default: + break; + } + #endif + + return state; +} + +// Keycode events + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static bool panic_del = false; // PANIC in delete-mode + static bool caps_active = false; + + switch (keycode) { + + /* + ██  ██ ███████ ██  ██  ██████  ██████  ██████  ███████ ███████ + ██  ██  ██       ██  ██  ██      ██    ██ ██   ██ ██      ██ + █████   █████   ████   ██  ██  ██ ██  ██ █████  ███████ + ██  ██  ██      ██   ██  ██  ██ ██  ██ ██          ██ + ██  ██ ███████  ██   ██████  ██████  ██████  ███████ ███████ + */ + + case PANIC: + if (record->event.pressed) { + if (RSFT_MASK) { + unregister_code(KC_RSFT); + register_code(KC_DEL); + panic_del = true; + } + else { + register_code(KC_BACKSPACE); + } + } + else { + if (panic_del) { + register_code(KC_RSFT); + unregister_code(KC_DEL); + panic_del = false; + } + else { + unregister_code(KC_BACKSPACE); + } + } + return false; + case KC_CAPS: + if (record->event.pressed) { + caps_active = !caps_active; + } + break; + + // rotary encoder + + case R_VOL: + if (record->event.pressed) { + rotary_state = VOLUME; + } + break; + case R_MEDIA: + if (record->event.pressed) { + rotary_state = MEDIA; + } + break; + case R_BRI: + if (record->event.pressed) { + rotary_state = BRIGHTNESS; + } + break; + case R_SC_V: + if (record->event.pressed) { + rotary_state = SCROLL_V; + } + break; + case R_SC_H: + if (record->event.pressed) { + rotary_state = SCROLL_H; + } + break; + case R_AR_V: + if (record->event.pressed) { + rotary_state = ARROW_V; + } + break; + case R_AR_H: + if (record->event.pressed) { + rotary_state = ARROW_H; + } + break; + case ROTARY: + if (record->event.pressed) { + if (rotary_state == VOLUME) { + tap_code(KC_MUTE); // toggle mute + } + else if (rotary_state == MEDIA) { + tap_code(KC_MPLY); // play/pause media + } + else if (rotary_state == SCROLL_V || rotary_state == SCROLL_H) { + tap_code(KC_BTN3); // middle mouse button + } + } + return false; + + /* + ███  ███  █████  ██████ ██████  ██████  ███████ + ████  ████ ██   ██ ██      ██   ██ ██    ██ ██ + ██ ████ ██ ███████ ██  ██████  ██  ██ ███████ + ██  ██  ██ ██   ██ ██  ██   ██ ██  ██      ██ + ██      ██ ██  ██  ██████ ██  ██  ██████  ███████ + */ + + case DEL_LN: + if (record->event.pressed) { + tap_code16(LCTL(KC_E)); // go to start of line + tap_code16(LCTL(KC_U)); // clear to beginning of line + } + break; + case EMAIL: + if (record->event.pressed) { + SEND_STRING("email macro not set"); + } + break; + case PHONE: + if (record->event.pressed) { + SEND_STRING("phone macro not set"); + } + break; + case SHEBANG: + if (record->event.pressed) { + SEND_STRING("#!/usr/bin/env "); + } + break; + case CHMOD: + if (record->event.pressed) { + SEND_STRING("chmod 744 *.sh "); + } + break; + case GT_CMT: + if (record->event.pressed) { + SEND_STRING("git commit -m ''"); + tap_code(KC_LEFT); + } + break; + case PY_VENV: + if (record->event.pressed) { + SEND_STRING("source *env*/bin/activate"); + } + break; + }; + + /* + █████  ██  ██ ██████  ██  ██████ + ██   ██ ██  ██ ██   ██ ██ ██    ██ + ███████ ██  ██ ██  ██ ██ ██  ██ + ██   ██ ██  ██ ██  ██ ██ ██  ██ + ██  ██  ██████  ██████  ██  ██████ + */ + + #ifdef AUDIO_ENABLE + if (record->event.pressed) { + switch (keycode) { + case KC_S: // CTRL+S + if (CTL_MASK) { + PLAY_SONG(save_song); + } + break; + case KC_C: // CTRL+C + if (CTL_MASK) { + PLAY_SONG(copy_song); + } + break; + case KC_V: // CTRL+V + if (CTL_MASK) { + PLAY_SONG(paste_song); + } + break; + case KC_X: // CTRL+X + if (CTL_MASK) { + PLAY_SONG(cut_song); + } + break; + case KC_Z: // CTRL+Z + if (CTL_MASK) { + PLAY_SONG(undo_song); + } + break; + case KC_Y: // CTRL+Y + if (CTL_MASK) { + PLAY_SONG(redo_song); + } + break; + case KC_CAPS: + if (caps_active) { + PLAY_SONG(caps_on_song); + } + else { + PLAY_SONG(caps_off_song); + } + break; + + // rotary encoder + + case R_VOL: + case R_MEDIA: + case R_BRI: + case R_SC_V: + case R_SC_H: + case R_AR_V: + case R_AR_H: + PLAY_SONG(confirm_song); + break; + + default: + if (IS_LAYER_ON(_ROTOR)) { + PLAY_SONG(reject_song); + } + }; + } + #endif + + return true; +} + +void post_process_record_user(uint16_t keycode, keyrecord_t *record) { + +} + + +/* +██████╗ ██████╗ ████████╗ █████╗ ██████╗ ██╗ ██╗ ███████╗███╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗██████╗ +██╔══██╗██╔═══██╗╚══██╔══╝██╔══██╗██╔══██╗╚██╗ ██╔╝ ██╔════╝████╗ ██║██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗ +██████╔╝██║ ██║ ██║ ███████║██████╔╝ ╚████╔╝ █████╗ ██╔██╗ ██║██║ ██║ ██║██║ ██║█████╗ ██████╔╝ +██╔══██╗██║ ██║ ██║ ██╔══██║██╔══██╗ ╚██╔╝ ██╔══╝ ██║╚██╗██║██║ ██║ ██║██║ ██║██╔══╝ ██╔══██╗ +██║ ██║╚██████╔╝ ██║ ██║ ██║██║ ██║ ██║ ███████╗██║ ╚████║╚██████╗╚██████╔╝██████╔╝███████╗██║ ██║ +╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ +*/ + + +#ifdef ENCODER_ENABLE +bool encoder_update_user(uint8_t index, bool clockwise) { + static int scroll_interval = 5; + + switch (rotary_state) { + case VOLUME: + if (clockwise) { + tap_code(KC_VOLU); + } + else { + tap_code(KC_VOLD); + } + break; + case MEDIA: + if (clockwise) { + tap_code(KC_MNXT); + } + else { + tap_code(KC_MPRV); + } + break; + case BRIGHTNESS: + if (clockwise) { + tap_code(KC_BRIU); + } + else { + tap_code(KC_BRID); + } + break; + case SCROLL_V: + if (clockwise) { + // tap_code(KC_PGDN); + for (int i=0; i. + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + BACKLIT +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | Up |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | / | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSFT, + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT +), + + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Vol- | Vol+ |Brite-|Brite+| + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_QUOT, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_BRMD, KC_BRMU +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Vol- | Vol+ |Brite-|Brite+| + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_BRMD, KC_BRMU +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + C(G(S(KC_4))), QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL, + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } + return true; +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} + +bool rgb_matrix_indicators_user(void) { + #ifdef RGB_MATRIX_ENABLE + switch (get_highest_layer(layer_state)) { + case _RAISE: + for (int i = 0; i < RGB_MATRIX_LED_COUNT; i++) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { + rgb_matrix_set_color(i, 0x6B, 0x00, 0x80); + } else { + rgb_matrix_set_color(i, 0x00, 0xFF, 0x00); + } + } + break; + + case _LOWER: + for (int i = 0; i < RGB_MATRIX_LED_COUNT; i++) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { + rgb_matrix_set_color(i, 0xFF, 0xA5, 0x00); + } else { + rgb_matrix_set_color(i, 0x00, 0x67, 0xC7); + } + } + break; + + case _ADJUST: + for (int i = 0; i < RGB_MATRIX_LED_COUNT; i++) { + rgb_matrix_set_color(i, 0xFF, 0x99, 0x00); + } + rgb_matrix_set_color(1, 0xFF, 0x00, 0x00); + break; + + default: + break; + } + #endif + return false; +} diff --git a/keyboards/planck/keymaps/tom/readme.md b/keyboards/planck/keymaps/tom/readme.md new file mode 100644 index 000000000000..8326cc13d85b --- /dev/null +++ b/keyboards/planck/keymaps/tom/readme.md @@ -0,0 +1,35 @@ +# tomholford's layout + +This layout is data-driven: I installed [WhatPulse](https://whatpulse.org/) a few months ago and generated a heatmap of the most frequently used keys. I also optimized for my most-used programming languages, and muscle memory. + +## Changes from Default + +### QWERTY + +- swap escape and tab +- rearrange arrows in original layout +- swap rshift and Enter +- map / to original location of left arrow key + +### RAISE + +- move backslash to backspace +- map quote to original location from qwerty layer +- map brightness up / down to original location of left and up arrows +- map volume up / down to original location of down and right arrows + +### LOWER + +- move pipe to backspace +- map quote to original location from qwerty layer +- map brightness up / down to original location of left and up arrows +- map volume up / down to original location of down and right arrows + +### ADJUST + +- map to esc key: screenshot region to clipboard - an alias for ctrl + cmd + shift + 4 + + +## RGB LED + +- Illuminate when pressing RAISE, LOWER, or ADJUST ([source](https://www.reddit.com/r/olkb/comments/8wvk8s/custom_rgb_configuration_by_keycodelayer/)) diff --git a/keyboards/planck/keymaps/tom/rules.mk b/keyboards/planck/keymaps/tom/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/tom/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/tomkonidas/config.h b/keyboards/planck/keymaps/tomkonidas/config.h new file mode 100644 index 000000000000..6e6d0f3ac731 --- /dev/null +++ b/keyboards/planck/keymaps/tomkonidas/config.h @@ -0,0 +1,46 @@ +/* Copyright 2015-2021 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE +# define STARTUP_SONG SONG(PLANCK_SOUND) +// #define STARTUP_SONG SONG(NO_SOUND) + +# define DEFAULT_LAYER_SONGS \ + { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND) } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/tomkonidas/keymap.c b/keyboards/planck/keymaps/tomkonidas/keymap.c new file mode 100644 index 000000000000..9f9464280f44 --- /dev/null +++ b/keyboards/planck/keymaps/tomkonidas/keymap.c @@ -0,0 +1,353 @@ +/* Copyright 2015-2021 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + + +enum planck_layers { + _DVORAK, + _QWERTY, + _COLEMAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + DVORAK = SAFE_RANGE, + QWERTY, + COLEMAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | Brite | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + KC_LCTL, KC_LALT, BACKLIT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | Brite | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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_LCTL, KC_LALT, BACKLIT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | Brite | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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_LCTL, KC_LALT, BACKLIT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * v------------------------RGB CONTROL--------------------v + * ,-----------------------------------------------------------------------------------. + * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | |MUSmod|Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + writePinLow(E6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + writePinHigh(E6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_song); } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_gb_song); } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } + return true; +} + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/tomkonidas/readme.md b/keyboards/planck/keymaps/tomkonidas/readme.md new file mode 100644 index 000000000000..fa62bf8be758 --- /dev/null +++ b/keyboards/planck/keymaps/tomkonidas/readme.md @@ -0,0 +1,101 @@ +# Planck Rev6 Layers + +``` + Dvorak + ,-----------------------------------------------------------------------------------. + | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Esc | A | O | E | U | I | D | H | T | N | S | / | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Ctrl | Alt | Brite | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + `-----------------------------------------------------------------------------------' + +``` + +``` + Qwerty + ,-----------------------------------------------------------------------------------. + | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Esc | A | S | D | F | G | H | J | K | L | ; | " | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Ctrl | Alt | Brite | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + `-----------------------------------------------------------------------------------' + +``` + +``` + Colemak + ,-----------------------------------------------------------------------------------. + | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Esc | A | R | S | T | D | H | N | E | I | O | " | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Ctrl | Alt | Brite | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + `-----------------------------------------------------------------------------------' + +``` + +``` + Lower + ,-----------------------------------------------------------------------------------. + | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | Next | Vol- | Vol+ | Play | + `-----------------------------------------------------------------------------------' + +``` + +``` + Raise + ,-----------------------------------------------------------------------------------. + | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | Next | Vol- | Vol+ | Play | + `-----------------------------------------------------------------------------------' + +``` + + +``` + Adjust (Lower + Raise) + v------------------------RGB CONTROL--------------------v + ,-----------------------------------------------------------------------------------. + | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | |MUSmod|Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + |------+------+------+------+------+------+------+------+------+------+------+------| + | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | | | | | + `-----------------------------------------------------------------------------------' + +``` + +``` + Plover layer (http://opensteno.org) + ,-----------------------------------------------------------------------------------. + | # | # | # | # | # | # | # | # | # | # | # | # | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | S | T | P | H | * | * | F | P | L | T | D | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | S | K | W | R | * | * | R | B | G | S | Z | + |------+------+------+------+------+------+------+------+------+------+------+------| + | Exit | | | A | O | | | E | U | | | | + `-----------------------------------------------------------------------------------' + +``` diff --git a/keyboards/planck/keymaps/tomkonidas/rules.mk b/keyboards/planck/keymaps/tomkonidas/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/tomkonidas/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/tong92/keymap.c b/keyboards/planck/keymaps/tong92/keymap.c new file mode 100644 index 000000000000..52549854413e --- /dev/null +++ b/keyboards/planck/keymaps/tong92/keymap.c @@ -0,0 +1,189 @@ +//Author: tong92 + +#include QMK_KEYBOARD_H + +enum planck_layers { + _WINDOW, + _MAC, + _LOWER, + _RAISE, + _WINDOW_SHORTCUT, + _MAC_SHORTCUT, + _MOUSE +}; + +enum planck_keycodes { + WINDOW = SAFE_RANGE, + MAC, + MOUSE, + BACKLIT, + EXT_MOUSE +}; + +#define LOWER M(1) +#define RAISE M(2) +#define WINDOW_SHORTCUT MO(_WINDOW_SHORTCUT) +#define MAC_SHORTCUT MO(_MAC_SHORTCUT) + +//MIT Layout +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Window - Qwerty +* ,-----------------------------------------------------------------------. +* |Tab | q | w | e | r | t | y | u | i | o | p | BS | +* |-----------------------------------------------------------------------| +* |Ctrl | a | s | d | f | g | h | j | k | l | ; |enter| +* |-----------------------------------------------------------------------| +* |Shift| z | x | c | v | b | n | m | , | . | / |Shift| +* |-----------------------------------------------------------------------| +* | Fn |Ctrl | Win | Alt |Lower| Space |Upper| ' | [ | ] | Alt | +* `-----------------------------------------------------------------------' +*/ +[_WINDOW] = LAYOUT_planck_grid( +KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, +KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_ENT , +KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, +WINDOW_SHORTCUT, KC_RCTL,KC_LGUI,KC_LALT,LOWER,KC_SPC,KC_SPC,RAISE,KC_QUOT,KC_LBRC,KC_RBRC,KC_RALT +), +/* Mac - Qwerty +* ,-----------------------------------------------------------------------. +* |Tab | q | w | e | r | t | y | u | i | o | p | BS | +* |-----------------------------------------------------------------------| +* |LComd| a | s | d | f | g | h | j | k | l | ; |enter| +* |-----------------------------------------------------------------------| +* |Shift| z | x | c | v | b | n | m | , | . | / |Shift| +* |-----------------------------------------------------------------------| +* | Fn |Lang |Ctrl | Alt |Lower| Space |Upper| ' | [ | ] |SPOT | +* `-----------------------------------------------------------------------' +*/ +[_MAC] = LAYOUT_planck_grid( +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_LGUI,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_ENT , +KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, +MAC_SHORTCUT, LCTL(KC_SPC),KC_LCTL,KC_LALT,LOWER,KC_SPC,KC_SPC,RAISE,KC_QUOT,KC_LBRC,KC_RBRC,LGUI(KC_SPC) +), +/* LOWER +* ,-----------------------------------------------------------------------. +* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | BS | +* |-----------------------------------------------------------------------| +* | | F1 | F2 | F3 | F4 | F5 | F6 | - | + | [ | ] | \ | +* |-----------------------------------------------------------------------| +* | | F7 | F8 | F9 | F10 | F11 | F12 | | HOME| PgUp| UP | PgDo| +* |-----------------------------------------------------------------------| +* | | | | | | SPACE | | END | LEFT| DOWN|RIGHT| +* `-----------------------------------------------------------------------' +*/ +[_LOWER] = LAYOUT_planck_grid( +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_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS,KC_PLUS,KC_LBRC,KC_RBRC,KC_BSLS , +_______,KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,KC_F12,_______,KC_HOME,KC_PGUP,KC_UP ,KC_PGDN , +XXXXXXX,_______,_______,_______,_______,KC_SPC,KC_SPC,_______,KC_END, KC_LEFT,KC_DOWN,KC_RIGHT +), +/* RAISE +* ,-----------------------------------------------------------------------. +* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | BS | +* |-----------------------------------------------------------------------| +* | | F1 | F2 | F3 | F4 | F5 | F6 | _ | = | { | } | | | +* |-----------------------------------------------------------------------| +* | | F7 | F8 | F9 | F10 | F11 | F12 | | HOME| PgUp| UP | PgDo| +* |-----------------------------------------------------------------------| +* | | | | | | SPACE | | END | LEFT| DOWN|RIGHT| +* `-----------------------------------------------------------------------' +*/ +[_RAISE] = LAYOUT_planck_grid( +KC_TILD,KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_BSPC , +_______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS,KC_EQL, KC_LCBR,KC_RCBR,KC_PIPE , +_______,KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,KC_HOME,KC_PGUP,KC_UP ,KC_PGDN , +XXXXXXX,_______,_______,_______,_______,KC_SPC, KC_SPC, _______,KC_END, KC_LEFT,KC_DOWN,KC_RIGHT +), +/* Window Shortcut +* ,-----------------------------------------------------------------------. +* | ESC |WinOf|WinUp| | |Sh+Ca| | PgUp| UP | PgDo|PrtSc| DEL | +* |-----------------------------------------------------------------------| +* | |WinLe|WinDo|WinRi| |Al+Ca|CapsL| LEFT| DOWN|RIGHT| | | +* |-----------------------------------------------------------------------| +* | |WinLW|WinRW| | |Ct+Ca|ScroL| HOME| | END | | | +* |-----------------------------------------------------------------------| +* | |DeskL|DeskR|DeskX|Task | ChangeLang| | | | | LED | +* `-----------------------------------------------------------------------' +*/ +[_WINDOW_SHORTCUT] = LAYOUT_planck_grid( +KC_ESC ,LALT(KC_F4) ,LGUI(KC_UP) ,XXXXXXX ,XXXXXXX ,S(KC_CAPS) ,XXXXXXX,KC_PGUP,KC_UP,KC_PGDN,KC_PSCR,KC_DEL, +_______,LGUI(KC_LEFT) ,LGUI(KC_DOWN) ,LGUI(KC_RIGHT) ,XXXXXXX ,LALT(KC_CAPS),KC_CAPS,KC_LEFT,KC_DOWN,KC_RIGHT,XXXXXXX,XXXXXXX, +_______,LGUI(LSFT(KC_LEFT)),LGUI(LSFT(KC_RIGHT)),XXXXXXX ,XXXXXXX ,LCTL(KC_CAPS),KC_SCRL,KC_HOME,XXXXXXX,KC_END,XXXXXXX,XXXXXXX, +KC_TRNS,LGUI(LCTL(KC_LEFT)),LGUI(LCTL(KC_RIGHT)),LGUI(LCTL(KC_F4)),LCTL(LALT(KC_DEL)),LGUI(KC_SPC),LGUI(KC_SPC),XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,BACKLIT +), +/* Mac Shortcut +* ,-----------------------------------------------------------------------. +* | ESC |CmdUp|CmdDo| | | | | PgUp| UP | PgDo|PrtSc| DEL | +* |-----------------------------------------------------------------------| +* | |WBlkL|WBlkR| |ScrF | |CapsL| LEFT| DOWN|RIGHT| | | +* |-----------------------------------------------------------------------| +* | |BlckL|BlckR| | | | | HOME| | END | | | +* |-----------------------------------------------------------------------| +* | | | | | | MOUSE | | | | | LED | +* `-----------------------------------------------------------------------' +*/ +[_MAC_SHORTCUT] = LAYOUT_planck_grid( +KC_ESC ,LGUI(KC_UP) ,LGUI(KC_DOWN) ,XXXXXXX,XXXXXXX ,XXXXXXX,XXXXXXX,KC_PGUP,KC_UP,KC_PGDN,KC_PSCR,KC_DEL, +_______,LALT(LSFT(KC_LEFT)),LALT(LSFT(KC_RIGHT)),XXXXXXX,LGUI(LCTL(KC_F)),XXXXXXX,KC_CAPS,KC_LEFT,KC_DOWN,KC_RIGHT,XXXXXXX,XXXXXXX, +_______,LGUI(LSFT(KC_LEFT)),LGUI(LSFT(KC_RIGHT)),XXXXXXX,XXXXXXX ,XXXXXXX,XXXXXXX,KC_HOME,XXXXXXX,KC_END,XXXXXXX,XXXXXXX, +KC_TRNS,_______ ,_______ ,MOUSE ,MOUSE ,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,BACKLIT +), +/* 10: mouse layer +* ,-----------------------------------------------------------------------. +* | | | |Mo_Up| | | |M_WhL|M_WhU|M_WhR| |QK_BOOT| +* |-----------------------------------------------------------------------| +* | | |Mo_Le|Mo_Do|Mo_Ri| | |M_Bt1|M_WhD|M_Bt2| | | +* |-----------------------------------------------------------------------| +* | | | | | | | |M_AC0|M_AC1|M_AC2| |WINDO| +* |-----------------------------------------------------------------------| +* | | | | | | GO_DEFT | | | | | MAC | +* `-----------------------------------------------------------------------' +*/ +[_MOUSE] = LAYOUT_planck_grid( +XXXXXXX,XXXXXXX,XXXXXXX,KC_MS_U,XXXXXXX,XXXXXXX,XXXXXXX,KC_WH_L,KC_WH_U,KC_WH_R,XXXXXXX,QK_BOOT, +XXXXXXX,XXXXXXX,KC_MS_L,KC_MS_D,KC_MS_R,XXXXXXX,XXXXXXX,KC_BTN1,KC_WH_D,KC_BTN2,XXXXXXX,XXXXXXX, +XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,KC_ACL0,KC_ACL1,KC_ACL2,XXXXXXX,WINDOW, +XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,EXT_MOUSE,EXT_MOUSE,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,MAC +) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case WINDOW: + if (record->event.pressed) { + set_single_persistent_default_layer(_WINDOW); + } + return false; + break; + case MAC: + if (record->event.pressed) { + set_single_persistent_default_layer(_MAC); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } + return false; + break; + case MOUSE: + if (record->event.pressed) { + layer_on(_MOUSE); + } + return false; + break; + case EXT_MOUSE: + if (record->event.pressed) { + layer_off(_MOUSE); + layer_off(_WINDOW_SHORTCUT); + layer_off(_MAC_SHORTCUT); + } + return false; + break; + } + return true; +}; diff --git a/keyboards/planck/keymaps/tong92/readme.md b/keyboards/planck/keymaps/tong92/readme.md new file mode 100644 index 000000000000..328d005f6f51 --- /dev/null +++ b/keyboards/planck/keymaps/tong92/readme.md @@ -0,0 +1,66 @@ +# The Tong92 Layout +- MIT Layout +- my keymap for WIndow User +- Lower && Upper Hold -> Mouse Layer +- Mouse Layer : space -> Default Layer +- No Audio + +## 1. Default Layer - Qwerty + + ,-----------------------------------------------------------------------. + |Tab | q | w | e | r | t | y | u | i | o | p | BS | + |-----------------------------------------------------------------------| + |Ctrl | a | s | d | f | g | h | j | k | l | ; |enter| + |-----------------------------------------------------------------------| + |Shift| z | x | c | v | b | n | m | , | . | / |Shift| + |-----------------------------------------------------------------------| + | Fn |Ctrl | Win | Alt |Lower| Space |Upper| ' | [ | ] | Alt | + `-----------------------------------------------------------------------' + +## 2. Lower Layer + + ,-----------------------------------------------------------------------. + | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | BS | + |-----------------------------------------------------------------------| + | | F1 | F2 | F3 | F4 | F5 | F6 | - | + | [ | ] | \ | + |-----------------------------------------------------------------------| + | | F7 | F8 | F9 | F10 | F11 | F12 | | HOME| PgUp| UP | PgDo| + |-----------------------------------------------------------------------| + | | | | | | SPACE |mouse| END | LEFT| DOWN|RIGHT| + `-----------------------------------------------------------------------' + +## 3. Upper Layer + + ,-----------------------------------------------------------------------. + | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | BS | + |-----------------------------------------------------------------------| + | | F1 | F2 | F3 | F4 | F5 | F6 | _ | = | { | } | | | + |-----------------------------------------------------------------------| + | | F7 | F8 | F9 | F10 | F11 | F12 | | HOME| PgUp| UP | PgDo| + |-----------------------------------------------------------------------| + | | | | |mouse| SPACE | | END | LEFT| DOWN|RIGHT| + `-----------------------------------------------------------------------' + +## 4. Fn Layer - Window Shortcuts + + ,-----------------------------------------------------------------------. + | ESC |WinOf|WinUp| | |Sh+Ca| | PgUp| UP | PgDo|PrtSc| DEL | + |-----------------------------------------------------------------------| + | |WinLe|WinDo|WinRi| |Al+Ca|CapsL| LEFT| DOWN|RIGHT| | | + |-----------------------------------------------------------------------| + | |WinLW|WinRW| | |Ct+Ca|ScroL| HOME| | END | | | + |-----------------------------------------------------------------------| + | |DeskL|DeskR|DeskX|Task | ChangeLang| | | | | LED | + `-----------------------------------------------------------------------' + +## 5. Mouse Layer + + ,-----------------------------------------------------------------------. + | | | |Mo_Up| | | |M_WhL|M_WhU|M_WhR| |RESET| + |-----------------------------------------------------------------------| + | | |Mo_Le|Mo_Do|Mo_Ri| | |M_Bt1|M_WhD|M_Bt2| | | + |-----------------------------------------------------------------------| + | | | | | | | |M_AC0|M_AC1|M_AC2| | | + |-----------------------------------------------------------------------| + | | | | | |GO_DEFAULT | | | | | | + `-----------------------------------------------------------------------' \ No newline at end of file diff --git a/keyboards/planck/keymaps/tong92/rules.mk b/keyboards/planck/keymaps/tong92/rules.mk new file mode 100644 index 000000000000..f836e54d5e76 --- /dev/null +++ b/keyboards/planck/keymaps/tong92/rules.mk @@ -0,0 +1,59 @@ +#---------------------------------------------------------------------------- +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make coff = Convert ELF to AVR COFF. +# +# make extcoff = Convert ELF to AVR Extended COFF. +# +# make program = Download the hex file to the device. +# Please customize your programmer settings(PROGRAM_CMD) +# +# make teensy = Download the hex file to the device, using teensy_loader_cli. +# (must have teensy_loader_cli installed). +# +# make dfu = Download the hex file to the device, using dfu-programmer (must +# have dfu-programmer installed). +# +# make flip = Download the hex file to the device, using Atmel FLIP (must +# have Atmel FLIP installed). +# +# make dfu-ee = Download the eeprom file to the device, using dfu-programmer +# (must have dfu-programmer installed). +# +# make flip-ee = Download the eeprom file to the device, using Atmel FLIP +# (must have Atmel FLIP installed). +# +# make debug = Start either simulavr or avarice as specified for debugging, +# with avr-gdb or avr-insight as the front end for debugging. +# +# make filename.s = Just compile filename.c into the assembler code only. +# +# make filename.i = Create a preprocessed source file for use in submitting +# bug reports to the GCC project. +# +# To rebuild project do "make clean" then "make all". +#---------------------------------------------------------------------------- +# Build Options +# change to "no" to disable the options, or define them in the makefile.mk in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/ttys0/config.h b/keyboards/planck/keymaps/ttys0/config.h new file mode 100644 index 000000000000..2c7d3aeecd5e --- /dev/null +++ b/keyboards/planck/keymaps/ttys0/config.h @@ -0,0 +1,24 @@ +/* Copyright 2021 Sean Johnson + * + * 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 . +*/ + +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(COLEMAK_SOUND) +#endif + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/ttys0/keymap.c b/keyboards/planck/keymaps/ttys0/keymap.c new file mode 100644 index 000000000000..c98cda20be1c --- /dev/null +++ b/keyboards/planck/keymaps/ttys0/keymap.c @@ -0,0 +1,280 @@ +/* Copyright 2021 Sean Johnson + * + * 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 QMK_KEYBOARD_H +#include "muse.h" + +#define a KC_A +#define b KC_B +#define c KC_C +#define d KC_D +#define e KC_E +#define f KC_F +#define g KC_G +#define h KC_H +#define i KC_I +#define j KC_J +#define k KC_K +#define l KC_L +#define m KC_M +#define n KC_N +#define o KC_O +#define p KC_P +#define q KC_Q +#define r KC_R +#define s KC_S +#define t KC_T +#define u KC_U +#define v KC_V +#define w KC_W +#define x KC_X +#define y KC_Y +#define z KC_Z + +#define lopt KC_LALT +#define lctl KC_LCTL +#define lsft KC_LSFT +#define ropt KC_RALT +#define rctl KC_RCTL +#define rsft KC_RSFT + +#define n0 KC_0 +#define n1 KC_1 +#define n2 KC_2 +#define n3 KC_3 +#define n4 KC_4 +#define n5 KC_5 +#define n6 KC_6 +#define n7 KC_7 +#define n8 KC_8 +#define n9 KC_9 + +#define bspc KC_BSPC +#define caps KC_CAPS +#define comm KC_COMM +#define dash A(KC_MINS) +#define scln KC_SCLN +#define slsh KC_SLSH +#define spc KC_SPC +#define tab KC_TAB +#define del KC_DEL +#define dot KC_DOT +#define ent KC_ENT +#define mins KC_MINS +#define quot KC_QUOT +#define esc KC_ESC +#define escg QK_GESC + +#define down KC_DOWN +#define home G(KC_LEFT) +#define end G(KC_RGHT) +#define up KC_UP +#define pgdn KC_PGDN +#define pgup KC_PGUP +#define left KC_LEFT +#define rght KC_RGHT + +#define tabl G(S(KC_LBRC)) +#define tabr G(S(KC_RBRC)) +#define fwd G(KC_RBRC) +#define back G(KC_LBRC) +#define dtl C(KC_LEFT) +#define dtr C(KC_RGHT) +#define slup S(A(KC_UP)) +#define sldn S(A(KC_DOWN)) + +#define f1 KC_F1 +#define f2 KC_F2 +#define f3 KC_F3 +#define f4 KC_F4 +#define f5 KC_F5 +#define f6 KC_F6 +#define f7 KC_F7 +#define f8 KC_F8 +#define f9 KC_F9 +#define f10 KC_F10 +#define f11 KC_F11 +#define f12 KC_F12 +#define f13 KC_F13 +#define f14 KC_F14 +#define f15 KC_F15 +#define f16 KC_F16 +#define f17 KC_F17 +#define f18 KC_F18 +#define f19 KC_F19 +#define f20 KC_F20 + +#define mute KC_MUTE +#define next KC_MNXT +#define play KC_MPLY +#define prev KC_MPRV +#define vold KC_VOLD +#define volu KC_VOLU + +#define symb MO(SYMB) +#define move MO(MOVE) +#define func MO(FUNC) + +#define rset QK_BOOT +#define powr KC_PWR + +#define ____ KC_TRNS +#define xxxx KC_NO + +#define emji LCMD(LCTL(KC_SPC)) +#define hypr OSM(MOD_HYPR) +#define brup KC_BRMU +#define brdn KC_BRMD +#define escf LT(FUNC,KC_ESC) + +enum planck_layers { + BASE, + SYMB, + MOVE, + FUNC, +}; + +enum planck_keycodes { + ampr = SAFE_RANGE, + astr, + at, + bsls, + circ, + dlr, + eql, + exlm, + grv, + hash, + lbrc, + lcbr, + lprn, + perc, + pipe, + plus, + rbrc, + rcbr, + rprn, + tild, + cmd, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = LAYOUT_planck_grid( + tab, q, w, f, p, g, j, l, u, y, scln, mins, + bspc, a, r, s, t, d, h, n, e, i, o, quot, + lsft, z, x, c, v, b, k, m, comm, dot, slsh, rsft, + hypr, lctl, lopt, cmd, move, ent, spc, symb, cmd, ropt, rctl, func + ), + + [SYMB] = LAYOUT_planck_grid( + esc, n7, n5, n3, n1, n9, n8, n0, n2, n4, n6, dash, + bspc, lbrc, lcbr, lprn, hash, pipe, astr, dlr, rprn, rcbr, rbrc, at, + ____, grv, exlm, circ, tild, perc, ampr, plus, mins, eql, bsls, ____, + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ + ), + + [MOVE] = LAYOUT_planck_grid( + esc, xxxx, slup, dtl, dtr, xxxx, xxxx, home, up, end, xxxx, ____, + del, xxxx, sldn, tabl, tabr, xxxx, xxxx, left, down, rght, xxxx, ____, + ____, xxxx, xxxx, back, fwd, xxxx, xxxx, pgdn, pgup, xxxx, xxxx, ____, + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ + ), + + [FUNC] = LAYOUT_planck_grid( + rset, f7, f5, f3, f1, f9, f8, f10, f2, f4, f6, volu, + powr, f17, f15, f13, f11, f19, f18, f20, f12, f14, f16, vold, + brup, ____, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, mute, + brdn, caps, ____, ____, ____, ____, ____, ____, prev, next, play, ____ + ), +}; + + +bool send_string_if_keydown(keyrecord_t *record, const char *s) { + if (record->event.pressed) { + send_string(s); + } + return true; +} + +int cmd_keys_down = 0; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // Override the default auto shifted symbols to use SEND_STRING See + // https://github.com/qmk/qmk_firmware/issues/4072 + case ampr: + return send_string_if_keydown(record, "&"); + case astr: + return send_string_if_keydown(record, "*"); + case at: + return send_string_if_keydown(record, "@"); + case bsls: + return send_string_if_keydown(record, "\\"); + case circ: + return send_string_if_keydown(record, "^"); + case dlr: + return send_string_if_keydown(record, "$"); + case eql: + return send_string_if_keydown(record, "="); + case exlm: + return send_string_if_keydown(record, "!"); + case grv: + return send_string_if_keydown(record, "`"); + case hash: + return send_string_if_keydown(record, "#"); + case lbrc: + return send_string_if_keydown(record, "["); + case lcbr: + return send_string_if_keydown(record, "{"); + case lprn: + return send_string_if_keydown(record, "("); + case perc: + return send_string_if_keydown(record, "%"); + case pipe: + return send_string_if_keydown(record, "|"); + case plus: + return send_string_if_keydown(record, "+"); + case rbrc: + return send_string_if_keydown(record, "]"); + case rcbr: + return send_string_if_keydown(record, "}"); + case rprn: + return send_string_if_keydown(record, ")"); + case tild: + return send_string_if_keydown(record, "~"); + + // cmd + cmd -> cmd + ctl + case cmd: + if (record->event.pressed) { + if (cmd_keys_down == 0) { + register_code(KC_LCMD); + } else { + register_code(KC_LCTL); + } + cmd_keys_down++; + } else { + if (cmd_keys_down == 1) { + unregister_code(KC_LCMD); + } else { + unregister_code(KC_LCTL); + } + cmd_keys_down--; + } + return true; + } + return true; +} + diff --git a/keyboards/planck/keymaps/ttys0/readme.md b/keyboards/planck/keymaps/ttys0/readme.md new file mode 100644 index 000000000000..9684d1042d5d --- /dev/null +++ b/keyboards/planck/keymaps/ttys0/readme.md @@ -0,0 +1,5 @@ +# Sean's Planck Config + +This is basically a copy of the `callum` layout with a few minor adjustments to better fit my style. + +[Keyboard Layout Editor](http://www.keyboard-layout-editor.com/#/gists/7fef3554143712e2317b466c09a73a27) diff --git a/keyboards/planck/keymaps/ttys0/rules.mk b/keyboards/planck/keymaps/ttys0/rules.mk new file mode 100644 index 000000000000..faa09801bec7 --- /dev/null +++ b/keyboards/planck/keymaps/ttys0/rules.mk @@ -0,0 +1,4 @@ +# Make some noise +SRC += muse.c + + diff --git a/keyboards/planck/keymaps/tylerwince/config.h b/keyboards/planck/keymaps/tylerwince/config.h new file mode 100644 index 000000000000..d0fb8680e332 --- /dev/null +++ b/keyboards/planck/keymaps/tylerwince/config.h @@ -0,0 +1,17 @@ +#pragma once + +#ifdef AUDIO_ENABLE +#define STARTUP_SONG SONG(PLANCK_SOUND) +#endif + +#define MIDI_BASIC + +#define ENCODER_RESOLUTION 4 + +/* + Set any config.h overrides for your specific keymap here. + See config.h options at https://docs.qmk.fm/#/config_options?id=the-configh-file +*/ +#define QUICK_TAP_TERM 0 + +#define EECONFIG_RGB_MATRIX (uint32_t *)16 diff --git a/keyboards/planck/keymaps/tylerwince/keymap.c b/keyboards/planck/keymaps/tylerwince/keymap.c new file mode 100644 index 000000000000..5477dab6a18a --- /dev/null +++ b/keyboards/planck/keymaps/tylerwince/keymap.c @@ -0,0 +1,296 @@ +#include QMK_KEYBOARD_H +#include "muse.h" + +enum planck_keycodes { + RGB_SLD = SAFE_RANGE, + TOGGLE_LAYER_COLOR, +}; + +enum planck_layers { + _BASE, + _LOWER, + _RAISE, + _ADJUST, + _LAYER4, +}; + +//Tap Dance Declarations +enum { + TD_SEMI_COLON, +}; + +tap_dance_action_t tap_dance_actions[] = { + [TD_SEMI_COLON] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_COLN), +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_planck_grid( + /* _BASE + * ,-----------------------------------------------------------------------------------. + * | Tab | ' | , | . | P | Y | F | G | C | R | L | / | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |CtlEsc| A | O | E | U | I | D | H | T | N | S | Bksp | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Ctrl | Alt | GUI |LOWER | Shift/Space | RAISE| | | | | + * `-----------------------------------------------------------------------------------' + */ + KC_TAB, KC_QUOTE, KC_COMMA, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLASH, + LCTL_T(KC_ESCAPE), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_BSPC, + _______, TD(TD_SEMI_COLON), KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENTER, + _______, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LSFT_T(KC_SPACE), KC_NO, RAISE, _______, _______, _______, _______ + ), + + [_LOWER] = LAYOUT_planck_grid( + /* _LOWER + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | _ | + | { | } |Delete| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Ctrl | Alt | GUI |LOWER | Shift/Space | RAISE| | [ | ] | | + * `-----------------------------------------------------------------------------------' + */ + KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, + _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_DELETE, + _______, KC_LCTL, KC_LALT, KC_LGUI, _______, _______, KC_NO, _______, _______, KC_LBRC, KC_RBRC, _______ + ), + + [_RAISE] = LAYOUT_planck_grid( + /* _RAISE + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | | | |RIGHT | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | F7 | F8 | F9 | F10 | F11 | F12 | | LEFT | | | |Delete| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | DOWN | UP | | | - | = | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |THINGS|1PASS | | |LOWER | Shift/Space | RAISE| | | | | + * `-----------------------------------------------------------------------------------' + */ + + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, _______, _______, KC_RIGHT, _______, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_LEFT, _______, _______, _______, KC_DELETE, + _______, _______, _______, KC_DOWN, KC_UP, _______, _______, KC_MINUS, KC_EQUAL, _______, _______, _______, + LALT(KC_SPACE), LGUI(KC_BSLS), _______, _______, _______, _______, KC_NO, _______, _______, _______, _______, _______ + ), + + [_ADJUST] = LAYOUT_planck_grid( + /* _LOWER + * ,-----------------------------------------------------------------------------------. + * |Reset | | | | |WIN-TL|WIN-TR| | | |WIN-R | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | |WIN-BL|WIN-BR|WIN-L | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | |WIN-B |WIN-T | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | BASE |LAYER4| | |LOWER | Shift/Space | RAISE|VOL-DN| BR-DN|BR-UP |VOL-UP| + * `-----------------------------------------------------------------------------------' + */ + + QK_BOOT, _______, _______, _______, _______, LALT(LCTL(KC_7)), LALT(LCTL(KC_8)), _______, _______, _______, LALT(LCTL(KC_L)), _______, + _______, _______, _______, _______, _______, LALT(LCTL(KC_U)), LALT(LCTL(KC_I)), LALT(LCTL(KC_H)), _______, _______, _______, _______, + _______, _______, _______, LALT(LCTL(KC_J)), LALT(LCTL(KC_K)), _______, _______, _______, _______, _______, _______, LALT(LCTL(KC_ENTER)), + TO(0), TO(4), _______, _______, _______, _______, KC_NO, _______, KC_AUDIO_VOL_DOWN, KC_F14, KC_F15, KC_AUDIO_VOL_UP + ), + + [_LAYER4] = LAYOUT_planck_grid( + /* _LOWER + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | ' | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |CtlEsc| A | S | D | F | G | H | J | K | L | ; | Bksp | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Ctrl | Alt | GUI |LOWER | Shift/Space | RAISE| | | | | + * `-----------------------------------------------------------------------------------' + */ + + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOTE, + LCTL_T(KC_ESCAPE), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_BSPC, + _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_ENTER, + _______, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LSFT_T(KC_SPACE), KC_NO, RAISE, _______, _______, _______, _______ + ), + +}; + +extern bool g_suspend_state; +extern rgb_config_t rgb_matrix_config; +bool disable_layer_color = 0; + +void keyboard_post_init_user(void) { + rgb_matrix_enable(); +} + +const uint8_t PROGMEM ledmap[][RGB_MATRIX_LED_COUNT][3] = { + [0] = { {32,255,234}, {32,255,234}, {12,225,241}, {12,225,241}, {0,204,255}, {0,204,255}, {169,120,255}, {169,120,255}, {169,120,255}, {146,224,255}, {146,224,255}, {146,224,255}, + {32,255,234}, {32,255,234}, {12,225,241}, {12,225,241}, {0,204,255}, {0,204,255}, {169,120,255}, {169,120,255}, {169,120,255}, {146,224,255}, {146,224,255}, {146,224,255}, + {32,255,234}, {32,255,234}, {12,225,241}, {12,225,241}, {0,204,255}, {0,204,255}, {169,120,255}, {169,120,255}, {169,120,255}, {146,224,255}, {146,224,255}, {146,224,255}, + {32,255,234}, {32,255,234}, {12,225,241}, {12,225,241}, {0,204,255}, {0,0,0}, {169,120,255}, {169,120,255}, {146,224,255}, {146,224,255}, {146,224,255} }, + + [1] = { {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, + {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, + {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, + {0,0,0}, {0,204,255}, {0,204,255}, {0,204,255}, {0,204,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,204,255}, {0,204,255}, {0,0,0} }, + + [2] = { {169,120,255}, {169,120,255}, {169,120,255}, {169,120,255}, {169,120,255}, {169,120,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {169,120,255}, {0,0,0}, + {169,120,255}, {169,120,255}, {169,120,255}, {169,120,255}, {169,120,255}, {169,120,255}, {0,0,0}, {169,120,255}, {0,0,0}, {0,0,0}, {0,0,0}, {169,120,255}, + {0,0,0}, {0,0,0}, {0,0,0}, {169,120,255}, {169,120,255}, {0,0,0}, {0,0,0}, {169,120,255}, {169,120,255}, {0,0,0}, {0,0,0}, {0,0,0}, + {169,120,255}, {169,120,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {169,120,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} }, + + [4] = { {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {105,255,255} }, + +}; + +void set_layer_color(int layer) { + for (int i = 0; i < RGB_MATRIX_LED_COUNT; i++) { + HSV hsv = { + .h = pgm_read_byte(&ledmap[layer][i][0]), + .s = pgm_read_byte(&ledmap[layer][i][1]), + .v = pgm_read_byte(&ledmap[layer][i][2]), + }; + if (!hsv.h && !hsv.s && !hsv.v) { + rgb_matrix_set_color( i, 0, 0, 0 ); + } else { + RGB rgb = hsv_to_rgb( hsv ); + rgb_matrix_set_color( i, rgb.r, rgb.g, rgb.b ); + } + } +} + +bool rgb_matrix_indicators_user(void) { + if (g_suspend_state || disable_layer_color) { return; } + switch (get_highest_layer(layer_state)) { + case 0: + set_layer_color(0); + break; + case 1: + set_layer_color(1); + break; + case 2: + set_layer_color(2); + break; + case 4: + set_layer_color(4); + break; + } + return false; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case RGB_SLD: + if (record->event.pressed) { + rgblight_mode(1); + } + return false; + case RGB_TOG: + if (record->event.pressed) { + if (rgb_matrix_config.val) { + rgb_matrix_sethsv(rgb_matrix_config.hue, rgb_matrix_config.sat, 0); + } else { + rgb_matrix_sethsv(rgb_matrix_config.hue, rgb_matrix_config.sat, 255); + } + } + return false; + case TOGGLE_LAYER_COLOR: + if (record->event.pressed) { + disable_layer_color ^= 1; + } + return false; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } + return true; +} + +void matrix_scan_user(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} +layer_state_t layer_state_set_user(layer_state_t state) { + palClearPad(GPIOB, 8); + palClearPad(GPIOB, 9); + uint8_t layer = get_highest_layer(state); + switch (layer) { + case _LOWER: + palSetPad(GPIOB, 9); + break; + case _RAISE: + palSetPad(GPIOB, 8); + break; + case _ADJUST: + palSetPad(GPIOB, 9); + palSetPad(GPIOB, 8); + break; + default: + break; + } + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} diff --git a/keyboards/planck/keymaps/tylerwince/rules.mk b/keyboards/planck/keymaps/tylerwince/rules.mk new file mode 100644 index 000000000000..2c1585883fbe --- /dev/null +++ b/keyboards/planck/keymaps/tylerwince/rules.mk @@ -0,0 +1,7 @@ +SRC += muse.c +# Set any rules.mk overrides for your specific keymap here. +# See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file +LTO_ENABLE = yes +COMMAND_ENABLE = no +MOUSEKEY_ENABLE = no +TAP_DANCE_ENABLE=yes diff --git a/keyboards/planck/keymaps/unagi/config.h b/keyboards/planck/keymaps/unagi/config.h new file mode 100644 index 000000000000..9b4fb8832357 --- /dev/null +++ b/keyboards/planck/keymaps/unagi/config.h @@ -0,0 +1,38 @@ +#pragma + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(SONIC_RING) + // #define STARTUP_SONG SONG(NO_SOUND) + #define MUSIC_ON_SONG SONG(ZELDA_PUZZLE) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define TAPPING_TERM 200 + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/unagi/keymap.c b/keyboards/planck/keymaps/unagi/keymap.c new file mode 100644 index 000000000000..6227a73e4f0e --- /dev/null +++ b/keyboards/planck/keymaps/unagi/keymap.c @@ -0,0 +1,349 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +// Tap Dance Declarations +enum { + SFT_CAP = 0 +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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, + TD(SFT_CAP), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +tap_dance_action_t tap_dance_actions[] = { + [SFT_CAP] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } + return true; +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/unagi/readme.md b/keyboards/planck/keymaps/unagi/readme.md new file mode 100644 index 000000000000..08477d7ee897 --- /dev/null +++ b/keyboards/planck/keymaps/unagi/readme.md @@ -0,0 +1,8 @@ +# The Unagi Planck Layout + +This layout is a modified version of the default Planck keymap with the following additions: +- Double tap left shift for caps lock +- Hold enter for right shift (enter on-tap) +- "Sonic Ring" startup tone +- "Zelda Puzzle" music tone + diff --git a/keyboards/planck/keymaps/unagi/rules.mk b/keyboards/planck/keymaps/unagi/rules.mk new file mode 100644 index 000000000000..5433b3b68252 --- /dev/null +++ b/keyboards/planck/keymaps/unagi/rules.mk @@ -0,0 +1,2 @@ +SRC += muse.c +TAP_DANCE_ENABLE = yes diff --git a/keyboards/planck/keymaps/vaire/config.h b/keyboards/planck/keymaps/vaire/config.h new file mode 100644 index 000000000000..a5e236e4a9e9 --- /dev/null +++ b/keyboards/planck/keymaps/vaire/config.h @@ -0,0 +1,30 @@ +#pragma once + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MOUSEKEY_INTERVAL 16 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 0 + +#define MIDI_BASIC + +#define BACKLIGHT_BREATHING + + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 diff --git a/keyboards/planck/keymaps/vaire/keymap.c b/keyboards/planck/keymaps/vaire/keymap.c new file mode 100644 index 000000000000..05f7f4a5201e --- /dev/null +++ b/keyboards/planck/keymaps/vaire/keymap.c @@ -0,0 +1,150 @@ +#include QMK_KEYBOARD_H + #include "action_layer.h" + + +extern keymap_config_t keymap_config; + +#define EXCEL_HOME LALT(KC_H) +#define EXCEL_COL LCTL(KC_SPC) +#define EXCEL_ROW LSFT(KC_SPC) +#define DESK_LEFT LCTL(LGUI(KC_LEFT)) +#define WIN_LEFT LSFT(KC_TAB) +#define WIN_CLOSE LALT(KC_F4) +#define WIN_RIGHT KC_TAB +#define DESK_RIGHT LCTL(LGUI(KC_RGHT)) +#define DOCS LGUI(KC_E) +#define SNAP_RIGHT LGUI(KC_RGHT) +#define SNAP_UP LGUI(KC_UP) +#define SNAP_LEFT LGUI(KC_LEFT) +#define SNAP_DOWN LGUI(KC_DOWN) +#define COPY LCTL(KC_C) +#define PASTE LCTL(KC_V) +#define CUT LCTL(KC_X) +#define UNDO LCTL(KC_Z) +#define FIND LCTL(KC_F) + + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + + + LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SFT_T(KC_ENT), + MO(1), KC_LCTL, KC_LALT, KC_LGUI, MO(2), LT(5,KC_ENT), LT(4,KC_SPC), MO(3), KC_SLSH, KC_LEFT, KC_DOWN, CTL_T(KC_RGHT)), + + LAYOUT_planck_grid( + KC_ESC, KC_NUM, LCTL(KC_SPC), KC_UP, LSFT(KC_SPC), KC_DLR, KC_EQL, KC_P7, KC_P8, KC_P9, KC_PPLS, LCTL(KC_BSPC), + KC_TAB, FIND, KC_LEFT, KC_DOWN, KC_RGHT, KC_PERC, KC_CIRC, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_BSLS, + KC_LSFT, UNDO, CUT, COPY, PASTE, EXCEL_HOME, KC_PSCR, KC_P1, KC_P2, KC_P3, KC_PSLS, KC_LSFT, + KC_TRNS, KC_LCTL, KC_LALT, KC_LGUI, TO(1), KC_ENT, KC_SPC, KC_PENT, KC_P0, KC_PDOT, KC_PAST, KC_LCTL), + + LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_EQL, KC_LT, KC_GT, KC_LPRN, + KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE, KC_MPLY, KC_MNXT, KC_PGUP, SFT_T(KC_VOLU), + TO(0), KC_LCTL, KC_LALT, KC_LGUI, KC_TRNS, KC_ENT, KC_SPC, MO(3), KC_PSCR, KC_MPRV, KC_PGDN, CTL_T(KC_VOLD)), + + LAYOUT_planck_grid( + KC_TILD, DESK_LEFT, WIN_LEFT, KC_F4, WIN_RIGHT, DESK_RIGHT, DOCS, SNAP_LEFT, SNAP_UP, SNAP_RIGHT, SNAP_DOWN, KC_DEL, + KC_CAPS, KC_QUOT, KC_LBRC, KC_LCBR, KC_LPRN, KC_BSLS, KC_SLSH, KC_RPRN, KC_RCBR, KC_RBRC, KC_DQUO, KC_QUOT, + KC_PWR, KC_SLEP, KC_WAKE, KC_HOME, BL_BRTG, BL_STEP, KC_TRNS, KC_CALC, KC_LT, KC_GT, KC_COLON, KC_LSFT, + TO(0), KC_LCTL, KC_LALT, KC_LGUI, KC_LALT, KC_LCTL, KC_TRNS, KC_TRNS, AU_TOGG, MU_TOGG, MU_NEXT, LCTL(KC_RGHT)), + + LAYOUT_planck_grid( + TO(0), KC_LSCR, WIN_LEFT, KC_MS_WH_UP, WIN_RIGHT, KC_TRNS, KC_TRNS, KC_MS_BTN1, KC_MS_U, KC_MS_BTN2, KC_TRNS, KC_TRNS, + KC_TRNS, KC_INS, KC_MS_WH_LEFT, KC_MS_WH_DOWN, KC_MS_WH_RIGHT, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, + QK_BOOT, KC_APP, KC_MS_ACCEL0, KC_MS_ACCEL0, KC_MS_ACCEL0, KC_TRNS, KC_TRNS, TO(0), TO(1), TO(2), TO(3), TO(4), + TO(0), KC_MENU, KC_TRNS, KC_TRNS, KC_LALT, KC_LCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RCTL), + + LAYOUT_planck_grid( + KC_BSPC, KC_P, KC_O, KC_I, KC_U, KC_Y, KC_T, KC_R, KC_E, KC_W, KC_Q, KC_BSPC, + KC_TAB, KC_SCLN, KC_L, KC_K, KC_J, KC_H, KC_G, KC_F, KC_D, KC_S, KC_A, KC_QUOT, + KC_LSFT, KC_ENT, KC_DOT, KC_COMM, KC_M, KC_N, KC_B, KC_V, KC_C, KC_X, KC_Z, SFT_T(KC_ENT), + TO(0), KC_LCTL, KC_LALT, KC_LGUI, MO(2), KC_TRNS, KC_TRNS, MO(3), KC_SLSH, KC_LEFT, KC_DOWN, LCTL(KC_RGHT)), + + + +}; + + +#ifdef AUDIO_ENABLE + +void matrix_init_user(void) +{ + set_voice(default_voice); + startup_user(); + println("Matrix Init"); +} + +void led_set_user(uint8_t usb_led) +{ + static uint8_t old_usb_led = 0; + + _delay_ms(10); // gets rid of tick + + if (!is_playing_notes()) + { + if ((usb_led & (1<. + */ + +#include QMK_KEYBOARD_H + +#define LOWER TL_LOWR +#define RAISE TL_UPPR + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [0] = LAYOUT_ortho_4x12 ( + 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, SC_SENT, + KC_NO, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [1] = LAYOUT_ortho_4x12 ( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [2] = LAYOUT_ortho_4x12 ( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + + /* Utility + * ,-----------------------------------------------------------------------------------. + * | |Boot |Debug | | | | | | | | |Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [3] = LAYOUT_ortho_4x12 ( + KC_TRNS, QK_BOOT, DB_TOGG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) + +}; diff --git a/keyboards/planck/keymaps/via/readme.md b/keyboards/planck/keymaps/via/readme.md new file mode 100644 index 000000000000..d859cbf95b8b --- /dev/null +++ b/keyboards/planck/keymaps/via/readme.md @@ -0,0 +1,8 @@ +# VIA QWERTY layout for Planck Rev6 +A heavily simplified version of the Planck Layout that deals with VIA layer limit by stripping out Dvorak, Colemak, and Plover layouts as well as all internal audio, lighting, and mod switching keys. + +Predefined Layers: +- 0 - Default Planck QWERTY keymap (minus lighting control, plus SHIFT ENTER) +- 1 - Default Planck LOWER keymap +- 2 - Default Planck RAISE keymap +- 3 - UTILITY keymap (QK_BOOT, DB_TOGG) diff --git a/keyboards/planck/keymaps/via/rules.mk b/keyboards/planck/keymaps/via/rules.mk new file mode 100644 index 000000000000..d055143e79a9 --- /dev/null +++ b/keyboards/planck/keymaps/via/rules.mk @@ -0,0 +1,5 @@ +VIA_ENABLE = yes +LTO_ENABLE = yes + +# Not enough USB endpoints +CONSOLE_ENABLE = no diff --git a/keyboards/planck/keymaps/vifon/config.h b/keyboards/planck/keymaps/vifon/config.h new file mode 100644 index 000000000000..41cc7245385c --- /dev/null +++ b/keyboards/planck/keymaps/vifon/config.h @@ -0,0 +1,31 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +/* A larger buffer for the dynamic macros as this keymap is not taking + * up that much memory. + */ +#define DYNAMIC_MACRO_SIZE 256 + +#endif diff --git a/keyboards/planck/keymaps/vifon/keymap.c b/keyboards/planck/keymaps/vifon/keymap.c new file mode 100644 index 000000000000..bd82d7b642f6 --- /dev/null +++ b/keyboards/planck/keymaps/vifon/keymap.c @@ -0,0 +1,209 @@ + +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum userlayer { + _QW = 0, + _CM, + _PP, + _PPG, + _NM, + _LW, + _RS, + _DL, + _DYN, +}; + +enum planck_keycodes { + KM_LW = SAFE_RANGE, + KM_RS, + KM_SHLK, /* ShiftLock */ + KM_HOLD, /* Any-key Lock */ + KM_RST, /* Reset */ + KM_NUM, /* Numeric layer */ + KM_SLP, /* Sleep 250 ms */ + KM_PP_GAME, /* Pure Pro Gaming layer */ + KM_PP_HOLD, /* Pure Pro / PP Gaming layer */ + DYNAMIC_MACRO_RANGE, +}; + +#include "dynamic_macro.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = LAYOUT_planck_mit( /* 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, + CTL_T(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, MT(MOD_RSFT, KC_ENT), + KC_LCTL, MO(_DYN), KC_LGUI, KC_LALT, KM_LW, KC_SPC, KM_RS, KC_RALT, KC_DOWN, KC_UP, KC_RCTL + ), + [_CM] = LAYOUT_planck_mit( /* 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, + CTL_T(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, MT(MOD_RSFT, KC_ENT), + KC_LCTL, MO(_DYN), KC_LGUI, KC_LALT, KM_LW, KC_SPC, KM_RS, KC_RALT, KC_DOWN, KC_UP, KC_RCTL + ), + [_PP] = LAYOUT_planck_mit( /* Pure Pro */ + 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_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, MT(MOD_RSFT, KC_DOT), KC_UP, MT(MOD_RCTL, KC_SLSH), + KC_LCTL, MO(_DYN), KC_LGUI, KC_LALT, KM_LW, KC_SPC, KM_RS, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT + ), + [_PPG] = LAYOUT_planck_mit( /* Pure Pro: Gaming */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT, _______, KC_RCTL, + _______, _______, KM_LW, _______, KM_RS, _______, KM_RS , _______, _______, _______, _______ + ), + [_NM] = LAYOUT_planck_mit( /* Numeric */ + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LSFT, _______, _______, _______, _______, _______, _______, _______, KC_COMM, KC_DOT, _______, MT(MOD_RSFT, KC_ENT), + _______, _______, _______, _______, _______, KC_SPC, _______, _______, _______, _______, _______ + ), + [_LW] = LAYOUT_planck_mit( /* LOWER */ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_ESC, LGUI(KC_1), LGUI(KC_2), LGUI(KC_3), LGUI(KC_4), LGUI(KC_5), KM_NUM, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, LGUI(KC_6), LGUI(KC_7), LGUI(KC_8), LGUI(KC_9), LGUI(KC_0), KM_SLP, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_ENT, + _______, BL_TOGG, _______, _______, _______, KC_BTN1, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + [_RS] = LAYOUT_planck_mit( /* RAISE */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), KM_PP_HOLD, KM_RST, KC_ENT, + _______, BL_STEP, _______, _______, _______, KC_BTN2, _______, KC_MPLY, KC_VOLD, KC_VOLU, _______ + ), + [_DL] = LAYOUT_planck_mit( /* DUAL */ + _______, _______, KC_WH_U, KC_MS_U, KC_WH_D, _______, _______, KC_APP, KC_INS, _______, KC_PSCR, _______, + _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_ACL0, KC_ACL2, + _______, _______, KC_BTN2, KC_BTN3, KC_BTN1, KC_WWW_BACK, KC_WWW_FORWARD, KC_MUTE, _______, _______, _______, _______, + _______, _______, KC_LGUI, KC_LALT, _______, _______, _______, _______, _______, _______, _______ + ), + [_DYN] = LAYOUT_planck_mit( /* special */ + KM_HOLD, DM_REC1, DM_PLY1, _______, _______, _______, _______, KC_APP, KC_INS, _______, KC_PSCR, KC_PAUS, + QK_LOCK, DM_REC2, DM_PLY2, _______, _______, _______, _______, _______, _______, KC_CAPS, KC_SCRL, KC_NUM, + KM_SHLK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, KM_PP_GAME, DF(_QW), DF(_PP), _______, _______, _______, _______ + ), +}; + +/* It's a pseudo-layer composed of two real layers, we need a function for this. */ +void enable_gaming_layer(void) { + default_layer_set((1UL << _PP) | (1UL << _PPG)); +#ifdef BACKLIGHT_ENABLE + backlight_toggle(); + _delay_ms(100); + backlight_toggle(); +#endif +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint16_t key_timer; + static uint8_t ignore_up_events = 0; + + uint16_t macro_kc = (keycode == MO(_DYN) ? DM_RSTP : keycode); + if (!process_record_dynamic_macro(macro_kc, record)) { + return false; + } + + if (ignore_up_events > 0 && keycode != MO(_DYN) && keycode != KM_HOLD && !record->event.pressed) { + ignore_up_events -= 1; + return false; + } + + switch (keycode) { + case KM_LW: + if (record->event.pressed) { + layer_on(_LW); + } else { + layer_off(_LW); + } + update_tri_layer(_LW, _RS, _DL); + return false; + break; + case KM_RS: + if (record->event.pressed) { + layer_on(_RS); + } else { + layer_off(_RS); + } + update_tri_layer(_LW, _RS, _DL); + return false; + break; + case KM_SHLK: + register_code(KC_LSFT); + break; + case KM_HOLD: + if (!record->event.pressed) { + ignore_up_events += 1; + } + break; + case KM_RST: + { + /* Make slash available on the PP layer. */ + if ((1UL << _PP) & default_layer_state) { + int32_t old_default_layer_state = default_layer_state; + int32_t old_layer_state = layer_state; + + layer_state = 0; + default_layer_state = (1UL << _QW); + + process_record(record); + + layer_state = old_layer_state; + default_layer_state = old_default_layer_state; + + return false; + } + } + + if (record->event.pressed) { + key_timer = timer_read(); + } else { + if (timer_elapsed(key_timer) >= 500) { + clear_keyboard(); + backlight_toggle(); + _delay_ms(250); + backlight_toggle(); + bootloader_jump(); + } + } + break; + case KM_PP_GAME: + if (!record->event.pressed) { + enable_gaming_layer(); + } + break; + case KM_PP_HOLD: + if (record->event.pressed) { + key_timer = timer_read(); + } else { + if (timer_elapsed(key_timer) >= 250) { + enable_gaming_layer(); + } else { + default_layer_set(1UL << _PP); + } + } + break; + case KM_NUM: + layer_on(_NM); + break; + case KM_SLP: + if (record->event.pressed) { + _delay_ms(250); + } + break; + } + + + if (record->event.pressed + && IS_LAYER_ON(_NM) + && keymap_key_to_keycode(_NM, record->event.key) == KC_TRNS) { + + layer_off(_NM); + } + + return true; +} diff --git a/keyboards/planck/keymaps/vifon/rules.mk b/keyboards/planck/keymaps/vifon/rules.mk new file mode 100644 index 000000000000..8cc3bcfd0cdb --- /dev/null +++ b/keyboards/planck/keymaps/vifon/rules.mk @@ -0,0 +1,23 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +KEY_LOCK_ENABLE = yes + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/planck/keymaps/vxid/config.h b/keyboards/planck/keymaps/vxid/config.h new file mode 100644 index 000000000000..6f70f09beec2 --- /dev/null +++ b/keyboards/planck/keymaps/vxid/config.h @@ -0,0 +1 @@ +#pragma once diff --git a/keyboards/planck/keymaps/vxid/keymap.c b/keyboards/planck/keymaps/vxid/keymap.c new file mode 100644 index 000000000000..82f28667fa98 --- /dev/null +++ b/keyboards/planck/keymaps/vxid/keymap.c @@ -0,0 +1,49 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, + KC_LCTL, KC_LGUI, KC_LALT, LOWER, RAISE, KC_MINS, KC_SPC, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT, KC_GRV +), + +[_LOWER] = LAYOUT_planck_grid( + _______, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, KC_F5, KC_F6, KC_F7, KC_F8, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, + _______, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_RAISE] = LAYOUT_planck_grid( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_ADJUST] = LAYOUT_planck_grid( + QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} diff --git a/keyboards/planck/keymaps/vxid/readme.md b/keyboards/planck/keymaps/vxid/readme.md new file mode 100644 index 000000000000..9e0ae33423bb --- /dev/null +++ b/keyboards/planck/keymaps/vxid/readme.md @@ -0,0 +1,13 @@ +# vxid planck layout + +## Layout + +This planck layout aims at proviging most symbols on the base layer while remaining usable. +The minus and space keys become alt and gui modifiers when pressed. +Arrow keys are located on hjkl on the lower layer. + +## Building + +``` + make planck/rev6:vxid:dfu-util +``` diff --git a/keyboards/planck/keymaps/winternebs/config.h b/keyboards/planck/keymaps/winternebs/config.h new file mode 100755 index 000000000000..4e75e7a6ed4c --- /dev/null +++ b/keyboards/planck/keymaps/winternebs/config.h @@ -0,0 +1,58 @@ +/* Copyright 2020 winterNebs + * + * 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 . + */ + +#pragma once +/* +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif +*/ +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +//#define ENCODER_RESOLUTION 4 + +//Mouse stuff +#define MOUSEKEY_DELAY 60 +#define MOUSEKEY_INTERVAL 8 +#define MOUSEKEY_MAX_SPEED 3 +#define MOUSEKEY_TIME_TO_MAX 0 +#define FORCE_NKRO diff --git a/keyboards/planck/keymaps/winternebs/keymap.c b/keyboards/planck/keymaps/winternebs/keymap.c new file mode 100755 index 000000000000..8b2bb65034a5 --- /dev/null +++ b/keyboards/planck/keymaps/winternebs/keymap.c @@ -0,0 +1,163 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H + + +enum planck_layers { + _QWERTY, + _WORKMAN, + _LOWER, + _ADJUST, +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + WORKMAN, + LOWER, +}; + +#define ADJUST MO(_ADJUST) +//#define LOWER MO(_LOWER) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | | Alt |Lower |Space |Space |Adjust| | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_LCTL, KC_LGUI, _______, KC_LALT, LOWER, KC_SPC, KC_SPC, ADJUST, _______, KC_LEFT, KC_DOWN, KC_RGHT +), +/* Workman + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | D | R | W | B | J | F | U | P | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | H | T | G | Y | N | E | O | I | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | M | C | V | K | L | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | | Alt |Lower |Space | Bksp |Adjust| | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_WORKMAN] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_LCTL, KC_LGUI, _______, KC_LALT, LOWER, KC_SPC, KC_BSPC, ADJUST, _______, KC_LEFT, KC_DOWN, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | |Pg Up | UP |Pg Dn | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | |PrScr | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______ , + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PGUP, KC_UP, KC_PGDN, + _______, _______, KC_PSCR, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Adjust (Lower + Raise) + * ,----------------------------------------------------------------------------------- + * | Boot |Debug | |Aud on|Audoff| | | | | | |Reset | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |QWERTY|WORKMAN| | | Help | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Home | End | VOL+ | Play | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | NKRO | | | | | | | | Prev | VOL- | Next | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + QK_BOOT, DB_TOGG, _______, _______, AU_ON, AU_OFF, _______, _______, _______, _______, _______, _______ , + _______, _______, _______, QWERTY, WORKMAN , _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_END, KC_VOLU, KC_MPLY, + MAGIC_TOGGLE_NKRO, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT +) +}; + + + + +bool held[7][6] = {{false}}; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if(record->event.key.row != 3 && record->event.key.row != 7 ){ + held[record->event.key.row][record->event.key.col] = record->event.pressed; + } + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case WORKMAN: + if (record->event.pressed) { + set_single_persistent_default_layer(_WORKMAN); + } + return false; + break; + case LOWER: + if(record->event.pressed){ + print("registered\n"); + for(int i = 0; i < 7; i++){ + for(int j = 0; j < 6; j++){ + if(held[i][j]){ + tap_code(pgm_read_word(&keymaps[_LOWER][i][j])); + } + } + } + layer_on(_LOWER); + return false; + } + + layer_off(_LOWER); + return false; + break; + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/winternebs/readme.md b/keyboards/planck/keymaps/winternebs/readme.md new file mode 100755 index 000000000000..d2040854ced7 --- /dev/null +++ b/keyboards/planck/keymaps/winternebs/readme.md @@ -0,0 +1 @@ +# winterNebs' Planck keymap diff --git a/keyboards/planck/keymaps/winternebs/rules.mk b/keyboards/planck/keymaps/winternebs/rules.mk new file mode 100755 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/winternebs/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/xjtian/config.h b/keyboards/planck/keymaps/xjtian/config.h new file mode 100644 index 000000000000..b417c13c68e6 --- /dev/null +++ b/keyboards/planck/keymaps/xjtian/config.h @@ -0,0 +1,7 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) +#endif + +#define PERMISSIVE_HOLD diff --git a/keyboards/planck/keymaps/xjtian/keymap.c b/keyboards/planck/keymaps/xjtian/keymap.c new file mode 100644 index 000000000000..c05b6261bed8 --- /dev/null +++ b/keyboards/planck/keymaps/xjtian/keymap.c @@ -0,0 +1,111 @@ +#include QMK_KEYBOARD_H + + +enum planck_layers { + _QWERTY, + _NUM, + _SYMBOL, + _FUNCTION, + _ADJUST +}; + +#define MON MO(_NUM) +#define MOS MO(_SYMBOL) +#define MOF MO(_FUNCTION) +#define MOA MO(_ADJUST) +#define LTS LT(_SYMBOL, KC_ESC) +#define LTN LT(_NUM, KC_ENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,---------------------------------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |-------+------+------+-------+----------+---------+-------+----------+-------+--------+------+-----------| + * |Esc/Ctl| A | S | D | F | G | H | J | K | L | ; | " | + * |-------+------+------+-------+----------+---------+-------+----------+-------+--------+------+-----------| + * | Shift | Z | X | C | V | B | N | M | , | . | / |Enter/Shift| + * |-------+------+------+-------+----------+---------+-------+----------+-------+--------+------+-----------| + * | Ctrl |L(Fn) | Alt | OS |Esc/L(Sym)|Shft/Bksp| Space |Ent/L(Num)|OS/Left|Alt/Down|Ctl/Up| Right | + * `---------------------------------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + CTL_T(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, RSFT_T(KC_ENT), + KC_LCTL, MOF, KC_LALT, KC_LGUI, LTS, SFT_T(KC_BSPC), KC_SPC, LTN, GUI_T(KC_LEFT), ALT_T(KC_DOWN), CTL_T(KC_UP), KC_RGHT +), + + +/* Numbers, calculator + * ,-------------------------------------------------------------------------. + * | | | | | | | | = | - | * | / | Bksp | + * |------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+------| + * | v | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+------| + * | v | | | | | | | | , | . | | v | + * |------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+------| + * | v | v | v | v |L(Ad)| v | v | v | OS | Alt | Ctl | | + * `-------------------------------------------------------------------------' + */ +[_NUM] = LAYOUT_ortho_4x12( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_EQUAL, KC_MINUS, KC_PAST, KC_SLSH, KC_BSPC, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NO, + _______, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_COMM, KC_DOT, KC_NO, _______, + _______, _______, _______, _______, MOA, _______, _______, _______, KC_RGUI, KC_RALT, KC_RCTL, KC_NO +), + +/* Symbols + * ,------------------------------------------------------------------------. + * | ` | ! | @ | # | $ | % | ^ | & | * | - | = | Bksp | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+------| + * | v | | | | { | ( | [ | ] | ) | } | \ | ' | | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+------| + * | v | ~ | | | | | | | | _ | + | v | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+------| + * | v | v | v | v | v | v | v |L(Ad)| OS | Alt | Ctl | | + * `------------------------------------------------------------------------' + */ +[_SYMBOL] = LAYOUT_ortho_4x12( + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_MINS, KC_EQL, KC_BSPC, + _______, KC_NO, KC_PIPE, KC_LCBR, KC_LPRN, KC_LBRC, KC_RBRC, KC_RPRN, KC_RCBR, KC_BSLS, KC_QUOT, KC_NO, + _______, KC_TILD, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_UNDS, KC_PLUS, _______, + _______, _______, _______, _______, _______, _______, _______, MOA, KC_RGUI, KC_RALT, KC_RCTL, KC_NO +), + +/* Function keys + * ,------+------+------+------+------+------+------+------+------+------+------+------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * +------+------+------+------+------+------+------+------+------+------+------+------| + * | v | | | | Home | | | End | | | | | + * +------+------+------+------+------+------+------+------+------+------+------+------| + * | v | | | | | | | | | | | v | + * +------+------+------+------+------+------+------+------+------+------+------+------| + * | v | v | v | v | v | v | v | v | OS | Alt | Ctl | | + * .-----------------------------------------------------------------------------------' + */ +[_FUNCTION] = LAYOUT_ortho_4x12( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, KC_NO, KC_NO, KC_NO, KC_HOME, KC_NO, KC_NO, KC_END, 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_RGUI, KC_RALT, KC_RCTL, KC_NO +), + +/* Adjust (Num + Symbol) + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | Left | Down | Up | Right| | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Rewind| Vol- | Stop | Play | Vol+ | Skip | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |QK_BOOT | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( + 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_MRWD, KC_VOLD, KC_MSTP, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_MRWD, KC_VOLD, KC_MSTP, KC_MPLY, KC_VOLU, KC_MFFD, KC_NO, KC_NO, KC_NO, + QK_BOOT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO +), +}; diff --git a/keyboards/planck/keymaps/xjtian/readme.md b/keyboards/planck/keymaps/xjtian/readme.md new file mode 100644 index 000000000000..f541f0004a85 --- /dev/null +++ b/keyboards/planck/keymaps/xjtian/readme.md @@ -0,0 +1,12 @@ +# Jacky Tian's Planck Layout + +This is a layout for a 4x12 grid layout Planck board with 3 custom layers and +a bare-bones adjust layer. I've kept the layers sparse and tried to keep +symbols close to where they would be on a standard staggered layout when +possible so I don't have to rewire my muscle memory. + +I've generally tried to avoid having to hit the shift key for symbols so +there's some duplication on the symbol layer. To me it's worth it since +I'm using grid layout so I have the extra keys to support this. I find typing +scoping delimiters like brackets and braces is much nicer only having to hit +a single thumb key instead of two thumb keys or thumb + shift. diff --git a/keyboards/planck/keymaps/yhaliaw/config.h b/keyboards/planck/keymaps/yhaliaw/config.h new file mode 100644 index 000000000000..ac241b8a6c77 --- /dev/null +++ b/keyboards/planck/keymaps/yhaliaw/config.h @@ -0,0 +1,29 @@ +/* Copyright 2020 Andrew Liaw + * + * 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE +#define STARTUP_SONG SONG(PLANCK_SOUND) +#endif + +#define RGBLIGHT_LAYERS +#define RGBLIGHT_LED_MAP {8, 2, 3, 7, 6, 5, 4, 0, 1} + +#define MK_COMBINED + +#define LEADER_TIMEOUT 200 +#define LEADER_PER_KEY_TIMING diff --git a/keyboards/planck/keymaps/yhaliaw/keymap.c b/keyboards/planck/keymaps/yhaliaw/keymap.c new file mode 100644 index 000000000000..8931101fefca --- /dev/null +++ b/keyboards/planck/keymaps/yhaliaw/keymap.c @@ -0,0 +1,209 @@ +/* Copyright 2020 Andrew Liaw + * + * 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 QMK_KEYBOARD_H + +enum planck_layers { + _BASE, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum planck_keycodes { + L_RESET = SAFE_RANGE, +}; + +#ifdef AUDIO_ENABLE +float planck_sound[][2] = SONG(PLANCK_SOUND); +#endif + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Base + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Leader| Ctrl | Alt | GUI | Lower| Enter| Space| Raise| GUI | Alt | Ctrl | Del | + * `-----------------------------------------------------------------------------------' + */ + [_BASE] = LAYOUT_planck_grid( + 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_RSFT, + QK_LEAD, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_ENT, KC_SPC, RAISE, KC_RGUI, KC_RALT, KC_RCTL, KC_DEL + ), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | | | | | | Left | Down | Up | Right| | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | Home | End | Pg Up| Pg Dn| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + KC_CAPS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, KC_BSLS, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_END, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | _ | + | { | } | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| Debug| Clear| RGB | HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Aud on|Audoff| Swap | Norm | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Mus on|Musoff| NKRO | 6KRO | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT_planck_grid( + _______, L_RESET, DB_TOGG, EE_CLR, RGB_TOG, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, + _______, XXXXXXX, XXXXXXX, AU_ON, AU_OFF, AG_SWAP, AG_NORM, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, XXXXXXX, XXXXXXX, MU_ON, MU_OFF, NK_ON, NK_OFF, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +const rgblight_segment_t PROGMEM base_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 9, 0, 0, 0}); + +const rgblight_segment_t PROGMEM lower_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 8, HSV_RED}); + +const rgblight_segment_t PROGMEM raise_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 8, HSV_GREEN}); + +const rgblight_segment_t PROGMEM adjust_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 8, HSV_BLUE}); + +const rgblight_segment_t PROGMEM capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS({4, 5, HSV_WHITE}); + +// Later layers take precedence. +const rgblight_segment_t* const PROGMEM rgb_layers[] = RGBLIGHT_LAYERS_LIST( + base_layer, + lower_layer, + raise_layer, + adjust_layer, + capslock_layer +); + +bool audio_disable = false; + +void keyboard_pre_init_user(void) { + // If the audio is off during hardware init, + // it causes problem when the audio is turn on later. + // The workaround is to always set the audio on during hardware init, + // then toggle audio back to the setting. +#ifdef AUDIO_ENABLE + if (!is_audio_on()) { + audio_disable = true; + audio_on(); + } +#endif +} + +void matrix_init_user(void) { + // To fix a audio related problem. See comments in keyboard_pre_init_user(). +#ifdef AUDIO_ENABLE + if (audio_disable) { + audio_off(); + } +#endif +} + +void keyboard_post_init_user(void) { + rgblight_layers = rgb_layers; + rgblight_set_layer_state(0, true); +} + +bool leader_found; + +void leader_end_user(void) { + leader_found = false; + + if (leader_sequence_one_key(L_RESET)) { + leader_found = true; + reset_keyboard(); + } else if (leader_sequence_one_key(KC_DEL)) { + leader_found = true; + layer_clear(); + } else if (leader_sequence_one_key(LOWER)) { + leader_found = true; + layer_on(_LOWER); + } else if (leader_sequence_one_key(RAISE)) { + leader_found = true; + layer_on(_RAISE); + } + + // Plays sound on if leader sequence found. + if (leader_found) { +#ifdef AUDIO_ENABLE + PLAY_SONG(planck_sound); +#endif + } +} + +bool led_update_user(led_t led_state) { + // Turn on RBG for capslock. + rgblight_set_layer_state(4, led_state.caps_lock); + return true; +} + +layer_state_t layer_state_set_user(layer_state_t state) { + // Set RBG layer according to active keymap layer. + rgblight_set_layer_state(1, layer_state_cmp(state, 1)); + rgblight_set_layer_state(2, layer_state_cmp(state, 2)); + rgblight_set_layer_state(3, layer_state_cmp(state, 1) && layer_state_cmp(state, 2)); + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/yhaliaw/readme.md b/keyboards/planck/keymaps/yhaliaw/readme.md new file mode 100644 index 000000000000..a10e54bd935a --- /dev/null +++ b/keyboards/planck/keymaps/yhaliaw/readme.md @@ -0,0 +1,32 @@ +# yhaliaw Planck layout + +The layout for Planck by yhaliaw. + +Developed and tested on Planck Rev 6.1. + +## Features + +Leader sequences can be used to turn on layers without holding the key and reset the layers. +Leader sequences are triggered by key the series of key in quick succession. +See Base layer notes in Layout section. + +Successful leader sequences will play the planck sound if sound is enabled. + +The RGB underglow is linked to the layers and capslock. + +## Keycodes + +Most Keycodes are standard [QMK keycodes](https://docs.qmk.fm/#/keycodes). + +### Custom Keycodes + +The `RESET` key to start the bootloader is access by a leader sequence. +This is done to prevent a mispress. +See Adjust layer notes in Layout section. + +The `Clear` key is used to clear the EEPROM of the keyboard. +This can be seen as resetting the state of the keyboard. +Replug the keyboard to load in the resetted states. + +## Layout +![yhaliaw planck layout](https://i.imgur.com/HvYva64.png) \ No newline at end of file diff --git a/keyboards/planck/keymaps/yhaliaw/rules.mk b/keyboards/planck/keymaps/yhaliaw/rules.mk new file mode 100644 index 000000000000..2c8510c3e0ed --- /dev/null +++ b/keyboards/planck/keymaps/yhaliaw/rules.mk @@ -0,0 +1,5 @@ +LEADER_ENABLE = yes + +RGBLIGHT_ENABLE = yes +ENCODER_ENABLE = no +DIP_SWITCH_ENABLE = no diff --git a/keyboards/planck/keymaps/yttyx/README.md b/keyboards/planck/keymaps/yttyx/README.md new file mode 100644 index 000000000000..963438e3b0f7 --- /dev/null +++ b/keyboards/planck/keymaps/yttyx/README.md @@ -0,0 +1,30 @@ +# Overview + +This layout uses a mirror variant of Balance 12, created by Sasha Viminitz. See [this page](https://mathematicalmulticore.wordpress.com/the-keyboard-layout-project/) +for more information. + +## To build + +``` +make planck/rev6:yttyx +``` + +## To build and flash + +``` +make planck/rev6:yttyx:flash +``` + +## Layers + +### Balance 12 base (BA) layer +![Base layer](https://i.imgur.com/I0TkIHT.png) + +### Numeric/Punctuation (NP) layer +![Numeric/Punctuation layer](https://i.imgur.com/GgZ0PCq.png) + +### Function/Cursor (FC) layer +![Function/Cursor layer](https://i.imgur.com/zcVID2d.png) + +### Plover (PL) layer +![Plover layer](https://i.imgur.com/RikOGXe.png) diff --git a/keyboards/planck/keymaps/yttyx/config.h b/keyboards/planck/keymaps/yttyx/config.h new file mode 100644 index 000000000000..b9e113ec0bb4 --- /dev/null +++ b/keyboards/planck/keymaps/yttyx/config.h @@ -0,0 +1,4 @@ +#pragma once +#define NO_ACTION_ONESHOT +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/keyboards/planck/keymaps/yttyx/keymap.c b/keyboards/planck/keymaps/yttyx/keymap.c new file mode 100644 index 000000000000..1201163ac7d1 --- /dev/null +++ b/keyboards/planck/keymaps/yttyx/keymap.c @@ -0,0 +1,95 @@ + +#include QMK_KEYBOARD_H +#include "keymap_steno.h" + +enum layers { + _BA, // Base (Balance Twelve mirror variant) + _NP, // Numeric/Punctuation + _FC, // Function + _PL // Plover +}; + +// Abbreviations +#define KX_SFT_Z MT(MOD_LSFT, KC_Z) +#define KX_SFT_X MT(MOD_LSFT, KC_X) +#define LT_ESC_FC LT(_FC, KC_ESC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Base + .--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------. + | P | L | C | D | W | | | U | O | Y | K | Q | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | N | R | S | T | M | | BS | A | E | I | H | V | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Z Sft | J | F | G | B | | Ent | ' @ | , < | . > | X Sft | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Ctl | Alt | Sup | NP | Spc | Esc FC | Sft | Sft | Sup | Alt | Ctl | | + '--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------' + */ + [_BA] = LAYOUT_planck_grid( + KC_P, KC_L, KC_C, KC_D, KC_W, XXXXXXX, XXXXXXX, KC_U, KC_O, KC_Y, KC_K, KC_Q, + KC_N, KC_R, KC_S, KC_T, KC_M, XXXXXXX, KC_BSPC, KC_A, KC_E, KC_I, KC_H, KC_V, + KX_SFT_Z, KC_J, KC_F, KC_G, KC_B, XXXXXXX, KC_ENT, KC_QUOT, KC_COMM, KC_DOT, KX_SFT_X, XXXXXXX, + KC_LCTL, KC_LALT, KC_LGUI, MO(_NP), KC_SPC, LT_ESC_FC, KC_LSFT, KC_LSFT, KC_LGUI, KC_LALT, KC_LCTL, XXXXXXX + ), + + /* Numeric/Punctuation (NP) + .--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------. + | 1 ! | 2 " | 3 | 4 $ | 5 % | PL | | 6 ^ | 7 & | 8 * | 9 ( | 0 ) | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Tab | Ctl-X | Ctl-C | Ctl-V | Ctl-Z | | | [ { | ] } | - _ | ; : | \ | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Sft | | | Del | Ins | | | / ? | = + | # ~ | ` | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Ctl | Alt | Sup | NP | Spc | | Sft | Sft | Sup | Alt | Ctl | | + '--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------' + */ + [_NP] = LAYOUT_planck_grid( + KC_1, KC_2, KC_3, KC_4, KC_5, TO(_PL), XXXXXXX, KC_6, KC_7, KC_8, KC_9, KC_0, + KC_TAB, C(KC_X), C(KC_C), C(KC_V), C(KC_Z), XXXXXXX, _______, KC_LBRC, KC_RBRC, KC_MINS, KC_SCLN, KC_NUBS, + KC_LSFT, XXXXXXX, XXXXXXX, KC_DEL, KC_INS, XXXXXXX, XXXXXXX, KC_SLSH, KC_EQL, KC_NUHS, KC_GRV, XXXXXXX, + _______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______, XXXXXXX + ), + + /* Function/Cursor (FC) + .--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------. + | F1 | F2 | F3 | F4 | F5 | | | Home | Up | End | PgUp | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | F6 | F7 | F8 | F9 | F10 | | | Left | Down | Right | PgDn | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Sft | | | F11 | F12 | | | PScr | Break | ScLk | Caps | | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | Ctl | Alt | Sup | | Spc | | Sft | Sft | Sup | Alt | Ctl | | + '--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------' + */ + [_FC] = LAYOUT_planck_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, + KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, + _______, XXXXXXX, XXXXXXX, KC_F11, KC_F12, XXXXXXX, XXXXXXX, KC_PSCR, KC_BRK, KC_SCRL, KC_CAPS, XXXXXXX, + _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, XXXXXXX + ), + + /* Plover (PL) + .--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------. + | # | # | # | # | # | BA | # | # | # | # | # | # | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | S | T | P | H | * | | * | F | P | L | T | D | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | S | K | W | R | * | | * | R | B | G | S | Z | + |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + | | | | A | O | | E | U | | | | | + '--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------' + */ + [_PL] = LAYOUT_planck_grid( + STN_NUM, STN_NUM, STN_NUM, STN_NUM, STN_NUM, TO(_BA), STN_NUM, STN_NUM, STN_NUM, STN_NUM, STN_NUM, STN_NUM, + STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, XXXXXXX, STN_ST1, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, + STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, XXXXXXX, STN_ST2, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, + XXXXXXX, XXXXXXX, XXXXXXX, STN_A, STN_O, XXXXXXX, STN_E, STN_U, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ) + +}; + +void matrix_init_user(void) { + steno_set_mode(STENO_MODE_GEMINI); +} diff --git a/keyboards/planck/keymaps/yttyx/rules.mk b/keyboards/planck/keymaps/yttyx/rules.mk new file mode 100644 index 000000000000..94f6392790d1 --- /dev/null +++ b/keyboards/planck/keymaps/yttyx/rules.mk @@ -0,0 +1,11 @@ +# Build Options +AUDIO_ENABLE = no +CONSOLE_ENABLE = no +EXTRAKEY_ENABLE = no +MIDI_ENABLE = no +MOUSEKEY_ENABLE = no +NKRO_ENABLE = yes +RGBLIGHT_ENABLE = no +STENO_ENABLE = yes +VIRTSER_ENABLE = yes + diff --git a/keyboards/planck/keymaps/zach/config.h b/keyboards/planck/keymaps/zach/config.h new file mode 100644 index 000000000000..c959cb06b50f --- /dev/null +++ b/keyboards/planck/keymaps/zach/config.h @@ -0,0 +1,53 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +#undef LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE +#undef LOCKING_RESYNC_ENABLE + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG +/* disable print */ +//#define NO_PRINT +#undef NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION +//#define DYNAMIC_MACRO_ENABLE // Enable if you need to use the macro functionality +//#define SPACE_CADET // Parenthesis on L/R shift + +#endif diff --git a/keyboards/planck/keymaps/zach/keymap.c b/keyboards/planck/keymaps/zach/keymap.c new file mode 100644 index 000000000000..50da3e3b2a56 --- /dev/null +++ b/keyboards/planck/keymaps/zach/keymap.c @@ -0,0 +1,48 @@ +// Zach Nielsen Custom Planck Keyboard layout +#include QMK_KEYBOARD_H +#define PLANCK_YES // This is the Planck +#include "zach_common_functions.c" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_COLEMAK] = LAYOUT_planck_grid( /* Base Layer */ + KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, KC_BSPC, + KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT, + SHFT_CAP,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + CTRLB, TD(SUP), KC_LALT, KC_LCTL, TD(LOW), KC_SPC, KC_SPC, TD(RAI), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +[_SWCOLE] = LAYOUT_planck_grid( /* Software Colemak */ + _______, CM_Q, CM_W, CM_F, CM_P, CM_G, CM_J, CM_L, CM_U, CM_Y, KC_QUOT, _______, + _______, CM_A, CM_R, CM_S, CM_T, CM_D, CM_H, CM_N, CM_E, CM_I, CM_O, _______, + _______, CM_Z, CM_X, CM_C, CM_V, CM_B, CM_K, CM_M, CM_COMM, CM_DOT, CM_SLSH, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_RAISE] = LAYOUT_planck_grid( /* RAISE - Numpad and Unicode symbols */ + KC_GRV, SUPA2, FACE, DISFACE, SHRUG, PLUMIN, IBANG, KC_7, KC_8, KC_9, KC_COLN, _______, + KC_DEL, DEGREE, MICRO, WOMEGA, OMEGA, PENGY, KC_ENT, KC_4, KC_5, KC_6, KC_SLSH, KC_ASTR, + _______, KC_COLN, TFLIP, LAROW, RAROW, DUCK, KC_SPC, KC_1, KC_2, KC_3, KC_MINS, KC_PLUS, + _______, KC_PIPE, TPUT, _______, _______, KC_TAB, KC_TAB, _______, KC_0, KC_0, KC_DOT, KC_EQL +), + +[_LOWER] = LAYOUT_planck_grid( /* LOWER - Symbols, Paging, CtrAltDel */ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_QUES, KC_DQT, KC_DEL, + KC_DEL, KC_LBRC, KC_RBRC, KC_MINS, KC_UNDS, KC_HOME, KC_END, KC_LPRN, KC_RPRN, KC_SLSH, KC_SCLN, KC_PGUP, + CPYPST, XXXXXXX, C(KC_X), KC_LABK, KC_RABK, XXXXXXX, XXXXXXX, KC_LCBR, KC_RCBR, KC_BSLS, KC_COLN, KC_PGDN, + _______, _______, _______, _______, _______, KC_TAB, KC_TAB, _______, _______, _______, _______, _______ +), + +[_ADJUST] = LAYOUT_planck_grid( /* ADJUST - Macros, Layer Switching, Function Keys */ + UNIWIN, XXXXXXX, XXXXXXX, PENGY, DUCK, KC_INS, KC_NUM, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, + UNILIN, XXXXXXX, XXXXXXX, RANDIG, RANDIG, SWCOLE, COLEMAK, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, + _______, CADKEY, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, + _______, _______, _______, _______, _______, QK_BOOT, QK_BOOT, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +), + +[_UNICODES] = LAYOUT_planck_grid( /* UNICODES - Extra layer for unicode stuff */ + _______, TFLIP, XXXXXXX, XXXXXXX, IBANG, roman7, XXXXXXX, XXXXXXX, ROMAN7, XXXXXXX, XXXXXXX, _______, + KC_DEL, TPUT, FACE, DISFACE, SHRUG, roman4, roman5, roman6, ROMAN4, ROMAN5, ROMAN6, _______, + XXXXXXX, XXXXXXX, XXXXXXX, LAROW, RAROW, roman1, roman2, roman3, ROMAN1, ROMAN2, ROMAN3, XXXXXXX, + _______, _______, _______, _______, _______, KC_SPC, KC_SPC, _______, _______, _______, _______, _______ +) +}; diff --git a/keyboards/planck/keymaps/zach/rules.mk b/keyboards/planck/keymaps/zach/rules.mk new file mode 100644 index 000000000000..544e10a456f0 --- /dev/null +++ b/keyboards/planck/keymaps/zach/rules.mk @@ -0,0 +1,24 @@ +# Zach Planck Makefile +# Max .hex size is about 28636 bytes + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +TAP_DANCE_ENABLE = yes # Enable TapDance functionality +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +#VARIABLE_TRACE = no # Debug changes to variable values +UNICODE_ENABLE = no # Unicode (can't be used with unicodemap) +UNICODEMAP_ENABLE = yes # Enable extended unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/zach/zach_common_functions.c b/keyboards/planck/keymaps/zach/zach_common_functions.c new file mode 100644 index 000000000000..6ad1c7bed337 --- /dev/null +++ b/keyboards/planck/keymaps/zach/zach_common_functions.c @@ -0,0 +1,445 @@ +#ifndef ZACH_COMMON_FUNCTIONS +#define ZACH_COMMON_FUNCTIONS +#include "eeconfig.h" +#include "action_layer.h" +#include "keymap_colemak.h" +extern keymap_config_t keymap_config; + +#undef C +#define C(n) RCTL(n) +#define CADKEY RCTL(RALT(KC_DEL)) + +void tap(uint16_t keycode){ + register_code(keycode); + unregister_code(keycode); +}; + +void persistent_default_layer_set(uint16_t default_layer){ + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +}; + +// Automatic number generation of important keywords +enum my_keycodes{ + // Layer numbers + _COLEMAK = 0, + _SWCOLE, + _RAISE, + _LOWER, + _ADJUST, + _UNICODES, + // These use process_record_user() + COLEMAK = SAFE_RANGE, + SWCOLE, + LOWER, + RAISE, + SHFT_CAP, + CTRLB, + CPYPST, + FACE, + UNIWIN, + UNILIN, + DISFACE, + TFLIP, + TPUT, + SHRUG, + RANDIG, + // Tap_Dance nums + RAI = 0, + LOW, + SUP +}; + +#ifdef AUDIO_ENABLE +#include "audio.h" +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_swcole[][2] = SONG(QWERTY_SOUND); +float tone_capslock_on[][2] = SONG(CAPS_LOCK_ON_SOUND); +float tone_capslock_off[][2] = SONG(CAPS_LOCK_OFF_SOUND); +float tone_ctrl_mod[][2] = SONG(COIN_SOUND); +float tone_copy[][2] = SONG(SCROLL_LOCK_ON_SOUND); +float tone_paste[][2] = SONG(SCROLL_LOCK_OFF_SOUND); +float uniwin[][2] = SONG(UNICODE_WINDOWS); +float unilin[][2] = SONG(UNICODE_LINUX); +#endif + +#ifdef TAP_DANCE_ENABLE +#define TAPPING_TERM 200 + +void dance_raise_press(tap_dance_state_t *state, void *user_data){// Called on each tap + switch(state->count){ // Only turn the layer on once + case 1: + layer_off(_UNICODES); + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + break; + } +}; +void dance_raise_lift(tap_dance_state_t *state, void *user_data){ // Called on release + switch(state->count){ + case 1: // Normal action. Turn off layers + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + layer_off(_UNICODES); + break; + } +}; +///////////////////////////////////////////////////////////////////// +void dance_lower_press(tap_dance_state_t *state, void *user_data){// Called on tap + switch(state->count){ + case 1: // Turn on lower + layer_off(_UNICODES); + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + break; + } +}; +void dance_lower_lift(tap_dance_state_t *state, void *user_data){ // Called on release + switch(state->count){ + case 1: // Normal action. Turn off layers + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + layer_off(_UNICODES); + break; + case 2: // Turn on _UNICODES layer + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + layer_on(_UNICODES); + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_ctrl_mod); + #endif + break; + } +}; +///////////////////////////////////////////////////////////////////// +void dance_super_press(tap_dance_state_t *state, void *user_data){ // Called on down + if(state->count == 1){ + register_code(KC_LGUI); + } +} +void dance_super_done(tap_dance_state_t *state, void *user_data){ // Called on timeout + switch(state->count){ + case 2: + register_code(KC_LGUI); + tap(KC_L); + unregister_code(KC_LGUI); + break; + } +} +void dance_super_lift(tap_dance_state_t *state, void *user_data){ // Called on up + unregister_code(KC_LGUI); +} + +tap_dance_action_t tap_dance_actions[] = { + [RAI] = ACTION_TAP_DANCE_FN_ADVANCED(dance_raise_press, NULL, dance_raise_lift), + [LOW] = ACTION_TAP_DANCE_FN_ADVANCED(dance_lower_press, NULL, dance_lower_lift), + [SUP] = ACTION_TAP_DANCE_FN_ADVANCED(dance_super_press, dance_super_done, dance_super_lift) +}; +#endif + +//#ifdef UNICODE_ENABLE +// Unicode shortcuts +#define IBANG X(0x203D) +#define RAROW X(0x2192) +#define LAROW X(0x2190) +#define DEGREE X(0x00B0) +#define OMEGA X(0x03A9) +#define WOMEGA X(0x03C9) +#define MICRO X(0x00B5) +#define PLUMIN X(0x00B1) +#define SUPA2 X(0x00B2) +#define ROMAN1 X(0x2160) +#define ROMAN2 X(0x2161) +#define ROMAN3 X(0x2162) +#define ROMAN4 X(0x2163) +#define ROMAN5 X(0x2164) +#define ROMAN6 X(0x2165) +#define ROMAN7 X(0x2166) +#define roman1 X(0x2170) +#define roman2 X(0x2171) +#define roman3 X(0x2172) +#define roman4 X(0x2173) +#define roman5 X(0x2174) +#define roman6 X(0x2175) +#define roman7 X(0x2176) + +#ifdef UNICODEMAP_ENABLE // For Unicode characters larger than 0x8000. Send with X() +enum Ext_Unicode{ + PENGUIN = 0, + BOAR, + MONKEY, + DRAGON, + CHICK, + TUMBLER +}; +const uint32_t unicode_map[] PROGMEM = { + [PENGUIN] = 0x1F427, + [BOAR] = 0x1F417, + [MONKEY] = 0x1F412, + [DRAGON] = 0x1F409, + [CHICK] = 0x1F425, + [TUMBLER] = 0x1F943 +}; +#define PENGY X(PENGUIN) +#define BOARY X(BOAR) +#define MNKY X(MONKEY) +#define DRGN X(DRAGON) +#define DUCK X(CHICK) +#define TMBL X(TUMBLER) +#endif + +//#endif + +static uint16_t key_timer; +static uint8_t caps_status = 0; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case COLEMAK: + if(record->event.pressed){ + persistent_default_layer_set(1UL<<_COLEMAK); + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + } + return false; + break; + case SWCOLE: + if(record->event.pressed){ + persistent_default_layer_set(1UL<<_SWCOLE); + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_swcole); + #endif + } + return false; + break; + case RAISE: + if(record->event.pressed){ + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case LOWER: + if(record->event.pressed){ + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case SHFT_CAP: + if(record->event.pressed){ + key_timer = timer_read(); // if the key is being pressed, we start the timer. + register_code(KC_LSFT); + } else { // this means the key was just released (tap or "held down") + if(timer_elapsed(key_timer) < 152){ // Time in ms, the threshold we pick for counting something as a tap. + tap(KC_CAPS); + if(caps_status == 0){ + caps_status = 1; + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_capslock_on); + #endif + } else { + caps_status = 0; + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_capslock_off); + #endif + } + } + unregister_code(KC_LSFT); + } + return false; + break; + case CTRLB: // Control-B on tap (bold) + if(record->event.pressed){ + key_timer = timer_read(); // if the key is being pressed, we start the timer. + register_code(KC_LCTL); + } else { // this means the key was just released (tap or "held down") + if (timer_elapsed(key_timer) < 152) { // Time in ms, the threshold we pick for counting something as a tap. + tap(KC_B); + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_ctrl_mod); + #endif + #ifdef BACKLIGHT_BREATHING + breathing_period_set(2); + breathing_pulse(); + #endif + } + unregister_code(KC_LCTL); + } + return false; + break; + case CPYPST: // One key copy/paste + if(record->event.pressed){ + key_timer = timer_read(); + } else { + if (timer_elapsed(key_timer) > 152) { // Hold, copy + register_code(KC_LCTL); + tap(KC_C); + unregister_code(KC_LCTL); + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_copy); + #endif + } else { // Tap, paste + register_code(KC_LCTL); + tap(KC_V); + unregister_code(KC_LCTL); + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_paste); + #endif + } + } + return false; + break; + #ifdef UNICODE_ENABLE + case UNIWIN: + if(record->event.pressed){ + set_unicode_input_mode(UNICODE_MODE_WINDOWS); + #ifdef AUDIO_ENABLE + PLAY_SONG(uniwin); + #endif + } + return false; + break; + case UNILIN: + if(record->event.pressed){ + set_unicode_input_mode(UNICODE_MODE_LINUX); + #ifdef AUDIO_ENABLE + PLAY_SONG(unilin); + #endif + } + return false; + break; + case DISFACE: // ಠ_ಠ + if(record->event.pressed){ + process_unicode((0x0CA0|QK_UNICODE), record); // Eye + register_code(KC_RSFT); + tap(KC_MINS); + unregister_code(KC_RSFT); + process_unicode((0x0CA0|QK_UNICODE), record); // Eye + } + return false; + break; + case TFLIP: // (╯°□°)╯ ︵ ┻━┻ + if(record->event.pressed){ + register_code(KC_RSFT); + tap(KC_9); + unregister_code(KC_RSFT); + process_unicode((0x256F|QK_UNICODE), record); // Arm + process_unicode((0x00B0|QK_UNICODE), record); // Eye + process_unicode((0x25A1|QK_UNICODE), record); // Mouth + process_unicode((0x00B0|QK_UNICODE), record); // Eye + register_code(KC_RSFT); + tap(KC_0); + unregister_code(KC_RSFT); + process_unicode((0x256F|QK_UNICODE), record); // Arm + tap(KC_SPC); + process_unicode((0x0361|QK_UNICODE), record); // Flippy + tap(KC_SPC); + process_unicode((0x253B|QK_UNICODE), record); // Table + process_unicode((0x2501|QK_UNICODE), record); // Table + process_unicode((0x253B|QK_UNICODE), record); // Table + } + return false; + break; + case TPUT: // ┬──┬ ノ( ゜-゜ノ) + if(record->event.pressed){ + process_unicode((0x252C|QK_UNICODE), record); // Table + process_unicode((0x2500|QK_UNICODE), record); // Table + process_unicode((0x2500|QK_UNICODE), record); // Table + process_unicode((0x252C|QK_UNICODE), record); // Table + tap(KC_SPC); + process_unicode((0x30CE|QK_UNICODE), record); // Arm + register_code(KC_RSFT); + tap(KC_9); + unregister_code(KC_RSFT); + tap(KC_SPC); + process_unicode((0x309C|QK_UNICODE), record); // Eye + tap(KC_MINS); + process_unicode((0x309C|QK_UNICODE), record); // Eye + process_unicode((0x30CE|QK_UNICODE), record); // Arm + register_code(KC_RSFT); + tap(KC_0); + unregister_code(KC_RSFT); + } + return false; + break; + case SHRUG: // ¯\_(ツ)_/¯ + if(record->event.pressed){ + process_unicode((0x00AF|QK_UNICODE), record); // Hand + tap(KC_BSLS); // Arm + register_code(KC_RSFT); + tap(KC_UNDS); // Arm + tap(KC_LPRN); // Head + unregister_code(KC_RSFT); + process_unicode((0x30C4|QK_UNICODE), record); // Face + register_code(KC_RSFT); + tap(KC_RPRN); // Head + tap(KC_UNDS); // Arm + unregister_code(KC_RSFT); + tap(KC_SLSH); // Arm + process_unicode((0x00AF|QK_UNICODE), record); // Hand + } + return false; + break; + #endif + case FACE: // (o_O) + if(record->event.pressed){ + register_code(KC_RSFT); + tap(KC_LPRN); + unregister_code(KC_RSFT); + tap(KC_O); + register_code(KC_RSFT); + tap(KC_UNDS); + tap(KC_O); + tap(KC_RPRN); + unregister_code(KC_RSFT); + } + return false; + break; + case RANDIG: + if (record->event.pressed) { + tap_random_base64(); + } + return false; + break; + } + return true; +}; + +void matrix_init_user(void){ // Run once at startup + #ifdef AUDIO_ENABLE + _delay_ms(50); // gets rid of tick + PLAY_SONG(tone_startup); + #endif +} + +#ifdef AUDIO_ENABLE +void play_goodbye_tone(void){ + PLAY_SONG(tone_goodbye); + _delay_ms(150); +} + +void shutdown_user(void){ + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void){ // Run when the music layer is turned on + PLAY_SONG(tone_startup); +} + +void music_off_user(void){ // Run when music is turned off + PLAY_SONG(tone_goodbye); +} +#endif + +#endif diff --git a/keyboards/planck/light/config.h b/keyboards/planck/light/config.h new file mode 100644 index 000000000000..d4001dd80bc7 --- /dev/null +++ b/keyboards/planck/light/config.h @@ -0,0 +1,71 @@ +#pragma once + +#define AUDIO_PIN C6 +#define AUDIO_PIN_ALT B5 + +#define NO_USB_STARTUP_CHECK + +#define PLANCK_MIT_LAYOUT + +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +// The address will vary depending on your wiring: +// 0b1110100 AD <-> GND +// 0b1110111 AD <-> VCC +// 0b1110101 AD <-> SCL +// 0b1110110 AD <-> SDA +#define DRIVER_ADDR_1 0b1110100 +#define DRIVER_ADDR_2 0b1110110 + +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 25 +#define DRIVER_2_LED_TOTAL 24 +#define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +#define ENABLE_RGB_MATRIX_ALPHAS_MODS +#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_BREATHING +#define ENABLE_RGB_MATRIX_BAND_SAT +#define ENABLE_RGB_MATRIX_BAND_VAL +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#define ENABLE_RGB_MATRIX_CYCLE_ALL +#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +#define ENABLE_RGB_MATRIX_DUAL_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#define ENABLE_RGB_MATRIX_RAINDROPS +#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#define ENABLE_RGB_MATRIX_HUE_BREATHING +#define ENABLE_RGB_MATRIX_HUE_PENDULUM +#define ENABLE_RGB_MATRIX_HUE_WAVE +#define ENABLE_RGB_MATRIX_PIXEL_RAIN +#define ENABLE_RGB_MATRIX_PIXEL_FLOW +#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +#define ENABLE_RGB_MATRIX_TYPING_HEATMAP +#define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#define ENABLE_RGB_MATRIX_SPLASH +#define ENABLE_RGB_MATRIX_MULTISPLASH +#define ENABLE_RGB_MATRIX_SOLID_SPLASH +#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH diff --git a/keyboards/planck/light/info.json b/keyboards/planck/light/info.json new file mode 100644 index 000000000000..64d9fdcd8512 --- /dev/null +++ b/keyboards/planck/light/info.json @@ -0,0 +1,141 @@ +{ + "keyboard_name": "Planck Light", + "manufacturer": "OLKB", + "url": "https://olkb.com/planck", + "maintainer": "jackhumbert", + "usb": { + "vid": "0x03A8", + "pid": "0xBEA2", + "device_version": "0.0.1" + }, + "rgb_matrix": { + "driver": "IS31FL3731" + }, + "matrix_pins": { + "cols": ["E6", "E3", "E4", "D3", "D4", "D5", "C0", "A7", "A6", "E1", "E0", "D7"], + "rows": ["B0", "E7", "F0", "F1"] + }, + "diode_direction": "COL2ROW", + "backlight": { + "pin": "A5" + }, + "processor": "at90usb1286", + "bootloader": "atmel-dfu", + "community_layouts": ["ortho_4x12", "planck_mit"], + "layout_aliases": { + "LAYOUT": "LAYOUT_ortho_4x12", + "LAYOUT_planck_grid": "LAYOUT_ortho_4x12", + "LAYOUT_planck_mit": "LAYOUT_planck_1x2uC" + }, + "layouts": { + "LAYOUT_planck_1x2uC": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [2, 6], "x": 6, "y": 2}, + {"matrix": [2, 7], "x": 7, "y": 2}, + {"matrix": [2, 8], "x": 8, "y": 2}, + {"matrix": [2, 9], "x": 9, "y": 2}, + {"matrix": [2, 10], "x": 10, "y": 2}, + {"matrix": [2, 11], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [3, 4], "x": 4, "y": 3}, + {"matrix": [3, 5], "x": 5, "y": 3, "w": 2}, + {"matrix": [3, 7], "x": 7, "y": 3}, + {"matrix": [3, 8], "x": 8, "y": 3}, + {"matrix": [3, 9], "x": 9, "y": 3}, + {"matrix": [3, 10], "x": 10, "y": 3}, + {"matrix": [3, 11], "x": 11, "y": 3} + ] + }, + "LAYOUT_ortho_4x12": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [2, 6], "x": 6, "y": 2}, + {"matrix": [2, 7], "x": 7, "y": 2}, + {"matrix": [2, 8], "x": 8, "y": 2}, + {"matrix": [2, 9], "x": 9, "y": 2}, + {"matrix": [2, 10], "x": 10, "y": 2}, + {"matrix": [2, 11], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [3, 4], "x": 4, "y": 3}, + {"matrix": [3, 5], "x": 5, "y": 3}, + {"matrix": [3, 6], "x": 6, "y": 3}, + {"matrix": [3, 7], "x": 7, "y": 3}, + {"matrix": [3, 8], "x": 8, "y": 3}, + {"matrix": [3, 9], "x": 9, "y": 3}, + {"matrix": [3, 10], "x": 10, "y": 3}, + {"matrix": [3, 11], "x": 11, "y": 3} + ] + } + } +} diff --git a/keyboards/planck/light/light.c b/keyboards/planck/light/light.c new file mode 100644 index 000000000000..1fc6a65c0c3b --- /dev/null +++ b/keyboards/planck/light/light.c @@ -0,0 +1,149 @@ +/* Copyright 2017 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 . + */ + +#include "quantum.h" + +const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, C1_3, C2_3, C3_3}, + {0, C1_4, C2_4, C3_4}, + {0, C1_5, C2_5, C3_5}, + {0, C1_11, C2_11, C3_11}, + {0, C1_12, C2_12, C3_12}, + {0, C1_13, C2_13, C3_13}, + {1, C1_3, C2_3, C3_3}, + {1, C1_4, C2_4, C3_4}, + {1, C1_5, C2_5, C3_5}, + {1, C1_11, C2_11, C3_11}, + {1, C1_12, C2_12, C3_12}, + {1, C1_13, C2_13, C3_13}, + + {0, C1_6, C2_6, C3_6}, + {0, C1_7, C2_7, C3_7}, + {0, C1_8, C2_8, C3_8}, + {0, C1_14, C2_14, C3_14}, + {0, C1_15, C2_15, C3_15}, + {0, C1_16, C2_16, C3_16}, + {1, C1_6, C2_6, C3_6}, + {1, C1_7, C2_7, C3_7}, + {1, C1_8, C2_8, C3_8}, + {1, C1_14, C2_14, C3_14}, + {1, C1_15, C2_15, C3_15}, + {1, C1_16, C2_16, C3_16}, + + {0, C9_1, C8_1, C7_1}, + {0, C9_2, C8_2, C7_2}, + {0, C9_3, C8_3, C7_3}, + {0, C9_9, C8_9, C7_9}, + {0, C9_10, C8_10, C7_10}, + {0, C9_11, C8_11, C7_11}, + {1, C9_1, C8_1, C7_1}, + {1, C9_2, C8_2, C7_2}, + {1, C9_3, C8_3, C7_3}, + {1, C9_9, C8_9, C7_9}, + {1, C9_10, C8_10, C7_10}, + {1, C9_11, C8_11, C7_11}, + + {0, C9_4, C8_4, C7_4}, + {0, C9_5, C8_5, C7_5}, + {0, C9_6, C8_6, C7_6}, + {0, C9_12, C8_12, C7_12}, + {0, C9_13, C8_13, C7_13}, + {0, C9_14, C8_14, C7_14}, + {0, C9_15, C8_15, C6_14}, // middle 2u switch + {1, C9_4, C8_4, C7_4}, + {1, C9_5, C8_5, C7_5}, + {1, C9_6, C8_6, C7_6}, + {1, C9_12, C8_12, C7_12}, + {1, C9_13, C8_13, C7_13}, + {1, C9_14, C8_14, C7_14} +}; + +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, + { 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 }, + { 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 }, + { 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48 } +}, { + { 0, 0 }, { 20, 0 }, { 40, 0 }, { 61, 0 }, { 81, 0 }, { 101, 0 }, { 122, 0 }, { 142, 0 }, { 162, 0 }, { 183, 0 }, { 203, 0 }, { 223, 0 }, + { 0, 21 }, { 20, 21 }, { 40, 21 }, { 61, 21 }, { 81, 21 }, { 101, 21 }, { 122, 21 }, { 142, 21 }, { 162, 21 }, { 183, 21 }, { 203, 21 }, { 223, 21 }, + { 0, 42 }, { 20, 42 }, { 40, 42 }, { 61, 42 }, { 81, 42 }, { 101, 42 }, { 122, 42 }, { 142, 42 }, { 162, 42 }, { 183, 42 }, { 203, 42 }, { 223, 42 }, + { 0, 63 }, { 20, 63 }, { 40, 63 }, { 61, 63 }, { 81, 63 }, { 101, 63 }, { 111, 63 }, { 122, 63 }, { 142, 63 }, { 162, 63 }, { 183, 63 }, { 203, 63 }, + { 223, 63 } +}, { + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 4, 4, 4, 1, 1, 1, 1, + 1 +} }; + +void matrix_init_kb(void) { + + // Turn status LED on + DDRD |= (1<<6); + PORTD |= (1<<6); + + matrix_init_user(); +} + +uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) { + // Spacebar has 2 leds 41 & 42, so add 42 to the array here, and 41 will be added + // by the default lookup code that runs after this + if (row == 3 && column == 5) { + led_i[0] = 42; + return 1; + } + return 0; +} + +void suspend_power_down_kb(void) +{ + rgb_matrix_set_suspend_state(true); + suspend_power_down_user(); +} + +void suspend_wakeup_init_kb(void) +{ + rgb_matrix_set_suspend_state(false); + suspend_wakeup_init_user(); +} + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, + {{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, + {{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, + {{11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, +}; + +# ifdef ENCODER_MAP_ENABLE +const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0}; +# endif +#endif + +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = { + {36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}, + {24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35}, + {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} +}; diff --git a/keyboards/planck/light/readme.md b/keyboards/planck/light/readme.md new file mode 100644 index 000000000000..f372e1fcc220 --- /dev/null +++ b/keyboards/planck/light/readme.md @@ -0,0 +1,15 @@ +# Planck Light + +![Planck Light](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/planck/light/planck_light.jpg) + +A Planck variant sold by Massdrop. Designed for Kailh PG1350 "Choc" switches, the Planck Light Features per-key RGB backlighting and a dual-channel speaker. [More info on qmk.fm](http://qmk.fm/planck/) + +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: Planck Light +Hardware Availability: [Massdrop](https://www.massdrop.com/buy/massdrop-x-olkb-planck-light-mechanical-keyboard?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make planck/light:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/light/rules.mk b/keyboards/planck/light/rules.mk new file mode 100644 index 000000000000..dbc992922b72 --- /dev/null +++ b/keyboards/planck/light/rules.mk @@ -0,0 +1,16 @@ +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = yes # MIDI support +AUDIO_ENABLE = yes # Audio output +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +RGB_MATRIX_ENABLE = yes + +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/planck.c b/keyboards/planck/planck.c new file mode 100644 index 000000000000..660be55babec --- /dev/null +++ b/keyboards/planck/planck.c @@ -0,0 +1,32 @@ +#include "quantum.h" + +__attribute__ ((weak)) +void matrix_init_kb(void) { + // Turn status LED on, with the exception of THK + #if defined(__AVR_ATmega32U4__) + setPinOutput(E6); + writePinHigh(E6); + #endif + + matrix_init_user(); +} + +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (get_highest_layer(layer_state) > 0) { + if (clockwise) { + tap_code_delay(KC_VOLU, 10); + } else { + tap_code_delay(KC_VOLD, 10); + } + } else { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } + return true; +} +#endif diff --git a/keyboards/planck/readme.md b/keyboards/planck/readme.md new file mode 100644 index 000000000000..797774dc0a15 --- /dev/null +++ b/keyboards/planck/readme.md @@ -0,0 +1,21 @@ +Planck +=== + +![Planck](http://i.imgur.com/q2M3uEU.jpg) + +A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. [More info on qmk.fm](http://qmk.fm/planck/) + +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: Planck PCB rev1, rev2, rev3, rev4, rev5, rev6, rev7; Planck Light, Planck EZ +Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open), [Ergodox (Planck EZ)](https://ergodox-ez.com/pages/planck) + +Make example for this keyboard (after setting up your build environment): + + make planck/rev4:default + +Install examples: + + make planck/rev5:default:dfu # For Planck rev5 or earlier and Planck Light + make planck/rev6:default:dfu-util # For Planck rev6 + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/rev1/info.json b/keyboards/planck/rev1/info.json new file mode 100644 index 000000000000..72646ac6bf3d --- /dev/null +++ b/keyboards/planck/rev1/info.json @@ -0,0 +1,138 @@ +{ + "keyboard_name": "Planck", + "manufacturer": "OLKB", + "url": "https://olkb.com/planck", + "maintainer": "jackhumbert", + "usb": { + "vid": "0x03A8", + "pid": "0xAE01", + "device_version": "0.0.1" + }, + "matrix_pins": { + "cols": ["F1", "F0", "B0", "C7", "F4", "F5", "F6", "F7", "D4", "D6", "B4", "D7"], + "rows": ["D0", "D5", "B5", "B6"] + }, + "diode_direction": "COL2ROW", + "backlight": { + "pin": "B7" + }, + "processor": "atmega32u4", + "bootloader": "atmel-dfu", + "community_layouts": ["ortho_4x12", "planck_mit"], + "layout_aliases": { + "LAYOUT": "LAYOUT_ortho_4x12", + "LAYOUT_planck_grid": "LAYOUT_ortho_4x12", + "LAYOUT_planck_mit": "LAYOUT_planck_1x2uC" + }, + "layouts": { + "LAYOUT_planck_1x2uC": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [2, 6], "x": 6, "y": 2}, + {"matrix": [2, 7], "x": 7, "y": 2}, + {"matrix": [2, 8], "x": 8, "y": 2}, + {"matrix": [2, 9], "x": 9, "y": 2}, + {"matrix": [2, 10], "x": 10, "y": 2}, + {"matrix": [2, 11], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [3, 4], "x": 4, "y": 3}, + {"matrix": [3, 5], "x": 5, "y": 3, "w": 2}, + {"matrix": [3, 7], "x": 7, "y": 3}, + {"matrix": [3, 8], "x": 8, "y": 3}, + {"matrix": [3, 9], "x": 9, "y": 3}, + {"matrix": [3, 10], "x": 10, "y": 3}, + {"matrix": [3, 11], "x": 11, "y": 3} + ] + }, + "LAYOUT_ortho_4x12": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [2, 6], "x": 6, "y": 2}, + {"matrix": [2, 7], "x": 7, "y": 2}, + {"matrix": [2, 8], "x": 8, "y": 2}, + {"matrix": [2, 9], "x": 9, "y": 2}, + {"matrix": [2, 10], "x": 10, "y": 2}, + {"matrix": [2, 11], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [3, 4], "x": 4, "y": 3}, + {"matrix": [3, 5], "x": 5, "y": 3}, + {"matrix": [3, 6], "x": 6, "y": 3}, + {"matrix": [3, 7], "x": 7, "y": 3}, + {"matrix": [3, 8], "x": 8, "y": 3}, + {"matrix": [3, 9], "x": 9, "y": 3}, + {"matrix": [3, 10], "x": 10, "y": 3}, + {"matrix": [3, 11], "x": 11, "y": 3} + ] + } + } +} diff --git a/keyboards/planck/rev1/readme.md b/keyboards/planck/rev1/readme.md new file mode 100644 index 000000000000..b5561fc1a768 --- /dev/null +++ b/keyboards/planck/rev1/readme.md @@ -0,0 +1,13 @@ +# Planck + +A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. [More info on qmk.fm](http://qmk.fm/planck/) + +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: Planck PCB rev1 +Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make planck/rev1:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/rev1/rev1.c b/keyboards/planck/rev1/rev1.c new file mode 100644 index 000000000000..f8f8d2132a5f --- /dev/null +++ b/keyboards/planck/rev1/rev1.c @@ -0,0 +1,22 @@ +#include "quantum.h" + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, + {{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, + {{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, + {{11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, +}; + +# ifdef ENCODER_MAP_ENABLE +const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0}; +# endif +#endif + +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = { + {36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}, + {24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35}, + {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} +}; diff --git a/keyboards/planck/rev1/rules.mk b/keyboards/planck/rev1/rules.mk new file mode 100644 index 000000000000..8827627e99fe --- /dev/null +++ b/keyboards/planck/rev1/rules.mk @@ -0,0 +1,14 @@ +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = no # Audio output +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/rev2/info.json b/keyboards/planck/rev2/info.json new file mode 100644 index 000000000000..2bbc5760c231 --- /dev/null +++ b/keyboards/planck/rev2/info.json @@ -0,0 +1,138 @@ +{ + "keyboard_name": "Planck", + "manufacturer": "OLKB", + "url": "https://olkb.com/planck", + "maintainer": "jackhumbert", + "usb": { + "vid": "0x03A8", + "pid": "0xAE01", + "device_version": "0.0.2" + }, + "matrix_pins": { + "cols": ["F1", "F0", "B0", "C7", "F4", "F5", "F6", "F7", "D4", "D6", "B4", "D7"], + "rows": ["D0", "D5", "B5", "B6"] + }, + "diode_direction": "COL2ROW", + "backlight": { + "pin": "B7" + }, + "processor": "atmega32u4", + "bootloader": "atmel-dfu", + "community_layouts": ["ortho_4x12", "planck_mit"], + "layout_aliases": { + "LAYOUT": "LAYOUT_ortho_4x12", + "LAYOUT_planck_grid": "LAYOUT_ortho_4x12", + "LAYOUT_planck_mit": "LAYOUT_planck_1x2uC" + }, + "layouts": { + "LAYOUT_planck_1x2uC": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [2, 6], "x": 6, "y": 2}, + {"matrix": [2, 7], "x": 7, "y": 2}, + {"matrix": [2, 8], "x": 8, "y": 2}, + {"matrix": [2, 9], "x": 9, "y": 2}, + {"matrix": [2, 10], "x": 10, "y": 2}, + {"matrix": [2, 11], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [3, 4], "x": 4, "y": 3}, + {"matrix": [3, 5], "x": 5, "y": 3, "w": 2}, + {"matrix": [3, 7], "x": 7, "y": 3}, + {"matrix": [3, 8], "x": 8, "y": 3}, + {"matrix": [3, 9], "x": 9, "y": 3}, + {"matrix": [3, 10], "x": 10, "y": 3}, + {"matrix": [3, 11], "x": 11, "y": 3} + ] + }, + "LAYOUT_ortho_4x12": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [2, 6], "x": 6, "y": 2}, + {"matrix": [2, 7], "x": 7, "y": 2}, + {"matrix": [2, 8], "x": 8, "y": 2}, + {"matrix": [2, 9], "x": 9, "y": 2}, + {"matrix": [2, 10], "x": 10, "y": 2}, + {"matrix": [2, 11], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [3, 4], "x": 4, "y": 3}, + {"matrix": [3, 5], "x": 5, "y": 3}, + {"matrix": [3, 6], "x": 6, "y": 3}, + {"matrix": [3, 7], "x": 7, "y": 3}, + {"matrix": [3, 8], "x": 8, "y": 3}, + {"matrix": [3, 9], "x": 9, "y": 3}, + {"matrix": [3, 10], "x": 10, "y": 3}, + {"matrix": [3, 11], "x": 11, "y": 3} + ] + } + } +} diff --git a/keyboards/planck/rev2/readme.md b/keyboards/planck/rev2/readme.md new file mode 100644 index 000000000000..16fa8b7fd250 --- /dev/null +++ b/keyboards/planck/rev2/readme.md @@ -0,0 +1,13 @@ +# Planck + +A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. [More info on qmk.fm](http://qmk.fm/planck/) + +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: Planck PCB rev2 +Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make planck/rev2:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/rev2/rev2.c b/keyboards/planck/rev2/rev2.c new file mode 100644 index 000000000000..f8f8d2132a5f --- /dev/null +++ b/keyboards/planck/rev2/rev2.c @@ -0,0 +1,22 @@ +#include "quantum.h" + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, + {{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, + {{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, + {{11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, +}; + +# ifdef ENCODER_MAP_ENABLE +const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0}; +# endif +#endif + +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = { + {36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}, + {24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35}, + {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} +}; diff --git a/keyboards/planck/rev2/rules.mk b/keyboards/planck/rev2/rules.mk new file mode 100644 index 000000000000..8827627e99fe --- /dev/null +++ b/keyboards/planck/rev2/rules.mk @@ -0,0 +1,14 @@ +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = no # Audio output +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/rev3/info.json b/keyboards/planck/rev3/info.json new file mode 100644 index 000000000000..17f07d58f353 --- /dev/null +++ b/keyboards/planck/rev3/info.json @@ -0,0 +1,138 @@ +{ + "keyboard_name": "Planck", + "manufacturer": "OLKB", + "url": "https://olkb.com/planck", + "maintainer": "jackhumbert", + "usb": { + "vid": "0x03A8", + "pid": "0xAE01", + "device_version": "0.0.3" + }, + "matrix_pins": { + "cols": ["F1", "F0", "B0", "C7", "F4", "F5", "F6", "F7", "D4", "D6", "B4", "D7"], + "rows": ["D0", "D5", "B5", "B6"] + }, + "diode_direction": "COL2ROW", + "backlight": { + "pin": "B7" + }, + "processor": "atmega32u4", + "bootloader": "atmel-dfu", + "community_layouts": ["ortho_4x12", "planck_mit"], + "layout_aliases": { + "LAYOUT": "LAYOUT_ortho_4x12", + "LAYOUT_planck_grid": "LAYOUT_ortho_4x12", + "LAYOUT_planck_mit": "LAYOUT_planck_1x2uC" + }, + "layouts": { + "LAYOUT_planck_1x2uC": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [2, 6], "x": 6, "y": 2}, + {"matrix": [2, 7], "x": 7, "y": 2}, + {"matrix": [2, 8], "x": 8, "y": 2}, + {"matrix": [2, 9], "x": 9, "y": 2}, + {"matrix": [2, 10], "x": 10, "y": 2}, + {"matrix": [2, 11], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [3, 4], "x": 4, "y": 3}, + {"matrix": [3, 5], "x": 5, "y": 3, "w": 2}, + {"matrix": [3, 7], "x": 7, "y": 3}, + {"matrix": [3, 8], "x": 8, "y": 3}, + {"matrix": [3, 9], "x": 9, "y": 3}, + {"matrix": [3, 10], "x": 10, "y": 3}, + {"matrix": [3, 11], "x": 11, "y": 3} + ] + }, + "LAYOUT_ortho_4x12": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [2, 6], "x": 6, "y": 2}, + {"matrix": [2, 7], "x": 7, "y": 2}, + {"matrix": [2, 8], "x": 8, "y": 2}, + {"matrix": [2, 9], "x": 9, "y": 2}, + {"matrix": [2, 10], "x": 10, "y": 2}, + {"matrix": [2, 11], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [3, 4], "x": 4, "y": 3}, + {"matrix": [3, 5], "x": 5, "y": 3}, + {"matrix": [3, 6], "x": 6, "y": 3}, + {"matrix": [3, 7], "x": 7, "y": 3}, + {"matrix": [3, 8], "x": 8, "y": 3}, + {"matrix": [3, 9], "x": 9, "y": 3}, + {"matrix": [3, 10], "x": 10, "y": 3}, + {"matrix": [3, 11], "x": 11, "y": 3} + ] + } + } +} diff --git a/keyboards/planck/rev3/readme.md b/keyboards/planck/rev3/readme.md new file mode 100644 index 000000000000..26ef898311de --- /dev/null +++ b/keyboards/planck/rev3/readme.md @@ -0,0 +1,13 @@ +# Planck + +A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. [More info on qmk.fm](http://qmk.fm/planck/) + +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: Planck PCB rev3 +Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make planck/rev3:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/rev3/rev3.c b/keyboards/planck/rev3/rev3.c new file mode 100644 index 000000000000..f8f8d2132a5f --- /dev/null +++ b/keyboards/planck/rev3/rev3.c @@ -0,0 +1,22 @@ +#include "quantum.h" + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, + {{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, + {{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, + {{11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, +}; + +# ifdef ENCODER_MAP_ENABLE +const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0}; +# endif +#endif + +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = { + {36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}, + {24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35}, + {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} +}; diff --git a/keyboards/planck/rev3/rules.mk b/keyboards/planck/rev3/rules.mk new file mode 100644 index 000000000000..8827627e99fe --- /dev/null +++ b/keyboards/planck/rev3/rules.mk @@ -0,0 +1,14 @@ +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = no # Audio output +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/rev4/info.json b/keyboards/planck/rev4/info.json new file mode 100644 index 000000000000..5eaf58e14cf6 --- /dev/null +++ b/keyboards/planck/rev4/info.json @@ -0,0 +1,138 @@ +{ + "keyboard_name": "Planck", + "manufacturer": "OLKB", + "url": "https://olkb.com/planck", + "maintainer": "jackhumbert", + "usb": { + "vid": "0x03A8", + "pid": "0xAE01", + "device_version": "0.0.4" + }, + "matrix_pins": { + "cols": ["F1", "F0", "B0", "C7", "F4", "F5", "F6", "F7", "D4", "D6", "B4", "D7"], + "rows": ["D0", "D5", "B5", "B6"] + }, + "diode_direction": "COL2ROW", + "backlight": { + "pin": "B7" + }, + "processor": "atmega32u4", + "bootloader": "atmel-dfu", + "community_layouts": ["ortho_4x12", "planck_mit"], + "layout_aliases": { + "LAYOUT": "LAYOUT_ortho_4x12", + "LAYOUT_planck_grid": "LAYOUT_ortho_4x12", + "LAYOUT_planck_mit": "LAYOUT_planck_1x2uC" + }, + "layouts": { + "LAYOUT_planck_1x2uC": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [2, 6], "x": 6, "y": 2}, + {"matrix": [2, 7], "x": 7, "y": 2}, + {"matrix": [2, 8], "x": 8, "y": 2}, + {"matrix": [2, 9], "x": 9, "y": 2}, + {"matrix": [2, 10], "x": 10, "y": 2}, + {"matrix": [2, 11], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [3, 4], "x": 4, "y": 3}, + {"matrix": [3, 5], "x": 5, "y": 3, "w": 2}, + {"matrix": [3, 7], "x": 7, "y": 3}, + {"matrix": [3, 8], "x": 8, "y": 3}, + {"matrix": [3, 9], "x": 9, "y": 3}, + {"matrix": [3, 10], "x": 10, "y": 3}, + {"matrix": [3, 11], "x": 11, "y": 3} + ] + }, + "LAYOUT_ortho_4x12": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [2, 6], "x": 6, "y": 2}, + {"matrix": [2, 7], "x": 7, "y": 2}, + {"matrix": [2, 8], "x": 8, "y": 2}, + {"matrix": [2, 9], "x": 9, "y": 2}, + {"matrix": [2, 10], "x": 10, "y": 2}, + {"matrix": [2, 11], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [3, 4], "x": 4, "y": 3}, + {"matrix": [3, 5], "x": 5, "y": 3}, + {"matrix": [3, 6], "x": 6, "y": 3}, + {"matrix": [3, 7], "x": 7, "y": 3}, + {"matrix": [3, 8], "x": 8, "y": 3}, + {"matrix": [3, 9], "x": 9, "y": 3}, + {"matrix": [3, 10], "x": 10, "y": 3}, + {"matrix": [3, 11], "x": 11, "y": 3} + ] + } + } +} diff --git a/keyboards/planck/rev4/readme.md b/keyboards/planck/rev4/readme.md new file mode 100644 index 000000000000..4cf6e8cf2d50 --- /dev/null +++ b/keyboards/planck/rev4/readme.md @@ -0,0 +1,13 @@ +# Planck + +A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. The first revision of the Planck to support Audio. [More info on qmk.fm](http://qmk.fm/planck/) + +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: Planck PCB rev4 +Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make planck/rev4:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/rev4/rev4.c b/keyboards/planck/rev4/rev4.c new file mode 100644 index 000000000000..f8f8d2132a5f --- /dev/null +++ b/keyboards/planck/rev4/rev4.c @@ -0,0 +1,22 @@ +#include "quantum.h" + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, + {{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, + {{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, + {{11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, +}; + +# ifdef ENCODER_MAP_ENABLE +const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0}; +# endif +#endif + +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = { + {36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}, + {24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35}, + {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} +}; diff --git a/keyboards/planck/rev4/rules.mk b/keyboards/planck/rev4/rules.mk new file mode 100644 index 000000000000..78e1ba9f7b1d --- /dev/null +++ b/keyboards/planck/rev4/rules.mk @@ -0,0 +1,14 @@ +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = yes # Audio output +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/rev5/info.json b/keyboards/planck/rev5/info.json new file mode 100644 index 000000000000..f9265e1409aa --- /dev/null +++ b/keyboards/planck/rev5/info.json @@ -0,0 +1,144 @@ +{ + "keyboard_name": "Planck", + "manufacturer": "OLKB", + "url": "https://olkb.com/planck", + "maintainer": "jackhumbert", + "usb": { + "vid": "0x03A8", + "pid": "0xAE01", + "device_version": "0.0.5" + }, + "matrix_pins": { + "cols": ["F1", "F0", "B0", "C7", "F4", "F5", "F6", "F7", "D4", "D6", "B4", "D7"], + "rows": ["D0", "D5", "B5", "B6"] + }, + "diode_direction": "COL2ROW", + "backlight": { + "pin": "B7" + }, + "qmk_lufa_bootloader": { + "esc_input": "D5", + "esc_output": "F1", + "led": "E6", + "speaker": "C6" + }, + "processor": "atmega32u4", + "bootloader": "qmk-dfu", + "community_layouts": ["ortho_4x12", "planck_mit"], + "layout_aliases": { + "LAYOUT": "LAYOUT_ortho_4x12", + "LAYOUT_planck_grid": "LAYOUT_ortho_4x12", + "LAYOUT_planck_mit": "LAYOUT_planck_1x2uC" + }, + "layouts": { + "LAYOUT_planck_1x2uC": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [2, 6], "x": 6, "y": 2}, + {"matrix": [2, 7], "x": 7, "y": 2}, + {"matrix": [2, 8], "x": 8, "y": 2}, + {"matrix": [2, 9], "x": 9, "y": 2}, + {"matrix": [2, 10], "x": 10, "y": 2}, + {"matrix": [2, 11], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [3, 4], "x": 4, "y": 3}, + {"matrix": [3, 5], "x": 5, "y": 3, "w": 2}, + {"matrix": [3, 7], "x": 7, "y": 3}, + {"matrix": [3, 8], "x": 8, "y": 3}, + {"matrix": [3, 9], "x": 9, "y": 3}, + {"matrix": [3, 10], "x": 10, "y": 3}, + {"matrix": [3, 11], "x": 11, "y": 3} + ] + }, + "LAYOUT_ortho_4x12": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [2, 6], "x": 6, "y": 2}, + {"matrix": [2, 7], "x": 7, "y": 2}, + {"matrix": [2, 8], "x": 8, "y": 2}, + {"matrix": [2, 9], "x": 9, "y": 2}, + {"matrix": [2, 10], "x": 10, "y": 2}, + {"matrix": [2, 11], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [3, 4], "x": 4, "y": 3}, + {"matrix": [3, 5], "x": 5, "y": 3}, + {"matrix": [3, 6], "x": 6, "y": 3}, + {"matrix": [3, 7], "x": 7, "y": 3}, + {"matrix": [3, 8], "x": 8, "y": 3}, + {"matrix": [3, 9], "x": 9, "y": 3}, + {"matrix": [3, 10], "x": 10, "y": 3}, + {"matrix": [3, 11], "x": 11, "y": 3} + ] + } + } +} diff --git a/keyboards/planck/rev5/readme.md b/keyboards/planck/rev5/readme.md new file mode 100644 index 000000000000..fed975a39038 --- /dev/null +++ b/keyboards/planck/rev5/readme.md @@ -0,0 +1,13 @@ +# Planck + +A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. [More info on qmk.fm](http://qmk.fm/planck/) + +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: Planck PCB rev5 +Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make planck/rev5:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/rev5/rev5.c b/keyboards/planck/rev5/rev5.c new file mode 100644 index 000000000000..f8f8d2132a5f --- /dev/null +++ b/keyboards/planck/rev5/rev5.c @@ -0,0 +1,22 @@ +#include "quantum.h" + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, + {{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, + {{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, + {{11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, +}; + +# ifdef ENCODER_MAP_ENABLE +const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0}; +# endif +#endif + +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = { + {36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}, + {24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35}, + {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} +}; diff --git a/keyboards/planck/rev5/rules.mk b/keyboards/planck/rev5/rules.mk new file mode 100644 index 000000000000..78e1ba9f7b1d --- /dev/null +++ b/keyboards/planck/rev5/rules.mk @@ -0,0 +1,14 @@ +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = yes # Audio output +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/rev6/chconf.h b/keyboards/planck/rev6/chconf.h new file mode 100644 index 000000000000..e1243f23eca4 --- /dev/null +++ b/keyboards/planck/rev6/chconf.h @@ -0,0 +1,29 @@ +/* Copyright 2020 QMK + * + * 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 . + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confmigrate -i keyboards/planck/rev6/chconf.h -r platforms/chibios/QMK_PROTON_C/configs/chconf.h` + */ + +#pragma once + +#define CH_CFG_ST_RESOLUTION 16 + +#define CH_CFG_ST_FREQUENCY 10000 + +#include_next + diff --git a/keyboards/planck/rev6/config.h b/keyboards/planck/rev6/config.h new file mode 100644 index 000000000000..1d029dae697b --- /dev/null +++ b/keyboards/planck/rev6/config.h @@ -0,0 +1,57 @@ +/* + * Copyright 2018 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 . + */ + +#pragma once + +#define DIP_SWITCH_PINS { B14, A15, A0, B9 } + +#define MUSIC_MAP +#undef AUDIO_VOICES +#undef AUDIO_PIN +#define AUDIO_PIN A5 +#define AUDIO_PIN_ALT A4 +#define AUDIO_PIN_ALT_AS_NEGATIVE + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT + +/* + * WS2812 Underglow Matrix options + */ +#define RGBLED_NUM 9 +#define RGB_MATRIX_LED_COUNT RGBLED_NUM + +#define WS2812_PWM_DRIVER PWMD2 +#define WS2812_PWM_CHANNEL 2 +#define WS2812_PWM_PAL_MODE 1 +#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 +#define WS2812_DMA_CHANNEL 2 + +#define RGB_DISABLE_WHEN_USB_SUSPENDED diff --git a/keyboards/planck/rev6/info.json b/keyboards/planck/rev6/info.json new file mode 100644 index 000000000000..c1e4e527cee4 --- /dev/null +++ b/keyboards/planck/rev6/info.json @@ -0,0 +1,309 @@ +{ + "keyboard_name": "Planck", + "manufacturer": "OLKB", + "url": "https://olkb.com/planck", + "maintainer": "jackhumbert", + "usb": { + "vid": "0x03A8", + "pid": "0xA4F9", + "device_version": "0.0.6" + }, + "ws2812": { + "pin": "A1", + "driver": "pwm" + }, + "rgb_matrix": { + "driver": "WS2812" + }, + "matrix_pins": { + "cols": ["B11", "B10", "B2", "B1", "A7", "B0"], + "rows": ["A10", "A9", "A8", "B15", "C13", "C14", "C15", "A2"] + }, + "diode_direction": "COL2ROW", + "encoder": { + "rotary": [ + {"pin_a": "B12", "pin_b": "B13"} + ] + }, + "processor": "STM32F303", + "bootloader": "stm32-dfu", + "board": "QMK_PROTON_C", + "community_layouts": ["ortho_4x12", "planck_mit"], + "layout_aliases": { + "LAYOUT": "LAYOUT_ortho_4x12", + "LAYOUT_planck_grid": "LAYOUT_ortho_4x12", + "LAYOUT_planck_mit": "LAYOUT_planck_1x2uC" + }, + "layouts": { + "LAYOUT_ortho_4x12": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [4, 0], "x": 6, "y": 0}, + {"matrix": [4, 1], "x": 7, "y": 0}, + {"matrix": [4, 2], "x": 8, "y": 0}, + {"matrix": [4, 3], "x": 9, "y": 0}, + {"matrix": [4, 4], "x": 10, "y": 0}, + {"matrix": [4, 5], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [5, 0], "x": 6, "y": 1}, + {"matrix": [5, 1], "x": 7, "y": 1}, + {"matrix": [5, 2], "x": 8, "y": 1}, + {"matrix": [5, 3], "x": 9, "y": 1}, + {"matrix": [5, 4], "x": 10, "y": 1}, + {"matrix": [5, 5], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [6, 0], "x": 6, "y": 2}, + {"matrix": [6, 1], "x": 7, "y": 2}, + {"matrix": [6, 2], "x": 8, "y": 2}, + {"matrix": [6, 3], "x": 9, "y": 2}, + {"matrix": [6, 4], "x": 10, "y": 2}, + {"matrix": [6, 5], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [7, 3], "x": 3, "y": 3}, + {"matrix": [7, 4], "x": 4, "y": 3}, + {"matrix": [7, 5], "x": 5, "y": 3}, + {"matrix": [7, 0], "x": 6, "y": 3}, + {"matrix": [7, 1], "x": 7, "y": 3}, + {"matrix": [7, 2], "x": 8, "y": 3}, + {"matrix": [3, 3], "x": 9, "y": 3}, + {"matrix": [3, 4], "x": 10, "y": 3}, + {"matrix": [3, 5], "x": 11, "y": 3} + ] + }, + "LAYOUT_planck_1x2uC": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [4, 0], "x": 6, "y": 0}, + {"matrix": [4, 1], "x": 7, "y": 0}, + {"matrix": [4, 2], "x": 8, "y": 0}, + {"matrix": [4, 3], "x": 9, "y": 0}, + {"matrix": [4, 4], "x": 10, "y": 0}, + {"matrix": [4, 5], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [5, 0], "x": 6, "y": 1}, + {"matrix": [5, 1], "x": 7, "y": 1}, + {"matrix": [5, 2], "x": 8, "y": 1}, + {"matrix": [5, 3], "x": 9, "y": 1}, + {"matrix": [5, 4], "x": 10, "y": 1}, + {"matrix": [5, 5], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [6, 0], "x": 6, "y": 2}, + {"matrix": [6, 1], "x": 7, "y": 2}, + {"matrix": [6, 2], "x": 8, "y": 2}, + {"matrix": [6, 3], "x": 9, "y": 2}, + {"matrix": [6, 4], "x": 10, "y": 2}, + {"matrix": [6, 5], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [7, 3], "x": 3, "y": 3}, + {"matrix": [7, 4], "x": 4, "y": 3}, + {"matrix": [7, 0], "x": 5, "y": 3, "w": 2}, + {"matrix": [7, 1], "x": 7, "y": 3}, + {"matrix": [7, 2], "x": 8, "y": 3}, + {"matrix": [3, 3], "x": 9, "y": 3}, + {"matrix": [3, 4], "x": 10, "y": 3}, + {"matrix": [3, 5], "x": 11, "y": 3} + ] + }, + "LAYOUT_planck_1x2uL": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [4, 0], "x": 6, "y": 0}, + {"matrix": [4, 1], "x": 7, "y": 0}, + {"matrix": [4, 2], "x": 8, "y": 0}, + {"matrix": [4, 3], "x": 9, "y": 0}, + {"matrix": [4, 4], "x": 10, "y": 0}, + {"matrix": [4, 5], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [5, 0], "x": 6, "y": 1}, + {"matrix": [5, 1], "x": 7, "y": 1}, + {"matrix": [5, 2], "x": 8, "y": 1}, + {"matrix": [5, 3], "x": 9, "y": 1}, + {"matrix": [5, 4], "x": 10, "y": 1}, + {"matrix": [5, 5], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [6, 0], "x": 6, "y": 2}, + {"matrix": [6, 1], "x": 7, "y": 2}, + {"matrix": [6, 2], "x": 8, "y": 2}, + {"matrix": [6, 3], "x": 9, "y": 2}, + {"matrix": [6, 4], "x": 10, "y": 2}, + {"matrix": [6, 5], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [7, 3], "x": 3, "y": 3}, + {"matrix": [7, 5], "x": 4, "y": 3, "w": 2}, + {"matrix": [7, 0], "x": 6, "y": 3}, + {"matrix": [7, 1], "x": 7, "y": 3}, + {"matrix": [7, 2], "x": 8, "y": 3}, + {"matrix": [3, 3], "x": 9, "y": 3}, + {"matrix": [3, 4], "x": 10, "y": 3}, + {"matrix": [3, 5], "x": 11, "y": 3} + ] + }, + "LAYOUT_planck_1x2uR": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [4, 0], "x": 6, "y": 0}, + {"matrix": [4, 1], "x": 7, "y": 0}, + {"matrix": [4, 2], "x": 8, "y": 0}, + {"matrix": [4, 3], "x": 9, "y": 0}, + {"matrix": [4, 4], "x": 10, "y": 0}, + {"matrix": [4, 5], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [5, 0], "x": 6, "y": 1}, + {"matrix": [5, 1], "x": 7, "y": 1}, + {"matrix": [5, 2], "x": 8, "y": 1}, + {"matrix": [5, 3], "x": 9, "y": 1}, + {"matrix": [5, 4], "x": 10, "y": 1}, + {"matrix": [5, 5], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [6, 0], "x": 6, "y": 2}, + {"matrix": [6, 1], "x": 7, "y": 2}, + {"matrix": [6, 2], "x": 8, "y": 2}, + {"matrix": [6, 3], "x": 9, "y": 2}, + {"matrix": [6, 4], "x": 10, "y": 2}, + {"matrix": [6, 5], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [7, 3], "x": 3, "y": 3}, + {"matrix": [7, 4], "x": 4, "y": 3}, + {"matrix": [7, 5], "x": 5, "y": 3}, + {"matrix": [7, 1], "x": 6, "y": 3, "w": 2}, + {"matrix": [7, 2], "x": 8, "y": 3}, + {"matrix": [3, 3], "x": 9, "y": 3}, + {"matrix": [3, 4], "x": 10, "y": 3}, + {"matrix": [3, 5], "x": 11, "y": 3} + ] + }, + "LAYOUT_planck_2x2u": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [4, 0], "x": 6, "y": 0}, + {"matrix": [4, 1], "x": 7, "y": 0}, + {"matrix": [4, 2], "x": 8, "y": 0}, + {"matrix": [4, 3], "x": 9, "y": 0}, + {"matrix": [4, 4], "x": 10, "y": 0}, + {"matrix": [4, 5], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [5, 0], "x": 6, "y": 1}, + {"matrix": [5, 1], "x": 7, "y": 1}, + {"matrix": [5, 2], "x": 8, "y": 1}, + {"matrix": [5, 3], "x": 9, "y": 1}, + {"matrix": [5, 4], "x": 10, "y": 1}, + {"matrix": [5, 5], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [6, 0], "x": 6, "y": 2}, + {"matrix": [6, 1], "x": 7, "y": 2}, + {"matrix": [6, 2], "x": 8, "y": 2}, + {"matrix": [6, 3], "x": 9, "y": 2}, + {"matrix": [6, 4], "x": 10, "y": 2}, + {"matrix": [6, 5], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [7, 3], "x": 3, "y": 3}, + {"matrix": [7, 5], "x": 4, "y": 3, "w": 2}, + {"matrix": [7, 1], "x": 6, "y": 3, "w": 2}, + {"matrix": [7, 2], "x": 8, "y": 3}, + {"matrix": [3, 3], "x": 9, "y": 3}, + {"matrix": [3, 4], "x": 10, "y": 3}, + {"matrix": [3, 5], "x": 11, "y": 3} + ] + } + } +} diff --git a/keyboards/planck/rev6/mcuconf.h b/keyboards/planck/rev6/mcuconf.h new file mode 100644 index 000000000000..3196b43ca4d3 --- /dev/null +++ b/keyboards/planck/rev6/mcuconf.h @@ -0,0 +1,32 @@ +/* Copyright 2020 QMK Contributors + * + * 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 3 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 . + */ + +#pragma once + +#include_next + +// The SysTick timer from the normal quantum/stm32 uses TIM2 -- the WS2812 pin used +// on the Planck requires the use of TIM2 to run PWM -- rework which timers are +// allocated for PWM usage. +#undef STM32_PWM_USE_TIM2 +#undef STM32_PWM_USE_TIM3 +#define STM32_PWM_USE_TIM2 TRUE +#define STM32_PWM_USE_TIM3 FALSE + +// As mentioned above, we need to reallocate the SysTick timer used from +// TIM2 to TIM3. +#undef STM32_ST_USE_TIMER +#define STM32_ST_USE_TIMER 3 diff --git a/keyboards/planck/rev6/readme.md b/keyboards/planck/rev6/readme.md new file mode 100644 index 000000000000..1034eb9d7a09 --- /dev/null +++ b/keyboards/planck/rev6/readme.md @@ -0,0 +1,13 @@ +# Planck + +A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. A complete hardware rework of the Planck, sporting a faster and more powerful STM32 ARM Cortex-M4 microcontroller, with support for rotary encoders and three additional layouts. [More info on qmk.fm](http://qmk.fm/planck/) + +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: Planck PCB rev6 +Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make planck/rev6:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/rev6/rev6.c b/keyboards/planck/rev6/rev6.c new file mode 100644 index 000000000000..49f7d8312399 --- /dev/null +++ b/keyboards/planck/rev6/rev6.c @@ -0,0 +1,73 @@ +/* Copyright 2018 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 . + */ +#include "quantum.h" + +#ifdef RGB_MATRIX_ENABLE +led_config_t g_led_config = { { + // Key Matrix to LED Index + { NO_LED, 6, NO_LED, NO_LED, 5, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 0 }, + { NO_LED, 7, NO_LED, NO_LED, 2, NO_LED }, + { NO_LED, 4, NO_LED, NO_LED, 3, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, 1, NO_LED, NO_LED, 8, NO_LED }, +}, { + // LED Index to Physical Position + {112, 39}, {148, 60}, {206, 53}, {206, 3}, {150, 3}, {74, 3}, {18, 3}, {18, 54}, {77, 60} +}, { + // LED Index to Flag + LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, + LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL +} }; + +// LED physical location index +// 6 5 4 3 +// 0 +// 7 8 1 2 + +#endif + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}}, + {{5, 5}, {4, 5}, {3, 5}, {2, 5}, {1, 5}, {0, 5}}, + {{5, 6}, {4, 6}, {3, 6}, {2, 6}, {1, 6}, {0, 6}}, + {{5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, + + {{5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, + {{5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, + {{5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, + {{5, 7}, {4, 7}, {3, 7}, {2, 7}, {1, 7}, {0, 7}}, +}; + +# ifdef ENCODER_MAP_ENABLE +const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0}; +# endif +#endif + +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = { + {36, 37, 38, 39, 40, 41}, + {24, 25, 26, 27, 28, 29}, + {12, 13, 14, 15, 16, 17}, + { 0, 1, 2, 9, 10, 11}, + {42, 43, 44, 45, 46, 47}, + {30, 31, 32, 33, 34, 35}, + {18, 19, 20, 21, 22, 23}, + { 6, 7, 8, 3, 4, 5} +}; diff --git a/keyboards/planck/rev6/rules.mk b/keyboards/planck/rev6/rules.mk new file mode 100644 index 000000000000..048b723c4ce4 --- /dev/null +++ b/keyboards/planck/rev6/rules.mk @@ -0,0 +1,18 @@ +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = yes # Audio output +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. + +RGB_MATRIX_ENABLE = no +ENCODER_ENABLE = yes +DIP_SWITCH_ENABLE = yes + +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/rev6_drop/chconf.h b/keyboards/planck/rev6_drop/chconf.h new file mode 100644 index 000000000000..e1243f23eca4 --- /dev/null +++ b/keyboards/planck/rev6_drop/chconf.h @@ -0,0 +1,29 @@ +/* Copyright 2020 QMK + * + * 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 . + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confmigrate -i keyboards/planck/rev6/chconf.h -r platforms/chibios/QMK_PROTON_C/configs/chconf.h` + */ + +#pragma once + +#define CH_CFG_ST_RESOLUTION 16 + +#define CH_CFG_ST_FREQUENCY 10000 + +#include_next + diff --git a/keyboards/planck/rev6_drop/config.h b/keyboards/planck/rev6_drop/config.h new file mode 100644 index 000000000000..ff15e9628d2c --- /dev/null +++ b/keyboards/planck/rev6_drop/config.h @@ -0,0 +1,58 @@ +/* + * Copyright 2018 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 . + */ + +#pragma once + +#define DIP_SWITCH_PINS \ + { B14, A15, A0, B9 } + +#define MUSIC_MAP +#undef AUDIO_VOICES +#undef AUDIO_PIN +#define AUDIO_PIN A5 +#define AUDIO_PIN_ALT A4 +#define AUDIO_PIN_ALT_AS_NEGATIVE + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT + +/* + * WS2812 Underglow Matrix options + */ +#define RGBLED_NUM 9 +#define RGB_MATRIX_LED_COUNT RGBLED_NUM + +#define WS2812_PWM_DRIVER PWMD2 +#define WS2812_PWM_CHANNEL 2 +#define WS2812_PWM_PAL_MODE 1 +#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 +#define WS2812_DMA_CHANNEL 2 + +#define RGB_DISABLE_WHEN_USB_SUSPENDED diff --git a/keyboards/planck/rev6_drop/halconf.h b/keyboards/planck/rev6_drop/halconf.h new file mode 100644 index 000000000000..153eacb2127d --- /dev/null +++ b/keyboards/planck/rev6_drop/halconf.h @@ -0,0 +1,23 @@ +/* Copyright 2020 QMK + * + * 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 3 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 . + */ +#pragma once + +#define HAL_USE_PWM TRUE +#define HAL_USE_GPT TRUE +#define HAL_USE_DAC TRUE +#define HAL_USE_I2C TRUE + +#include_next diff --git a/keyboards/planck/rev6_drop/info.json b/keyboards/planck/rev6_drop/info.json new file mode 100644 index 000000000000..00f1fab14eea --- /dev/null +++ b/keyboards/planck/rev6_drop/info.json @@ -0,0 +1,308 @@ +{ + "keyboard_name": "Planck", + "manufacturer": "Drop", + "url": "https://olkb.com/planck", + "maintainer": "jackhumbert", + "usb": { + "vid": "0x03A8", + "pid": "0xA4F9", + "device_version": "0.0.6" + }, + "ws2812": { + "pin": "A1", + "driver": "pwm" + }, + "rgb_matrix": { + "driver": "WS2812" + }, + "matrix_pins": { + "cols": ["B11", "B10", "B2", "B1", "A7", "B0"], + "rows": ["A10", "A9", "A8", "B15", "C13", "C14", "C15", "A2"] + }, + "diode_direction": "COL2ROW", + "encoder": { + "rotary": [ + {"pin_a": "B12", "pin_b": "B13"} + ] + }, + "processor": "STM32F303", + "bootloader": "stm32-dfu", + "community_layouts": ["ortho_4x12", "planck_mit"], + "layout_aliases": { + "LAYOUT": "LAYOUT_ortho_4x12", + "LAYOUT_planck_grid": "LAYOUT_ortho_4x12", + "LAYOUT_planck_mit": "LAYOUT_planck_1x2uC" + }, + "layouts": { + "LAYOUT_ortho_4x12": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [4, 0], "x": 6, "y": 0}, + {"matrix": [4, 1], "x": 7, "y": 0}, + {"matrix": [4, 2], "x": 8, "y": 0}, + {"matrix": [4, 3], "x": 9, "y": 0}, + {"matrix": [4, 4], "x": 10, "y": 0}, + {"matrix": [4, 5], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [5, 0], "x": 6, "y": 1}, + {"matrix": [5, 1], "x": 7, "y": 1}, + {"matrix": [5, 2], "x": 8, "y": 1}, + {"matrix": [5, 3], "x": 9, "y": 1}, + {"matrix": [5, 4], "x": 10, "y": 1}, + {"matrix": [5, 5], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [6, 0], "x": 6, "y": 2}, + {"matrix": [6, 1], "x": 7, "y": 2}, + {"matrix": [6, 2], "x": 8, "y": 2}, + {"matrix": [6, 3], "x": 9, "y": 2}, + {"matrix": [6, 4], "x": 10, "y": 2}, + {"matrix": [6, 5], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [7, 3], "x": 3, "y": 3}, + {"matrix": [7, 4], "x": 4, "y": 3}, + {"matrix": [7, 5], "x": 5, "y": 3}, + {"matrix": [7, 0], "x": 6, "y": 3}, + {"matrix": [7, 1], "x": 7, "y": 3}, + {"matrix": [7, 2], "x": 8, "y": 3}, + {"matrix": [3, 3], "x": 9, "y": 3}, + {"matrix": [3, 4], "x": 10, "y": 3}, + {"matrix": [3, 5], "x": 11, "y": 3} + ] + }, + "LAYOUT_planck_1x2uC": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [4, 0], "x": 6, "y": 0}, + {"matrix": [4, 1], "x": 7, "y": 0}, + {"matrix": [4, 2], "x": 8, "y": 0}, + {"matrix": [4, 3], "x": 9, "y": 0}, + {"matrix": [4, 4], "x": 10, "y": 0}, + {"matrix": [4, 5], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [5, 0], "x": 6, "y": 1}, + {"matrix": [5, 1], "x": 7, "y": 1}, + {"matrix": [5, 2], "x": 8, "y": 1}, + {"matrix": [5, 3], "x": 9, "y": 1}, + {"matrix": [5, 4], "x": 10, "y": 1}, + {"matrix": [5, 5], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [6, 0], "x": 6, "y": 2}, + {"matrix": [6, 1], "x": 7, "y": 2}, + {"matrix": [6, 2], "x": 8, "y": 2}, + {"matrix": [6, 3], "x": 9, "y": 2}, + {"matrix": [6, 4], "x": 10, "y": 2}, + {"matrix": [6, 5], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [7, 3], "x": 3, "y": 3}, + {"matrix": [7, 4], "x": 4, "y": 3}, + {"matrix": [7, 0], "x": 5, "y": 3, "w": 2}, + {"matrix": [7, 1], "x": 7, "y": 3}, + {"matrix": [7, 2], "x": 8, "y": 3}, + {"matrix": [3, 3], "x": 9, "y": 3}, + {"matrix": [3, 4], "x": 10, "y": 3}, + {"matrix": [3, 5], "x": 11, "y": 3} + ] + }, + "LAYOUT_planck_1x2uL": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [4, 0], "x": 6, "y": 0}, + {"matrix": [4, 1], "x": 7, "y": 0}, + {"matrix": [4, 2], "x": 8, "y": 0}, + {"matrix": [4, 3], "x": 9, "y": 0}, + {"matrix": [4, 4], "x": 10, "y": 0}, + {"matrix": [4, 5], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [5, 0], "x": 6, "y": 1}, + {"matrix": [5, 1], "x": 7, "y": 1}, + {"matrix": [5, 2], "x": 8, "y": 1}, + {"matrix": [5, 3], "x": 9, "y": 1}, + {"matrix": [5, 4], "x": 10, "y": 1}, + {"matrix": [5, 5], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [6, 0], "x": 6, "y": 2}, + {"matrix": [6, 1], "x": 7, "y": 2}, + {"matrix": [6, 2], "x": 8, "y": 2}, + {"matrix": [6, 3], "x": 9, "y": 2}, + {"matrix": [6, 4], "x": 10, "y": 2}, + {"matrix": [6, 5], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [7, 3], "x": 3, "y": 3}, + {"matrix": [7, 5], "x": 4, "y": 3, "w": 2}, + {"matrix": [7, 0], "x": 6, "y": 3}, + {"matrix": [7, 1], "x": 7, "y": 3}, + {"matrix": [7, 2], "x": 8, "y": 3}, + {"matrix": [3, 3], "x": 9, "y": 3}, + {"matrix": [3, 4], "x": 10, "y": 3}, + {"matrix": [3, 5], "x": 11, "y": 3} + ] + }, + "LAYOUT_planck_1x2uR": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [4, 0], "x": 6, "y": 0}, + {"matrix": [4, 1], "x": 7, "y": 0}, + {"matrix": [4, 2], "x": 8, "y": 0}, + {"matrix": [4, 3], "x": 9, "y": 0}, + {"matrix": [4, 4], "x": 10, "y": 0}, + {"matrix": [4, 5], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [5, 0], "x": 6, "y": 1}, + {"matrix": [5, 1], "x": 7, "y": 1}, + {"matrix": [5, 2], "x": 8, "y": 1}, + {"matrix": [5, 3], "x": 9, "y": 1}, + {"matrix": [5, 4], "x": 10, "y": 1}, + {"matrix": [5, 5], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [6, 0], "x": 6, "y": 2}, + {"matrix": [6, 1], "x": 7, "y": 2}, + {"matrix": [6, 2], "x": 8, "y": 2}, + {"matrix": [6, 3], "x": 9, "y": 2}, + {"matrix": [6, 4], "x": 10, "y": 2}, + {"matrix": [6, 5], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [7, 3], "x": 3, "y": 3}, + {"matrix": [7, 4], "x": 4, "y": 3}, + {"matrix": [7, 5], "x": 5, "y": 3}, + {"matrix": [7, 1], "x": 6, "y": 3, "w": 2}, + {"matrix": [7, 2], "x": 8, "y": 3}, + {"matrix": [3, 3], "x": 9, "y": 3}, + {"matrix": [3, 4], "x": 10, "y": 3}, + {"matrix": [3, 5], "x": 11, "y": 3} + ] + }, + "LAYOUT_planck_2x2u": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [4, 0], "x": 6, "y": 0}, + {"matrix": [4, 1], "x": 7, "y": 0}, + {"matrix": [4, 2], "x": 8, "y": 0}, + {"matrix": [4, 3], "x": 9, "y": 0}, + {"matrix": [4, 4], "x": 10, "y": 0}, + {"matrix": [4, 5], "x": 11, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [5, 0], "x": 6, "y": 1}, + {"matrix": [5, 1], "x": 7, "y": 1}, + {"matrix": [5, 2], "x": 8, "y": 1}, + {"matrix": [5, 3], "x": 9, "y": 1}, + {"matrix": [5, 4], "x": 10, "y": 1}, + {"matrix": [5, 5], "x": 11, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [6, 0], "x": 6, "y": 2}, + {"matrix": [6, 1], "x": 7, "y": 2}, + {"matrix": [6, 2], "x": 8, "y": 2}, + {"matrix": [6, 3], "x": 9, "y": 2}, + {"matrix": [6, 4], "x": 10, "y": 2}, + {"matrix": [6, 5], "x": 11, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [7, 3], "x": 3, "y": 3}, + {"matrix": [7, 5], "x": 4, "y": 3, "w": 2}, + {"matrix": [7, 1], "x": 6, "y": 3, "w": 2}, + {"matrix": [7, 2], "x": 8, "y": 3}, + {"matrix": [3, 3], "x": 9, "y": 3}, + {"matrix": [3, 4], "x": 10, "y": 3}, + {"matrix": [3, 5], "x": 11, "y": 3} + ] + } + } +} diff --git a/keyboards/planck/rev6_drop/matrix.c b/keyboards/planck/rev6_drop/matrix.c new file mode 100644 index 000000000000..e31e473ae251 --- /dev/null +++ b/keyboards/planck/rev6_drop/matrix.c @@ -0,0 +1,75 @@ +/* + * Copyright 2018-2023 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 . + */ + +#include "quantum.h" + +/* matrix state(1:on, 0:off) */ +static pin_t matrix_row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static pin_t matrix_col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +static matrix_row_t matrix_inverted[MATRIX_COLS]; + +void matrix_init_custom(void) { + // actual matrix setup - cols + for (int i = 0; i < MATRIX_COLS; i++) { + setPinOutput(matrix_col_pins[i]); + writePinLow(matrix_col_pins[i]); + } + + // rows + for (int i = 0; i < MATRIX_ROWS; i++) { + setPinInputLow(matrix_row_pins[i]); + } +} + +bool matrix_scan_custom(matrix_row_t current_matrix[]) { + bool changed = false; + + // actual matrix + for (int col = 0; col < MATRIX_COLS; col++) { + matrix_row_t data = 0; + + // strobe col + writePinHigh(matrix_col_pins[col]); + + // need wait to settle pin state + wait_us(20); + + // read row data + for (int row = 0; row < MATRIX_ROWS; row++) { + data |= (readPin(matrix_row_pins[row]) << row); + } + + // unstrobe col + writePinLow(matrix_col_pins[col]); + + if (matrix_inverted[col] != data) { + matrix_inverted[col] = data; + } + } + + for (int row = 0; row < MATRIX_ROWS; row++) { + matrix_row_t old = current_matrix[row]; + current_matrix[row] = 0; + for (int col = 0; col < MATRIX_COLS; col++) { + current_matrix[row] |= ((matrix_inverted[col] & (1 << row) ? 1 : 0) << col); + } + changed |= old != current_matrix[row]; + } + + return changed; +} diff --git a/keyboards/planck/rev6_drop/mcuconf.h b/keyboards/planck/rev6_drop/mcuconf.h new file mode 100644 index 000000000000..2837fb34ff8b --- /dev/null +++ b/keyboards/planck/rev6_drop/mcuconf.h @@ -0,0 +1,46 @@ +/* Copyright 2020 QMK Contributors + * + * 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 3 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 . + */ + +#pragma once + +#include_next + +// The SysTick timer from the normal quantum/stm32 uses TIM2 -- the WS2812 pin used +// on the Planck requires the use of TIM2 to run PWM -- rework which timers are +// allocated for PWM usage. +#undef STM32_PWM_USE_TIM2 +#define STM32_PWM_USE_TIM2 TRUE + +#undef STM32_DAC_USE_DAC1_CH1 +#define STM32_DAC_USE_DAC1_CH1 TRUE +#undef STM32_DAC_USE_DAC1_CH2 +#define STM32_DAC_USE_DAC1_CH2 TRUE +#undef STM32_GPT_USE_TIM6 +#define STM32_GPT_USE_TIM6 TRUE +#undef STM32_GPT_USE_TIM7 +#define STM32_GPT_USE_TIM7 TRUE +#undef STM32_GPT_USE_TIM8 +#define STM32_GPT_USE_TIM8 TRUE + +// As mentioned above, we need to reallocate the SysTick timer used from +// TIM2 to TIM3. +#undef STM32_ST_USE_TIMER +#define STM32_ST_USE_TIMER 3 + +// enable i2c +#undef STM32_I2C_USE_I2C1 +#define STM32_I2C_USE_I2C1 TRUE + diff --git a/keyboards/planck/rev6_drop/readme.md b/keyboards/planck/rev6_drop/readme.md new file mode 100644 index 000000000000..0ea2619acb12 --- /dev/null +++ b/keyboards/planck/rev6_drop/readme.md @@ -0,0 +1,13 @@ +# Planck + +A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. A complete hardware rework of the Planck, sporting a faster and more powerful STM32 ARM Cortex-M4 microcontroller, with support for rotary encoders and three additional layouts. [More info on qmk.fm](http://qmk.fm/planck/) + +* Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +* Hardware Supported: Planck PCB rev6 +* Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make planck/rev6_drop:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/rev6_drop/rev6_drop.c b/keyboards/planck/rev6_drop/rev6_drop.c new file mode 100644 index 000000000000..8f613851dc5c --- /dev/null +++ b/keyboards/planck/rev6_drop/rev6_drop.c @@ -0,0 +1,74 @@ +/* Copyright 2018 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 . + */ +#include "quantum.h" + +#ifdef RGB_MATRIX_ENABLE +// clang-format off +led_config_t g_led_config = { { + // Key Matrix to LED Index + { NO_LED, 6, NO_LED, NO_LED, 5, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 0 }, + { NO_LED, 7, NO_LED, NO_LED, 2, NO_LED }, + { NO_LED, 4, NO_LED, NO_LED, 3, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, 1, NO_LED, NO_LED, 8, NO_LED }, +}, { + // LED Index to Physical Position + {112, 39}, {148, 60}, {206, 53}, {206, 3}, {150, 3}, {74, 3}, {18, 3}, {18, 54}, {77, 60} +}, { + // LED Index to Flag + LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, + LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL +} }; + +// LED physical location index +// 6 5 4 3 +// 0 +// 7 8 1 2 + +#endif + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}}, + {{5, 5}, {4, 5}, {3, 5}, {2, 5}, {1, 5}, {0, 5}}, + {{5, 6}, {4, 6}, {3, 6}, {2, 6}, {1, 6}, {0, 6}}, + {{5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, + + {{5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, + {{5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, + {{5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, + {{5, 7}, {4, 7}, {3, 7}, {2, 7}, {1, 7}, {0, 7}}, +}; + +# ifdef ENCODER_MAP_ENABLE +const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0}; +# endif +#endif + +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = { + {36, 37, 38, 39, 40, 41}, + {24, 25, 26, 27, 28, 29}, + {12, 13, 14, 15, 16, 17}, + { 0, 1, 2, 9, 10, 11}, + {42, 43, 44, 45, 46, 47}, + {30, 31, 32, 33, 34, 35}, + {18, 19, 20, 21, 22, 23}, + { 6, 7, 8, 3, 4, 5} +}; diff --git a/keyboards/planck/rev6_drop/rules.mk b/keyboards/planck/rev6_drop/rules.mk new file mode 100644 index 000000000000..3eb3eac7ebc3 --- /dev/null +++ b/keyboards/planck/rev6_drop/rules.mk @@ -0,0 +1,21 @@ +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +AUDIO_ENABLE = yes # Audio output +CUSTOM_MATRIX = lite +# Do not enable RGB_MATRIX_ENABLE together with RGBLIGHT_ENABLE +RGB_MATRIX_ENABLE = no +ENCODER_ENABLE = yes +DIP_SWITCH_ENABLE = yes + +SRC += matrix.c + +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/rev7/chconf.h b/keyboards/planck/rev7/chconf.h new file mode 100644 index 000000000000..e1243f23eca4 --- /dev/null +++ b/keyboards/planck/rev7/chconf.h @@ -0,0 +1,29 @@ +/* Copyright 2020 QMK + * + * 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 . + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confmigrate -i keyboards/planck/rev6/chconf.h -r platforms/chibios/QMK_PROTON_C/configs/chconf.h` + */ + +#pragma once + +#define CH_CFG_ST_RESOLUTION 16 + +#define CH_CFG_ST_FREQUENCY 10000 + +#include_next + diff --git a/keyboards/planck/rev7/config.h b/keyboards/planck/rev7/config.h new file mode 100644 index 000000000000..3da5a4e6b9c5 --- /dev/null +++ b/keyboards/planck/rev7/config.h @@ -0,0 +1,53 @@ +/* + * Copyright 2023 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 . + */ + +#pragma once + +#define DIP_SWITCH_PINS \ + { B14, A15, A0, B9 } + +#define MUSIC_MAP +#undef AUDIO_VOICES +#undef AUDIO_PIN +#define AUDIO_PIN A5 +#define AUDIO_PIN_ALT A4 +#define AUDIO_PIN_ALT_AS_NEGATIVE + +#define WS2812_PWM_DRIVER PWMD2 +#define WS2812_PWM_CHANNEL 2 +#define WS2812_PWM_PAL_MODE 1 +#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 +#define WS2812_DMA_CHANNEL 2 + +#define RGB_DISABLE_WHEN_USB_SUSPENDED + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT + diff --git a/keyboards/planck/rev7/halconf.h b/keyboards/planck/rev7/halconf.h new file mode 100644 index 000000000000..6da795fada1a --- /dev/null +++ b/keyboards/planck/rev7/halconf.h @@ -0,0 +1,24 @@ +/* Copyright 2020 QMK + * + * 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 3 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 . + */ +#pragma once + +#define HAL_USE_PWM TRUE +#define HAL_USE_GPT TRUE +#define HAL_USE_DAC TRUE +#define HAL_USE_I2C TRUE +#define HAL_USE_WDG TRUE + +#include_next diff --git a/keyboards/planck/rev7/info.json b/keyboards/planck/rev7/info.json new file mode 100644 index 000000000000..e4d743342366 --- /dev/null +++ b/keyboards/planck/rev7/info.json @@ -0,0 +1,322 @@ +{ + "keyboard_name": "Planck", + "manufacturer": "Drop", + "url": "https://olkb.com/planck", + "maintainer": "jackhumbert", + "usb": { + "vid": "0x03A8", + "pid": "0xA4F9", + "device_version": "0.0.7" + }, + "ws2812": { + "pin": "A1", + "driver": "pwm" + }, + "rgb_matrix": { + "driver": "WS2812" + }, + "matrix_pins": { + "cols": ["B11", "B10", "B2", "B1", "A7", "B0"], + "rows": ["A10", "A9", "A8", "B15", "C13", "C14", "C15", "A2"] + }, + "diode_direction": "COL2ROW", + "encoder": { + "rotary": [ + {"pin_a": "B12", "pin_b": "B13"} + ] + }, + "features": { + "audio": true, + "bootmagic": true, + "command": true, + "console": true, + "encoder": true, + "extrakey": true, + "mousekey": true, + "nkro": true, + "rgblight": true + }, + "rgblight": { + "led_count": 9 + }, + "processor": "STM32F303", + "bootloader": "stm32-dfu", + "community_layouts": ["ortho_4x12", "planck_mit"], + "layout_aliases": { + "LAYOUT": "LAYOUT_ortho_4x12", + "LAYOUT_planck_grid": "LAYOUT_ortho_4x12", + "LAYOUT_planck_mit": "LAYOUT_planck_1x2uC" + }, + "layouts": { + "LAYOUT_ortho_4x12": { + "layout": [ + { "matrix": [0, 0], "x": 0, "y": 0 }, + { "matrix": [0, 1], "x": 1, "y": 0 }, + { "matrix": [0, 2], "x": 2, "y": 0 }, + { "matrix": [0, 3], "x": 3, "y": 0 }, + { "matrix": [0, 4], "x": 4, "y": 0 }, + { "matrix": [0, 5], "x": 5, "y": 0 }, + { "matrix": [4, 0], "x": 6, "y": 0 }, + { "matrix": [4, 1], "x": 7, "y": 0 }, + { "matrix": [4, 2], "x": 8, "y": 0 }, + { "matrix": [4, 3], "x": 9, "y": 0 }, + { "matrix": [4, 4], "x": 10, "y": 0 }, + { "matrix": [4, 5], "x": 11, "y": 0 }, + + { "matrix": [1, 0], "x": 0, "y": 1 }, + { "matrix": [1, 1], "x": 1, "y": 1 }, + { "matrix": [1, 2], "x": 2, "y": 1 }, + { "matrix": [1, 3], "x": 3, "y": 1 }, + { "matrix": [1, 4], "x": 4, "y": 1 }, + { "matrix": [1, 5], "x": 5, "y": 1 }, + { "matrix": [5, 0], "x": 6, "y": 1 }, + { "matrix": [5, 1], "x": 7, "y": 1 }, + { "matrix": [5, 2], "x": 8, "y": 1 }, + { "matrix": [5, 3], "x": 9, "y": 1 }, + { "matrix": [5, 4], "x": 10, "y": 1 }, + { "matrix": [5, 5], "x": 11, "y": 1 }, + + { "matrix": [2, 0], "x": 0, "y": 2 }, + { "matrix": [2, 1], "x": 1, "y": 2 }, + { "matrix": [2, 2], "x": 2, "y": 2 }, + { "matrix": [2, 3], "x": 3, "y": 2 }, + { "matrix": [2, 4], "x": 4, "y": 2 }, + { "matrix": [2, 5], "x": 5, "y": 2 }, + { "matrix": [6, 0], "x": 6, "y": 2 }, + { "matrix": [6, 1], "x": 7, "y": 2 }, + { "matrix": [6, 2], "x": 8, "y": 2 }, + { "matrix": [6, 3], "x": 9, "y": 2 }, + { "matrix": [6, 4], "x": 10, "y": 2 }, + { "matrix": [6, 5], "x": 11, "y": 2 }, + + { "matrix": [3, 0], "x": 0, "y": 3 }, + { "matrix": [3, 1], "x": 1, "y": 3 }, + { "matrix": [3, 2], "x": 2, "y": 3 }, + { "matrix": [7, 3], "x": 3, "y": 3 }, + { "matrix": [7, 4], "x": 4, "y": 3 }, + { "matrix": [7, 5], "x": 5, "y": 3 }, + { "matrix": [7, 0], "x": 6, "y": 3 }, + { "matrix": [7, 1], "x": 7, "y": 3 }, + { "matrix": [7, 2], "x": 8, "y": 3 }, + { "matrix": [3, 3], "x": 9, "y": 3 }, + { "matrix": [3, 4], "x": 10, "y": 3 }, + { "matrix": [3, 5], "x": 11, "y": 3 } + ] + }, + "LAYOUT_planck_1x2uC": { + "layout": [ + { "matrix": [0, 0], "x": 0, "y": 0 }, + { "matrix": [0, 1], "x": 1, "y": 0 }, + { "matrix": [0, 2], "x": 2, "y": 0 }, + { "matrix": [0, 3], "x": 3, "y": 0 }, + { "matrix": [0, 4], "x": 4, "y": 0 }, + { "matrix": [0, 5], "x": 5, "y": 0 }, + { "matrix": [4, 0], "x": 6, "y": 0 }, + { "matrix": [4, 1], "x": 7, "y": 0 }, + { "matrix": [4, 2], "x": 8, "y": 0 }, + { "matrix": [4, 3], "x": 9, "y": 0 }, + { "matrix": [4, 4], "x": 10, "y": 0 }, + { "matrix": [4, 5], "x": 11, "y": 0 }, + + { "matrix": [1, 0], "x": 0, "y": 1 }, + { "matrix": [1, 1], "x": 1, "y": 1 }, + { "matrix": [1, 2], "x": 2, "y": 1 }, + { "matrix": [1, 3], "x": 3, "y": 1 }, + { "matrix": [1, 4], "x": 4, "y": 1 }, + { "matrix": [1, 5], "x": 5, "y": 1 }, + { "matrix": [5, 0], "x": 6, "y": 1 }, + { "matrix": [5, 1], "x": 7, "y": 1 }, + { "matrix": [5, 2], "x": 8, "y": 1 }, + { "matrix": [5, 3], "x": 9, "y": 1 }, + { "matrix": [5, 4], "x": 10, "y": 1 }, + { "matrix": [5, 5], "x": 11, "y": 1 }, + + { "matrix": [2, 0], "x": 0, "y": 2 }, + { "matrix": [2, 1], "x": 1, "y": 2 }, + { "matrix": [2, 2], "x": 2, "y": 2 }, + { "matrix": [2, 3], "x": 3, "y": 2 }, + { "matrix": [2, 4], "x": 4, "y": 2 }, + { "matrix": [2, 5], "x": 5, "y": 2 }, + { "matrix": [6, 0], "x": 6, "y": 2 }, + { "matrix": [6, 1], "x": 7, "y": 2 }, + { "matrix": [6, 2], "x": 8, "y": 2 }, + { "matrix": [6, 3], "x": 9, "y": 2 }, + { "matrix": [6, 4], "x": 10, "y": 2 }, + { "matrix": [6, 5], "x": 11, "y": 2 }, + + { "matrix": [3, 0], "x": 0, "y": 3 }, + { "matrix": [3, 1], "x": 1, "y": 3 }, + { "matrix": [3, 2], "x": 2, "y": 3 }, + { "matrix": [7, 3], "x": 3, "y": 3 }, + { "matrix": [7, 4], "x": 4, "y": 3 }, + { "matrix": [7, 0], "x": 5, "y": 3, "w": 2 }, + { "matrix": [7, 1], "x": 7, "y": 3 }, + { "matrix": [7, 2], "x": 8, "y": 3 }, + { "matrix": [3, 3], "x": 9, "y": 3 }, + { "matrix": [3, 4], "x": 10, "y": 3 }, + { "matrix": [3, 5], "x": 11, "y": 3 } + ] + }, + "LAYOUT_planck_1x2uL": { + "layout": [ + { "matrix": [0, 0], "x": 0, "y": 0 }, + { "matrix": [0, 1], "x": 1, "y": 0 }, + { "matrix": [0, 2], "x": 2, "y": 0 }, + { "matrix": [0, 3], "x": 3, "y": 0 }, + { "matrix": [0, 4], "x": 4, "y": 0 }, + { "matrix": [0, 5], "x": 5, "y": 0 }, + { "matrix": [4, 0], "x": 6, "y": 0 }, + { "matrix": [4, 1], "x": 7, "y": 0 }, + { "matrix": [4, 2], "x": 8, "y": 0 }, + { "matrix": [4, 3], "x": 9, "y": 0 }, + { "matrix": [4, 4], "x": 10, "y": 0 }, + { "matrix": [4, 5], "x": 11, "y": 0 }, + + { "matrix": [1, 0], "x": 0, "y": 1 }, + { "matrix": [1, 1], "x": 1, "y": 1 }, + { "matrix": [1, 2], "x": 2, "y": 1 }, + { "matrix": [1, 3], "x": 3, "y": 1 }, + { "matrix": [1, 4], "x": 4, "y": 1 }, + { "matrix": [1, 5], "x": 5, "y": 1 }, + { "matrix": [5, 0], "x": 6, "y": 1 }, + { "matrix": [5, 1], "x": 7, "y": 1 }, + { "matrix": [5, 2], "x": 8, "y": 1 }, + { "matrix": [5, 3], "x": 9, "y": 1 }, + { "matrix": [5, 4], "x": 10, "y": 1 }, + { "matrix": [5, 5], "x": 11, "y": 1 }, + + { "matrix": [2, 0], "x": 0, "y": 2 }, + { "matrix": [2, 1], "x": 1, "y": 2 }, + { "matrix": [2, 2], "x": 2, "y": 2 }, + { "matrix": [2, 3], "x": 3, "y": 2 }, + { "matrix": [2, 4], "x": 4, "y": 2 }, + { "matrix": [2, 5], "x": 5, "y": 2 }, + { "matrix": [6, 0], "x": 6, "y": 2 }, + { "matrix": [6, 1], "x": 7, "y": 2 }, + { "matrix": [6, 2], "x": 8, "y": 2 }, + { "matrix": [6, 3], "x": 9, "y": 2 }, + { "matrix": [6, 4], "x": 10, "y": 2 }, + { "matrix": [6, 5], "x": 11, "y": 2 }, + + { "matrix": [3, 0], "x": 0, "y": 3 }, + { "matrix": [3, 1], "x": 1, "y": 3 }, + { "matrix": [3, 2], "x": 2, "y": 3 }, + { "matrix": [7, 3], "x": 3, "y": 3 }, + { "matrix": [7, 5], "x": 4, "y": 3, "w": 2 }, + { "matrix": [7, 0], "x": 6, "y": 3 }, + { "matrix": [7, 1], "x": 7, "y": 3 }, + { "matrix": [7, 2], "x": 8, "y": 3 }, + { "matrix": [3, 3], "x": 9, "y": 3 }, + { "matrix": [3, 4], "x": 10, "y": 3 }, + { "matrix": [3, 5], "x": 11, "y": 3 } + ] + }, + "LAYOUT_planck_1x2uR": { + "layout": [ + { "matrix": [0, 0], "x": 0, "y": 0 }, + { "matrix": [0, 1], "x": 1, "y": 0 }, + { "matrix": [0, 2], "x": 2, "y": 0 }, + { "matrix": [0, 3], "x": 3, "y": 0 }, + { "matrix": [0, 4], "x": 4, "y": 0 }, + { "matrix": [0, 5], "x": 5, "y": 0 }, + { "matrix": [4, 0], "x": 6, "y": 0 }, + { "matrix": [4, 1], "x": 7, "y": 0 }, + { "matrix": [4, 2], "x": 8, "y": 0 }, + { "matrix": [4, 3], "x": 9, "y": 0 }, + { "matrix": [4, 4], "x": 10, "y": 0 }, + { "matrix": [4, 5], "x": 11, "y": 0 }, + + { "matrix": [1, 0], "x": 0, "y": 1 }, + { "matrix": [1, 1], "x": 1, "y": 1 }, + { "matrix": [1, 2], "x": 2, "y": 1 }, + { "matrix": [1, 3], "x": 3, "y": 1 }, + { "matrix": [1, 4], "x": 4, "y": 1 }, + { "matrix": [1, 5], "x": 5, "y": 1 }, + { "matrix": [5, 0], "x": 6, "y": 1 }, + { "matrix": [5, 1], "x": 7, "y": 1 }, + { "matrix": [5, 2], "x": 8, "y": 1 }, + { "matrix": [5, 3], "x": 9, "y": 1 }, + { "matrix": [5, 4], "x": 10, "y": 1 }, + { "matrix": [5, 5], "x": 11, "y": 1 }, + + { "matrix": [2, 0], "x": 0, "y": 2 }, + { "matrix": [2, 1], "x": 1, "y": 2 }, + { "matrix": [2, 2], "x": 2, "y": 2 }, + { "matrix": [2, 3], "x": 3, "y": 2 }, + { "matrix": [2, 4], "x": 4, "y": 2 }, + { "matrix": [2, 5], "x": 5, "y": 2 }, + { "matrix": [6, 0], "x": 6, "y": 2 }, + { "matrix": [6, 1], "x": 7, "y": 2 }, + { "matrix": [6, 2], "x": 8, "y": 2 }, + { "matrix": [6, 3], "x": 9, "y": 2 }, + { "matrix": [6, 4], "x": 10, "y": 2 }, + { "matrix": [6, 5], "x": 11, "y": 2 }, + + { "matrix": [3, 0], "x": 0, "y": 3 }, + { "matrix": [3, 1], "x": 1, "y": 3 }, + { "matrix": [3, 2], "x": 2, "y": 3 }, + { "matrix": [7, 3], "x": 3, "y": 3 }, + { "matrix": [7, 4], "x": 4, "y": 3 }, + { "matrix": [7, 5], "x": 5, "y": 3 }, + { "matrix": [7, 1], "x": 6, "y": 3, "w": 2 }, + { "matrix": [7, 2], "x": 8, "y": 3 }, + { "matrix": [3, 3], "x": 9, "y": 3 }, + { "matrix": [3, 4], "x": 10, "y": 3 }, + { "matrix": [3, 5], "x": 11, "y": 3 } + ] + }, + "LAYOUT_planck_2x2u": { + "layout": [ + { "matrix": [0, 0], "x": 0, "y": 0 }, + { "matrix": [0, 1], "x": 1, "y": 0 }, + { "matrix": [0, 2], "x": 2, "y": 0 }, + { "matrix": [0, 3], "x": 3, "y": 0 }, + { "matrix": [0, 4], "x": 4, "y": 0 }, + { "matrix": [0, 5], "x": 5, "y": 0 }, + { "matrix": [4, 0], "x": 6, "y": 0 }, + { "matrix": [4, 1], "x": 7, "y": 0 }, + { "matrix": [4, 2], "x": 8, "y": 0 }, + { "matrix": [4, 3], "x": 9, "y": 0 }, + { "matrix": [4, 4], "x": 10, "y": 0 }, + { "matrix": [4, 5], "x": 11, "y": 0 }, + + { "matrix": [1, 0], "x": 0, "y": 1 }, + { "matrix": [1, 1], "x": 1, "y": 1 }, + { "matrix": [1, 2], "x": 2, "y": 1 }, + { "matrix": [1, 3], "x": 3, "y": 1 }, + { "matrix": [1, 4], "x": 4, "y": 1 }, + { "matrix": [1, 5], "x": 5, "y": 1 }, + { "matrix": [5, 0], "x": 6, "y": 1 }, + { "matrix": [5, 1], "x": 7, "y": 1 }, + { "matrix": [5, 2], "x": 8, "y": 1 }, + { "matrix": [5, 3], "x": 9, "y": 1 }, + { "matrix": [5, 4], "x": 10, "y": 1 }, + { "matrix": [5, 5], "x": 11, "y": 1 }, + + { "matrix": [2, 0], "x": 0, "y": 2 }, + { "matrix": [2, 1], "x": 1, "y": 2 }, + { "matrix": [2, 2], "x": 2, "y": 2 }, + { "matrix": [2, 3], "x": 3, "y": 2 }, + { "matrix": [2, 4], "x": 4, "y": 2 }, + { "matrix": [2, 5], "x": 5, "y": 2 }, + { "matrix": [6, 0], "x": 6, "y": 2 }, + { "matrix": [6, 1], "x": 7, "y": 2 }, + { "matrix": [6, 2], "x": 8, "y": 2 }, + { "matrix": [6, 3], "x": 9, "y": 2 }, + { "matrix": [6, 4], "x": 10, "y": 2 }, + { "matrix": [6, 5], "x": 11, "y": 2 }, + + { "matrix": [3, 0], "x": 0, "y": 3 }, + { "matrix": [3, 1], "x": 1, "y": 3 }, + { "matrix": [3, 2], "x": 2, "y": 3 }, + { "matrix": [7, 3], "x": 3, "y": 3 }, + { "matrix": [7, 5], "x": 4, "y": 3, "w": 2 }, + { "matrix": [7, 1], "x": 6, "y": 3, "w": 2 }, + { "matrix": [7, 2], "x": 8, "y": 3 }, + { "matrix": [3, 3], "x": 9, "y": 3 }, + { "matrix": [3, 4], "x": 10, "y": 3 }, + { "matrix": [3, 5], "x": 11, "y": 3 } + ] + } + } +} diff --git a/keyboards/planck/rev7/keymaps/default/config.h b/keyboards/planck/rev7/keymaps/default/config.h new file mode 100644 index 000000000000..fbbab996e1e7 --- /dev/null +++ b/keyboards/planck/rev7/keymaps/default/config.h @@ -0,0 +1,43 @@ +/* Copyright 2015-2023 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE +# define STARTUP_SONG SONG(PLANCK_SOUND) +// #define STARTUP_SONG SONG(NO_SOUND) + +# define DEFAULT_LAYER_SONGS \ + { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND) } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +// #define MIDI_ADVANCED diff --git a/keyboards/planck/rev7/keymaps/default/keymap.c b/keyboards/planck/rev7/keymaps/default/keymap.c new file mode 100644 index 000000000000..4ac4c0de4f88 --- /dev/null +++ b/keyboards/planck/rev7/keymaps/default/keymap.c @@ -0,0 +1,306 @@ +/* Copyright 2015-2023 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 . + */ + +#include QMK_KEYBOARD_H + +enum planck_layers { _QWERTY, _COLEMAK, _DVORAK, _LOWER, _RAISE, _PLOVER, _ADJUST }; + +enum planck_keycodes { QWERTY = SAFE_RANGE, COLEMAK, DVORAK, PLOVER, BACKLIT, EXT_PLV }; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +/* clang-format off */ +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_RSFT, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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 , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_RSFT, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | ' | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_RSFT, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * v------------------------RGB CONTROL--------------------v + * ,-----------------------------------------------------------------------------------. + * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | |MUSmod|Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, EE_CLR, MU_NEXT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, AU_PREV, AU_NEXT, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; +/* clang-format on */ + +#ifdef AUDIO_ENABLE +float plover_song[][2] = SONG(PLOVER_SOUND); +float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); +#endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); +#endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +/* clang-format off */ +float melody[8][2][2] = { + {{440.0f, 8}, {440.0f, 24}}, + {{440.0f, 8}, {440.0f, 24}}, + {{440.0f, 8}, {440.0f, 24}}, + {{440.0f, 8}, {440.0f, 24}}, + {{440.0f, 8}, {440.0f, 24}}, + {{440.0f, 8}, {440.0f, 24}}, + {{440.0f, 8}, {440.0f, 24}}, + {{440.0f, 8}, {440.0f, 24}}, +}; +/* clang-format on */ + +#define JUST_MINOR_THIRD 1.2 +#define JUST_MAJOR_THIRD 1.25 +#define JUST_PERFECT_FOURTH 1.33333333 +#define JUST_TRITONE 1.42222222 +#define JUST_PERFECT_FIFTH 1.33333333 + +#define ET12_MINOR_SECOND 1.059463 +#define ET12_MAJOR_SECOND 1.122462 +#define ET12_MINOR_THIRD 1.189207 +#define ET12_MAJOR_THIRD 1.259921 +#define ET12_PERFECT_FOURTH 1.33484 +#define ET12_TRITONE 1.414214 +#define ET12_PERFECT_FIFTH 1.498307 + +deferred_token tokens[8]; + +uint32_t reset_note(uint32_t trigger_time, void *note) { + *(float*)note = 440.0f; + return 0; +} + +bool encoder_update_user(uint8_t index, bool clockwise) { + cancel_deferred_exec(tokens[index]); + if (clockwise) { + melody[index][1][0] = melody[index][1][0] * ET12_MINOR_SECOND; + melody[index][0][0] = melody[index][1][0] / ET12_PERFECT_FIFTH; + audio_play_melody(&melody[index], 2, false); + } else { + melody[index][1][0] = melody[index][1][0] / ET12_MINOR_SECOND; + melody[index][0][0] = melody[index][1][0] * ET12_TRITONE; + audio_play_melody(&melody[index], 2, false); + } + tokens[index] = defer_exec(1000, reset_note, &melody[index][1][0]); + return false; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { + PLAY_SONG(plover_song); + } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { + PLAY_SONG(plover_gb_song); + } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + } + return true; +} \ No newline at end of file diff --git a/keyboards/planck/rev7/keymaps/default/rules.mk b/keyboards/planck/rev7/keymaps/default/rules.mk new file mode 100644 index 000000000000..13fc199bb6c7 --- /dev/null +++ b/keyboards/planck/rev7/keymaps/default/rules.mk @@ -0,0 +1 @@ +DEFERRED_EXEC_ENABLE = yes \ No newline at end of file diff --git a/keyboards/planck/rev7/keymaps/peterfalken/config.h b/keyboards/planck/rev7/keymaps/peterfalken/config.h new file mode 100644 index 000000000000..c3de26365b22 --- /dev/null +++ b/keyboards/planck/rev7/keymaps/peterfalken/config.h @@ -0,0 +1,49 @@ +/* Copyright 2015-2023 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 . + */ + +#pragma once + +#ifdef AUDIO_ENABLE +# define STARTUP_SONG SONG(PLANCK_SOUND) +// #define STARTUP_SONG SONG(NO_SOUND) + +# define DEFAULT_LAYER_SONGS \ + { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND) } +#endif + +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +// #define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +// #define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/rev7/keymaps/peterfalken/keymap.c b/keyboards/planck/rev7/keymaps/peterfalken/keymap.c new file mode 100644 index 000000000000..140149c47233 --- /dev/null +++ b/keyboards/planck/rev7/keymaps/peterfalken/keymap.c @@ -0,0 +1,80 @@ +// Copyright 2023 Peter.Falken (@PeterFalken) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "muse.h" +#include "peterfalken.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ▽ | Ctrl | Opt | Cmd | LWR | Space | RSE | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + _______, KC_LCTL, KC_LOPT, KC_LCMD, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ▽ | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | ▽ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ ▽ | ▽ | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ▽ | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | ▽ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ ▽ | ▽ | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | RSET | ▽ | M.AP | M.AL | LPAD | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | SLEP | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | CPWD | UN | CU | CO | PA | MV | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + QK_BOOT, _______, CK_M1, KC_MCTL, KC_LPAD, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CK_SLP, + CK_CW, _______, CK_CU, CK_CO, CK_PA, CK_MV, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; diff --git a/keyboards/planck/rev7/keymaps/peterfalken/readme.md b/keyboards/planck/rev7/keymaps/peterfalken/readme.md new file mode 100644 index 000000000000..f64d682a51ed --- /dev/null +++ b/keyboards/planck/rev7/keymaps/peterfalken/readme.md @@ -0,0 +1,14 @@ +Copyright 2023 LEG @PeterFalken + +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 . diff --git a/keyboards/planck/rev7/keymaps/peterfalken/rules.mk b/keyboards/planck/rev7/keymaps/peterfalken/rules.mk new file mode 100644 index 000000000000..4db223543d7a --- /dev/null +++ b/keyboards/planck/rev7/keymaps/peterfalken/rules.mk @@ -0,0 +1,4 @@ +# Setup keymap QMK features +# TODO: Check for space optimizations +AUDIO_ENABLE = yes # Enable Audio Output +ENCODER_ENABLE = no # Disable encoder diff --git a/keyboards/planck/rev7/matrix.c b/keyboards/planck/rev7/matrix.c new file mode 100644 index 000000000000..c89c399a40d2 --- /dev/null +++ b/keyboards/planck/rev7/matrix.c @@ -0,0 +1,188 @@ +/* + * Copyright 2018-2023 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 . + */ + +#include "gpio.h" +#include "hal_pal.h" +#include "hal_pal_lld.h" +#include "quantum.h" +#include + +// STM32-specific watchdog config calculations +// timeout = 31.25us * PR * (RL + 1) +#define _STM32_IWDG_LSI(us) ((us) / 31.25) +#define STM32_IWDG_PR_US(us) (uint8_t)(log(_STM32_IWDG_LSI(us)) / log(2) - 11) +#define STM32_IWDG_PR_MS(s) STM32_IWDG_PR_US(s * 1000.0) +#define STM32_IWDG_PR_S(s) STM32_IWDG_PR_US(s * 1000000.0) +#define _STM32_IWDG_SCALAR(us) (2 << ((uint8_t)STM32_IWDG_PR_US(us) + 1)) +#define STM32_IWDG_RL_US(us) (uint64_t)(_STM32_IWDG_LSI(us)) / _STM32_IWDG_SCALAR(us) +#define STM32_IWDG_RL_MS(s) STM32_IWDG_RL_US(s * 1000.0) +#define STM32_IWDG_RL_S(s) STM32_IWDG_RL_US(s * 1000000.0) + +#if !defined(PLANCK_ENCODER_RESOLUTION) +# define PLANCK_ENCODER_RESOLUTION 4 +#endif + +#if !defined(PLANCK_WATCHDOG_TIMEOUT) +# define PLANCK_WATCHDOG_TIMEOUT 1.0 +#endif + +#ifdef ENCODER_MAP_ENABLE +#error "The encoder map feature is not currently supported by the Planck's encoder matrix" +#endif + +/* matrix state(1:on, 0:off) */ +static pin_t matrix_row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static pin_t matrix_col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +static matrix_row_t matrix_inverted[MATRIX_COLS]; + +#ifdef ENCODER_ENABLE +int8_t encoder_LUT[] = {0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0}; +uint8_t encoder_state[8] = {0}; +int8_t encoder_pulses[8] = {0}; +uint8_t encoder_value[8] = {0}; +#endif + +void matrix_init_custom(void) { + // actual matrix setup - cols + for (int i = 0; i < MATRIX_COLS; i++) { + setPinOutput(matrix_col_pins[i]); + writePinLow(matrix_col_pins[i]); + } + + // rows + for (int i = 0; i < MATRIX_ROWS; i++) { + setPinInputLow(matrix_row_pins[i]); + } + + // encoder A & B setup + setPinInputLow(B12); + setPinInputLow(B13); + +#ifndef PLANCK_WATCHDOG_DISABLE + wdgInit(); + + static WDGConfig wdgcfg; + wdgcfg.pr = STM32_IWDG_PR_S(PLANCK_WATCHDOG_TIMEOUT); + wdgcfg.rlr = STM32_IWDG_RL_S(PLANCK_WATCHDOG_TIMEOUT); + wdgcfg.winr = STM32_IWDG_WIN_DISABLED; + wdgStart(&WDGD1, &wdgcfg); +#endif +} + +#ifdef ENCODER_ENABLE +bool encoder_update(uint8_t index, uint8_t state) { + bool changed = false; + uint8_t i = index; + + encoder_pulses[i] += encoder_LUT[state & 0xF]; + + if (encoder_pulses[i] >= PLANCK_ENCODER_RESOLUTION) { + encoder_value[index]++; + changed = true; + encoder_update_kb(index, false); + } + if (encoder_pulses[i] <= -PLANCK_ENCODER_RESOLUTION) { + encoder_value[index]--; + changed = true; + encoder_update_kb(index, true); + } + encoder_pulses[i] %= PLANCK_ENCODER_RESOLUTION; +#ifdef ENCODER_DEFAULT_POS + encoder_pulses[i] = 0; +#endif + return changed; +} +#endif + +bool matrix_scan_custom(matrix_row_t current_matrix[]) { +#ifndef PLANCK_WATCHDOG_DISABLE + // reset watchdog + wdgReset(&WDGD1); +#endif + + bool changed = false; + + // actual matrix + for (int col = 0; col < MATRIX_COLS; col++) { + matrix_row_t data = 0; + + // strobe col + writePinHigh(matrix_col_pins[col]); + + // need wait to settle pin state + wait_us(20); + + // read row data + for (int row = 0; row < MATRIX_ROWS; row++) { + data |= (readPin(matrix_row_pins[row]) << row); + } + + // unstrobe col + writePinLow(matrix_col_pins[col]); + + if (matrix_inverted[col] != data) { + matrix_inverted[col] = data; + } + } + + for (int row = 0; row < MATRIX_ROWS; row++) { + matrix_row_t old = current_matrix[row]; + current_matrix[row] = 0; + for (int col = 0; col < MATRIX_COLS; col++) { + current_matrix[row] |= ((matrix_inverted[col] & (1 << row) ? 1 : 0) << col); + } + changed |= old != current_matrix[row]; + } + +#ifdef ENCODER_ENABLE + // encoder-matrix functionality + + // set up C/rows for encoder read + for (int i = 0; i < MATRIX_ROWS; i++) { + setPinOutput(matrix_row_pins[i]); + writePinHigh(matrix_row_pins[i]); + } + + // set up A & B for reading + setPinInputHigh(B12); + setPinInputHigh(B13); + + for (int i = 0; i < MATRIX_ROWS; i++) { + writePinLow(matrix_row_pins[i]); + wait_us(10); + uint8_t new_status = (palReadPad(GPIOB, 12) << 0) | (palReadPad(GPIOB, 13) << 1); + if ((encoder_state[i] & 0x3) != new_status) { + encoder_state[i] <<= 2; + encoder_state[i] |= new_status; + encoder_update(i, encoder_state[i]); + } + writePinHigh(matrix_row_pins[i]); + } + + // revert A & B to matrix state + setPinInputLow(B12); + setPinInputLow(B13); + + // revert C/rows to matrix state + for (int i = 0; i < MATRIX_ROWS; i++) { + setPinInputLow(matrix_row_pins[i]); + } +#endif + + return changed; +} diff --git a/keyboards/planck/rev7/mcuconf.h b/keyboards/planck/rev7/mcuconf.h new file mode 100644 index 000000000000..fa3d3be885de --- /dev/null +++ b/keyboards/planck/rev7/mcuconf.h @@ -0,0 +1,51 @@ +/* Copyright 2020 QMK Contributors + * + * 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 3 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 . + */ + +#pragma once + +#include_next + +// The SysTick timer from the normal quantum/stm32 uses TIM2 -- the WS2812 pin used +// on the Planck requires the use of TIM2 to run PWM -- rework which timers are +// allocated for PWM usage. +#undef STM32_PWM_USE_TIM2 +#define STM32_PWM_USE_TIM2 TRUE + +#undef STM32_DAC_USE_DAC1_CH1 +#define STM32_DAC_USE_DAC1_CH1 TRUE +#undef STM32_DAC_USE_DAC1_CH2 +#define STM32_DAC_USE_DAC1_CH2 TRUE +#undef STM32_GPT_USE_TIM6 +#define STM32_GPT_USE_TIM6 TRUE +#undef STM32_GPT_USE_TIM7 +#define STM32_GPT_USE_TIM7 TRUE +#undef STM32_GPT_USE_TIM8 +#define STM32_GPT_USE_TIM8 TRUE + +// As mentioned above, we need to reallocate the SysTick timer used from +// TIM2 to TIM3. +#undef STM32_ST_USE_TIMER +#define STM32_ST_USE_TIMER 3 + +// enable i2c +#undef STM32_I2C_USE_I2C1 +#define STM32_I2C_USE_I2C1 TRUE + +// use the watchdog timer +#undef STM32_WDG_USE_IWDG +#define STM32_WDG_USE_IWDG TRUE +#undef STM32_IWDG_IS_WINDOWED +#define STM32_IWDG_IS_WINDOWED TRUE diff --git a/keyboards/planck/rev7/readme.md b/keyboards/planck/rev7/readme.md new file mode 100644 index 000000000000..6a4df377046a --- /dev/null +++ b/keyboards/planck/rev7/readme.md @@ -0,0 +1,42 @@ +# Planck + +A compact 40% (12x4) ortholinear keyboard kit designed by OLKB and sold by Drop. A complete hardware rework of the rev6 Planck PCB, with support for up to 8 rotary encoders. [More info on qmk.fm](http://qmk.fm/planck/) + +* Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +* Hardware Supported: Planck PCB rev7 +* Hardware Availability: [Drop](https://drop.com/buy/planck-mechanical-keyboard?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make planck/rev7:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Encoders + +Encoders must have matching pulse & detent resolutions (e.g. 24/24) for the scanning to work properly. Multiple encoders can be used at the same time, and are zero-indexed (compared to being one-indexed on the PCB's silkscreen) in the `encoder_update_user(uint8_t index, bool clockwise)` function: + +``` +,-----------------------------------------------------------------------------------. +| 0 | | | | | | | | | | | 4 | +|------+------+------+------+------+------+------+------+------+------+------+------| +| 1 | | | | | | | | | | | 5 | +|------+------+------+------+------+------+------+------+------+------+------+------| +| 2 | | | | | | | | | | | 6 | +|------+------+------+------+------+------+------+------+------+------+------+------| +| 3 | | | | | | | | | | 7 | +`-----------------------------------------------------------------------------------' +``` + +If an encoder has a switch built-in, it's connected to the key at that location. On the default keymap, each encoder will play its own rising/falling tone sequence when rotated, and will reset the pitch after one second of inactivity. The encoder map feature is not currently supported. + +## Some Planck-specific config.h options: + +```c +// sets the length (in seconds) of the watchdog timer, which will reset the keyboard due to hang/crash in the code +#define PLANCK_WATCHDOG_TIMEOUT 1.0 +// disables the watchdog timer - you may want to disable the watchdog timer if you use longer macros +#define PLANCK_WATCHDOG_DISABLE +// the resolution of the encoders used in the encoder matrix +#define PLANCK_ENCODER_RESOLUTION 4 +``` diff --git a/keyboards/planck/rev7/rev7.c b/keyboards/planck/rev7/rev7.c new file mode 100644 index 000000000000..bb9d0ee1e8cc --- /dev/null +++ b/keyboards/planck/rev7/rev7.c @@ -0,0 +1,74 @@ +/* Copyright 2023 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 . + */ +#include "quantum.h" + +#ifdef RGB_MATRIX_ENABLE +// clang-format off +led_config_t g_led_config = { { + // Key Matrix to LED Index + { NO_LED, 6, NO_LED, NO_LED, 5, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 0 }, + { NO_LED, 7, NO_LED, NO_LED, 2, NO_LED }, + { NO_LED, 4, NO_LED, NO_LED, 3, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, 1, NO_LED, NO_LED, 8, NO_LED }, +}, { + // LED Index to Physical Position + {112, 39}, {148, 60}, {206, 53}, {206, 3}, {150, 3}, {74, 3}, {18, 3}, {18, 54}, {77, 60} +}, { + // LED Index to Flag + LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, + LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL +} }; + +// LED physical location index +// 6 5 4 3 +// 0 +// 7 8 1 2 + +#endif + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}}, + {{5, 5}, {4, 5}, {3, 5}, {2, 5}, {1, 5}, {0, 5}}, + {{5, 6}, {4, 6}, {3, 6}, {2, 6}, {1, 6}, {0, 6}}, + {{5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, + + {{5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, + {{5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, + {{5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, + {{5, 7}, {4, 7}, {3, 7}, {2, 7}, {1, 7}, {0, 7}}, +}; + +# ifdef ENCODER_MAP_ENABLE +const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0}; +# endif +#endif + +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = { + {36, 37, 38, 39, 40, 41}, + {24, 25, 26, 27, 28, 29}, + {12, 13, 14, 15, 16, 17}, + { 0, 1, 2, 9, 10, 11}, + {42, 43, 44, 45, 46, 47}, + {30, 31, 32, 33, 34, 35}, + {18, 19, 20, 21, 22, 23}, + { 6, 7, 8, 3, 4, 5} +}; diff --git a/keyboards/planck/rev7/rules.mk b/keyboards/planck/rev7/rules.mk new file mode 100644 index 000000000000..38710bc00b8b --- /dev/null +++ b/keyboards/planck/rev7/rules.mk @@ -0,0 +1,9 @@ +# Build Options +# change yes to no to disable +# +CUSTOM_MATRIX = lite +DIP_SWITCH_ENABLE = yes + +SRC += matrix.c + +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/thk/config.h b/keyboards/planck/thk/config.h new file mode 100644 index 000000000000..832fb0789cca --- /dev/null +++ b/keyboards/planck/thk/config.h @@ -0,0 +1,30 @@ +/* + * Copyright 2018 Jack Humbert + * Copyright 2021 Erovia + +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 . +*/ + +#pragma once + +#define TAPPING_TOGGLE 3 + +#define DIP_SWITCH_PINS { D0, D1, D4, D6 } + +// THK uses D5 for audio +#undef AUDIO_PIN +#define AUDIO_PIN D5 + +// VUSB D- port +#define USB_CFG_DMINUS_BIT 3 diff --git a/keyboards/planck/thk/info.json b/keyboards/planck/thk/info.json new file mode 100644 index 000000000000..e7321ba69720 --- /dev/null +++ b/keyboards/planck/thk/info.json @@ -0,0 +1,134 @@ +{ + "keyboard_name": "Planck THK", + "manufacturer": "OLKB", + "maintainer": "Erovia", + "url": "https://olkb.com/planck", + "usb": { + "vid": "0x03A8", + "pid": "0x25A7", + "device_version": "0.0.1" + }, + "matrix_pins": { + "cols": ["D7", "C2", "C3", "C4", "C5", "C6", "C7", "A3", "A2", "A1", "A0", "B0"], + "rows": ["A7", "A6", "A5", "A4"] + }, + "diode_direction": "COL2ROW", + "encoder": { + "rotary": [ + {"pin_a": "B4", "pin_b": "B3"}, + {"pin_a": "B2", "pin_b": "B1"} + ] + }, + "processor": "atmega32a", + "bootloader": "usbasploader", + "layout_aliases": { + "LAYOUT_planck_grid": "LAYOUT_ortho_4x12", + "LAYOUT_planck_mit": "LAYOUT_planck_1x2uC" + }, + "community_layouts": ["ortho_4x12", "planck_mit"], + "layouts": { + "LAYOUT_ortho_4x12": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [2, 6], "x": 6, "y": 2}, + {"matrix": [2, 7], "x": 7, "y": 2}, + {"matrix": [2, 8], "x": 8, "y": 2}, + {"matrix": [2, 9], "x": 9, "y": 2}, + {"matrix": [2, 10], "x": 10, "y": 2}, + {"matrix": [2, 11], "x": 11, "y": 2}, + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [3, 4], "x": 4, "y": 3}, + {"matrix": [3, 5], "x": 5, "y": 3}, + {"matrix": [3, 6], "x": 6, "y": 3}, + {"matrix": [3, 7], "x": 7, "y": 3}, + {"matrix": [3, 8], "x": 8, "y": 3}, + {"matrix": [3, 9], "x": 9, "y": 3}, + {"matrix": [3, 10], "x": 10, "y": 3}, + {"matrix": [3, 11], "x": 11, "y": 3} + ] + }, + "LAYOUT_planck_1x2uC": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [2, 6], "x": 6, "y": 2}, + {"matrix": [2, 7], "x": 7, "y": 2}, + {"matrix": [2, 8], "x": 8, "y": 2}, + {"matrix": [2, 9], "x": 9, "y": 2}, + {"matrix": [2, 10], "x": 10, "y": 2}, + {"matrix": [2, 11], "x": 11, "y": 2}, + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [3, 4], "x": 4, "y": 3}, + {"matrix": [3, 5], "x": 5, "y": 3, "w": 2}, + {"matrix": [3, 7], "x": 7, "y": 3}, + {"matrix": [3, 8], "x": 8, "y": 3}, + {"matrix": [3, 9], "x": 9, "y": 3}, + {"matrix": [3, 10], "x": 10, "y": 3}, + {"matrix": [3, 11], "x": 11, "y": 3} + ] + } + } +} diff --git a/keyboards/planck/thk/keymaps/thk/keymap.c b/keyboards/planck/thk/keymaps/thk/keymap.c new file mode 100644 index 000000000000..8df45e8733c5 --- /dev/null +++ b/keyboards/planck/thk/keymaps/thk/keymap.c @@ -0,0 +1,241 @@ +/* Copyright 2015-2017 Jack Humbert + * Copyright 2021 Erovia + * + * 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 QMK_KEYBOARD_H + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + THK, +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | THK | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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 , + THK, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | THK | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + 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 , + THK, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | THK | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + THK, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset|Debug | | | | | | | | | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | |AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , + _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + case THK: + if (record->event.pressed) { + SEND_STRING("Pretty cool keyboard, eh?"); + } + return false; + } + return true; +} + +bool encoder_mode = false; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); + #else + tap_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); + #else + tap_code(KC_PGUP); + #endif + } + } else if (index == 1) { /* Second encoder */ + if (clockwise) { + if (encoder_mode) { + tap_code(KC_RGHT); + } else { + tap_code_delay(KC_VOLU, 60); + } + } else { + if (encoder_mode) { + tap_code(KC_LEFT); + } else { + tap_code_delay(KC_VOLD, 60); + } + } + } + return true; +} + +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { + if (active) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + } + break; + case 1: + if (active) { + encoder_mode = true; + } else { + encoder_mode = false; + } + break; + case 2: + SEND_STRING("QMK is the best thing ever"); + break; + case 3: + SEND_STRING("This is a Planck THK"); + break; + } + return true; +} diff --git a/keyboards/planck/thk/keymaps/thk/readme.md b/keyboards/planck/thk/keymaps/thk/readme.md new file mode 100644 index 000000000000..bae51e067fea --- /dev/null +++ b/keyboards/planck/thk/keymaps/thk/readme.md @@ -0,0 +1,3 @@ +# Keymap specifically for the Planck T.H.K. + +Based on the `default` Planck keymap. diff --git a/keyboards/planck/thk/readme.md b/keyboards/planck/thk/readme.md new file mode 100644 index 000000000000..d9dde7401732 --- /dev/null +++ b/keyboards/planck/thk/readme.md @@ -0,0 +1,28 @@ +# Planck Through Hole Kit + +![THK](https://i.imgur.com/Fj8X0TDl.jpg) + +The OG 4x12, through-hole, ortho board. + +[Buildlog](https://erovia.github.io/posts/thk/) + +* Keyboard Maintainer: [Erovia](https://github.com/Erovia) +* Hardware Supported: [Planck THK](https://github.com/olkb/planck_thk) +* Hardware Availability: The hardware was released under GPLv3, see link above. + +Make example for this keyboard (after setting up your build environment): + + make planck/thk:thk + +Flashing example for this keyboard: + + make planck/thk:thk:flash + +**Reset**: With [the recommended bootloader](https://github.com/Erovia/planck_thk_usbasploader) a single press on the RESET button. + +## Audio + +The board has rudimental [audio](https://docs.qmk.fm/#/feature_audio) support. +As it can cause the USB connection to crash, likely due the mcu not being able to keep up with the USB's strict timing requirements, it's is disabled for the `thk` keymap. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/thk/rules.mk b/keyboards/planck/thk/rules.mk new file mode 100644 index 000000000000..417fb95129aa --- /dev/null +++ b/keyboards/planck/thk/rules.mk @@ -0,0 +1,17 @@ +# Processor frequency +F_CPU = 16000000 + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = yes +DIP_SWITCH_ENABLE = yes diff --git a/keyboards/planck/thk/thk.c b/keyboards/planck/thk/thk.c new file mode 100644 index 000000000000..bd7080e01b24 --- /dev/null +++ b/keyboards/planck/thk/thk.c @@ -0,0 +1,39 @@ +/* Copyright 2018 Jack Humbert + * Copyright 2021 Erovia + * + * 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 "quantum.h" + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, + {{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, + {{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, + {{11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, +}; + +# ifdef ENCODER_MAP_ENABLE +const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0}; +# endif +#endif + +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = { + {36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}, + {24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35}, + {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} +};