aboutsummaryrefslogtreecommitdiff
path: root/keyboards/lets_split/keymaps/henxing/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/lets_split/keymaps/henxing/keymap.c')
-rw-r--r--keyboards/lets_split/keymaps/henxing/keymap.c114
1 files changed, 114 insertions, 0 deletions
diff --git a/keyboards/lets_split/keymaps/henxing/keymap.c b/keyboards/lets_split/keymaps/henxing/keymap.c
new file mode 100644
index 000000000..49b89b113
--- /dev/null
+++ b/keyboards/lets_split/keymaps/henxing/keymap.c
@@ -0,0 +1,114 @@
1#include "lets_split.h"
2#include "action_layer.h"
3#include "eeconfig.h"
4
5extern keymap_config_t keymap_config;
6
7// Each layer gets a name for readability, which is then used in the keymap matrix below.
8// The underscores don't mean anything - you can have a layer called STUFF or any other name.
9// Layer names don't all need to be of the same length, obviously, and you can also skip them
10// entirely and just use numbers.
11#define _QWERTY 0
12#define _LOWER 1
13#define _RAISE 2
14
15enum custom_keycodes {
16 QWERTY = SAFE_RANGE,
17 LOWER,
18 RAISE
19};
20
21// Fillers to make layering more clear
22#define _______ KC_TRNS
23#define XXXXXXX KC_NO
24
25const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
26
27 /*
28 * q w e r t _ _ y u i o p
29 * a s d f g _ _ h j k l ;
30 * z x c v b _ _ n m , . /
31 * esc tab gui shift bksp ctrl alt space fn - ' enter
32 */
33 [_QWERTY] = KEYMAP( \
34 KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P, \
35 KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, \
36 KC_Z, KC_X, KC_C, KC_V, KC_B, KC_NO, KC_NO, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, \
37 KC_ESC, KC_TAB, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_LALT, KC_SPC, LOWER, KC_MINS, KC_QUOT, KC_ENT \
38 ),
39
40 /*
41 * ! @ up { } _ _ pgup 7 8 9 *
42 * # left down right $ _ _ pgdn 4 5 6 +
43 * [ ] ( ) & _ _ ` 1 2 3 \
44 * lower insert gui shift bksp ctrl alt space fn . 0 =
45 */
46 [_LOWER] = KEYMAP( \
47 KC_EXLM, KC_AT, KC_UP, KC_LCBR, KC_RCBR, KC_NO, KC_NO, KC_PGUP, KC_7, KC_8, KC_9, KC_ASTR, \
48 KC_HASH, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_NO, KC_NO, KC_PGDN, KC_4, KC_5, KC_6, KC_PLUS, \
49 KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_AMPR, KC_NO, KC_NO, KC_GRV, KC_1, KC_2, KC_3, KC_BSLS, \
50 RAISE, KC_INS, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_LALT, KC_SPC, KC_TRNS, KC_DOT, KC_0, KC_EQL \
51 ),
52
53 /*
54 * insert home up end pgup _ _ up F7 F8 F9 F10
55 * del left down right pgdn _ _ down F4 F5 F6 F11
56 * _ volup _ _ reset _ _ F1 F2 F3 F12
57 * _ voldn super shift bksp ctrl alt space L0 prtsc scroll pause
58 */
59 [_RAISE] = KEYMAP( \
60 KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_NO, KC_NO, KC_UP, KC_F7, KC_F8, KC_F9, KC_F10, \
61 KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_NO, KC_NO, KC_DOWN, KC_F4, KC_F5, KC_F6, KC_F11, \
62 KC_TRNS, KC_VOLU, KC_TRNS, KC_TRNS, RESET, KC_NO, KC_NO, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F12, \
63 KC_NO, KC_VOLD, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_LALT, KC_SPC, QWERTY, KC_PSCR, KC_SLCK, KC_PAUS \
64 )
65
66};
67
68#ifdef AUDIO_ENABLE
69float tone_qwerty[][2] = SONG(QWERTY_SOUND);
70float tone_dvorak[][2] = SONG(DVORAK_SOUND);
71float tone_colemak[][2] = SONG(COLEMAK_SOUND);
72#endif
73
74void persistent_default_layer_set(uint16_t default_layer) {
75 eeconfig_update_default_layer(default_layer);
76 default_layer_set(default_layer);
77}
78
79bool process_record_user(uint16_t keycode, keyrecord_t *record) {
80
81 // The value to return
82 bool return_value = false;
83
84 switch (keycode) {
85 case QWERTY:
86 if (record->event.pressed) {
87#ifdef AUDIO_ENABLE
88 PLAY_SONG(tone_qwerty);
89#endif
90 persistent_default_layer_set(1UL<<_QWERTY);
91 }
92 break;
93
94 case LOWER:
95 if (record->event.pressed) {
96 layer_on(_LOWER);
97 } else {
98 layer_off(_LOWER);
99 }
100 break;
101
102 case RAISE:
103 persistent_default_layer_set(1UL<<_RAISE);
104 break;
105 default:
106
107 // If the keycode is not handled by any of the other cases, we
108 // should return true
109 return_value = true;
110 break;
111 }
112
113 return return_value;
114}