forked from mirrors/qmk_userspace
Ninjonas userspace (#8070)
* [keymap(kyria)] moved OLED & encoder implementation to separate classes * [feat] created logic to cycle through hue wheel when starting keyboard * [feat] created logic to cycle through hue wheel and return to user's default color * [refactor] updating OLED layout for crkbd & lily58 * [refactor] updating OLED layout for crkbd & lily58 * [fix(8070)] updating encoder.c logic based off drashna's code review * [refactor(8070)] added key to send + Shift + M
This commit is contained in:
parent
c6f389b527
commit
50554ca270
10 changed files with 305 additions and 239 deletions
|
@ -21,7 +21,7 @@ bool process_record_oled(uint16_t keycode, keyrecord_t *record) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void render_default_layer_state(void) {
|
||||
void render_layout_state(void) {
|
||||
oled_write_P(PSTR("Layout: "), false);
|
||||
switch (biton32(default_layer_state)) {
|
||||
case _COLEMAK:
|
||||
|
@ -43,15 +43,23 @@ void oled_white_space(void){
|
|||
}
|
||||
|
||||
void render_layer_state(void) {
|
||||
oled_write_P(PSTR("\nLayer: "), false);
|
||||
oled_write_P(PSTR("LOW"), (layer_state_is(_LOWER) & !layer_state_is(_ADJUST)));
|
||||
oled_white_space();
|
||||
oled_write_P(PSTR("RAI"), (layer_state_is(_RAISE) & !layer_state_is(_ADJUST)));
|
||||
oled_white_space();
|
||||
oled_write_P(PSTR("ADJ"), layer_state_is(_ADJUST));
|
||||
oled_write_P(PSTR("\nLayer:"), false);
|
||||
bool lower = layer_state_is(_LOWER) & !layer_state_is(_ADJUST);
|
||||
bool raise = layer_state_is(_RAISE) & !layer_state_is(_ADJUST);
|
||||
bool adjust = layer_state_is(_ADJUST);
|
||||
|
||||
if(lower){
|
||||
oled_write_P(PSTR(" Lower "), true);
|
||||
} else if(raise){
|
||||
oled_write_P(PSTR(" Raise "), true);
|
||||
} else if(adjust){
|
||||
oled_write_P(PSTR(" Adjust "), true);
|
||||
} else {
|
||||
oled_write_P(PSTR(" Default"), false);
|
||||
}
|
||||
}
|
||||
|
||||
void render_mod_status(uint8_t modifiers) {
|
||||
void render_mod_state(uint8_t modifiers) {
|
||||
oled_write_P(PSTR("\nMods: "), false);
|
||||
oled_write_P(PSTR("SHF"), (modifiers & MOD_MASK_SHIFT));
|
||||
oled_white_space();
|
||||
|
@ -63,10 +71,10 @@ void render_mod_status(uint8_t modifiers) {
|
|||
}
|
||||
|
||||
void render_status(void){
|
||||
render_default_layer_state();
|
||||
render_layout_state();
|
||||
oled_write_P(PSTR("\n"), false);
|
||||
render_layer_state();
|
||||
render_mod_status(get_mods()|get_oneshot_mods());
|
||||
render_mod_state(get_mods()|get_oneshot_mods());
|
||||
}
|
||||
|
||||
static void render_logo(void) {
|
||||
|
@ -80,7 +88,7 @@ static void render_logo(void) {
|
|||
}
|
||||
|
||||
void oled_task_user(void) {
|
||||
if (timer_elapsed32(oled_timer) > 30000) {
|
||||
if (timer_elapsed32(oled_timer) > 15000) {
|
||||
oled_off();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue