diff options
Diffstat (limited to 'keyboards/7c8/framework/keymaps/steven/keymap.c')
-rw-r--r-- | keyboards/7c8/framework/keymaps/steven/keymap.c | 130 |
1 files changed, 130 insertions, 0 deletions
diff --git a/keyboards/7c8/framework/keymaps/steven/keymap.c b/keyboards/7c8/framework/keymaps/steven/keymap.c new file mode 100644 index 000000000..77134db5b --- /dev/null +++ b/keyboards/7c8/framework/keymaps/steven/keymap.c | |||
@@ -0,0 +1,130 @@ | |||
1 | /* Copyright 2020 Steven Nguyen | ||
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 | |||
19 | enum framework_layers { | ||
20 | _BASE, | ||
21 | _LOWER, | ||
22 | _RAISE, | ||
23 | _BOTH, | ||
24 | _FN | ||
25 | }; | ||
26 | |||
27 | enum framework_keycodes { | ||
28 | LOWER = SAFE_RANGE, | ||
29 | RAISE, | ||
30 | BOTH, | ||
31 | FN | ||
32 | }; | ||
33 | |||
34 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
35 | [_BASE] = framework_via( | ||
36 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MEDIA_PLAY_PAUSE, | ||
37 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, | ||
38 | KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | ||
39 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, | ||
40 | KC_LCTL, KC_LGUI, KC_LALT, MO(_FN), MO(_LOWER), KC_SPC, KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, | ||
41 | KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP | ||
42 | ), | ||
43 | |||
44 | [_LOWER] = framework_via( | ||
45 | _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, _______, | ||
46 | KC_LEAD, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, _______, _______, KC_LBRC, KC_RBRC, KC_BSLS, | ||
47 | KC_DEL, KC_F5, KC_F6, KC_F7, KC_F8, _______, _______, _______, _______, _______, _______, _______, | ||
48 | _______, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, | ||
49 | _______, _______, _______, _______, _______, _______, _______, MO(_BOTH), KC_HOME, KC_PGDN, KC_PGUP, KC_END, | ||
50 | C(S(KC_TAB)), C(KC_TAB) | ||
51 | ), | ||
52 | |||
53 | [_RAISE] = framework_via( | ||
54 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
55 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
56 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
57 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
58 | _______, _______, _______, _______, MO(_BOTH), _______, _______, _______, _______, _______, _______, _______, | ||
59 | C(KC_LEFT), C(KC_RIGHT) | ||
60 | ), | ||
61 | |||
62 | [_BOTH] = framework_via( | ||
63 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
64 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
65 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
66 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
67 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, DEBUG, | ||
68 | C(KC_Z), C(KC_Y) | ||
69 | ), | ||
70 | |||
71 | [_FN] = framework_via( | ||
72 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
73 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
74 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
75 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
76 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
77 | KC_MS_WH_LEFT, KC_MS_WH_RIGHT | ||
78 | ) | ||
79 | }; | ||
80 | |||
81 | LEADER_EXTERNS(); | ||
82 | |||
83 | void matrix_scan_user(void) { | ||
84 | LEADER_DICTIONARY() { | ||
85 | leading = false; | ||
86 | leader_end(); | ||
87 | |||
88 | // qq, alt+f4 close window | ||
89 | SEQ_TWO_KEYS(KC_Q, KC_Q) { | ||
90 | tap_code16(A(KC_F4)); | ||
91 | } | ||
92 | |||
93 | // ee, open explorer | ||
94 | SEQ_TWO_KEYS(KC_E, KC_E) { | ||
95 | tap_code16(G(KC_E)); | ||
96 | } | ||
97 | |||
98 | // rr, windows run prompt | ||
99 | SEQ_TWO_KEYS(KC_R, KC_R) { | ||
100 | tap_code16(G(KC_R)); | ||
101 | } | ||
102 | |||
103 | // ww, maximize window | ||
104 | SEQ_TWO_KEYS(KC_W, KC_W) { | ||
105 | tap_code16(G(KC_UP)); | ||
106 | } | ||
107 | |||
108 | // ss, minimize window | ||
109 | SEQ_TWO_KEYS(KC_S, KC_S) { | ||
110 | tap_code16(G(KC_DOWN)); | ||
111 | } | ||
112 | |||
113 | // <space><space>, toggle desktop | ||
114 | SEQ_TWO_KEYS(KC_SPC, KC_SPC) { | ||
115 | tap_code16(G(KC_D)); | ||
116 | } | ||
117 | } | ||
118 | } | ||
119 | |||
120 | bool encoder_update_user(uint8_t index, bool clockwise) { | ||
121 | uint8_t layer = get_highest_layer(layer_state); | ||
122 | if (index == 0) { | ||
123 | if (clockwise) { | ||
124 | tap_code16(dynamic_keymap_get_keycode(layer, 10, 1)); | ||
125 | } else { | ||
126 | tap_code16(dynamic_keymap_get_keycode(layer, 10, 0)); | ||
127 | } | ||
128 | } | ||
129 | return true; | ||
130 | } | ||