summaryrefslogtreecommitdiffstats
path: root/keyboards/ps2avrGB/keymaps
diff options
context:
space:
mode:
authorLuiz Ribeiro <luizribeiro@gmail.com>2017-05-28 18:40:03 +0200
committerLuiz Ribeiro <luizribeiro@gmail.com>2017-06-11 18:30:48 +0200
commit6037cede2ce66dd8ce4df82d6d9a347c1de3110a (patch)
tree34538431c8d23c3b814e41b6e429653e85b89d5b /keyboards/ps2avrGB/keymaps
parentc22a400603bfafedefa04c430214965cd191663b (diff)
downloadqmk_firmware-6037cede2ce66dd8ce4df82d6d9a347c1de3110a.tar.gz
qmk_firmware-6037cede2ce66dd8ce4df82d6d9a347c1de3110a.tar.xz
rgblight support for ps2avrGB
Diffstat (limited to 'keyboards/ps2avrGB/keymaps')
-rw-r--r--keyboards/ps2avrGB/keymaps/default/keymap.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/keyboards/ps2avrGB/keymaps/default/keymap.c b/keyboards/ps2avrGB/keymaps/default/keymap.c
index 3e4cebc81..60929ac99 100644
--- a/keyboards/ps2avrGB/keymaps/default/keymap.c
+++ b/keyboards/ps2avrGB/keymaps/default/keymap.c
@@ -16,6 +16,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ps2avrGB.h"
+#include "action_layer.h"
+#include "rgblight.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_KEYMAP(
@@ -28,5 +30,69 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
+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_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_STEP_MODE:
+ if (record->event.pressed) {
+ rgblight_step();
+ }
+ 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;
+ }
};