aboutsummaryrefslogtreecommitdiff
path: root/keyboards/crkbd/keymaps
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/crkbd/keymaps')
-rw-r--r--keyboards/crkbd/keymaps/madhatter/config.h50
-rw-r--r--keyboards/crkbd/keymaps/madhatter/keymap.c131
-rw-r--r--keyboards/crkbd/keymaps/madhatter/rules.mk9
3 files changed, 112 insertions, 78 deletions
diff --git a/keyboards/crkbd/keymaps/madhatter/config.h b/keyboards/crkbd/keymaps/madhatter/config.h
index 9a4d85dfc..899fde008 100644
--- a/keyboards/crkbd/keymaps/madhatter/config.h
+++ b/keyboards/crkbd/keymaps/madhatter/config.h
@@ -1,18 +1,46 @@
1/*
2This is the c configuration file for the keymap
3
4Copyright 2012 Jun Wako <wakojun@gmail.com>
5Copyright 2015 Jack Humbert
6
7This program is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program. If not, see <http://www.gnu.org/licenses/>.
19*/
20
1#pragma once 21#pragma once
2 22
3#define EE_HANDS 23//#define USE_MATRIX_I2C
24
25/* Select hand configuration */
26
27#define MASTER_LEFT
28// #define MASTER_RIGHT
29// #define EE_HANDS
4 30
5#define SSD1306OLED 31#define SSD1306OLED
6 32
33#define USE_SERIAL_PD2
34
35#define TAPPING_FORCE_HOLD
36#define TAPPING_TERM 100
37
7#ifdef RGBLIGHT_ENABLE 38#ifdef RGBLIGHT_ENABLE
8# undef RGBLED_NUM 39 #undef RGBLED_NUM
9# define RGBLIGHT_ANIMATIONS 40 #define RGBLIGHT_ANIMATIONS
10# define RGBLED_NUM 27 41 #define RGBLED_NUM 27
11# define RGBLIGHT_LIMIT_VAL 120 42 #define RGBLIGHT_LIMIT_VAL 120
12# define RGBLIGHT_HUE_STEP 10 43 #define RGBLIGHT_HUE_STEP 10
13# define RGBLIGHT_SAT_STEP 17 44 #define RGBLIGHT_SAT_STEP 17
14# define RGBLIGHT_VAL_STEP 17 45 #define RGBLIGHT_VAL_STEP 17
15#endif 46#endif
16
17#undef PRODUCT
18#define PRODUCT MadHatter Hacked Corne Keyboard
diff --git a/keyboards/crkbd/keymaps/madhatter/keymap.c b/keyboards/crkbd/keymaps/madhatter/keymap.c
index 9f52d3b54..57a522deb 100644
--- a/keyboards/crkbd/keymaps/madhatter/keymap.c
+++ b/keyboards/crkbd/keymaps/madhatter/keymap.c
@@ -1,112 +1,96 @@
1#include QMK_KEYBOARD_H 1/*
2Copyright 2019 @foostan
3Copyright 2020 Drashna Jaelre <@drashna>
2 4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 2 of the License, or
8(at your option) any later version.
3 9
4#ifdef OLED_DRIVER_ENABLE 10This program is distributed in the hope that it will be useful,
5# define KEYLOGGER_LENGTH 5 11but WITHOUT ANY WARRANTY; without even the implied warranty of
6static uint32_t oled_timer = 0; 12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7static char keylog_str[KEYLOGGER_LENGTH + 1] = {"\n"}; 13GNU General Public License for more details.
8static uint16_t log_timer = 0;
9// clang-format off
10static const char PROGMEM code_to_name[0xFF] = {
11// 0 1 2 3 4 5 6 7 8 9 A B c D E F
12 ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', // 0x
13 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', // 1x
14 '3', '4', '5', '6', '7', '8', '9', '0', 20, 19, 27, 26, 22, '-', '=', '[', // 2x
15 ']','\\', '#', ';','\'', '`', ',', '.', '/', 128, ' ', ' ', ' ', ' ', ' ', ' ', // 3x
16 ' ', ' ', ' ', ' ', ' ', ' ', 'P', 'S', ' ', ' ', ' ', ' ', 16, ' ', ' ', ' ', // 4x
17 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 5x
18 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 6x
19 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 7x
20 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 8x
21 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 9x
22 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ax
23 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Bx
24 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Cx
25 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Dx
26 'C', 'S', 'A', 'C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ex
27 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' // Fx
28};
29 14
30void add_keylog(uint16_t keycode); 15You should have received a copy of the GNU General Public License
31#endif 16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#include QMK_KEYBOARD_H
32 20
33extern uint8_t is_master; 21extern uint8_t is_master;
34 22
35enum corny_layers { 23enum corny_layers {
36 _QWERTY, 24 _QWERTY,
37 _LOWER, 25 _LOWER,
38 _RAISE, 26 _RAISE,
39 _ADJUST, 27 _ADJUST
40}; 28};
41 29
42enum custom_keycodes { 30enum corny_keycodes {
43 QWERTY = SAFE_RANGE, 31 QWERTY = SAFE_RANGE,
44 LOWER, 32 LOWER,
45 RAISE, 33 RAISE,
46 ADJUST, 34 ADJUST,
35 BACKLIT,
47 RGBRST 36 RGBRST
48}; 37};
49 38
50#define LY_LWR MO(_LOWER) 39enum macro_keycodes {
51#define LY_RSE MO(_RAISE) 40 KC_SAMPLEMACRO,
52 41};
53#define KY_CESC LCTL_T(KC_ESC)
54 42
55const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 43const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
56 [_QWERTY] = LAYOUT( 44 [_QWERTY] = LAYOUT_split_3x6_3(
57 //,-----------------------------------------------------. ,-----------------------------------------------------. 45 //,-----------------------------------------------------. ,-----------------------------------------------------.
58 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, 46 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
59 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| 47 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
60 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, 48 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,\
61 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| 49 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
62 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, 50 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
63 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| 51 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
64 KC_LALT, LY_LWR, KC_LCMD, KC_SPC, LY_RSE, KC_ENT 52 KC_LCTL, LOWER, KC_BSPC, KC_SPC, RAISE, KC_RCMD
65 //`--------------------------' `--------------------------' 53 //`--------------------------' `--------------------------'
66 54
67 ), 55 ),
68 56
69 [_LOWER] = LAYOUT( 57 [_LOWER] = LAYOUT_split_3x6_3(
70 //,-----------------------------------------------------. ,-----------------------------------------------------. 58 //,-----------------------------------------------------. ,-----------------------------------------------------.
71 KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, 59 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
72 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| 60 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
73 KC_LCTL, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, KC_MINS, KC_EQL, KC_LCBR, KC_RCBR, KC_PIPE, KC_GRV, 61 KC_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, XXXXXXX, XXXXXXX,
74 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| 62 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
75 KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UNDS, KC_PLUS, KC_LBRC, KC_RBRC, KC_BSLS, KC_TILD, 63 KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
76 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| 64 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
77 KC_LALT, LY_LWR, KC_LCMD, KC_SPC, LY_RSE, KC_ENT 65 KC_TRNS, LOWER, KC_TRNS, KC_TRNS, RAISE, KC_TRNS
78 //`--------------------------' `--------------------------' 66 //`--------------------------' `--------------------------'
79 ), 67 ),
80 68
81 [_RAISE] = LAYOUT( 69 [_RAISE] = LAYOUT_split_3x6_3(
82 //,-----------------------------------------------------. ,-----------------------------------------------------. 70 //,-----------------------------------------------------. ,-----------------------------------------------------.
83 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, 71 KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
84 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| 72 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
85 KC_LCTL, XXXXXXX, KC_PGUP, KC_HOME, KC_END,KC_PGDN, KC_MINS, KC_EQL, KC_LCBR, KC_RCBR, KC_PIPE, KC_GRV, 73 KC_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MINS, KC_EQL, KC_LCBR, KC_RCBR, KC_PIPE, KC_GRV,
86 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| 74 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
87 KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UNDS, KC_PLUS, KC_LBRC, KC_RBRC, KC_BSLS, KC_TILD, 75 KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UNDS, KC_PLUS, KC_LBRC, KC_RBRC, KC_BSLS, KC_TILD,
88 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| 76 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
89 KC_LALT, LY_LWR, KC_LCMD, KC_SPC, LY_RSE, KC_ENT 77 KC_TRNS, LOWER, KC_BSPC, KC_TRNS, RAISE, KC_TRNS
90 //`--------------------------' `--------------------------' 78 //`--------------------------' `--------------------------'
91 ), 79 ),
92 80
93 [_ADJUST] = LAYOUT( 81 [_ADJUST] = LAYOUT_split_3x6_3(
94 //,-----------------------------------------------------. ,-----------------------------------------------------. 82 //,-----------------------------------------------------. ,-----------------------------------------------------.
95 RESET, KC_BTN1, KC_MS_U, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, 83 XXXXXXX, RGBRST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
96 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| 84 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
97 XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_R, XXXXXXX, XXXXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, 85 RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
98 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| 86 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
99 XXXXXXX, RGBRST, EEP_RST, AG_TOGG, XXXXXXX, XXXXXXX, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, 87 RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET,
100 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| 88 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
101 KC_LALT, LY_LWR, KC_LCMD, KC_SPC, LY_RSE, KC_ENT 89 KC_TRNS, LOWER, KC_TRNS, KC_TRNS, RAISE, KC_TRNS
102 //`--------------------------' `--------------------------' 90 //`--------------------------' `--------------------------'
103 ) 91 )
104}; 92};
105 93
106layer_state_t layer_state_set_user(layer_state_t state) {
107 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
108}
109
110int RGB_current_mode; 94int RGB_current_mode;
111 95
112// Setting ADJUST layer RGB back to default 96// Setting ADJUST layer RGB back to default
@@ -185,6 +169,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
185 } 169 }
186 170
187 switch (keycode) { 171 switch (keycode) {
172 case QWERTY:
173 if (record->event.pressed) {
174 set_single_persistent_default_layer(_QWERTY);
175 }
176 break;
188 case LOWER: 177 case LOWER:
189 if (record->event.pressed) { 178 if (record->event.pressed) {
190 layer_on(_LOWER); 179 layer_on(_LOWER);
@@ -210,6 +199,24 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
210 layer_off(_ADJUST); 199 layer_off(_ADJUST);
211 } 200 }
212 return false; 201 return false;
202 case RGB_MOD:
203 #ifdef RGBLIGHT_ENABLE
204 if (record->event.pressed) {
205 rgblight_mode(RGB_current_mode);
206 rgblight_step();
207 RGB_current_mode = rgblight_get_mode();
208 }
209 #endif
210 return false;
211 case RGBRST:
212 #ifdef RGBLIGHT_ENABLE
213 if (record->event.pressed) {
214 eeconfig_update_rgblight_default();
215 rgblight_enable();
216 RGB_current_mode = rgblight_get_mode();
217 }
218 #endif
219 break;
213 } 220 }
214 return true; 221 return true;
215} 222}
diff --git a/keyboards/crkbd/keymaps/madhatter/rules.mk b/keyboards/crkbd/keymaps/madhatter/rules.mk
index dfee5a0bf..f84e5b2af 100644
--- a/keyboards/crkbd/keymaps/madhatter/rules.mk
+++ b/keyboards/crkbd/keymaps/madhatter/rules.mk
@@ -1,11 +1,10 @@
1BOOTLOADER = atmel-dfu # Elite-C
2
3MOUSEKEY_ENABLE = yes
4RGBLIGHT_ENABLE = yes
5 1
6# If you want to change the display of OLED, you need to change here 2# If you want to change the display of OLED, you need to change here
7SRC += ./lib/glcdfont.c \ 3SRC += ./lib/glcdfont.c \
8 ./lib/rgb_state_reader.c \ 4 ./lib/rgb_state_reader.c \
9 ./lib/layer_state_reader.c \ 5 ./lib/layer_state_reader.c \
10 ./lib/logo_reader.c \ 6 ./lib/logo_reader.c \
11 ./lib/keylogger.c 7 ./lib/keylogger.c \
8 # ./lib/mode_icon_reader.c \
9 # ./lib/host_led_state_reader.c \
10 # ./lib/timelogger.c \