summaryrefslogtreecommitdiffstats
path: root/keyboards/mechmini
diff options
context:
space:
mode:
authorkrusli <rusli.kenneth@gmail.com>2017-09-16 10:30:52 +0200
committerJack Humbert <jack.humb@gmail.com>2017-09-16 15:34:29 +0200
commit25aa474246409bb407545e93ad6eb8f810f2e54d (patch)
treed2d35c5c60c8820245d1719abf485fa4114c0ba6 /keyboards/mechmini
parentc7ebb0f950ea2d98db05b36fcf1b5de3120431cc (diff)
downloadqmk_firmware-25aa474246409bb407545e93ad6eb8f810f2e54d.tar.gz
qmk_firmware-25aa474246409bb407545e93ad6eb8f810f2e54d.tar.xz
Updated RGB code to use event.pressed
Diffstat (limited to 'keyboards/mechmini')
-rw-r--r--keyboards/mechmini/keymaps/default/keymap.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/keyboards/mechmini/keymaps/default/keymap.c b/keyboards/mechmini/keymaps/default/keymap.c
index 31279ffe9..5cae1bc81 100644
--- a/keyboards/mechmini/keymaps/default/keymap.c
+++ b/keyboards/mechmini/keymaps/default/keymap.c
@@ -63,7 +63,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
*/
-uint8_t current_level = 2;
+uint8_t current_level = 4;
int is_on = 0;
uint8_t r = 0xFF;
@@ -106,22 +106,30 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
}
break;
case COLOR_1: // set to pink
- r = 0xFF;
- g = 0x81;
- b = 0xC2;
+ if (event.pressed) {
+ r = 0xFF;
+ g = 0x81;
+ b = 0xC2;
+ }
break;
case COLOR_2: // set to cyan
- r = 0x00;
- g = 0xE0;
- b = 0xFF;
+ if (event.pressed) {
+ r = 0x00;
+ g = 0xE0;
+ b = 0xFF;
+ }
break;
case COLOR_3: // set to white
- r = 0xFF;
- g = 0xFF;
- b = 0xFF;
+ if (event.pressed) {
+ r = 0xFF;
+ g = 0xFF;
+ b = 0xFF;
+ }
break;
case ENABLE_MAX_BRIGHTNESS: // enable all 16 brightness steps
- max_brightness = MAX_BRIGHTNESS;
+ if (event.pressed) {
+ max_brightness = MAX_BRIGHTNESS;
+ }
break;
}