aboutsummaryrefslogtreecommitdiffstats
path: root/keyboards/gonnerd/keymaps/gam3cat/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/gonnerd/keymaps/gam3cat/keymap.c')
-rw-r--r--keyboards/gonnerd/keymaps/gam3cat/keymap.c351
1 files changed, 166 insertions, 185 deletions
diff --git a/keyboards/gonnerd/keymaps/gam3cat/keymap.c b/keyboards/gonnerd/keymaps/gam3cat/keymap.c
index 3e43d67d5..f01dd920e 100644
--- a/keyboards/gonnerd/keymaps/gam3cat/keymap.c
+++ b/keyboards/gonnerd/keymaps/gam3cat/keymap.c
@@ -11,13 +11,16 @@ enum layers {
_AL, // Adjust Layer
};
-enum gonnerd_keycodes {
+enum custom_keycodes {
DYNAMIC_MACRO_RANGE = SAFE_RANGE,
+ QMK_REV,
+ KC_WEB,
+ KC_SP4
};
+extern backlight_config_t backlight_config;
+
#include "dynamic_macro.h"
-#define _______ KC_TRNS
-#define XXXXXXX KC_NO
#define FN_CAPS LT(_FL, KC_CAPS)
#define KC_DMR1 DYN_REC_START1
#define KC_DMR2 DYN_REC_START2
@@ -25,47 +28,44 @@ enum gonnerd_keycodes {
#define KC_DMP2 DYN_MACRO_PLAY2
#define KC_DMRS DYN_REC_STOP
-static uint8_t current_layer;
-
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
- /* _BL: Base Layer, mostly standard TKL QWERTY layout.
- * .-----------------------------------------------------------------------.
- * |Esc||||| F1| F2| F3| F4||| F5| F6| F7| F8||| F9|F10|F11|F12|PSc|SLk|Pau|
- * |-----------------------------------------------------------|-----------|
- * | ~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |Ins|Hom|PgU|
- * |-----------------------------------------------------------|-----------|
- * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|Del|End|PgD|
- * |-----------------------------------------------------------|-----------|
- * |FnCaps| A| S| D| F| G| H| J| K| L| ;| '|Return | |
- * |-----------------------------------------------------------|-----------|
- * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up| |
- * |-----------------------------------------------------------|-----------|
- * |Ctrl |||||Win | Space |RAlt |||||Ctrl |Lft|Dwn|Rgt|
- * *-----------------------------------------------------------------------*
+ /*#### _BL: Base Layer - Standard TKL QWERTY layout.
+ * .-----------------------------------------------------------------------.
+ * |Esc|||||F1 |F2 |F3 |F4 |||F5 |F6 |F7 |F8 |||F9 |F10|F11|F12|PSc|SLk|Pau|
+ * |-----------------------------------------------------------|-----------|
+ * |~ |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |- |= |Backsp |Ins|Hom|PgU|
+ * |-----------------------------------------------------------|-----------|
+ * |Tab |Q |W |E |R |T |Y |U |I |O |P |[ |] |\ |Del|End|PgD|
+ * |-----------------------------------------------------------|-----------|
+ * |Caps |A |S |D |F |G |H |J |K |L |; |' |Return | |
+ * |-----------------------------------------------------------|-----------|
+ * |Shift |Z |X |C |V |B |N |M |, |. |/ |Shift |Fn | | Up| |
+ * |-----------------------------------------------------------|-----------|
+ * |Ctrl |Win|Alt | Space |RAlt |Fn |Ctrl |Lft|Dwn|Rgt|
+ * *-----------------------------------------------------------------------*
*/
[_BL] = LAYOUT_tkl( \
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_PSCR, KC_SLCK, KC_PAUS, \
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_INS, KC_HOME, KC_PGUP, \
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_DEL, KC_END, KC_PGDN, \
- FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, 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, XXXXXXX, KC_ENT, \
KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FL), KC_UP, \
- KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \
),
-
- /* _WL: Workman Layer.
- * .-----------------------------------------------------------------------.
- * | ||||| | | | ||| | | | ||| | | | | | | |
- * .-----------------------------------------------------------|-----------|
- * | | | | | | | | | | | | -| =| | | | |
- * |-----------------------------------------------------------|-----------|
- * | | Q| D| R| W| B| J| F| U| P| ;| [| ]| \| | | |
- * |-----------------------------------------------------------|-----------|
- * | | A| S| H| T| G| Y| N| E| O| I| '| | |
- * |-----------------------------------------------------------|-----------|
- * | | Z| X| M| C| V| K| L| ,| .| /| | | | | |
- * |-----------------------------------------------------------|-----------|
- * | ||||| | | ||||| | | | |
- * *-----------------------------------------------------------------------*
+ /*#### _WL: Workman Layer.
+ * .-----------------------------------------------------------------------.
+ * | ||||| | | | ||| | | | ||| | | | | | | |
+ * .-----------------------------------------------------------|-----------|
+ * | | | | | | | | | | | |- |= | | | | |
+ * |-----------------------------------------------------------|-----------|
+ * | |Q |D |R |W |B |J |F |U |P |; |[ |] |\ | | | |
+ * |-----------------------------------------------------------|-----------|
+ * | |A |S |H |T |G |Y |N |E |O |I |' | | |
+ * |-----------------------------------------------------------|-----------|
+ * | |Z |X |M |C |V |K |L |, |. |/ | | | | | |
+ * |-----------------------------------------------------------|-----------|
+ * | | | | | | | | | | |
+ * *-----------------------------------------------------------------------*
*/
[_WL] = LAYOUT_tkl( \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
@@ -75,21 +75,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, KC_Z , KC_X , KC_M , KC_C , KC_V , KC_K , KC_L , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),
-
- /* _NL: Norman Layer.
- * .-----------------------------------------------------------------------.
- * | ||||| | | | ||| | | | ||| | | | | | | |
- * .-----------------------------------------------------------|-----------|
- * | | | | | | | | | | | | -| =| | | | |
- * |-----------------------------------------------------------|-----------|
- * | | Q| W| D| F| K| J| U| R| L| ;| [| ]| \| | | |
- * |-----------------------------------------------------------|-----------|
- * | | A| S| E| T| G| Y| N| I| O| H| '| | |
- * |-----------------------------------------------------------|-----------|
- * | | Z| X| C| V| B| P| M| ,| .| /| | | | | |
- * |-----------------------------------------------------------|-----------|
- * | ||||| | | ||||| | | | |
- * *-----------------------------------------------------------------------*
+ /*#### _NL: Norman Layer.
+ * .-----------------------------------------------------------------------.
+ * | ||||| | | | ||| | | | ||| | | | | | | |
+ * .-----------------------------------------------------------|-----------|
+ * | | | | | | | | | | | |- |= | | | | |
+ * |-----------------------------------------------------------|-----------|
+ * | |Q |W |D |F |K |J |U |R |L |; |[ |] |\ | | | |
+ * |-----------------------------------------------------------|-----------|
+ * | |A |S |E |T |G |Y |N |I |O |H |' | | |
+ * |-----------------------------------------------------------|-----------|
+ * | |Z |X |C |V |B |P |M |, |. |/ | | | | | |
+ * |-----------------------------------------------------------|-----------|
+ * | | | | | | | | | | |
+ * *-----------------------------------------------------------------------*
*/
[_NL] = LAYOUT_tkl( \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
@@ -99,21 +98,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_P , KC_M , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),
-
- /* _DL: Dvorak Layer.
- * .-----------------------------------------------------------------------.
- * | ||||| | | | ||| | | | ||| | | | | | | |
- * .-----------------------------------------------------------|-----------|
- * | | | | | | | | | | | | [| ]| | | | |
- * |-----------------------------------------------------------|-----------|
- * | | '| ,| .| P| Y| F| G| C| R| L| /| =| \| | | |
- * |-----------------------------------------------------------|-----------|
- * | | A| O| E| U| I| D| H| T| N| S| -| | |
- * |-----------------------------------------------------------|-----------|
- * | | ;| Q| J| K| X| B| M| W| V| Z| | | | | |
- * |-----------------------------------------------------------|-----------|
- * | ||||| | | ||||| | | | |
- * *-----------------------------------------------------------------------*
+ /*#### _DL: Dvorak Layer.
+ * .-----------------------------------------------------------------------.
+ * | ||||| | | | ||| | | | ||| | | | | | | |
+ * .-----------------------------------------------------------|-----------|
+ * | | | | | | | | | | | |[ |] | | | | |
+ * |-----------------------------------------------------------|-----------|
+ * | |' |, |. |P |Y |F |G |C |R |L |/ |= |\ | | | |
+ * |-----------------------------------------------------------|-----------|
+ * | |A |O |E |U |I |D |H |T |N |S |- | | |
+ * |-----------------------------------------------------------|-----------|
+ * | |; |Q |J |K |X |B |M |W |V |Z | | | | | |
+ * |-----------------------------------------------------------|-----------|
+ * | | | | | | | | | | |
+ * *-----------------------------------------------------------------------*
*/
[_DL] = LAYOUT_tkl( \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
@@ -123,21 +121,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, KC_SCLN, KC_Q , KC_J , KC_K , KC_X , KC_B , KC_M , KC_W , KC_V , KC_Z , _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),
-
- /* _CL: Colmak Layer.
- * .-----------------------------------------------------------------------.
- * | ||||| | | | ||| | | | ||| | | | | | | |
- * .-----------------------------------------------------------|-----------|
- * | | | | | | | | | | | | -| =| | | | |
- * |-----------------------------------------------------------|-----------|
- * | | Q| W| F| P| G| J| L| U| Y| ;| [| ]| \| | | |
- * |-----------------------------------------------------------|-----------|
- * | | A| R| S| T| D| H| N| E| I| O| '| | |
- * |-----------------------------------------------------------|-----------|
- * | | Z| X| C| V| B| K| M| ,| .| /| | | | | |
- * |-----------------------------------------------------------|-----------|
- * | ||||| | | ||||| | | | |
- * *-----------------------------------------------------------------------*
+ /*#### _CL: Colmak Layer.
+ * .-----------------------------------------------------------------------.
+ * | ||||| | | | ||| | | | ||| | | | | | | |
+ * .-----------------------------------------------------------|-----------|
+ * | | | | | | | | | | | |- |= | | | | |
+ * |-----------------------------------------------------------|-----------|
+ * | |Q |W |F |P |G |J |L |U |Y |; |[ |] |\ | | | |
+ * |-----------------------------------------------------------|-----------|
+ * | |A |R |S |T |D |H |N |E |I |O |' | | |
+ * |-----------------------------------------------------------|-----------|
+ * | |Z |X |C |V |B |K |M |, |. |/ | | | | | |
+ * |-----------------------------------------------------------|-----------|
+ * | | | | | | | | | | |
+ * *-----------------------------------------------------------------------*
*/
[_CL] = LAYOUT_tkl( \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
@@ -147,142 +144,126 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_K , KC_M , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),
-
- /* _FL: Function Layer.
- * M0 opens Chrome
- * .-----------------------------------------------------------------------.
- * | ||||| | | | ||| | | | ||| |VlM|VlD|VlU| | | |
- * .-----------------------------------------------------------|-----------|
- * | M0| | | | | | | | | | | | | | | | |
- * |-----------------------------------------------------------|-----------|
- * |Fn_AL| | | | | | | | | | | | | | | | |
- * |-----------------------------------------------------------|-----------|
- * |FnCaps| | | | | | |Lft|Dwn|Up |Rgt| | | |
- * |-----------------------------------------------------------|-----------|
- * | | | | | | | | | | | | | | | | |
- * |-----------------------------------------------------------|-----------|
- * | ||||| | | ||||| |WBk| |WFw|
- * *-----------------------------------------------------------------------*
+ /*#### _FL: Function Layer.
+ * .-----------------------------------------------------------------------.
+ * | ||||| | | | ||| | | | ||| |VlM|VlD|VlU| | | |
+ * .-----------------------------------------------------------|-----------|
+ * |Web| | | | | | | | | | | | | | | | |
+ * |-----------------------------------------------------------|-----------|
+ * |Fn_AL| | | | | | | | | | | | | | | | |
+ * |-----------------------------------------------------------|-----------|
+ * | | | | | | | |Lft|Dwn|Up |Rgt| | | |
+ * |-----------------------------------------------------------|-----------|
+ * | | | | | | | | | | | | |Fn | | | |
+ * |-----------------------------------------------------------|-----------|
+ * | | | | SP4 | |Fn | |WBk| |WFw|
+ * *-----------------------------------------------------------------------*
*/
[_FL] = LAYOUT_tkl( \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, \
- M(0), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
+ KC_WEB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
MO(_AL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
- _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, \
- XXXXXXX, XXXXXXX, KC_MENU, M(1), XXXXXXX, _______, XXXXXXX, XXXXXXX, KC_WBAK, XXXXXXX, KC_WFWD \
+ XXXXXXX, XXXXXXX, KC_MENU, KC_SP4, XXXXXXX, _______, XXXXXXX, XXXXXXX, KC_WBAK, XXXXXXX, KC_WFWD \
),
-
- /* _AL: Adjust Layer.
- * Default keymap, RGB Underglow, LED backlight, and Dynamic Macro settings.
- * .-----------------------------------------------------------------------.
- * |Rst||||| | | | ||| | | | ||| | | | | | | |
- * .-----------------------------------------------------------|-----------|
- * |Ver|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| | |MR1|MP1|
- * |-----------------------------------------------------------|-----------|
- * |Fn_AL|_BL|_WL| | | | | | | | | | | | MS|MR2|MP2|
- * |-----------------------------------------------------------|-----------|
- * |FnCaps| | |_DL| | | | | | | | | | |
- * |-----------------------------------------------------------|-----------|
- * | | | |_CL| |_BL|_NL| | | | | | | | | |
- * |-----------------------------------------------------------|-----------|
- * | ||||| | | ||||| | | | |
- * *-----------------------------------------------------------------------*
+ /*#### _AL: Adjust Layer - Keymap select, LED backlight, and Dynamic Macro settings.
+ * .-----------------------------------------------------------------------.
+ * |Rst||||| | | | ||| | | | ||| | | | | | | |
+ * .-----------------------------------------------------------|-----------|
+ * |Rev|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| | |MR1|MP1|
+ * |-----------------------------------------------------------|-----------|
+ * |Fn_AL|_BL|_WL| | | | | | | | | | | | MS|MR2|MP2|
+ * |-----------------------------------------------------------|-----------|
+ * | | | |_DL| | | | | | | | | | |
+ * |-----------------------------------------------------------|-----------|
+ * | | | |_CL| |_BL|_NL| | | | | |Fn | | | |
+ * |-----------------------------------------------------------|-----------|
+ * | | | | | |Fn | | | | |
+ * *-----------------------------------------------------------------------*
*/
[_AL] = LAYOUT_tkl( \
RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
- F(0), RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, XXXXXXX, BL_TOGG, BL_DEC, BL_INC, XXXXXXX, XXXXXXX, KC_DMR1, KC_DMP1, \
+ QMK_REV, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, XXXXXXX, BL_TOGG, BL_DEC, BL_INC, XXXXXXX, XXXXXXX, KC_DMR1, KC_DMP1, \
_______, DF(_BL), DF(_WL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DMRS, KC_DMR2, KC_DMP2, \
- _______, XXXXXXX, XXXXXXX, DF(_DL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
+ XXXXXXX, XXXXXXX, XXXXXXX, DF(_DL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DF(_CL), XXXXXXX, DF(_BL), DF(_NL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, \
- _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \
),
};
-const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
- switch(id) {
- case 0:
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case QMK_REV:
if (record->event.pressed) {
- return MACRO(I(0), D(LGUI), T(R), U(LGUI), END);
+ SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP "@" QMK_VERSION ":" QMK_BUILDDATE);
}
- else {
+ return false;
+ break;
+ case KC_WEB:
+ if (record->event.pressed) {
+ SEND_STRING(SS_LGUI("r"));
+ wait_ms(100);
SEND_STRING("chrome.exe\n");
- return false;
}
- break;
- case 1:
+ return false;
+ break;
+ case KC_SP4:
if (record->event.pressed) {
- return MACRO(I(0), T(SPC), T(SPC), T(SPC), T(SPC), END);
+ SEND_STRING (" ");
}
- else {
- return false;
- }
- break;
+ return false;
+ break;
}
- return MACRO_NONE;
-};
-
-const uint16_t PROGMEM fn_actions[] = {
- [0] = ACTION_FUNCTION(0),
-};
-
-void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
- switch (id) {
- case 0:
- if (record->event.pressed) {
- SEND_STRING ("[QMK:" QMK_KEYBOARD ":" QMK_KEYMAP ":" QMK_VERSION "]");
- }
- break;
+ // Dynamic Macros.
+ if (!process_record_dynamic_macro(keycode, record)) {
+ return false;
}
+ return true;
+}
+
+void custom_backlight_level(uint8_t level) {
+ if (level > BACKLIGHT_LEVELS)
+ level = BACKLIGHT_LEVELS;
+ backlight_config.level = level;
+ backlight_config.enable = !!backlight_config.level;
+ backlight_set(backlight_config.level);
}
void matrix_init_user(void) {
#ifdef BACKLIGHT_ENABLE
- backlight_level(0);
+ custom_backlight_level(0);
#endif
}
-// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
- uint8_t layer = biton32(layer_state);
- if (current_layer == layer) {
- }
- else {
- current_layer = layer;
- switch (layer) {
- case 0:
- backlight_level(0);
- break;
- case 1:
- backlight_level(1);
- break;
- case 2:
- backlight_level(1);
- break;
- case 3:
- backlight_level(1);
- break;
- case 4:
- backlight_level(1);
- break;
- case 5:
- backlight_level(2);
- break;
- case 6:
- backlight_level(3);
- break;
- default:
- backlight_level(0);
- break;
- }
- }
}
-bool process_record_user(uint16_t keycode, keyrecord_t *record) {
- // Enable Dynamic Macros.
- if (!process_record_dynamic_macro(keycode, record)) {
- return false;
+uint32_t layer_state_set_user(uint32_t state) {
+ switch (biton32(state)) {
+ case _BL:
+ custom_backlight_level(0);
+ break;
+ case _WL:
+ case _NL:
+ case _DL:
+ case _CL:
+ custom_backlight_level(1);
+ break;
+ case _FL:
+ custom_backlight_level(2);
+ break;
+ case _AL:
+ custom_backlight_level(3);
+ break;
+ default:
+ custom_backlight_level(0);
+ break;
}
- return true;
+ return state;
+}
+
+void led_set_user(uint8_t usb_led) {
+
}