forked from mirrors/qmk_firmware
[Keymap] add cwebster2 userspace and keymaps (#10541)
* Adding my keymap * Add a starter keymap for kyria * Updated keymap * Add auto shift, tapping modifications and gravatar oled bitmap * Add flashing helper scripts * Updates to my keymap * Enable raw hid and rgblight sleep * Cleanup * Updated keymap and board features * Remove some RGB modes for space * Start working on a miryoku-like keymap. This adds homerow mods to my keymap on the base layer and adds a game layer that doesnt have them * more work on keymaps * Fine tuning home row mods * update keymap * Keymap update * add split transport * keymap * cherry pick from develop * merge develop * fix * keymap iterations * Refactoring * continued refactoring * messing with rgb * update layer coloring * continued refactoring * more features * modifier color * Move stuff to userspace * Moving stuff out to userspace * refactoring into userspace * More refactoring * Fixing some errors in the keymap and changing the oled output * Sync zen1 keymap to my userspace config * Update copyright notices and revert transport.c to master * Swap tab and esc * Remove a file accidentally created * Use LTO_ENABLE to turn on Link_Time_Optimization * Drop modtap thumbs on game layout * Update game keymap * More iteration on the game keymap * Add oled indications of kitty and i3 mod * Promote colemak to default * Update tapping term for modtap keys * Add per key tapping term * Use left modifiers on right side
This commit is contained in:
parent
c492dd7912
commit
8bb2eeaabb
13 changed files with 952 additions and 0 deletions
55
keyboards/kyria/keymaps/cwebster2/config.h
Normal file
55
keyboards/kyria/keymaps/cwebster2/config.h
Normal file
|
@ -0,0 +1,55 @@
|
|||
/* Copyright 2020 Casey Webster <casey@e1337.dev>
|
||||
*
|
||||
* 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
|
||||
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
#define OLED_DISPLAY_128X64
|
||||
#endif
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
//#define RGBLIGHT_ANIMATIONS
|
||||
//#define RGBLIGHT_EFFECT_ALTERNATING
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
//#define RGBLIGHT_EFFECT_CHRISTMAS
|
||||
//#define RGBLIGHT_EFFECT_KNIGHT
|
||||
//#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
//#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||
//#define RGBLIGHT_EFFECT_RGB_TEST
|
||||
//#define RGBLIGHT_EFFECT_SNAKE
|
||||
//#define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
//#define RGBLIGHT_EFFECT_TWINKLE
|
||||
#define RGBLIGHT_HUE_STEP 8
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
#define RGBLIGHT_SLEEP
|
||||
#define RGBLIGHT_LIMIT_VAL 128
|
||||
#define RGBLIGHT_EFFECT_BREATHE_MAX 128
|
||||
#define RGBLIGHT_LAYERS
|
||||
#define RGBLIGHT_MAX_LAYERS 16
|
||||
//#define RGBLIGHT_STARTUP_ANIMATION
|
||||
#endif
|
||||
|
||||
#ifdef COMBO_ENABLE
|
||||
#define COMBO_COUNT 2
|
||||
#endif
|
||||
|
||||
#define QMK_KEYS_PER_SCAN 4
|
||||
|
||||
#define EE_HANDS
|
||||
|
||||
//#define DEBUG_MATRIX_SCAN_RATE
|
||||
//#define SPLIT_MODS_ENABLE
|
397
keyboards/kyria/keymaps/cwebster2/keymap.c
Normal file
397
keyboards/kyria/keymaps/cwebster2/keymap.c
Normal file
|
@ -0,0 +1,397 @@
|
|||
/* Copyright 2020 Casey Webster <casey@e1337.dev>
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "raw_hid.h"
|
||||
#define RAW_EPSIZE 8
|
||||
#include <stdio.h>
|
||||
|
||||
#include "cwebster2.h"
|
||||
|
||||
#ifdef WPM_ENABLE
|
||||
char wpm_str[10];
|
||||
uint16_t wpm_graph_timer = 0;
|
||||
#endif
|
||||
|
||||
#ifdef COMBO_ENABLE
|
||||
enum combos {
|
||||
ZX_COPY,
|
||||
CV_PASTE
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM copy_combo[] = { KC_Z, KC_X, COMBO_END };
|
||||
const uint16_t PROGMEM paste_combo[] = { KC_C, KC_V, COMBO_END };
|
||||
|
||||
combo_t key_combos[COMBO_COUNT] = {
|
||||
[ZX_COPY] = COMBO(copy_combo, LCTL_T(KC_C)),
|
||||
[CV_PASTE] = COMBO(paste_combo, LCTL_T(KC_V))
|
||||
};
|
||||
#endif
|
||||
|
||||
#define LAYOUT_kyria_base( \
|
||||
L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, \
|
||||
L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, \
|
||||
L21, L22, L23, L24, L25, R25, R24, R23, R22, R21, \
|
||||
L33, L34, L35, R35, R34, R33 \
|
||||
) \
|
||||
LAYOUT_kyria_wrapper ( \
|
||||
KC_GRV, L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, KC_BSLS, \
|
||||
KC_CTLBS, L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, KC_QUOT, \
|
||||
KC_EQL, L21, L22, L23, L24, L25, KC_LCCL, KC_LGUI, KC_ALTCL, KC_LSFT, R25, R24, R23, R22, R21, KC_MINS, \
|
||||
SCMD_T(KC_LBRC), C_S_T(KC_MINS), L33, L34, L35, R35, R34, R33, TO(_GAME), KC_PSCR \
|
||||
)
|
||||
#define LAYOUT_kyria_base_wrapper(...) LAYOUT_kyria_base(__VA_ARGS__)
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/*
|
||||
* Base Layer: QWERTY
|
||||
*/
|
||||
[_QWERTY] = LAYOUT_kyria_base_wrapper(
|
||||
/* ,-----------------------. ,-----------------------. */
|
||||
_______QWERTY_L1______, _______QWERTY_R1______,
|
||||
_______QWERTY_L2______, _______QWERTY_R2______,
|
||||
_______QWERTY_L3______, _______QWERTY_R3______,
|
||||
_______THUMBS_L_______, _______THUMBS_R_______
|
||||
/* `---------------------' `---------------------' */
|
||||
),
|
||||
[_COLEMAK] = LAYOUT_kyria_wrapper(
|
||||
/* ,-----------------------. ,-----------------------. */
|
||||
KC_GRV, _______COLEMAK_L1_____, _______COLEMAK_R1_____, KC_BSLS,
|
||||
KC_CTLBS, _______COLEMAK_L2_____, _______COLEMAK_R2_____, KC_SCLN,
|
||||
KC_EQL, _______COLEMAK_L3_____, KC_LCCL, KC_LGUI, KC_ALTCL, KC_LSFT, _______COLEMAK_R3_____, KC_MINS,
|
||||
SCMD_T(KC_LBRC), C_S_T(KC_MINS), _______THUMBS_L_______, _______THUMBS_R_______, TO(_QWERTY), KC_PSCR
|
||||
/* `---------------------' `---------------------' */
|
||||
),
|
||||
// GAME layout -- qwerty without homerow mods
|
||||
[_GAME] = LAYOUT_kyria_wrapper(
|
||||
/* ,-------------------------------------------. ,-------------------------------------------. */
|
||||
KC_GRV, _______QWERTY_L1______, _______QWERTY_R1______, KC_BSLS,
|
||||
KC_CTLBS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||
KC_LSFT, _______QWERTY_L3______, KC_LCCL, KC_LALT, KC_ALTCL, KC_LSFT, _______QWERTY_R3______, KC_MINS,
|
||||
KC_EQL, KC_0, _______NAKED_L___T____, _______THUMBS_R_______, TO(_COLEMAK), KC_F12
|
||||
/* `----------------------------------' `----------------------------------' */
|
||||
),
|
||||
[_FN] = LAYOUT_kyria_base_wrapper(
|
||||
/* ,-----------------------. ,-----------------------. */
|
||||
_______FN_______L1____, _______INACTIVE_R1____,
|
||||
_______FN_______L2____, _______INACTIVE_R2____,
|
||||
_______FN_______L3____, _______NAV______R2____,
|
||||
_______FN________T____, _______INACTIVE__T____
|
||||
/* `---------------------' `---------------------' */
|
||||
),
|
||||
[_SYMBOLS] = LAYOUT_kyria_base_wrapper(
|
||||
/* ,-----------------------. ,-----------------------. */
|
||||
_______SYM______L1____, _______INACTIVE_R1____,
|
||||
_______SYM______L2____, _______INACTIVE_R2____,
|
||||
_______SYM______L3____, _______INACTIVE_R3____,
|
||||
_______SYM_______T____, _______INACTIVE__T____
|
||||
/* `---------------------' `---------------------' */
|
||||
),
|
||||
[_NUM] = LAYOUT_kyria_base_wrapper(
|
||||
/* ,-----------------------. ,-----------------------. */
|
||||
_______NUM______L1____, _______INACTIVE_R1____,
|
||||
_______NUM______L2____, _______INACTIVE_R2____,
|
||||
_______NUM______L3____, _______INACTIVE_R3____,
|
||||
_______NUM_______T____, _______INACTIVE__T____
|
||||
/* `---------------------' `---------------------' */
|
||||
),
|
||||
[_NAV] = LAYOUT_kyria_base_wrapper(
|
||||
/* ,-----------------------. ,-----------------------. */
|
||||
_______INACTIVE_L1____, _______NAV______R1____,
|
||||
_______INACTIVE_L2____, _______NAV______R2____,
|
||||
_______INACTIVE_L3____, _______NAV______R3____,
|
||||
_______INACTIVE__T____, _______NAV_______T____
|
||||
/* `---------------------' `---------------------' */
|
||||
),
|
||||
[_MOUSE] = LAYOUT_kyria_base_wrapper(
|
||||
/* ,-----------------------. ,-----------------------. */
|
||||
_______INACTIVE_L1____, _______MOUSE____R1____,
|
||||
_______INACTIVE_L2____, _______MOUSE____R2____,
|
||||
_______INACTIVE_L3____, _______MOUSE____R3____,
|
||||
_______INACTIVE__T____, _______MOUSE_____T____
|
||||
/* `---------------------' `---------------------' */
|
||||
),
|
||||
[_MEDIA] = LAYOUT_kyria_base_wrapper(
|
||||
/* ,-----------------------. ,-----------------------. */
|
||||
_______INACTIVE_L1____, _______MEDIA____R1____,
|
||||
_______INACTIVE_L2____, _______MEDIA____R2____,
|
||||
_______INACTIVE_L3____, _______MEDIA____R3____,
|
||||
_______INACTIVE__T____, _______MEDIA_____T____
|
||||
/* `---------------------' `---------------------' */
|
||||
),
|
||||
};
|
||||
|
||||
#ifdef RAW_ENABLE
|
||||
static void send_layer_via_hid(int layer) {
|
||||
uint8_t data[RAW_EPSIZE];
|
||||
data[0] = 1;
|
||||
data[1] = layer;
|
||||
raw_hid_send(data, sizeof(data));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef RGBLIGHT_LAYERS
|
||||
const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_AZURE} );
|
||||
const rgblight_segment_t PROGMEM my_colemak_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_BLUE} );
|
||||
const rgblight_segment_t PROGMEM my_game_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_RED} );
|
||||
const rgblight_segment_t PROGMEM my_fn_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_PINK} );
|
||||
const rgblight_segment_t PROGMEM my_symbols_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_GREEN} );
|
||||
const rgblight_segment_t PROGMEM my_num_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_CORAL} );
|
||||
const rgblight_segment_t PROGMEM my_nav_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_GOLDENROD} );
|
||||
const rgblight_segment_t PROGMEM my_mouse_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_TURQUOISE} );
|
||||
const rgblight_segment_t PROGMEM my_media_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_MAGENTA} );
|
||||
|
||||
const rgblight_segment_t PROGMEM my_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
||||
{0, 3, HSV_RED},
|
||||
{7, 1, HSV_RED},
|
||||
{10, 3, HSV_RED},
|
||||
{17, 1, HSV_RED}
|
||||
);
|
||||
|
||||
const rgblight_segment_t PROGMEM my_shift_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
||||
{3, 1, HSV_RED},
|
||||
{13, 1, HSV_RED}
|
||||
);
|
||||
|
||||
const rgblight_segment_t PROGMEM my_ctrl_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
||||
{4, 1, HSV_ORANGE},
|
||||
{14, 1, HSV_ORANGE}
|
||||
);
|
||||
|
||||
const rgblight_segment_t PROGMEM my_alt_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
||||
{5, 1, HSV_GOLD},
|
||||
{15, 1, HSV_GOLD}
|
||||
);
|
||||
|
||||
const rgblight_segment_t PROGMEM my_gui_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
||||
{9, 1, HSV_SPRINGGREEN},
|
||||
{19, 1, HSV_SPRINGGREEN}
|
||||
);
|
||||
|
||||
const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(
|
||||
my_colemak_layer,
|
||||
my_qwerty_layer,
|
||||
my_game_layer,
|
||||
my_fn_layer,
|
||||
my_symbols_layer,
|
||||
my_num_layer,
|
||||
my_nav_layer,
|
||||
my_mouse_layer,
|
||||
my_media_layer,
|
||||
my_capslock_layer,
|
||||
my_shift_layer,
|
||||
my_ctrl_layer,
|
||||
my_alt_layer,
|
||||
my_gui_layer
|
||||
);
|
||||
|
||||
void matrix_scan_keymap(void) {
|
||||
uint8_t mods = mod_config(get_mods());
|
||||
rgblight_set_layer_state(10, mods & MOD_MASK_SHIFT);
|
||||
rgblight_set_layer_state(11, mods & MOD_MASK_CTRL);
|
||||
rgblight_set_layer_state(12, mods & MOD_MASK_ALT);
|
||||
rgblight_set_layer_state(13, mods & MOD_MASK_GUI);
|
||||
}
|
||||
#endif
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
rgblight_sethsv_noeeprom(HSV_BLUE);
|
||||
keyboard_post_init_rgb();
|
||||
#ifdef RGBLIGHT_LAYERS
|
||||
rgblight_layers = my_rgb_layers;
|
||||
#else
|
||||
rgblight_sethsv_noeeprom(HSV_BLUE);
|
||||
#endif
|
||||
/*debug_enable=true;*/
|
||||
/*debug_matrix=true;*/
|
||||
}
|
||||
|
||||
//todo https://github.com/qmk/qmk_firmware/blob/debdc6379c7a72815df1f53e3406479381d243af/keyboards/crkbd/keymaps/soundmonster/keymap.c RGBRST
|
||||
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
#ifdef RGBLIGHT_LAYERS
|
||||
for (int i = _QWERTY; i < __LAST; i++) {
|
||||
rgblight_set_layer_state(i, layer_state_cmp(state, i));
|
||||
}
|
||||
# ifdef RAW_ENABLE
|
||||
send_layer_via_hid(state);
|
||||
# endif
|
||||
#endif
|
||||
return state;
|
||||
}
|
||||
|
||||
#ifdef RGBLIGHT_LAYERS
|
||||
bool led_update_user(led_t led_state) {
|
||||
rgblight_set_layer_state(9, led_state.caps_lock);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
void suspend_power_down_user() {
|
||||
oled_clear();
|
||||
oled_off();
|
||||
}
|
||||
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return OLED_ROTATION_180;
|
||||
}
|
||||
|
||||
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,0};
|
||||
|
||||
static const char PROGMEM logo[] = {
|
||||
// canvas is 128x64. need 16 padding
|
||||
// 80x32
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x60, 0xe0, 0xf0, 0xfe, 0xfe, 0xf0, 0x60, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x7c, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0x7c, 0xf8, 0xe0, 0x60, 0x20, 0x10, 0x10, 0x0c, 0x0f, 0x09, 0x08, 0x00, 0x09, 0x9b, 0x5c, 0x50, 0x10, 0x20, 0x40, 0xe0, 0xf8, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0x78, 0x38, 0x38, 0x10, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, 0x17, 0x15, 0x3d, 0xef, 0xaf, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x10, 0x00, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x40, 0xa0, 0xbf, 0xff, 0x3f, 0x3f, 0x3f, 0x1f, 0x1f, 0x1f, 0x1f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
oled_write_raw_P(logo, sizeof(logo));
|
||||
|
||||
oled_advance_page(false);
|
||||
oled_advance_page(false);
|
||||
oled_advance_page(false);
|
||||
oled_advance_page(false);
|
||||
oled_write_P(qmk_logo, false);
|
||||
|
||||
#ifdef COMBO_ENABLE
|
||||
oled_write_P(PSTR("Combos enabled: "), false);
|
||||
if (is_combo_enabled()) {
|
||||
oled_write_P(PSTR("Yes\n"), false);
|
||||
} else {
|
||||
oled_write_P(PSTR("No\n"), false);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SPLIT_MODS_ENABLE
|
||||
uint8_t mods = get_mods() | get_weak_mods();
|
||||
oled_write_P((mods & MOD_MASK_GUI) ? PSTR("GUI ") : PSTR(" "), false);
|
||||
oled_write_P((mods & MOD_MASK_ALT) ? PSTR("ALT ") : PSTR(" "), false);
|
||||
oled_write_P((mods & MOD_MASK_CTRL) ? PSTR("CTRL ") : PSTR(" "), false);
|
||||
oled_write_P((mods & MOD_MASK_SHIFT) ? PSTR("SHFT ") : PSTR(" "), false);
|
||||
oled_write_P(PSTR("\n"), false);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef WPM_ENABLE
|
||||
// Write WPM
|
||||
sprintf(wpm_str, "WPM: %03d", get_current_wpm());
|
||||
//oled_write_P(PSTR("\n"), false);
|
||||
oled_write_P(PSTR(" "), false);
|
||||
oled_write(wpm_str, false);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static void render_status(void) {
|
||||
static bool isColemak = false;
|
||||
// QMK Logo and version information
|
||||
oled_write_P(PSTR("Kyria rev1.3\n\n"), false);
|
||||
|
||||
oled_write_P(isColemak ? PSTR("COLEMAK ") : PSTR("QWERTY "), false);
|
||||
|
||||
// Host Keyboard Layer Status
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case _QWERTY:
|
||||
oled_write_P(PSTR("Default\n"), false);
|
||||
isColemak = false;
|
||||
break;
|
||||
case _SYMBOLS:
|
||||
oled_write_P(PSTR("Shifted Sym\n"), false);
|
||||
break;
|
||||
case _NUM:
|
||||
oled_write_P(PSTR("Numbers\n"), false);
|
||||
break;
|
||||
case _NAV:
|
||||
oled_write_P(PSTR("Navigation\n"), false);
|
||||
break;
|
||||
case _FN:
|
||||
oled_write_P(PSTR("Fn\n"), false);
|
||||
break;
|
||||
case _GAME:
|
||||
oled_write_P(PSTR("Game\n"), false);
|
||||
isColemak = false;
|
||||
break;
|
||||
case _COLEMAK:
|
||||
oled_write_P(PSTR("Colemak-DHm\n"), false);
|
||||
isColemak = true;
|
||||
break;
|
||||
case _MEDIA:
|
||||
oled_write_P(PSTR("Media keys\n"), false);
|
||||
break;
|
||||
case _MOUSE:
|
||||
oled_write_P(PSTR("Mouse keys\n"), false);
|
||||
break;
|
||||
default:
|
||||
oled_write_P(PSTR("Undefined\n"), false);
|
||||
}
|
||||
|
||||
uint8_t mods = get_mods() | get_weak_mods();
|
||||
oled_write_P(PSTR("\n"), false);
|
||||
oled_write_P((mods & MOD_MASK_GUI) ? PSTR("GUI ") : PSTR(" "), false);
|
||||
oled_write_P((mods & MOD_MASK_ALT) ? PSTR("ALT ") : PSTR(" "), false);
|
||||
oled_write_P((mods & MOD_MASK_CTRL) ? PSTR("CTRL ") : PSTR(" "), false);
|
||||
oled_write_P((mods & MOD_MASK_SHIFT) ? PSTR("SHFT ") : PSTR(" "), false);
|
||||
oled_write_P(PSTR("\n"), false);
|
||||
|
||||
#define I3MASK MOD_BIT(KC_LGUI)
|
||||
#define I3SMASK (MOD_BIT(KC_LGUI) | MOD_BIT(KC_LSFT))
|
||||
#define KMASK (MOD_BIT(KC_LCTL) | MOD_BIT(KC_LSFT))
|
||||
|
||||
oled_write_P((mods == I3MASK) ? PSTR("I3 ") : (mods == I3SMASK) ? PSTR("I3-SFT ") : PSTR(" "), false);
|
||||
oled_write_P((mods == KMASK) ? PSTR("KITTY ") : PSTR(" "), false);
|
||||
oled_write_P(PSTR("\n"), false);
|
||||
|
||||
// Host Keyboard LED Status
|
||||
uint8_t led_usb_state = host_keyboard_leds();
|
||||
oled_write_P(IS_LED_ON(led_usb_state, USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false);
|
||||
oled_write_P(IS_LED_ON(led_usb_state, USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false);
|
||||
oled_write_P(IS_LED_ON(led_usb_state, USB_LED_SCROLL_LOCK) ? PSTR("SCRLCK ") : PSTR(" "), false);
|
||||
|
||||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
|
||||
} else {
|
||||
render_logo();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef RAW_ENABLE
|
||||
void raw_hid_receive(uint8_t *data, uint8_t length) {
|
||||
// messages from host
|
||||
// add ability to set color
|
||||
raw_hid_send(data, length);
|
||||
}
|
||||
#endif
|
5
keyboards/kyria/keymaps/cwebster2/rules.mk
Normal file
5
keyboards/kyria/keymaps/cwebster2/rules.mk
Normal file
|
@ -0,0 +1,5 @@
|
|||
OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays
|
||||
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
|
||||
RAW_ENABLE = yes
|
||||
WPM_ENABLE = yes
|
||||
COMBO_ENABLE = no
|
34
keyboards/rgbkb/zen/rev1/keymaps/cwebster2/config.h
Normal file
34
keyboards/rgbkb/zen/rev1/keymaps/cwebster2/config.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
Copyright 2020 Casey Webster <casey@e1337.dev>
|
||||
|
||||
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
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* Use I2C or Serial, not both */
|
||||
|
||||
#define USE_SERIAL
|
||||
|
||||
#define EE_HANDS
|
||||
|
||||
#ifdef COMBO_ENABLE
|
||||
#define COMBO_COUNT 2
|
||||
#endif
|
||||
|
||||
#define QMK_KEYS_PER_SCAN 4
|
||||
|
||||
#define EE_HANDS
|
116
keyboards/rgbkb/zen/rev1/keymaps/cwebster2/keymap.c
Normal file
116
keyboards/rgbkb/zen/rev1/keymaps/cwebster2/keymap.c
Normal file
|
@ -0,0 +1,116 @@
|
|||
/* Copyright 2020 Casey Webster <casey@e1337.dev>
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "rev1.h"
|
||||
#include "cwebster2.h"
|
||||
|
||||
#define LAYOUT_zen_base( \
|
||||
L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, \
|
||||
L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, \
|
||||
L21, L22, L23, L24, L25, R25, R24, R23, R22, R21, \
|
||||
L33, L34, L35, R35, R34, R33 \
|
||||
) \
|
||||
LAYOUT_zen_wrapper ( \
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, \
|
||||
KC_GRV, L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, KC_BSLS, \
|
||||
KC_CTLBS, L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, KC_QUOT, \
|
||||
KC_EQL, L21, L22, L23, L24, L25, R25, R24, R23, R22, R21, KC_MINS, \
|
||||
KC_LCCL, KC_LGUI, SCMD_T(KC_LBRC), C_S_T(KC_MINS), L33, L34, L35, R35, R34, R33, TO(_GAME), KC_PSCR, KC_ALTCL, KC_LSFT \
|
||||
)
|
||||
#define LAYOUT_zen_base_wrapper(...) LAYOUT_zen_base(__VA_ARGS__)
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/*
|
||||
* Base Layer: QWERTY
|
||||
*/
|
||||
[_QWERTY] = LAYOUT_zen_base_wrapper(
|
||||
/* ,-----------------------. ,-----------------------. */
|
||||
_______QWERTY_L1______, _______QWERTY_R1______,
|
||||
_______QWERTY_L2______, _______QWERTY_R2______,
|
||||
_______QWERTY_L3______, _______QWERTY_R3______,
|
||||
_______THUMBS_L_______, _______THUMBS_R_______
|
||||
/* `---------------------' `---------------------' */
|
||||
),
|
||||
[_COLEMAK] = LAYOUT_zen_wrapper(
|
||||
/* ,-----------------------. ,-----------------------. */
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL,
|
||||
KC_GRV, _______COLEMAK_L1_____, _______COLEMAK_R1_____, KC_BSLS,
|
||||
KC_CTLBS, _______COLEMAK_L2_____, _______COLEMAK_R2_____, KC_SCLN,
|
||||
KC_EQL, _______COLEMAK_L3_____, _______COLEMAK_R3_____, KC_MINS,
|
||||
KC_LCCL, KC_LGUI, SCMD_T(KC_LBRC), C_S_T(KC_MINS), _______THUMBS_L_______, _______THUMBS_R_______, TO(_QWERTY), KC_PSCR, KC_ALTCL, KC_LSFT
|
||||
/* `---------------------' `---------------------' */
|
||||
),
|
||||
// GAME layout -- qwerty without homerow mods
|
||||
[_GAME] = LAYOUT_zen_wrapper(
|
||||
/* ,-------------------------------------------. ,-------------------------------------------. */
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL,
|
||||
KC_GRV, _______QWERTY_L1______, _______QWERTY_R1______, KC_BSLS,
|
||||
KC_CTLBS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||
KC_EQL, _______QWERTY_L3______, _______QWERTY_R3______, KC_MINS,
|
||||
KC_LCCL, KC_LGUI, SCMD_T(KC_LBRC), C_S_T(KC_MINS), _______THUMBS_L_______, _______THUMBS_R_______, TO(_COLEMAK), KC_PSCR, KC_ALTCL, KC_LSFT
|
||||
/* `----------------------------------' `----------------------------------' */
|
||||
),
|
||||
[_FN] = LAYOUT_zen_base_wrapper(
|
||||
/* ,-----------------------. ,-----------------------. */
|
||||
_______FN_______L1____, _______INACTIVE_R1____,
|
||||
_______FN_______L2____, _______INACTIVE_R2____,
|
||||
_______FN_______L3____, _______NAV______R2____,
|
||||
_______FN________T____, _______INACTIVE__T____
|
||||
/* `---------------------' `---------------------' */
|
||||
),
|
||||
[_SYMBOLS] = LAYOUT_zen_base_wrapper(
|
||||
/* ,-----------------------. ,-----------------------. */
|
||||
_______SYM______L1____, _______INACTIVE_R1____,
|
||||
_______SYM______L2____, _______INACTIVE_R2____,
|
||||
_______SYM______L3____, _______INACTIVE_R3____,
|
||||
_______SYM_______T____, _______INACTIVE__T____
|
||||
/* `---------------------' `---------------------' */
|
||||
),
|
||||
[_NUM] = LAYOUT_zen_base_wrapper(
|
||||
/* ,-----------------------. ,-----------------------. */
|
||||
_______NUM______L1____, _______INACTIVE_R1____,
|
||||
_______NUM______L2____, _______INACTIVE_R2____,
|
||||
_______NUM______L3____, _______INACTIVE_R3____,
|
||||
_______NUM_______T____, _______INACTIVE__T____
|
||||
/* `---------------------' `---------------------' */
|
||||
),
|
||||
[_NAV] = LAYOUT_zen_base_wrapper(
|
||||
/* ,-----------------------. ,-----------------------. */
|
||||
_______INACTIVE_L1____, _______NAV______R1____,
|
||||
_______INACTIVE_L2____, _______NAV______R2____,
|
||||
_______INACTIVE_L3____, _______NAV______R3____,
|
||||
_______INACTIVE__T____, _______NAV_______T____
|
||||
/* `---------------------' `---------------------' */
|
||||
),
|
||||
[_MOUSE] = LAYOUT_zen_base_wrapper(
|
||||
/* ,-----------------------. ,-----------------------. */
|
||||
_______INACTIVE_L1____, _______MOUSE____R1____,
|
||||
_______INACTIVE_L2____, _______MOUSE____R2____,
|
||||
_______INACTIVE_L3____, _______MOUSE____R3____,
|
||||
_______INACTIVE__T____, _______MOUSE_____T____
|
||||
/* `---------------------' `---------------------' */
|
||||
),
|
||||
[_MEDIA] = LAYOUT_zen_base_wrapper(
|
||||
/* ,-----------------------. ,-----------------------. */
|
||||
_______INACTIVE_L1____, _______MEDIA____R1____,
|
||||
_______INACTIVE_L2____, _______MEDIA____R2____,
|
||||
_______INACTIVE_L3____, _______MEDIA____R3____,
|
||||
_______INACTIVE__T____, _______MEDIA_____T____
|
||||
/* `---------------------' `---------------------' */
|
||||
),
|
||||
};
|
||||
|
2
keyboards/rgbkb/zen/rev1/keymaps/cwebster2/rules.mk
Normal file
2
keyboards/rgbkb/zen/rev1/keymaps/cwebster2/rules.mk
Normal file
|
@ -0,0 +1,2 @@
|
|||
RGBLIGHT_ENABLE = no
|
||||
RAW_ENABLE = yes
|
57
users/cwebster2/config.h
Normal file
57
users/cwebster2/config.h
Normal file
|
@ -0,0 +1,57 @@
|
|||
/* Copyright 2020 Casey Webster <casey@e1337.dev>
|
||||
*
|
||||
* 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 TAPPING_TOGGLE 1
|
||||
#define TAPPING_TERM 200
|
||||
#define TAPPING_TERM_PER_KEY
|
||||
//#define TAPPING_FORCE_HOLD
|
||||
#undef PERMISSIVE_HOLD
|
||||
#define IGNORE_MOD_TAP_INTERRUPT
|
||||
#define NO_ACTION_ONESHOT
|
||||
|
||||
#ifdef AUTO_SHIFT_ENABLE
|
||||
#define AUTO_SHIFT_TIMEOUT 200
|
||||
#define NO_AUTO_SHIFT_SPECIAL
|
||||
#define NO_AUTO_SHIFT_ALPHA
|
||||
#endif
|
||||
|
||||
#undef MOUSEKEY_DELAY
|
||||
#define MOUSEKEY_DELAY 0
|
||||
#undef MOUSEKEY_INTERVAL
|
||||
#define MOUSEKEY_INTERVAL 16
|
||||
#undef MOUSEKEY_WHEEL_DELAY
|
||||
#define MOUSEKEY_WHEEL_DELAY 0
|
||||
#undef MOUSEKEY_MAX_SPEED
|
||||
#define MOUSEKEY_MAX_SPEED 6
|
||||
#undef MOUSEKEY_TIME_TO_MAX
|
||||
#define MOUSEKEY_TIME_TO_MAX 64
|
||||
|
||||
#ifdef LOCKING_SUPPORT_ENABLE
|
||||
# undef LOCKING_SUPPORT_ENABLE
|
||||
#endif
|
||||
#ifdef LOCKING_RESYNC_ENABLE
|
||||
# undef LOCKING_RESYNC_ENABLE
|
||||
#endif
|
||||
|
||||
#define NO_ACTION_MACRO
|
||||
#define NO_ACTION_FUNCTION
|
||||
#ifndef NO_DEBUG
|
||||
#define NO_DEBUG
|
||||
#endif // !NO_DEBUG
|
||||
#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE)
|
||||
#define NO_PRINT
|
||||
#endif // !NO_PRINT
|
65
users/cwebster2/cwebster2.c
Normal file
65
users/cwebster2/cwebster2.c
Normal file
|
@ -0,0 +1,65 @@
|
|||
/* Copyright 2020 Casey Webster <casey@e1337.dev>
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
#include "cwebster2.h"
|
||||
|
||||
userspace_config_t userspace_config;
|
||||
|
||||
__attribute__((weak)) void matrix_scan_keymap(void) {}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
static bool has_ran_yet;
|
||||
if (!has_ran_yet) {
|
||||
has_ran_yet = true;
|
||||
startup_user();
|
||||
}
|
||||
|
||||
matrix_scan_keymap();
|
||||
}
|
||||
|
||||
void keyboard_post_init_rgb(void) {
|
||||
#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION)
|
||||
/*if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); }*/
|
||||
/*if (rgblight_config.enable) {*/
|
||||
/*layer_state_set_user(layer_state);*/
|
||||
/*uint16_t old_hue = rgblight_config.hue;*/
|
||||
uint16_t old_hue = 170;
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
|
||||
for (uint16_t i = 255; i > 0; i--) {
|
||||
rgblight_sethsv_noeeprom( ( i + old_hue) % 255, 255, 255);
|
||||
matrix_scan();
|
||||
wait_ms(10);
|
||||
}
|
||||
/*}*/
|
||||
#endif
|
||||
/*layer_state_set_user(layer_state);*/
|
||||
}
|
||||
|
||||
__attribute__((weak)) void eeconfig_init_keymap(void) {}
|
||||
|
||||
void eeconfig_init_user(void) {
|
||||
userspace_config.raw = 0;
|
||||
userspace_config.rgb_layer_change = true;
|
||||
eeconfig_update_user(userspace_config.raw);
|
||||
eeconfig_init_keymap();
|
||||
keyboard_init();
|
||||
}
|
||||
|
||||
bool hasAllBitsInMask(uint8_t value, uint8_t mask) {
|
||||
value &= 0xF;
|
||||
mask &= 0xF;
|
||||
|
||||
return (value & mask) == mask;
|
||||
}
|
51
users/cwebster2/cwebster2.h
Normal file
51
users/cwebster2/cwebster2.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
/* Copyright 2020 Casey Webster <casey@e1337.dev>
|
||||
*
|
||||
* 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
|
||||
|
||||
#include "my_miryoku.h"
|
||||
#include "keycodes.h"
|
||||
#include "eeprom.h"
|
||||
|
||||
#define LAYOUT_kyria_wrapper(...) LAYOUT(__VA_ARGS__)
|
||||
#define LAYOUT_zen_wrapper(...) LAYOUT(__VA_ARGS__)
|
||||
|
||||
enum userspace_layers {
|
||||
_COLEMAK = 0,
|
||||
_QWERTY,
|
||||
_GAME,
|
||||
_FN,
|
||||
_SYMBOLS,
|
||||
_NUM,
|
||||
_NAV,
|
||||
_MOUSE,
|
||||
_MEDIA,
|
||||
__LAST
|
||||
};
|
||||
|
||||
void keyboard_post_init_rgb(void);
|
||||
void matrix_scan_keymap(void);
|
||||
void eeconfig_init_keymap(void);
|
||||
bool hasAllBitsInMask(uint8_t value, uint8_t mask);
|
||||
|
||||
|
||||
typedef union {
|
||||
uint32_t raw;
|
||||
struct {
|
||||
bool rgb_layer_change :1;
|
||||
};
|
||||
} userspace_config_t;
|
||||
|
||||
extern userspace_config_t userspace_config;
|
53
users/cwebster2/keycodes.c
Normal file
53
users/cwebster2/keycodes.c
Normal file
|
@ -0,0 +1,53 @@
|
|||
/* Copyright 2020 Casey Webster <casey@e1337.dev>
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
#include "keycodes.h"
|
||||
|
||||
__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; }
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
static uint16_t my_colon_timer;
|
||||
|
||||
switch (keycode) {
|
||||
case KC_LCCL:
|
||||
if (record->event.pressed) {
|
||||
my_colon_timer = timer_read();
|
||||
register_code(KC_LCTL);
|
||||
} else {
|
||||
unregister_code(KC_LCTL);
|
||||
if (timer_elapsed(my_colon_timer) < TAPPING_TERM) {
|
||||
SEND_STRING(":");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return process_record_keymap(keycode, record);
|
||||
}
|
||||
|
||||
uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case LGUI_T(KC_A):
|
||||
case LALT_T(KC_S):
|
||||
case LCTL_T(KC_D):
|
||||
case LSFT_T(KC_F):
|
||||
case RSFT_T(KC_J):
|
||||
case RCTL_T(KC_K):
|
||||
case RALT_T(KC_L):
|
||||
case RGUI_T(KC_SCLN):
|
||||
return TAPPING_TERM + 150;
|
||||
default:
|
||||
return TAPPING_TERM;
|
||||
}
|
||||
}
|
27
users/cwebster2/keycodes.h
Normal file
27
users/cwebster2/keycodes.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
/* Copyright 2020 Casey Webster <casey@e1337.dev>
|
||||
*
|
||||
* 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
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
enum userspace_custom_keycodes {
|
||||
KC_LCCL = SAFE_RANGE,
|
||||
NEW_SAFE_RANGE
|
||||
};
|
||||
|
||||
#define KC_CTLBS CTL_T(KC_BSPC)
|
||||
#define KC_ALTCL LALT_T(KC_CAPS)
|
||||
#define KC_LOCK LGUI(LCTL(KC_L))
|
77
users/cwebster2/my_miryoku.h
Normal file
77
users/cwebster2/my_miryoku.h
Normal file
|
@ -0,0 +1,77 @@
|
|||
/* Copyright 2020 Casey Webster <casey@e1337.dev>
|
||||
*
|
||||
* 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 _______QWERTY_L1______ KC_Q, KC_W, KC_E, KC_R, KC_T
|
||||
#define _______QWERTY_L2______ LGUI_T(KC_A), LALT_T(KC_S), LCTL_T(KC_D), LSFT_T(KC_F), KC_G
|
||||
#define _______QWERTY_L3______ KC_Z, KC_X, KC_C, KC_V, KC_B
|
||||
#define _______QWERTY_R1______ KC_Y, KC_U, KC_I, KC_O, KC_P
|
||||
#define _______QWERTY_R2______ KC_H, RSFT_T(KC_J), RCTL_T(KC_K), RALT_T(KC_L), RGUI_T(KC_SCLN)
|
||||
#define _______QWERTY_R3______ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH
|
||||
|
||||
#define _______COLEMAK_L1_____ KC_Q, KC_W, KC_F, KC_P, KC_B
|
||||
#define _______COLEMAK_L2_____ LGUI_T(KC_A), LALT_T(KC_R), LCTL_T(KC_S), LSFT_T(KC_T), KC_G
|
||||
#define _______COLEMAK_L3_____ KC_Z, KC_X, KC_C, KC_D, KC_V
|
||||
#define _______COLEMAK_R1_____ KC_J, KC_L, KC_U, KC_Y, KC_QUOT
|
||||
#define _______COLEMAK_R2_____ KC_M, RSFT_T(KC_N), RCTL_T(KC_E), RALT_T(KC_I), RGUI_T(KC_O)
|
||||
#define _______COLEMAK_R3_____ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH
|
||||
|
||||
#define _______THUMBS_L_______ LT(_MOUSE,KC_ESC), LT(_NAV,KC_SPC), LT(_MEDIA, KC_TAB)
|
||||
#define _______THUMBS_R_______ LT(_FN, KC_ENT), LT(_NUM,KC_BSPC), LT(_SYMBOLS,KC_DEL)
|
||||
|
||||
#define _______NAKED_R___T____ KC_ENT, KC_BSPC, KC_DEL
|
||||
#define _______NAKED_L___T____ KC_ESC, KC_SPC, KC_TAB
|
||||
|
||||
#define _______INACTIVE_R1____ KC_LOCK, KC_TRNS, KC_TRNS, KC_TRNS, RESET
|
||||
#define _______INACTIVE_R2____ KC_TRNS, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI
|
||||
#define _______INACTIVE_R3____ KC_TRNS, KC_TRNS, KC_TRNS, KC_RALT, KC_TRNS
|
||||
|
||||
#define _______INACTIVE_L1____ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LOCK
|
||||
#define _______INACTIVE_L2____ KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_TRNS
|
||||
#define _______INACTIVE_L3____ KC_TRNS, KC_RALT, KC_LEFT, KC_RGHT, KC_TRNS
|
||||
|
||||
#define _______INACTIVE__T____ KC_TRNS, KC_TRNS, KC_TRNS
|
||||
|
||||
|
||||
#define _______SYM______L1____ KC_RCBR, KC_AMPR, KC_ASTR, KC_LPRN, KC_LCBR
|
||||
#define _______SYM______L2____ KC_COLN, KC_DLR, KC_PERC, KC_CIRC, KC_PLUS
|
||||
#define _______SYM______L3____ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_PIPE
|
||||
#define _______SYM_______T____ KC_LPRN, KC_RPRN, KC_UNDS
|
||||
|
||||
#define _______NUM______L1____ KC_RBRC, KC_7, KC_8, KC_9, KC_LBRC
|
||||
#define _______NUM______L2____ KC_SCLN, KC_4, KC_5, KC_6, KC_EQL
|
||||
#define _______NUM______L3____ KC_GRV, KC_1, KC_2, KC_3, KC_SLSH
|
||||
#define _______NUM_______T____ KC_DOT, KC_0, KC_MINS
|
||||
|
||||
#define _______FN_______L1____ KC_F12, KC_F7, KC_F8, KC_F9, KC_SYSREQ
|
||||
#define _______FN_______L2____ KC_F11, KC_F4, KC_F5, KC_F6, KC_TRNS
|
||||
#define _______FN_______L3____ KC_F10, KC_F1, KC_F2, KC_F3, KC_BSLS
|
||||
#define _______FN________T____ KC_MENU, KC_SLSH, KC_TRNS
|
||||
|
||||
#define _______NAV______R1____ KC_UNDO, KC_CUT, KC_COPY, KC_PSTE, KC_AGIN
|
||||
#define _______NAV______R2____ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_CAPS
|
||||
#define _______NAV______R3____ KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_INS
|
||||
#define _______NAV_______T____ KC_ENT, KC_BSPC, KC_DEL
|
||||
|
||||
#define _______MEDIA____R1____ RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI
|
||||
#define _______MEDIA____R2____ KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, KC_TRNS
|
||||
#define _______MEDIA____R3____ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
||||
#define _______MEDIA_____T____ KC_MSTP, KC_MPLY, KC_MUTE
|
||||
|
||||
#define _______MOUSE____R1____ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
||||
#define _______MOUSE____R2____ KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS
|
||||
#define _______MOUSE____R3____ KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_TRNS
|
||||
#define _______MOUSE_____T____ KC_BTN1, KC_BTN3, KC_BTN2
|
13
users/cwebster2/rules.mk
Normal file
13
users/cwebster2/rules.mk
Normal file
|
@ -0,0 +1,13 @@
|
|||
AUTO_SHIFT_ENABLE = no # Enable autoshift
|
||||
MOUSEKEY_ENABLE = yes
|
||||
EXTRAKEY_ENABLE = yes
|
||||
CONSOLE_ENABLE = no
|
||||
BOOTMAGIC_ENABLE = no
|
||||
GRAVE_ESC_ENABLE = no
|
||||
CONSOLE_ENABLE = no
|
||||
SPACE_CADET_ENABLE = no
|
||||
GRAVE_ESC_ENABLE = no
|
||||
LTO_ENABLE = yes
|
||||
|
||||
SRC += cwebster2.c
|
||||
SRC += keycodes.c
|
Loading…
Reference in a new issue