aboutsummaryrefslogtreecommitdiff
path: root/keyboards/cospad/keymaps/default/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/cospad/keymaps/default/keymap.c')
-rw-r--r--keyboards/cospad/keymaps/default/keymap.c91
1 files changed, 91 insertions, 0 deletions
diff --git a/keyboards/cospad/keymaps/default/keymap.c b/keyboards/cospad/keymaps/default/keymap.c
new file mode 100644
index 000000000..0e762c2e4
--- /dev/null
+++ b/keyboards/cospad/keymaps/default/keymap.c
@@ -0,0 +1,91 @@
1#include "cospad.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#define _______ KC_TRNS
16
17const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
18 /* Keymap _BL: (Base Layer) Default Layer
19 * ,-------------------.
20 * |Esc |TAB | FN | BS |
21 * |----|----|----|----|
22 * | NL | / | * | - |
23 * |----|----|----|----|
24 * | 7 | 8 | 9 | |
25 * |----|----|----| + |
26 * | 4 | 5 | 6 | |
27 * |----|----|----|----|
28 * | 1 | 2 | 3 | |
29 * |----|----|----| En |
30 * | 0 | . | |
31 * `-------------------'
32 */
33
34[_BL] = KEYMAP(
35 KC_ESC, KC_TAB, MO(_FL), KC_BSPC, \
36 KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
37 KC_P7, KC_P8, KC_P9, KC_PPLS, \
38 KC_P4, KC_P5, KC_P6, KC_NO, \
39 KC_P1, KC_P2, KC_P3, KC_PENT, \
40 KC_P0, KC_NO, KC_PDOT, KC_NO),
41
42 /* Keymap _FL: Function Layer
43 * ,-------------------.
44 * |RGBT|TAB | FN | BS |
45 * |----|----|----|----|
46 * |RGBM|RGBP|BTOG| - |
47 * |----|----|----|----|
48 * |HUD |HUI |BON | |
49 * |----|----|----| + |
50 * |SAD |SAI |BOFF| |
51 * |----|----|----|----|
52 * |VAD |VAS | 3 | |
53 * |----|----|----| En |
54 * | 0 |RST | |
55 * `-------------------'
56 */
57[_FL] = KEYMAP(
58 RGB_TOG, KC_TAB, KC_TRNS, KC_BSPC, \
59 RGB_MOD, RGB_M_P, BL_TOGG, KC_PMNS, \
60 RGB_HUD, RGB_HUI, BL_ON, KC_PPLS, \
61 RGB_SAD, RGB_SAI, BL_OFF, KC_NO, \
62 RGB_VAD, RGB_VAI, KC_P3, KC_PENT, \
63 KC_P0, KC_NO, RESET, KC_NO),
64};
65
66
67const uint16_t PROGMEM fn_actions[] = {
68 [0] = MO(_FL),
69};
70
71bool process_record_user(uint16_t keycode, keyrecord_t *record) {
72 switch (keycode) {
73 case BL_TOGG:
74 if (record->event.pressed) {
75 cospad_bl_led_togg();
76 }
77 return false;
78 case BL_ON:
79 if (record->event.pressed) {
80 cospad_bl_led_on();
81 }
82 return false;
83 case BL_OFF:
84 if(record->event.pressed) {
85 cospad_bl_led_off();
86 }
87 return false;
88 default:
89 return true;
90 }
91}