]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/cospad/keymaps/default/keymap.c
Remove redundant KC_TRNS and KC_NO fillers in default keymaps (#5152)
[qmk_firmware.git] / keyboards / cospad / keymaps / default / keymap.c
1 #include QMK_KEYBOARD_H
2 #include "led.h"
3
4 #ifdef RGBLIGHT_ENABLE
5 #include "rgblight.h"
6 #endif
7
8 // Each layer gets a name for readability, which is then used in the keymap matrix below.
9 // The underscores don't mean anything - you can have a layer called STUFF or any other name.
10 // Layer names don't all need to be of the same length, obviously, and you can also skip them
11 // entirely and just use numbers.
12 #define _BL 0
13 #define _FL 1
14
15 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
16   /* Keymap _BL: (Base Layer) Default Layer
17    * ,-------------------.
18    * |Esc |TAB | FN | BS |
19    * |----|----|----|----|
20    * | NL | /  | *  | -  |
21    * |----|----|----|----|
22    * | 7  | 8  | 9  |    |
23    * |----|----|----| +  |
24    * | 4  | 5  | 6  |    |
25    * |----|----|----|----|
26    * | 1  | 2  | 3  |    |
27    * |----|----|----| En |
28    * |   0     | .  |    |
29    * `-------------------'
30    */
31
32 [_BL] = LAYOUT_numpad_6x4(
33   KC_ESC,   KC_TAB,   MO(_FL),   KC_BSPC, \
34   KC_NLCK,  KC_PSLS,  KC_PAST,   KC_PMNS, \
35   KC_P7,    KC_P8,    KC_P9,              \
36   KC_P4,    KC_P5,    KC_P6,     KC_PPLS, \
37   KC_P1,    KC_P2,    KC_P3,              \
38   KC_P0,              KC_PDOT,   KC_PENT),
39
40   /* Keymap _FL: Function Layer
41    * ,-------------------.
42    * |RGBT|TAB | FN | BS |
43    * |----|----|----|----|
44    * |RGBM|RGBP|BTOG| -  |
45    * |----|----|----|----|
46    * |HUD |HUI |BON |    |
47    * |----|----|----| +  |
48    * |SAD |SAI |BOFF|    |
49    * |----|----|----|----|
50    * |VAD |VAS | 3  |    |
51    * |----|----|----| En |
52    * |   0     |RST |    |
53    * `-------------------'
54    */
55 [_FL] = LAYOUT_numpad_6x4(
56   RGB_TOG,  KC_TAB,   KC_TRNS,   KC_BSPC, \
57   RGB_MOD,  RGB_M_P,  BL_TOGG,   KC_PMNS, \
58   RGB_HUD,  RGB_HUI,  BL_ON,              \
59   RGB_SAD,  RGB_SAI,  BL_OFF,    KC_PPLS, \
60   RGB_VAD,  RGB_VAI,  KC_P3,              \
61   KC_P0,              RESET,     KC_PENT),
62 };
63
64 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
65    switch (keycode) {
66       case BL_TOGG:
67          if (record->event.pressed) {
68             cospad_bl_led_togg();
69          }
70          return false;
71       case BL_ON:
72          if (record->event.pressed) {
73             cospad_bl_led_on();
74          }
75          return false;
76       case BL_OFF:
77          if(record->event.pressed) {
78             cospad_bl_led_off();
79          }
80          return false;
81       default:
82          return true;
83    }
84 }