aboutsummaryrefslogtreecommitdiff
path: root/keyboards/lfkeyboards/lfkpad/keymaps/pascalpfeil/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/lfkeyboards/lfkpad/keymaps/pascalpfeil/keymap.c')
-rw-r--r--keyboards/lfkeyboards/lfkpad/keymaps/pascalpfeil/keymap.c73
1 files changed, 73 insertions, 0 deletions
diff --git a/keyboards/lfkeyboards/lfkpad/keymaps/pascalpfeil/keymap.c b/keyboards/lfkeyboards/lfkpad/keymaps/pascalpfeil/keymap.c
new file mode 100644
index 000000000..b2b97f442
--- /dev/null
+++ b/keyboards/lfkeyboards/lfkpad/keymaps/pascalpfeil/keymap.c
@@ -0,0 +1,73 @@
1/* Copyright 2021 Pascal Pfeil
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include QMK_KEYBOARD_H
18
19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20 [0] = LAYOUT_numpad_6x4(
21 KC_ESC, KC_TAB, KC_BSPC, MO(1),
22 KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
23 KC_P7, KC_P8, KC_P9,
24 KC_P4, KC_P5, KC_P6, KC_PPLS,
25 KC_P1, KC_P2, KC_P3,
26 KC_P0, KC_PDOT, KC_PENT
27 ),
28
29 /* RGB */
30 [1] = LAYOUT_numpad_6x4(
31 RGB_SAI, RGB_VAI, RGB_HUI, _______,
32 RGB_SAD, RGB_VAD, RGB_HUD, RESET,
33 RGB_M_X, RGB_M_G, RGB_MOD,
34 RGB_M_SW,RGB_M_SN,RGB_M_K, RGB_RMOD,
35 RGB_M_P, RGB_M_B, RGB_M_R,
36 XXXXXXX, XXXXXXX, RGB_TOG
37 ),
38
39 /* VIA wants four keymaps */
40 [2] = LAYOUT_numpad_6x4(
41 _______, _______, _______, _______,
42 _______, _______, _______, _______,
43 _______, _______, _______,
44 _______, _______, _______, _______,
45 _______, _______, _______,
46 _______, _______, _______
47 ),
48
49 /* VIA wants four keymaps */
50 [3] = LAYOUT_numpad_6x4(
51 _______, _______, _______, _______,
52 _______, _______, _______, _______,
53 _______, _______, _______,
54 _______, _______, _______, _______,
55 _______, _______, _______,
56 _______, _______, _______
57 ),
58};
59
60const uint8_t number_leds[] = {8, 9, 10, 11, 12, 13, 15, 16, 17};
61const uint8_t number_leds_size = sizeof(number_leds) / sizeof(uint8_t);
62
63bool led_update_user(led_t led_state) {
64 for (uint8_t i = 0; i < number_leds_size; i++)
65 if (led_state.num_lock)
66 // set to whatever the other leds are doing
67 // this is needed so that upon disabling num lock, the leds don't stay red
68 rgblight_sethsv_at(rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val(), numer_leds[i]);
69 else
70 rgblight_setrgb_red_at(numer_leds[i]); // set to red
71
72 return true;
73}