aboutsummaryrefslogtreecommitdiff
path: root/keyboards/jj4x4/keymaps/default/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/jj4x4/keymaps/default/keymap.c')
-rw-r--r--keyboards/jj4x4/keymaps/default/keymap.c83
1 files changed, 39 insertions, 44 deletions
diff --git a/keyboards/jj4x4/keymaps/default/keymap.c b/keyboards/jj4x4/keymaps/default/keymap.c
index a0b06ee92..ae2c6b541 100644
--- a/keyboards/jj4x4/keymaps/default/keymap.c
+++ b/keyboards/jj4x4/keymaps/default/keymap.c
@@ -13,61 +13,56 @@
13 * You should have received a copy of the GNU General Public License 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/>. 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16
16#include QMK_KEYBOARD_H 17#include QMK_KEYBOARD_H
17 18
18enum layers { 19enum layers {
19 _BASE = 0, 20 _BASE = 0,
20 _FN1, 21 _FN1,
21 _FN2, 22 _FN2
22}; 23};
23 24
24// Defines the keycodes used by our macros in process_record_user 25// Defines the keycodes used by our macros in process_record_user
25enum custom_keycodes { 26enum custom_keycodes {
26 QMKBEST = SAFE_RANGE, 27 QMKBEST = SAFE_RANGE,
27 QMKURL 28 QMKURL
28}; 29};
29 30
30const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 31const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
31 32 [_BASE] = LAYOUT_ortho_4x4(
32 [_BASE] = LAYOUT_ortho_4x4( 33 KC_PGUP, KC_HOME, KC_UP, KC_END,
33 KC_PGUP, KC_HOME, KC_UP, KC_END , \ 34 KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT,
34 KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, \ 35 MO(_FN2), KC_VOLU, KC_MPLY, KC_MPRV,
35 MO(_FN2), KC_VOLU, KC_MPLY, KC_MPRV, \ 36 MO(_FN1), KC_VOLD, KC_MUTE, KC_MNXT
36 MO(_FN1), KC_VOLD, KC_MUTE, KC_MNXT \ 37 ),
37 ), 38 [_FN1] = LAYOUT_ortho_4x4(
38 [_FN1] = LAYOUT_ortho_4x4( 39 KC_ESC, KC_P7, KC_P8, KC_P9,
39 KC_ESC, KC_P7, KC_P8, KC_P9, \ 40 KC_TAB, KC_P4, KC_P5, KC_P6,
40 KC_TAB, KC_P4, KC_P5, KC_P6, \ 41 KC_ENT, KC_P1, KC_P2, KC_P3,
41 KC_ENT, KC_P1, KC_P2, KC_P3, \ 42 _______, KC_P0, KC_P0, KC_DOT
42 _______, KC_P0, KC_P0, KC_DOT \ 43 ),
43 ), 44 [_FN2] = LAYOUT_ortho_4x4(
44 [_FN2] = LAYOUT_ortho_4x4( 45 RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI,
45 RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ 46 RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD,
46 RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, \ 47 _______, _______, _______, RESET,
47 _______, _______, _______, RESET, \ 48 BL_STEP, _______, QMKBEST, QMKURL
48 BL_STEP, _______, QMKBEST, QMKURL \ 49 )
49 )
50
51}; 50};
52 51
53bool process_record_user(uint16_t keycode, keyrecord_t *record) { 52bool process_record_user(uint16_t keycode, keyrecord_t *record) {
54 switch (keycode) { 53 switch (keycode) {
55 case QMKBEST: 54 case QMKBEST:
56 if (record->event.pressed) { 55 if (record->event.pressed) {
57 // when keycode QMKBEST is pressed 56 // when keycode QMKBEST is pressed
58 SEND_STRING("QMK is the best thing ever!"); 57 SEND_STRING("QMK is the best thing ever!");
59 } else { 58 }
60 // when keycode QMKBEST is released 59 break;
61 } 60 case QMKURL:
62 break; 61 if (record->event.pressed) {
63 case QMKURL: 62 // when keycode QMKURL is pressed
64 if (record->event.pressed) { 63 SEND_STRING("https://qmk.fm/\n");
65 // when keycode QMKURL is pressed 64 }
66 SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); 65 break;
67 } else { 66 }
68 // when keycode QMKURL is released 67 return true;
69 }
70 break;
71 }
72 return true;
73} 68}