1
0
Fork 0

[Keymap] Adding my userspace and keymaps (#6496)

* add Userspace and keymaps

* Adding keymaps for zeal60 and iris
* Created my own tap dance that toggles RGB Mode based on whether I toggled caps lock or not

* parent 578ed42a7f8f986147cad040d50d4ae1d24a32e2
author Seth Barberee <seth.barberee@gmail.com> 1565065903 -0500
committer Seth Barberee <seth.barberee@gmail.com> 1565065903 -0500

move to userspace

add zeal60

* update based on review

* move userspace to github name
This commit is contained in:
Seth Barberee 2019-08-13 12:25:51 -05:00 committed by Drashna Jaelre
parent d8d2a09674
commit 0ec0d29e9f
11 changed files with 411 additions and 0 deletions

View file

@ -0,0 +1,60 @@
/*
Copyright 2017 Danny Nguyen <danny@keeb.io>
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
/* Use I2C or Serial, not both */
#define USE_SERIAL
//#define USE_I2C
/* Select hand configuration */
//#define MASTER_LEFT
//#define MASTER_RIGHT
#define EE_HANDS
#undef RGBLED_NUM
#define RGBLED_NUM 8
#define RGBLIGHT_ANIMATIONS
#define RGBLIGHT_SLEEP
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#define RGBLED_SPLIT { RGBLED_NUM, 0} // defined to sync animations
#define FORCE_NKRO // force NKRO on by default
#undef TAPPING_TERM
#define TAPPING_TERM 200
#if !defined(NO_DEBUG) && !defined(CONSOLE_ENABLE)
#define NO_DEBUG
#endif // !NO_DEBUG
#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE)
#define NO_PRINT
#endif // !NO_PRINT
#define NO_MUSIC_MODE
// Override caps lock indication from my userspace
//#undef NORMAL_MODE
//#define NORMAL_MODE 1
//#undef CAPS_LOCK_MODE
//#define CAPS_LOCK_MODE 28

View file

@ -0,0 +1,179 @@
#include QMK_KEYBOARD_H
#include "sethBarberee.h"
extern backlight_config_t backlight_config;
enum layers {
_QWERTY,
_LOWER,
_RAISE,
_ADJUST
};
enum custom_keycodes {
QWERTY = SAFE_RANGE,
LOWER,
RAISE,
ADJUST,
};
#define KC_ KC_TRNS
#define KC_LOWR LOWER
#define KC_RASE RAISE
#define KC_RST RESET
#define KC_BL_S BL_STEP
#define KC_RTOG RGB_TOG
#define KC_RMOD RGB_MOD
#define KC_RHUI RGB_HUI
#define KC_RHUD RGB_HUD
#define KC_RSAI RGB_SAI
#define KC_RSAD RGB_SAD
#define KC_RVAI RGB_VAI
#define KC_RVAD RGB_VAD
#define KC_VK VLK_TOG
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT_kc(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
ECAP, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
TAB , Q , W , E , R , T , Y , U , I , O , P ,DEL ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
LSFT, A , S , D , F , G , H , J , K , L ,SCLN,QUOT,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
LCTL, Z , X , C , V , B , SPC, RASE, N , M ,COMM,DOT ,SLSH,RSFT,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
LGUI,LOWR, SPC, BSPC ,ENT,LALT
// `----+----+----' `----+----+----'
),
[_LOWER] = LAYOUT_kc(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
RST , , , UP , , , GRV , P7 , P8 , P9 , , ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
DEL , ,LEFT,DOWN,RGHT,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
BL_S, , , , ,LCBR,LPRN, RPRN,RCBR, P1 , P2 , P3 ,MINS, ,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
, ,LPRN , DEL , , P0
// `----+----+----' `----+----+----'
),
[_RAISE] = LAYOUT_kc(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , , , , , , , , , , ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , ,PLUS,END , , , , ,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
, , , , ,
// `----+----+----' `----+----+----'
),
[_ADJUST] = LAYOUT_kc(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
, , , , , , , , , , , ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
RTOG,RMOD,RHUI,RSAI,RVAI, , , , , , , ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
VK, ,RHUD,RSAD,RVAD, , , , , , , ,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
BL_S,RST , , , , , , , , , , , , ,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
, , , , ,
// `----+----+----' `----+----+----'
)
};
void keyboard_pre_init_user(void) {
// Make sure the red LEDs don't light
setPinOutput(D5);
writePinHigh(D5);
setPinOutput(B0);
writePinHigh(B0);
}
void keyboard_post_init_user(void){
rgblight_enable_noeeprom(); // enable the RGBs
rgblight_sethsv_noeeprom_red(); // set to red
rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); // set to breathing
}
void suspend_power_down_user(void){
backlight_config.enable = false; // disable LED backlight
}
void suspend_wakeup_init_user(void){
backlight_config.enable = true; // enable LED backlight
}
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 ADJUST:
if (record->event.pressed) {
layer_on(_ADJUST);
} else {
layer_off(_ADJUST);
}
return false;
break;
}
return true;
}
uint32_t layer_state_set_user(uint32_t state){
switch(biton32(state)) {
case _QWERTY:
rgblight_sethsv_noeeprom(HSV_RED);
break;
case _LOWER:
rgblight_sethsv_noeeprom(HSV_GREEN);
break;
case _RAISE:
rgblight_sethsv_noeeprom(HSV_BLUE);
break;
case _ADJUST:
rgblight_sethsv_noeeprom(HSV_ORANGE);
break;
default:
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_GRADIENT + 3);
break;
}
return state;
}

View file

@ -0,0 +1,8 @@
BOOTMAGIC_ENABLE = no
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
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 my Red LEDS
RGBLIGHT_ENABLE = yes # Enable my RGBS
VELOCIKEY_ENABLE = yes # I like RGB
TAP_DANCE_ENABLE = yes # fancy fancy Caps
LINK_TIME_OPTIMIZATION = yes # Enable link time optimization

View file

@ -0,0 +1,37 @@
#pragma once
/* enable/disable LEDs based on layout */
#undef RGB_BACKLIGHT_USE_SPLIT_BACKSPACE
#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 1
#undef RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT
#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0
#undef RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT
#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 1
#undef RGB_BACKLIGHT_USE_7U_SPACEBAR
#define RGB_BACKLIGHT_USE_7U_SPACEBAR 1
#undef RGB_BACKLIGHT_USE_ISO_ENTER
#define RGB_BACKLIGHT_USE_ISO_ENTER 0
#undef RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS
#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0
// disable backlight when USB suspended (PC sleep/hibernate/shutdown)
//
#undef RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED
#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 1
#undef RGB_BACKLIGHT_EFFECT
#define RGB_BACKLIGHT_EFFECT 5
#undef RGB_BACKLIGHT_CAPS_LOCK_INDICATOR
#undef RGB_BACKLIGHT_LAYER_2_INDICATOR
#undef RGB_BACKLIGHT_LAYER_3_INDICATOR
#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s= 255}, .index = 254}
#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 150, .s = 255 }, .index = 60-1 } //blue
#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 100, .s = 255 }, .index = 60-1 } //blue

View file

@ -0,0 +1,46 @@
// ANSI split backspace/right shift layout for Zeal60
#include QMK_KEYBOARD_H
#define KC_CAFN LT(1,KC_CAPS)
#define KC_ENFN LT(3,KC_ENT)
#define KC_RSUP RSFT_T(KC_UP)
#define KC_RGLT RALT_T(KC_LEFT)
#define KC_RGDN RGUI_T(KC_DOWN)
#define KC_RCRT RCTL_T(KC_RIGHT)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// Default layer
[0] = LAYOUT_60_ansi_split_bs_rshift(
KC_ESC, 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_BSLS, KC_GRV,
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_RBRC, KC_BSPC,
KC_CAFN, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENFN,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSUP, FN_MO13,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_TRNS, KC_RGLT, KC_RGDN, KC_RCRT),
// Fn1 Layer
[1] = LAYOUT_60_ansi_split_bs_rshift(
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_INS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_UP, KC_END, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_INS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_DOWN, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
// Fn2 Layer
[2] = LAYOUT_60_ansi_split_bs_rshift(
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_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),
// Fn3 Layer (zeal60 Configuration)
[3] = LAYOUT_60_ansi_split_bs_rshift(
RESET, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ES_DEC, ES_INC, 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),
};

View file

@ -0,0 +1 @@
BOOTMAGIC_ENABLE = lite

View file

@ -0,0 +1,8 @@
#ifdef RGBLIGHT_ENABLE
# ifndef CAPS_LOCK_MODE
# define CAPS_LOCK_MODE 1
# endif
# ifndef NORMAL_MODE
# define NORMAL_MODE 4
# endif
#endif

View file

@ -0,0 +1,6 @@
# seth's userspace
## Features
* Escape/Caps Lock tap dance (1 for Escape / 2 for Caps Lock)
* RGB Mode indication for Caps Lock
* Solid Mode for Caps On

View file

@ -0,0 +1 @@
SRC += sethBarberee.c

View file

@ -0,0 +1,45 @@
#include "sethBarberee.h"
#ifdef RGBLIGHT_ENABLE
#ifdef TAP_DANCE_ENABLE
// Initialize it now
tap caps_status = {
.toggled = false,
.toggle_mode = CAPS_LOCK_MODE,
.normal_mode = NORMAL_MODE
};
void dance_ecap_finished (qk_tap_dance_state_t *state, void *user_data){
if(state->count == 1){
register_code(KC_ESC);
} else {
register_code(KC_CAPS);
if(!caps_status.toggled){
// Toggling caps so indicate
caps_status.toggled = true;
rgblight_mode_noeeprom(caps_status.toggle_mode);
} else {
// Turning off so return to normal mode
caps_status.toggled = false;
rgblight_mode_noeeprom(caps_status.normal_mode);
}
}
}
void dance_ecap_reset (qk_tap_dance_state_t *state, void *user_data){
if(state->count == 1){
unregister_code(KC_ESC);
} else {
unregister_code(KC_CAPS);
}
}
//Tap Dance Definitions
qk_tap_dance_action_t tap_dance_actions[] = {
//Tap once for Esc, twice for Caps Lock
[TD_ECAP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_ecap_finished, dance_ecap_reset),
// Other declarations would go here, separated by commas, if you have them
};
#endif
#endif

View file

@ -0,0 +1,20 @@
#ifndef USERSPACE
#define USERSPACE
#include "quantum.h"
#ifdef TAP_DANCE_ENABLE // only enable for tap dances
enum {
TD_ECAP = 0,
};
#define KC_ECAP TD(TD_ECAP)
typedef struct {
bool toggled; // store whether we have toggled caps lock
int toggle_mode; // idk why but maybe do something with this..
int normal_mode;
} tap;
#endif
#endif