diff options
Diffstat (limited to 'keyboards/7skb/keymaps/default/keymap.c')
-rw-r--r-- | keyboards/7skb/keymaps/default/keymap.c | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/keyboards/7skb/keymaps/default/keymap.c b/keyboards/7skb/keymaps/default/keymap.c new file mode 100644 index 000000000..c56fb76fc --- /dev/null +++ b/keyboards/7skb/keymaps/default/keymap.c | |||
@@ -0,0 +1,115 @@ | |||
1 | #include QMK_KEYBOARD_H | ||
2 | |||
3 | |||
4 | #ifdef RGBLIGHT_ENABLE | ||
5 | //Following line allows macro to read current RGB settings | ||
6 | extern rgblight_config_t rgblight_config; | ||
7 | #endif | ||
8 | |||
9 | extern uint8_t is_master; | ||
10 | |||
11 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
12 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
13 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
14 | // entirely and just use numbers. | ||
15 | enum layer_number { | ||
16 | _QWERTY = 0, | ||
17 | _FN, | ||
18 | _ADJUST, | ||
19 | }; | ||
20 | |||
21 | enum custom_keycodes { | ||
22 | RGB_RST = SAFE_RANGE | ||
23 | }; | ||
24 | |||
25 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
26 | [_QWERTY] = LAYOUT( | ||
27 | //,-----------------------------------------------------| |--------------------------------------------------------------------------------. | ||
28 | KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, | ||
29 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
30 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSPC, | ||
31 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------| | ||
32 | KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, | ||
33 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| | ||
34 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN), | ||
35 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| | ||
36 | KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, KC_RALT | ||
37 | //`---------------------------------------------| |--------------------------------------------' | ||
38 | ), | ||
39 | |||
40 | [_FN] = LAYOUT( | ||
41 | //,-----------------------------------------------------| |--------------------------------------------------------------------------------. | ||
42 | TG(_ADJUST), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, | ||
43 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
44 | _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK,KC_PAUSE, KC_UP, _______, KC_BSPC, | ||
45 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------| | ||
46 | _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_LEFT,KC_RIGHT, _______, | ||
47 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| | ||
48 | _______, _______, _______, _______, _______, _______, _______, _______, KC_END, KC_PGDN, KC_DOWN, _______, _______, | ||
49 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| | ||
50 | _______, _______, _______, _______, _______, _______, KC_STOP, _______ | ||
51 | //`---------------------------------------------| |--------------------------------------------' | ||
52 | ), | ||
53 | |||
54 | [_ADJUST] = LAYOUT( /* Base */ | ||
55 | //,-----------------------------------------------------| |--------------------------------------------------------------------------------. | ||
56 | TG(_ADJUST), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, | ||
57 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
58 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_RST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
59 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------| | ||
60 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_TOG, RGB_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
61 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| | ||
62 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_VAD, RGB_VAI, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, XXXXXXX, | ||
63 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| | ||
64 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_STOP, XXXXXXX | ||
65 | //`---------------------------------------------| |--------------------------------------------' | ||
66 | ) | ||
67 | }; | ||
68 | |||
69 | |||
70 | //A description for expressing the layer position in LED mode. | ||
71 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
72 | #ifdef RGBLIGHT_ENABLE | ||
73 | switch (get_highest_layer(state)) { | ||
74 | case _FN: | ||
75 | rgblight_sethsv_at(HSV_BLUE, 0); | ||
76 | break; | ||
77 | case _ADJUST: | ||
78 | rgblight_sethsv_at(HSV_PURPLE, 0); | ||
79 | break; | ||
80 | default: // for any other layers, or the default layer | ||
81 | rgblight_sethsv_at( 0, 0, 0, 0); | ||
82 | break; | ||
83 | } | ||
84 | rgblight_set_effect_range( 1, 4); | ||
85 | #endif | ||
86 | return state; | ||
87 | } | ||
88 | |||
89 | int RGB_current_mode; | ||
90 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
91 | bool result = false; | ||
92 | switch (keycode) { | ||
93 | #ifdef RGBLIGHT_ENABLE | ||
94 | case RGB_MOD: | ||
95 | if (record->event.pressed) { | ||
96 | rgblight_mode(RGB_current_mode); | ||
97 | rgblight_step(); | ||
98 | RGB_current_mode = rgblight_config.mode; | ||
99 | } | ||
100 | break; | ||
101 | case RGB_RST: | ||
102 | if (record->event.pressed) { | ||
103 | eeconfig_update_rgblight_default(); | ||
104 | rgblight_enable(); | ||
105 | RGB_current_mode = rgblight_config.mode; | ||
106 | } | ||
107 | break; | ||
108 | #endif | ||
109 | default: | ||
110 | result = true; | ||
111 | break; | ||
112 | } | ||
113 | |||
114 | return result; | ||
115 | } | ||