summaryrefslogtreecommitdiff
path: root/keyboards/phantom
diff options
context:
space:
mode:
authorTerryMathews <terry@terrymathews.net>2016-07-07 23:34:33 -0400
committerTerryMathews <terry@terrymathews.net>2016-07-07 23:34:33 -0400
commit50c686587ed49d8079ba1b11d45ceb6a55d6cd4b (patch)
tree73bddcd35f632004d615d69725f07ccfd7074007 /keyboards/phantom
parente8719e10c4395102f8e252c8377e2f19a18ee74d (diff)
Create keycodes for RGB control functions
Moves RGB controls out of the macro function and assigns them their own keycodes: RGB_TOG (toggle on/off) RGB_MOD (mode step) RGB_HUI (increase hue) RGB_HUD (decrease hue) RGB_SAI (increase saturation) RGB_SAD (decrease saturation) RGB_VAI (increase brightness) RGB_VAD (decrease brightness)
Diffstat (limited to 'keyboards/phantom')
-rw-r--r--keyboards/phantom/keymaps/default/keymap.c69
1 files changed, 1 insertions, 68 deletions
diff --git a/keyboards/phantom/keymaps/default/keymap.c b/keyboards/phantom/keymaps/default/keymap.c
index 1368226aa9..a4fc319ac8 100644
--- a/keyboards/phantom/keymaps/default/keymap.c
+++ b/keyboards/phantom/keymaps/default/keymap.c
@@ -1,9 +1,5 @@
#include "phantom.h"
-#ifdef RGBLIGHT_ENABLE
-#include "rgblight.h"
-#endif
-
// Used for SHIFT_ESC
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
@@ -59,7 +55,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, \
- KC_TRNS, F(1), F(2), F(3), F(4), F(5), F(6), F(7), F(8), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
+ KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
#else
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
@@ -73,30 +69,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
enum function_id {
SHIFT_ESC,
- #ifdef RGBLIGHT_ENABLE
- RGBLED_TOGGLE,
- RGBLED_STEP_MODE,
- RGBLED_INCREASE_HUE,
- RGBLED_DECREASE_HUE,
- RGBLED_INCREASE_SAT,
- RGBLED_DECREASE_SAT,
- RGBLED_INCREASE_VAL,
- RGBLED_DECREASE_VAL
- #endif
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(SHIFT_ESC),
- #ifdef RGBLIGHT_ENABLE
- [1] = ACTION_FUNCTION(RGBLED_TOGGLE),
- [2] = ACTION_FUNCTION(RGBLED_STEP_MODE),
- [3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
- [4] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
- [5] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
- [6] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
- [7] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
- [8] = ACTION_FUNCTION(RGBLED_DECREASE_VAL),
- #endif
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
@@ -122,48 +98,5 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
}
}
break;
- //led operations
- #ifdef RGBLIGHT_ENABLE
- 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;
- #endif
}
}