Update keymap keebio/nyquist (#8602)

* format code, add shift color

* testing colors

* todos, shift on right

* changed colors

* use rgh layers api

* impl shift layer

* replace xor with !=

* moved shift rbg

* breathing animation, simplyfy layers

* remove breating animation

* use tt

* minor cleanup

* debounce eager, lto

* shut down rbg when poweroff

* update readme

* readme.md fix

* more readme.md fix

* more readme.md fix
master
George Petri 2020-03-30 00:14:43 +03:00 committed by GitHub
parent dc98d44582
commit 74c01654c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 60 additions and 43 deletions

View File

@ -17,11 +17,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
// #define USE_I2C
/* Select hand configuration */
// #define MASTER_RIGHT
// #define EE_HANDS
#undef RGBLED_NUM
#define RGBLED_NUM 12
#define RGBLIGHT_LAYERS
#define TAPPING_TOGGLE 2
#define TAPPING_TERM 150

View File

@ -6,10 +6,6 @@ extern keymap_config_t keymap_config;
#define _L 1
#define _R 2
enum custom_keycodes {
QWERTY = SAFE_RANGE
};
#define KC_TL LCTL(KC_PGUP)
#define KC_TR LCTL(KC_PGDN)
#define KC_TC LCTL(KC_W)
@ -26,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
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_LCTL, KC_LGUI, KC_LALT, MO(_L) , KC_SPC , KC_SPC , TG(_R) , KC_LEFT, KC_DOWN, KC_UP , KC_RGHT
KC_CAPS, KC_LCTL, KC_LGUI, KC_LALT, MO(_L) , KC_SPC , KC_RSFT, TT(_R) , KC_LEFT, KC_DOWN, KC_UP , KC_RGHT
//└────────┴────────┴────────┴────────┴────────┴────────┘ └────────┴────────┴────────┴────────┴────────┴────────┘
),
@ -59,33 +55,54 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
const rgblight_segment_t PROGMEM left[] = RGBLIGHT_LAYER_SEGMENTS(
{0, 12, HSV_MAGENTA}
);
const rgblight_segment_t PROGMEM right[] = RGBLIGHT_LAYER_SEGMENTS(
{0, 12, HSV_RED}
);
const rgblight_segment_t PROGMEM capslock[] = RGBLIGHT_LAYER_SEGMENTS(
{0, 3, HSV_GOLD},
{6, 3, HSV_GOLD}
);
const rgblight_segment_t* const PROGMEM rgb_layers[] = RGBLIGHT_LAYERS_LIST(left, right, capslock);
void keyboard_post_init_user(void) {
rgblight_sethsv_noeeprom(HSV_BLUE);
rgblight_sethsv_noeeprom(HSV_SPRINGGREEN);
rgblight_layers = rgb_layers;
}
void update_led(void) {
switch (biton32(layer_state)) {
case _BASE:
rgblight_sethsv_noeeprom(HSV_BLUE);
break;
case _L:
rgblight_sethsv_noeeprom(HSV_CORAL);
break;
case _R:
rgblight_sethsv_noeeprom(HSV_MAGENTA);
break;
layer_state_t layer_state_set_user(layer_state_t state) {
rgblight_set_layer_state(0, layer_state_cmp(state, _L));
rgblight_set_layer_state(1, layer_state_cmp(state, _R));
return state;
}
void suspend_power_down_user(void) {
rgblight_disable();
}
void suspend_wakeup_init_user(void) {
rgblight_enable();
}
bool is_shift_pressed = false;
bool led_update_user(led_t led_state) {
rgblight_set_layer_state(2, is_shift_pressed != led_state.caps_lock);
return true;
}
bool process_record_user(uint16_t keycode, keyrecord_t* record) {
switch (keycode) {
case KC_LSFT:
case KC_RSFT:
is_shift_pressed = record->event.pressed;
rgblight_set_layer_state(2, is_shift_pressed != host_keyboard_led_state().caps_lock);
default:
return true;
}
if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) {
rgblight_sethsv_range(HSV_WHITE,0,3);
rgblight_sethsv_range(HSV_WHITE,9,12);
}
}
uint32_t layer_state_set_user(uint32_t state) {
update_led();
return state;
}
void led_set_user(uint8_t usb_led) {
update_led();
}

View File

@ -1,7 +1,7 @@
# George Petri's Nyquist layout
```
make keebio/nyquist/rev2:georgepetri
sudo make keebio/nyquist/rev2:georgepetri:dfu
```
Features a dedicated navigation layer on rise and current layer status on rgb underglow.
@ -15,9 +15,9 @@ Features a dedicated navigation layer on rise and current layer status on rgb un
├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤
│ ESC │ A │ S │ D │ F │ G │ │ H │ J │ K │ L │ SCLN│ QUOT │
├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤
│ LSFT│ Z │ X │ C │ V │ B │ │ N │ M │ COMM │ DOT │ SLSH│ ENT │
│ LSFT│ Z │ X │ C │ V │ B │ │ N │ M │ COMM│ DOT │ SLSH│ ENT │
├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤
│ CAPS│ LCTL│ LGUI │ LALT │MO(_L)│ SPC │ │ SPC │MO(_R)│ LEFT │ DOWN│ UP │ RGHT │
│ CAPS│ LCTL│ LGUI │ LALT │MO(_L)│ SPC │ │ RSFT│MO(_R)│ LEFT│ DOWN│ UP │ RGHT │
└──────┴──────┴──────┴──────┴──────┴──────┘ └──────┴──────┴──────┴──────┴──────┴──────┘
```
@ -28,7 +28,7 @@ Features a dedicated navigation layer on rise and current layer status on rgb un
├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤
│ │ F11 │ F12 │ │ │ │ │ │ MINS│ EQL │ LBRC│ RBRC│ BSLS │
├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤
│ │ │ │ │ │ │ │ LEFT │ DOWN │ UP │ RGHT │ │ │
│ │ │ │ │ │ │ │ LEFT│ DOWN│ UP │ RGHT│ │ │
├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤
│ │ │ │ │ │ │ │ │ PGDN│ PGUP │ HOME│ END │ │
├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤
@ -43,9 +43,9 @@ Features a dedicated navigation layer on rise and current layer status on rgb un
├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤
│ │ TAB_L│ TAB_R│ TAB_C│ TAB_R│ │ │ │ TAB_L│ TAB_R│ TAB_C│ TAB_R│ │
├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤
│ │ LEFT │ DOWN │ UP │ RGHT │ │ │ LEFT │ DOWN │ UP │ RGHT │ │ │
│ │ LEFT│ DOWN│ UP │ RGHT│ │ │ LEFT│ DOWN│ UP │ RGHT│ │ │
├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤
│ │ PGDN │ PGUP │ HOME│ END │ │ │ │ PGDN │ PGUP │ HOME│ END │ │
│ │ PGDN│ PGUP│ HOME│ END │ │ │ │ PGDN│ PGUP│ HOME│ END │ │
├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤
│ │ │ │ │ │ │ │ │ │ │ │ │ │
└──────┴──────┴──────┴──────┴──────┴──────┘ └──────┴──────┴──────┴──────┴──────┴──────┘

View File

@ -1,3 +1,5 @@
RGBLIGHT_ENABLE = yes
MOUSEKEY_ENABLE = no
COMMAND_ENABLE = no
RGBLIGHT_ENABLE = yes
LTO_ENABLE = yes
DEBOUNCE_TYPE = eager_pk