[Keymap] Updating crkbd RGB keymap implementation & ninjonas userspace updates (#6834)

* [keymap] Updating crkbd RGB implementation & ninjonas userspace updates

* [chore] adding process_record_oled method to process_records.h
This commit is contained in:
Jonas Avellana 2019-09-30 11:50:27 -06:00 committed by Drashna Jaelre
parent f418efcaf5
commit cffe671a61
16 changed files with 115 additions and 94 deletions

View file

@ -16,7 +16,7 @@ See: https://docs.qmk.fm/#/feature_userspace
- [Lily58](../../keyboards/lily58/keymaps/ninjonas)
## Features
### [Keys](ninjonas.h#L40)
### [Keys](ninjonas.h#L37)
|Code | Description |
|---|---|
|K_LOCK | MacOS shortcut to execute lock command  + ctrl + Q |
@ -25,7 +25,7 @@ See: https://docs.qmk.fm/#/feature_userspace
|K_RAPP | MacOS shortcut to switch apps to the right |
|K_LAPP | MacOS shortcut to switch apps to the left |
### [Layers](ninjonas.h#L47)
### [Layers](ninjonas.h#L44)
|Code | Description |
|---|---|
|LT_LOW | Tap for ENTER, hold for RAISE |
@ -34,7 +34,7 @@ See: https://docs.qmk.fm/#/feature_userspace
|LM_LOW | Dedicated key to momentarily toggle to use LOWER layer |
|LM_RAI | Dedicated key to momentarily toggle to use RAISE layer |
### [Layout Blocks](ninjonas.h#L53)
### [Layout Blocks](ninjonas.h#L50)
Predefined keyboard layout templates to speed up configuring split keyboards
|Code | Description |
@ -59,6 +59,7 @@ Predefined keyboard layout templates to speed up configuring split keyboards
|M_VRSN | macro to send QMK version |
|M_SHFT | Sends  + alt + shift to a keycode to activate [ShiftIt](https://github.com/fikovnik/ShiftIt) |
|M_CODE | Opens [Visual Studio Code](https://code.visualstudio.com/) on current directory |
|M_XXX1 to M_XXX5 | Reserved for secret macros see [Secrets](#secrets) |
### [Tap-Dance](tap_dances.h)
|Code | Description |
@ -73,21 +74,29 @@ Predefined keyboard layout templates to speed up configuring split keyboards
|T_Q | Tap for Q, double tap for  + Q |
### Secrets
There's times where you have macros you don't want to share like emails, passwords 😱, & and private strings. Based off [drashna's secret macros](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/readme_secrets.md), it's now possible to do this. All you need to do is create a `secrets.c` file. Below is an example of how this is used.
There's times where you have macros you don't want to share like emails, an address you need but you always forget, passwords 😱, & and private strings. Based off [drashna's secret macros](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/readme_secrets.md), it's now possible to do this. All you need to do is create a `secrets.c` file. Below is an example of how this is used.
```c
// secrets.c
#include "ninjonas.h"
#include "ninjonas.h"
static const char * const secret[] = {
"BLANK1",
"BLANK2",
"BLANK3",
"BLANK4",
"BLANK5"
};
bool process_record_secrets(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
// Sends zoom URL
case M_ZOOM:
case M_XXX1...M_XXX5:
if (record->event.pressed) {
SEND_STRING("SECRET_STRING_HERE" SS_TAP(X_ENTER));
send_string(secret[keycode - M_XXX1]);
}
break;
}
return true;
}
```

View file

@ -26,9 +26,6 @@
#include "lufa.h"
#include "split_util.h"
#endif
#ifdef SSD1306OLED
#include "ssd1306.h"
#endif
#define _QWERTY 0
#define _DVORAK 1

View file

@ -7,10 +7,10 @@
static uint16_t oled_timer = 0;
extern uint8_t is_master;
bool process_record_oled(uint16_t keycode, keyrecord_t *record) {
bool process_record_oled(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
oled_timer = timer_read();
}
}
return true;
}
@ -48,6 +48,7 @@ void render_mod_status(uint8_t modifiers) {
void render_status(void){
render_default_layer_state();
oled_write_P(PSTR("\n"), false);
render_layer_state();
render_mod_status(get_mods()|get_oneshot_mods());
}
@ -70,12 +71,13 @@ void oled_task_user(void) {
#ifndef SPLIT_KEYBOARD
else { oled_on(); }
#endif
if (is_master) {
render_status();
render_status();
} else {
render_logo();
oled_scroll_left();
oled_write_P(PSTR("\n"), false);
render_logo();
oled_scroll_left();
}
}

View file

@ -12,18 +12,16 @@ bool process_record_oled(uint16_t keycode, keyrecord_t *record) { return true; }
#endif
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
#ifdef OLED_DRIVER_ENABLE
process_record_oled(keycode, record);
#endif
}
#ifdef OLED_DRIVER_ENABLE
process_record_oled(keycode, record);
#endif
switch (keycode) {
// Sends pyenv to activate 'jira' environment
case M_PYNV:
if (record->event.pressed) {
SEND_STRING("pyenv activate jira" SS_TAP(X_ENTER));
SEND_STRING("pyenv activate jira\n");
}
break;

View file

@ -7,7 +7,6 @@ enum custom_keycodes {
DVORAK,
COLEMAK,
// Custom Macros
M_ZOOM,
M_PYNV,
M_SHFT,
M_MAKE,
@ -15,11 +14,16 @@ enum custom_keycodes {
M_FLSH,
M_VRSN,
M_CODE,
// Secret Macros
M_XXX1,
M_XXX2,
M_XXX3,
M_XXX4,
M_XXX5,
};
#ifdef SSD1306OLED
void set_keylog(uint16_t keycode, keyrecord_t *record);
#endif
bool process_record_secrets(uint16_t keycode, keyrecord_t *record);
bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
#ifdef OLED_DRIVER_ENABLE
bool process_record_oled(uint16_t keycode, keyrecord_t *record);
#endif