aboutsummaryrefslogtreecommitdiff
path: root/keyboards/kprepublic/jj4x4/keymaps/default/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/kprepublic/jj4x4/keymaps/default/keymap.c')
-rw-r--r--keyboards/kprepublic/jj4x4/keymaps/default/keymap.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/keyboards/kprepublic/jj4x4/keymaps/default/keymap.c b/keyboards/kprepublic/jj4x4/keymaps/default/keymap.c
new file mode 100644
index 000000000..ae2c6b541
--- /dev/null
+++ b/keyboards/kprepublic/jj4x4/keymaps/default/keymap.c
@@ -0,0 +1,68 @@
1/* Copyright 2019
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
19enum layers {
20 _BASE = 0,
21 _FN1,
22 _FN2
23};
24
25// Defines the keycodes used by our macros in process_record_user
26enum custom_keycodes {
27 QMKBEST = SAFE_RANGE,
28 QMKURL
29};
30
31const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
32 [_BASE] = LAYOUT_ortho_4x4(
33 KC_PGUP, KC_HOME, KC_UP, KC_END,
34 KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT,
35 MO(_FN2), KC_VOLU, KC_MPLY, KC_MPRV,
36 MO(_FN1), KC_VOLD, KC_MUTE, KC_MNXT
37 ),
38 [_FN1] = LAYOUT_ortho_4x4(
39 KC_ESC, KC_P7, KC_P8, KC_P9,
40 KC_TAB, KC_P4, KC_P5, KC_P6,
41 KC_ENT, KC_P1, KC_P2, KC_P3,
42 _______, KC_P0, KC_P0, KC_DOT
43 ),
44 [_FN2] = LAYOUT_ortho_4x4(
45 RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI,
46 RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD,
47 _______, _______, _______, RESET,
48 BL_STEP, _______, QMKBEST, QMKURL
49 )
50};
51
52bool process_record_user(uint16_t keycode, keyrecord_t *record) {
53 switch (keycode) {
54 case QMKBEST:
55 if (record->event.pressed) {
56 // when keycode QMKBEST is pressed
57 SEND_STRING("QMK is the best thing ever!");
58 }
59 break;
60 case QMKURL:
61 if (record->event.pressed) {
62 // when keycode QMKURL is pressed
63 SEND_STRING("https://qmk.fm/\n");
64 }
65 break;
66 }
67 return true;
68}