summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/handwired/node5_1/keymaps/default/keymap.c75
1 files changed, 47 insertions, 28 deletions
diff --git a/keyboards/handwired/node5_1/keymaps/default/keymap.c b/keyboards/handwired/node5_1/keymaps/default/keymap.c
index 17e15a92c4..67a2860e9b 100644
--- a/keyboards/handwired/node5_1/keymaps/default/keymap.c
+++ b/keyboards/handwired/node5_1/keymaps/default/keymap.c
@@ -51,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_PGUP, KC_UP, KC_PGDN,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------|
- KC_LCTL, KC_LGUI, KC_LALT, KC_A, KC_SPACE, KC_BTN1, KC_BTN3, KC_BTN2, KC_APP, KC_HOME, KC_END, KC_LEFT, KC_DOWN, KC_RGHT
+ KC_LCTL, KC_LGUI, KC_LALT, MO(_FN), KC_SPACE, KC_BTN1, KC_BTN3, KC_BTN2, KC_APP, KC_HOME, KC_END, KC_LEFT, KC_DOWN, KC_RGHT
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------|
),
@@ -73,37 +73,40 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT(
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------|
- KC_ESC, 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_DEL,
+ KC_ESC, 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_DEL,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------|
- KC_GRV, 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_BSPC,
+ KC_GRV, 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_BSPC,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------|
- 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_BSLS,
+ 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_BSLS,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------|
- KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
+ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------|
- KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_PGUP, KC_UP, KC_PGDN,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_PGUP, KC_UP, KC_PGDN,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------|
- KC_LCTL, KC_LGUI, KC_LALT, MO(_FN), KC_SPACE, KC_BTN1, KC_BTN3, KC_BTN2, KC_APP, KC_HOME, KC_END, KC_LEFT, KC_DOWN, KC_RGHT
+ KC_LCTL, KC_LGUI, KC_LALT, MO(_FN), KC_SPACE, KC_BTN1, KC_BTN3, KC_BTN2, KC_APP, KC_HOME, KC_END, KC_LEFT, KC_DOWN, KC_RGHT
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------|
),
[_FN] = LAYOUT(
- //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------|
- KC_A, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
- //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------|
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
- //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------|
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
- //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------|
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
- //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------|
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
- //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------|
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
- //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------|
+ //|--------+---------+--------+--------+--------+--------+ |--------+--------+--------+--------+--------+--------+--------+--------|
+ _______, KC_MUTE, KC_VOLU, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ //|--------+---------+--------+--------+--------+--------+ |--------+--------+--------+--------+--------+--------+--------+--------|
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ //|--------+---------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------|
+ _______,TO(_QWERTY),KC_PWR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ //|--------+---------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+-----------------|
+ _______, _______, KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ //|--------+---------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+-----------------|
+ _______, _______,_______,TO(_COLEMAK),_______,_______, _______, _______, _______, _______, _______, _______, _______, _______,
+ //|--------+---------+--------+--------+-----------------| |--------+--------+--------+--------+--------+--------+--------+--------+--------|
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+ //|--------+---------+--------+--------+-----------------| |--------+--------+--------+--------+--------+--------+--------+--------+--------|
)
};
+// Micro controller indicator brightness
+const int indicator_brightness = 7;
+
// Custom composite data type for holding colors
typedef struct {
int red;
@@ -154,13 +157,9 @@ void set_trackball_normal_color(void) {
void keyboard_post_init_user(void) {
// Call the post init code.
- setrgb(0, 15, 0, (LED_TYPE *)&led[0]); // led 0
- rgblight_set(); // Utility functions do not call rgblight_set() automatically, so they need to be called explicitly.
-
- set_trackball_normal_color();
pointing_device_set_cpi(cpis[cpi_index].cpi);
-
debug_enable=true;
+ // LED's called suspend_wakeup_init_user to handle suspention
}
bool set_scrolling = false;
@@ -251,12 +250,12 @@ void suspend_power_down_user(void) {
}
void suspend_wakeup_init_user(void) {
- // code will run on keyboard wakeup
+ // code will run on keyboard wakeup from suspention and initial plugin
// Turn on light when computer is woken from sleep
set_trackball_normal_color();
- setrgb(0, 15, 0, (LED_TYPE *)&led[0]); // led 0
- rgblight_set(); // Utility functions do not call rgblight_set() automatically, so they need to be called explicitly.
+ setrgb(0, indicator_brightness, 0, (LED_TYPE *)&led[0]);
+ rgblight_set();
}
/*
@@ -274,3 +273,23 @@ uint8_t pointing_device_handle_buttons(uint8_t buttons, bool pressed, pointing_d
}
*/
+layer_state_t layer_state_set_user(layer_state_t state) {
+ switch (get_highest_layer(state)) {
+ case _QWERTY:
+ setrgb(indicator_brightness, 0, 0, (LED_TYPE *)&led[0]);
+ break;
+ case _COLEMAK:
+ setrgb(0, indicator_brightness, 0, (LED_TYPE *)&led[0]);
+ break;
+ case _FN:
+ setrgb(0, 0, indicator_brightness, (LED_TYPE *)&led[0]);
+ break;
+ default: // for any other layers, or the default layer
+ setrgb(indicator_brightness, indicator_brightness, indicator_brightness, (LED_TYPE *)&led[0]);
+ break;
+ }
+
+ rgblight_set();
+ return state;
+}
+