1
0
Fork 0

Keymap: Adds zen layout for 333fred (#3563)

* Initial commit of zen keymap

* Added RGB control for my zen

* Fixed ergodox layout.

* Reduce brightness.

* PR feedback.
This commit is contained in:
Fred Silberberg 2018-08-05 08:42:16 -07:00 committed by Drashna Jaelre
parent a6e1cb08c6
commit 9a4db7a860
15 changed files with 243 additions and 38 deletions

View file

@ -34,6 +34,7 @@ void tap_dance_layer_finished(qk_tap_dance_state_t *state, void *user_data) {
break;
case DOUBLE:
layer_on(VIM);
break;
}
}
@ -61,3 +62,26 @@ void tap_dance_process_record(uint16_t keycode) {
tap_dance_active = false;
}
}
__attribute__ ((weak))
void matrix_init_rgb(void) {}
__attribute__ ((weak))
void layer_state_set_rgb(uint32_t state) {}
__attribute__ ((weak))
void matrix_scan_user_keyboard(void) {}
void matrix_scan_user() {
static bool first_run = true;
if (first_run) {
first_run = false;
matrix_init_rgb();
}
matrix_scan_user_keyboard();
}
uint32_t layer_state_set_user(uint32_t state) {
layer_state_set_rgb(state);
return state;
}

View file

@ -1,5 +1,4 @@
#ifndef FRED_333
#define FRED_333
#pragma once
#include "quantum.h"
@ -18,5 +17,3 @@ enum tap_dance_declarations {
void tap_dance_layer_finished(qk_tap_dance_state_t*, void*);
void tap_dance_layer_reset(qk_tap_dance_state_t*, void*);
void tap_dance_process_record(uint16_t);
#endif

View file

@ -1,7 +1,4 @@
#ifndef FRED333_CONFIG
#define FRED333_CONFIG
#pragma once
#define PREVENT_STUCK_MODIFIERS
#define PERMISSIVE_HOLD
#endif

28
users/333fred/rgb.c Normal file
View file

@ -0,0 +1,28 @@
#include "quantum.h"
#include "333fred.h"
void matrix_init_rgb(void) {
rgblight_enable_noeeprom();
rgblight_sethsv_noeeprom(270, 255, 20);
}
void layer_state_set_rgb(uint32_t state) {
switch (biton32(state)) {
case BASE:
// purple
rgblight_sethsv_noeeprom(270, 255, 20);
break;
case SYMB:
// blue
rgblight_sethsv_noeeprom(240, 255, 20);
break;
case VIM:
// green
rgblight_sethsv_noeeprom(120, 255, 20);
break;
case GAME:
// red
rgblight_sethsv_noeeprom(0, 255, 20);
break;
}
}

View file

@ -1,2 +1,5 @@
SRC += 333fred.c
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
SRC += rgb.c
endif