2 Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #include "action_layer.h"
22 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
24 ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,HOME,END,
25 GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, DEL,
26 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, INS,
27 CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, PGUP,
28 LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT, UP, PGDN,
29 LCTL,LALT,LGUI, SPC, RGUI,RALT,RCTL,LEFT,DOWN,RGHT
44 const uint16_t PROGMEM fn_actions[] = {
45 [0] = ACTION_FUNCTION(RGBLED_TOGGLE),
46 [1] = ACTION_FUNCTION(RGBLED_STEP_MODE),
47 [2] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
48 [3] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
49 [4] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
50 [5] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
51 [6] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
52 [7] = ACTION_FUNCTION(RGBLED_DECREASE_VAL),
55 void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
58 if (record->event.pressed) {
62 case RGBLED_STEP_MODE:
63 if (record->event.pressed) {
67 case RGBLED_INCREASE_HUE:
68 if (record->event.pressed) {
69 rgblight_increase_hue();
72 case RGBLED_DECREASE_HUE:
73 if (record->event.pressed) {
74 rgblight_decrease_hue();
77 case RGBLED_INCREASE_SAT:
78 if (record->event.pressed) {
79 rgblight_increase_sat();
82 case RGBLED_DECREASE_SAT:
83 if (record->event.pressed) {
84 rgblight_decrease_sat();
87 case RGBLED_INCREASE_VAL:
88 if (record->event.pressed) {
89 rgblight_increase_val();
92 case RGBLED_DECREASE_VAL:
93 if (record->event.pressed) {
94 rgblight_decrease_val();