[Keymap] keymaps for planck and crkbd (#6895)

* using similar keymaps (with vim in mind) for planck and crkbd

* changed to rgb matrix and lower max brightness to prevent unresponsiveness

* readme and default rgb mode

* disable all the not wanted effects and activate the framebuffer ones

* changed effects

* changed custom keycodes to defines

* fixed comment
This commit is contained in:
dsanchezseco 2019-10-08 20:16:38 +02:00 committed by Drashna Jaelre
parent 2707652c98
commit 19584b92c5
6 changed files with 232 additions and 65 deletions

View file

@ -0,0 +1,10 @@
# Dvorak keymap for CRKBD
To flash the halves use:
```
#left side
make crkbd:dsanchezseco:dfu-split-left
#right side, with RGB matrix fix
make crkbd:dsanchezseco:dfu-split-right RGB_MATRIX_SPLIT_RIGHT=yes
```

View file

@ -0,0 +1,69 @@
/*
This is the c configuration file for the keymap
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
//#define USE_MATRIX_I2C
#define USE_SERIAL
/* Select hand configuration */
// #define MASTER_LEFT
// #define MASTER_RIGHT
#define EE_HANDS
// lower maximum brightness to lower power usage and prevent unresponsiveness
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200
#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_LEFT_RIGHT
//disable effects
#define DISABLE_RGB_MATRIX_ALPHAS_MODS // Static dual hue speed is hue for secondary hue
#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN // Static gradient top to bottom speed controls how much gradient changes
#define DISABLE_RGB_MATRIX_BAND_SAT // Single hue band fading saturation scrolling left to right
#define DISABLE_RGB_MATRIX_BAND_VAL // Single hue band fading brightness scrolling left to right
#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT // Single hue 3 blade spinning pinwheel fades saturation
#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL // Single hue 3 blade spinning pinwheel fades brightness
#define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT // Single hue spinning spiral fades saturation
#define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL // Single hue spinning spiral fades brightness
#define DISABLE_RGB_MATRIX_CYCLE_ALL // Full keyboard solid hue cycling through full gradient
#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN // Full gradient scrolling top to bottom
#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN // Full gradient scrolling out to in
#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL // Full dual gradients scrolling out to in
#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON // Full gradent Chevron shapped scrolling left to right
#define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL // Full gradient spinning pinwheel around center of keyboard
#define DISABLE_RGB_MATRIX_CYCLE_SPIRAL // Full gradient spinning spiral around center of keyboard
#define DISABLE_RGB_MATRIX_DUAL_BEACON // Full gradient spinning around center of keyboard
#define DISABLE_RGB_MATRIX_RAINBOW_BEACON // Full tighter gradient spinning around center of keyboard
#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS // Full dual gradients spinning two halfs of keyboard
#define DISABLE_RGB_MATRIX_RAINDROPS // Randomly changes a single key's hue
#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS // Randomly changes a single key's hue and saturation
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE // Pulses keys hit to hue & value then fades value out
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE // Static single hue pulses keys hit to shifted hue then fades to current hue
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE // Hue & value pulse near a single key hit then fades value out
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE // Hue & value pulse near multiple key hits then fades value out
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS // Hue & value pulse the same column and row of a single key hit then fades value out
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS // Hue & value pulse the same column and row of multiple key hits then fades value out
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS // Hue & value pulse away on the same column and row of a single key hit then fades value out
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS // Hue & value pulse away on the same column and row of multiple key hits then fades value out
#define DISABLE_RGB_MATRIX_SPLASH // Full gradient & value pulse away from a single key hit then fades value out
#define DISABLE_RGB_MATRIX_MULTISPLASH // Full gradient & value pulse away from multiple key hits then fades value out
#define DISABLE_RGB_MATRIX_SOLID_SPLASH // Hue & value pulse away from a single key hit then fades value out
#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH // Hue & value pulse away from multiple key hits then fades value out
#define DISABLE_RGB_MATRIX_EFFECT_MAX

View file

@ -0,0 +1,111 @@
#include QMK_KEYBOARD_H
#include "split_util.h"
extern keymap_config_t keymap_config;
#ifdef RGBLIGHT_ENABLE
//Following line allows macro to read current RGB settings
extern rgblight_config_t rgblight_config;
#endif
extern uint8_t is_master;
#define LOWER MO(_LOWER)
#define RAISE MO(_RAISE)
#define ESC_CTL LCTL_T(KC_ESC)
// 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 crkbd_layers {
_DVORAK,
_LOWER,
_RAISE,
_ADJUST
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_DVORAK] = LAYOUT( \
//,-----------------------------------------------. ,-----------------------------------------------.
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,KC_SFTENT,\
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
KC_LGUI, LOWER, KC_SPC, KC_BSPC, RAISE,KC_RALT \
//`-----------------------' `----------------------'
),
[_LOWER] = LAYOUT( \
//,-----------------------------------------------. ,-----------------------------------------------.
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( \
//,-----------------------------------------------. ,-----------------------------------------------.
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( \
//,-----------------------------------------------. ,-----------------------------------------------.
RGB_TOG,RGB_HUI,RGB_SAI,RGB_VAI,_______,RGB_M_T, _______,_______,_______,_______,KC_RIGHT,_______,\
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
RGB_MOD,RGB_HUD,RGB_SAD,RGB_VAD,_______,_______, _______,KC_LEFT,_______,_______,_______,_______,\
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
_______,KC_PSCR,_______,KC_DOWN, KC_UP, _______, _______,_______,_______,_______,_______,_______,\
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
_______,_______,_______, KC_DEL ,_______,_______ \
//`-----------------------' `----------------------'
)
};
uint32_t layer_state_set_user(uint32_t state) {
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
}
#ifdef OLED_DRIVER_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (!isLeftHand)
return OLED_ROTATION_180; // flips the display 180 to see it from my side
return rotation;
}
const char *read_logo(void);
void oled_task_user(void){
switch (biton32(layer_state)){
case _DVORAK:
oled_write_ln_P(PSTR("DVRK"), false);
break;
case _LOWER:
oled_write_ln_P(PSTR("LOWER"), false);
break;
case _RAISE:
oled_write_ln_P(PSTR("RAISE"), false);
break;
case _ADJUST:
oled_write_ln_P(PSTR("ADJST"), false);
break;
default:
oled_write_ln_P(PSTR("?????"), false);
}
//now print logo
oled_write(read_logo(), false);
}
#endif

View file

@ -0,0 +1,9 @@
const char *read_logo(void) {
static char 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,
0};
return logo;
}

View file

@ -0,0 +1,15 @@
# If you want to change the display of OLED, you need to change here
SRC += ./logo_reader.c
# enable OLED displays
OLED_DRIVER_ENABLE = yes
# enable media keys
EXTRAKEY_ENABLE = yes
# enable LEDs
RGB_MATRIX_ENABLE = WS2812
# using elite-c controllers
BOOTLOADER = qmk-dfu

View file

@ -1,6 +1,10 @@
#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 {
@ -10,85 +14,34 @@ enum planck_layers {
_ADJUST
};
enum planck_keycodes {
DVORAK = SAFE_RANGE,
};
#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 | / |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | O | E | U | I | D | H | T | N | S | - |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Ctrl | AltGr| Alt | GUI |Lower |Space | Bksp |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_SLSH,
KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINUS,
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, KC_SFTENT,
KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
KC_LCTL, _______, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_BSPC, RAISE, KC_RGUI, KC_RALT, _______, KC_RCTL
),
/* Lower
* ,-----------------------------------------------------------------------------------.
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | Del | | 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_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_DEL, _______, KC_MPLY, KC_VOLD, KC_VOLU, KC_MNXT
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
* ,-----------------------------------------------------------------------------------.
* | ` | 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 | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | Del | | 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_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_DEL, _______, KC_MPLY, KC_VOLD, KC_VOLU, KC_MNXT
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 (Lower + Raise)
* ,-----------------------------------------------------------------------------------
* | | Reset| | | | | | | | | | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | |PtrScr| |Mus on|Musoff| | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = LAYOUT_planck_grid(
_______, RESET, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, KC_PSCR, _______, MU_ON, MU_OFF, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, KC_RIGHT, _______,
_______, _______, _______, _______, _______, _______, _______, KC_LEFT, _______, _______, _______, _______,
_______, KC_PSCR, _______, KC_DOWN, KC_UP, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
)
};