aboutsummaryrefslogtreecommitdiff
path: root/keyboards/cluepad/keymaps/default/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/cluepad/keymaps/default/keymap.c')
-rw-r--r--keyboards/cluepad/keymaps/default/keymap.c67
1 files changed, 5 insertions, 62 deletions
diff --git a/keyboards/cluepad/keymaps/default/keymap.c b/keyboards/cluepad/keymaps/default/keymap.c
index 8ba49952f..10881e8de 100644
--- a/keyboards/cluepad/keymaps/default/keymap.c
+++ b/keyboards/cluepad/keymaps/default/keymap.c
@@ -1,7 +1,6 @@
1#include "cluepad.h" 1#include "cluepad.h"
2 2
3#include "backlight.h" 3#include "backlight.h"
4#include "rgblight.h"
5 4
6// Each layer gets a name for readability, which is then used in the keymap matrix below. 5// Each layer gets a name for readability, which is then used in the keymap matrix below.
7// The underscores don't mean anything - you can have a layer called STUFF or any other name. 6// The underscores don't mean anything - you can have a layer called STUFF or any other name.
@@ -46,77 +45,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
46 * '-------------------' 45 * '-------------------'
47 */ 46 */
48[_FL] = KEYMAP( 47[_FL] = KEYMAP(
49 LT(_FL, KC_NLCK), KC_TRNS, KC_TRNS, F(0), \ 48 LT(_FL, KC_NLCK), KC_TRNS, KC_TRNS, RGB_TOG, \
50 KC_TRNS, F(4), KC_TRNS, F(6), \ 49 KC_TRNS, RGB_SAI, KC_TRNS, RGB_VAI, \
51 F(3), BL_STEP, F(2), \ 50 RGB_HUD, BL_STEP, RGB_HUI, \
52 KC_TRNS, F(5), KC_TRNS, F(7), \ 51 KC_TRNS, RGB_SAD, KC_TRNS, RGB_VAD, \
53 F(1), KC_TRNS) 52 RGB_MOD, KC_TRNS)
54}; 53};
55 54
56enum function_id { 55enum function_id {
57 RGBLED_TOGGLE,
58 RGBLED_STEP_MODE,
59 RGBLED_INCREASE_HUE,
60 RGBLED_DECREASE_HUE,
61 RGBLED_INCREASE_SAT,
62 RGBLED_DECREASE_SAT,
63 RGBLED_INCREASE_VAL,
64 RGBLED_DECREASE_VAL,
65}; 56};
66 57
67const uint16_t PROGMEM fn_actions[] = { 58const uint16_t PROGMEM fn_actions[] = {
68 [0] = ACTION_FUNCTION(RGBLED_TOGGLE),
69 [1] = ACTION_FUNCTION(RGBLED_STEP_MODE),
70 [2] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
71 [3] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
72 [4] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
73 [5] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
74 [6] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
75 [7] = ACTION_FUNCTION(RGBLED_DECREASE_VAL),
76}; 59};
77 60
78void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { 61void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
79 switch (id) { 62 switch (id) {
80 case RGBLED_TOGGLE:
81 if (record->event.pressed) {
82 rgblight_toggle();
83 }
84 break;
85 case RGBLED_INCREASE_HUE:
86 if (record->event.pressed) {
87 rgblight_increase_hue();
88 }
89 break;
90 case RGBLED_DECREASE_HUE:
91 if (record->event.pressed) {
92 rgblight_decrease_hue();
93 }
94 break;
95 case RGBLED_INCREASE_SAT:
96 if (record->event.pressed) {
97 rgblight_increase_sat();
98 }
99 break;
100 case RGBLED_DECREASE_SAT:
101 if (record->event.pressed) {
102 rgblight_decrease_sat();
103 }
104 break;
105 case RGBLED_INCREASE_VAL:
106 if (record->event.pressed) {
107 rgblight_increase_val();
108 }
109 break;
110 case RGBLED_DECREASE_VAL:
111 if (record->event.pressed) {
112 rgblight_decrease_val();
113 }
114 break;
115 case RGBLED_STEP_MODE:
116 if (record->event.pressed) {
117 rgblight_step();
118 }
119 break;
120 } 63 }
121} 64}
122 65