diff options
author | dbroqua <dbroqua@mousur.org> | 2016-12-24 14:43:07 +0100 |
---|---|---|
committer | dbroqua <dbroqua@mousur.org> | 2016-12-24 14:43:07 +0100 |
commit | 033f0b92c4c5f6fbad08bacc87f2cf6776949f90 (patch) | |
tree | c0dde03db30cc4684bb380873524274c06090b6a /keyboards/gh60/keymaps/dbroqua/keymap.c | |
parent | 6be061c6d42d538f756a986a412f28adb955ef1e (diff) |
- Added RGB layer on dbroqua GH60 layout
Diffstat (limited to 'keyboards/gh60/keymaps/dbroqua/keymap.c')
-rw-r--r-- | keyboards/gh60/keymaps/dbroqua/keymap.c | 109 |
1 files changed, 100 insertions, 9 deletions
diff --git a/keyboards/gh60/keymaps/dbroqua/keymap.c b/keyboards/gh60/keymaps/dbroqua/keymap.c index 3c16baa226..be88edc090 100644 --- a/keyboards/gh60/keymaps/dbroqua/keymap.c +++ b/keyboards/gh60/keymaps/dbroqua/keymap.c @@ -1,9 +1,11 @@ #include "gh60.h" #include "action_layer.h" +#include "rgblight.h" #define _DEFAULT 0 #define _FN 1 #define _WASD 2 +#define _SFX 3 //bool esc_led_on; @@ -50,11 +52,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------' */ [_FN] = KEYMAP_HHKB( /* Layer 1 */ - ______, 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_INS, KC_DEL, \ + TG(_SFX),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_INS, KC_DEL, \ KC_CAPS, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ______, ______, \ ______, KC_VOLD, KC_VOLU, KC_MUTE, ______, ______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT,______, \ ______, KC_MPRV, KC_MPLY, KC_MNXT, ______, ______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, ______, ______, \ - ______, ______, ______, KC_FN1, KC_MSTP, ______, ______, ______ \ + ______, ______, ______, TG(_WASD), KC_MSTP, ______, ______, ______ \ ), /* WASD Layer @@ -71,11 +73,32 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------' */ [_WASD] = KEYMAP_HHKB( /* Layer 2 */ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, ______, KC_UP, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, KC_LEFT, KC_DOWN, KC_RGHT, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______, \ - ______, ______, ______, ______, ______, ______, ______, ______ \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, KC_UP, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, KC_LEFT, KC_DOWN,KC_RGHT,______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______, \ + ______, ______, ______, ______, ______, ______, ______, ______ \ + ), + +/* SFX Layer + * ,-----------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | BL- | BL+ | BL | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | RGBT| RGBM| | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | + * `-----------------------------------------------------------------' + */ + [_SFX] = KEYMAP_HHKB( + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, F(0), F(1), ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, F(2), F(3), F(4), F(5), F(6), F(7), ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______ \ ) }; @@ -85,11 +108,73 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) return MACRO_NONE; }; +enum function_id { + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL +}; + const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay - [1] = ACTION_LAYER_TOGGLE(2), // toggle wasd overlay + [0] = ACTION_FUNCTION(RGBLED_TOGGLE), + [1] = ACTION_FUNCTION(RGBLED_STEP_MODE), + [2] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), + [3] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), + [4] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), + [5] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), + [6] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), + [7] = ACTION_FUNCTION(RGBLED_DECREASE_VAL) }; +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch (id) { + case RGBLED_TOGGLE: + if (record->event.pressed) { + rgblight_toggle(); + } + break; + case RGBLED_INCREASE_HUE: + if (record->event.pressed) { + rgblight_increase_hue(); + } + break; + case RGBLED_DECREASE_HUE: + if (record->event.pressed) { + rgblight_decrease_hue(); + } + break; + case RGBLED_INCREASE_SAT: + if (record->event.pressed) { + rgblight_increase_sat(); + } + break; + case RGBLED_DECREASE_SAT: + if (record->event.pressed) { + rgblight_decrease_sat(); + } + break; + case RGBLED_INCREASE_VAL: + if (record->event.pressed) { + rgblight_increase_val(); + } + break; + case RGBLED_DECREASE_VAL: + if (record->event.pressed) { + rgblight_decrease_val(); + } + break; + case RGBLED_STEP_MODE: + if (record->event.pressed) { + rgblight_step(); + } + break; + } +} + void matrix_scan_user(void) { uint32_t layer = layer_state; @@ -104,4 +189,10 @@ void matrix_scan_user(void) { } else { gh60_wasd_leds_off(); } + + if (layer & (1<<3)) { + gh60_esc_led_on(); + } else { + gh60_esc_led_off(); + } };
\ No newline at end of file |