aboutsummaryrefslogtreecommitdiff
path: root/keyboards/helix/rev3_4rows/keymaps/default/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/helix/rev3_4rows/keymaps/default/keymap.c')
-rw-r--r--keyboards/helix/rev3_4rows/keymaps/default/keymap.c193
1 files changed, 193 insertions, 0 deletions
diff --git a/keyboards/helix/rev3_4rows/keymaps/default/keymap.c b/keyboards/helix/rev3_4rows/keymaps/default/keymap.c
new file mode 100644
index 000000000..a9a2c4acc
--- /dev/null
+++ b/keyboards/helix/rev3_4rows/keymaps/default/keymap.c
@@ -0,0 +1,193 @@
1/* Copyright 2020 yushakobo
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#include QMK_KEYBOARD_H
17
18
19// Defines names for use in layer keycodes and the keymap
20enum layer_names {
21 _QWERTY = 0,
22 _LOWER,
23 _RAISE,
24 _ADJUST
25};
26
27// Defines the keycodes used by our macros in process_record_user
28enum custom_keycodes {
29 EISU = SAFE_RANGE,
30 KANA,
31 ADJUST,
32 RGBRST
33};
34
35#define LOWER MO(_LOWER)
36#define RAISE MO(_RAISE)
37
38const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
39
40 /* Qwerty
41 * ,-----------------------------------------. ,-----------------------------------------.
42 * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp |
43 * |------+------+------+------+------+------| |------+------+------+------+------+------|
44 * | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' |
45 * |------+------+------+------+------+------| |------+------+------+------+------+------|
46 * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter |
47 * |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
48 * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right |
49 * `-------------------------------------------------------------------------------------------------'
50 */
51 [_QWERTY] = LAYOUT( \
52 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
53 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
54 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
55 ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
56 ),
57
58 /* Lower
59 * ,-----------------------------------------. ,-----------------------------------------.
60 * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | |
61 * |------+------+------+------+------+------| |------+------+------+------+------+------|
62 * | | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | |
63 * |------+------+------+------+------+------| |------+------+------+------+------+------|
64 * | CAPS | F7 | F8 | F9 | F10 | F11 | | F12 | | | Home | End | |
65 * |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
66 * | | | | | | | | | | | Next | Vol- | Vol+ | Play |
67 * `-------------------------------------------------------------------------------------------------'
68 */
69 [_LOWER] = LAYOUT( \
70 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \
71 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
72 KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_HOME, KC_END, _______, \
73 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
74 ),
75
76 /* Raise
77 * ,-----------------------------------------. ,-----------------------------------------.
78 * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del |
79 * |------+------+------+------+------+------| |------+------+------+------+------+------|
80 * | | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ |
81 * |------+------+------+------+------+------| |------+------+------+------+------+------|
82 * | CAPS | F7 | F8 | F9 | F10 | F11 | | F12 | | |PageDn|PageUp| |
83 * |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
84 * | | | | | | | | | | | Next | Vol- | Vol+ | Play |
85 * `-------------------------------------------------------------------------------------------------'
86 */
87 [_RAISE] = LAYOUT( \
88 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
89 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
90 KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, \
91 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
92 ),
93
94 /* Adjust (Lower + Raise)
95 * ,-----------------------------------------. ,-----------------------------------------.
96 * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |
97 * |------+------+------+------+------+------| |------+------+------+------+------+------|
98 * | | Reset|RGBRST|EEPRST| | | | | | | | | Del |
99 * |------+------+------+------+------+------| |------+------+------+------+------+------|
100 * | | | | | | Mac | | Win | |RGB ON| HUE+ | SAT+ | VAL+ |
101 * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
102 * | | | | | | | | | | | MODE | HUE- | SAT- | VAL- |
103 * `-------------------------------------------------------------------------------------------------'
104 */
105 [_ADJUST] = LAYOUT( \
106 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \
107 _______, RESET, RGBRST, EEP_RST, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
108 _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \
109 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \
110 )
111
112};
113
114void encoder_update_user(uint8_t index, bool clockwise) {
115 if (index == 0) { /* Left side encoder */
116 if (clockwise) {
117 tap_code(KC_PGDN);
118 } else {
119 tap_code(KC_PGUP);
120 }
121 } else if (index == 1) { /* Right side encoder */
122 if (clockwise) {
123 tap_code(KC_DOWN);
124 } else {
125 tap_code(KC_UP);
126 }
127 }
128}
129
130layer_state_t layer_state_set_user(layer_state_t state) {
131 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
132}
133
134bool process_record_user(uint16_t keycode, keyrecord_t *record) {
135 switch (keycode) {
136 case EISU:
137 if (record->event.pressed) {
138 if (is_mac_mode()) {
139 register_code(KC_LANG2);
140 }else{
141 tap_code16(LALT(KC_GRAVE));
142 }
143 } else {
144 unregister_code(KC_LANG2);
145 }
146 return false;
147 break;
148 case KANA:
149 if (record->event.pressed) {
150 if (is_mac_mode()) {
151 register_code(KC_LANG1);
152 }else{
153 tap_code16(LALT(KC_GRAVE));
154 }
155 } else {
156 unregister_code(KC_LANG1);
157 }
158 return false;
159 break;
160 case ADJUST:
161 if (record->event.pressed) {
162 layer_on(_LOWER);
163 layer_on(_RAISE);
164 } else {
165 layer_off(_LOWER);
166 layer_off(_RAISE);
167 }
168 break;
169 case RGBRST:
170 #ifdef RGBLIGHT_ENABLE
171 if (record->event.pressed) {
172 eeconfig_update_rgblight_default();
173 rgblight_enable();
174 }
175 #endif
176 break;
177 }
178 return true;
179}
180
181/*
182void matrix_init_user(void) {
183
184}
185
186void matrix_scan_user(void) {
187
188}
189
190bool led_update_user(led_t led_state) {
191 return true;
192}
193*/