aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/crkbd/keymaps/xyverz/config.h56
-rw-r--r--keyboards/crkbd/keymaps/xyverz/keymap.c204
-rw-r--r--keyboards/crkbd/keymaps/xyverz/rules.mk2
-rw-r--r--layouts/community/ortho_4x12/xyverz/keymap.c4
4 files changed, 264 insertions, 2 deletions
diff --git a/keyboards/crkbd/keymaps/xyverz/config.h b/keyboards/crkbd/keymaps/xyverz/config.h
new file mode 100644
index 000000000..339039680
--- /dev/null
+++ b/keyboards/crkbd/keymaps/xyverz/config.h
@@ -0,0 +1,56 @@
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
21#pragma once
22
23//#define USE_MATRIX_I2C
24
25/* Select hand configuration */
26
27// #define MASTER_LEFT
28// #define MASTER_RIGHT
29#define EE_HANDS
30
31#define USE_SERIAL_PD2
32
33#define TAPPING_FORCE_HOLD
34#define TAPPING_TERM 300
35#define PERMISSIVE_HOLD
36#define IGNORE_MOD_TAP_INTERRUPT
37#define LEADER_PER_KEY_TIMING
38#define LEADER_TIMEOUT 300
39
40
41#ifdef RGBLIGHT_ENABLE
42 #undef RGBLED_NUM
43 #define RGBLIGHT_ANIMATIONS
44 #define RGBLED_NUM 27
45 #define RGBLIGHT_LIMIT_VAL 120
46 #define RGBLIGHT_HUE_STEP 10
47 #define RGBLIGHT_SAT_STEP 17
48 #define RGBLIGHT_VAL_STEP 17
49#endif
50
51#ifdef RGB_MATRIX_ENABLE
52 #define RGBLED_NUM 54 // Number of LEDs
53 #define DRIVER_LED_TOTAL RGBLED_NUM
54#endif
55
56#define OLED_FONT_H "keyboards/crkbd/lib/glcdfont.c" \ No newline at end of file
diff --git a/keyboards/crkbd/keymaps/xyverz/keymap.c b/keyboards/crkbd/keymaps/xyverz/keymap.c
new file mode 100644
index 000000000..c1777f202
--- /dev/null
+++ b/keyboards/crkbd/keymaps/xyverz/keymap.c
@@ -0,0 +1,204 @@
1/*
2Copyright 2019 @foostan
3Copyright 2020 Drashna Jaelre <@drashna>
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.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#include QMK_KEYBOARD_H
20
21enum layer_names {
22 _DVORAK,
23 _LOWER,
24 _RAISE,
25 _ADJUST
26};
27
28enum planck_keycodes {
29 DVORAK = SAFE_RANGE,
30 LOWER,
31 RAISE,
32 ADJUST
33};
34
35// Adding macros to make the keymaps below much easier to read.
36#define DELGUI GUI_T(KC_DEL)
37#define ALTENT ALT_T(KC_ENT)
38#define SCLNCTL CTL_T(KC_SCLN)
39#define QUEALT ALT_T(KC_Q)
40#define VEEALT ALT_T(KC_V)
41#define ZEDCTL CTL_T(KC_Z)
42#define ADJUST MO(_ADJUST)
43#define LOWER MO(_LOWER)
44#define RAISE MO(_RAISE)
45#define MACLOCK LGUI(LCTL(KC_Q))
46
47const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
48 [_DVORAK] = LAYOUT_split_3x6_3(
49 //,-----------------------------------------------------. ,-----------------------------------------------------.
50 KC_TAB, KC_SCLN, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH,
51 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
52 KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS,
53 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
54 KC_LSFT, SCLNCTL, QUEALT, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, VEEALT, ZEDCTL, KC_RSFT,
55 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
56 LOWER, KC_BSPC, DELGUI, KC_ENT, KC_SPC, RAISE
57 //`--------------------------' `--------------------------'
58
59 ),
60
61 [_LOWER] = LAYOUT_split_3x6_3(
62 //,-----------------------------------------------------. ,-----------------------------------------------------.
63 KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSLS,
64 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
65 XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, KC_HOME, KC_PGUP, XXXXXXX, KC_PLUS, KC_LCBR, KC_RCBR, XXXXXXX,
66 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
67 XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX,
68 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
69 _______, KC_DEL, MACLOCK, _______, KC_INS, _______
70 //`--------------------------' `--------------------------'
71 ),
72
73 [_RAISE] = LAYOUT_split_3x6_3(
74 //,-----------------------------------------------------. ,-----------------------------------------------------.
75 KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PIPE,
76 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
77 XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, KC_HOME, KC_PGUP, XXXXXXX, KC_EQL, KC_LBRC, KC_RBRC, XXXXXXX,
78 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
79 XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_PGDN, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX,
80 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
81 _______, KC_DEL, MACLOCK, _______, KC_INS, _______
82 //`--------------------------' `--------------------------'
83 ),
84
85 [_ADJUST] = LAYOUT_split_3x6_3(
86 //,-----------------------------------------------------. ,-----------------------------------------------------.
87 KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12,
88 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
89 RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
90 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
91 RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET,
92 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
93 _______, _______, _______, _______, _______, _______
94 //`--------------------------' `--------------------------'
95 )
96};
97
98layer_state_t layer_state_set_user(layer_state_t state) {
99 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
100}
101
102#ifdef OLED_DRIVER_ENABLE
103oled_rotation_t oled_init_user(oled_rotation_t rotation) {
104 if (!is_master) {
105 return OLED_ROTATION_180; // flips the display 180 degrees if offhand
106 }
107 return rotation;
108}
109
110#define L_BASE 0
111#define L_LOWER 2
112#define L_RAISE 4
113#define L_ADJUST 8
114
115void oled_render_layer_state(void) {
116 oled_write_P(PSTR("Layer: "), false);
117 switch (layer_state) {
118 case L_BASE:
119 oled_write_ln_P(PSTR("Default"), false);
120 break;
121 case L_LOWER:
122 oled_write_ln_P(PSTR("Lower"), false);
123 break;
124 case L_RAISE:
125 oled_write_ln_P(PSTR("Raise"), false);
126 break;
127 case L_ADJUST:
128 case L_ADJUST|L_LOWER:
129 case L_ADJUST|L_RAISE:
130 case L_ADJUST|L_LOWER|L_RAISE:
131 oled_write_ln_P(PSTR("Adjust"), false);
132 break;
133 }
134}
135
136
137char keylog_str[24] = {};
138
139const char code_to_name[60] = {
140 ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
141 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
142 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
143 '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
144 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\',
145 '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '};
146
147void set_keylog(uint16_t keycode, keyrecord_t *record) {
148 char name = ' ';
149 if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) ||
150 (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { keycode = keycode & 0xFF; }
151 if (keycode < 60) {
152 name = code_to_name[keycode];
153 }
154
155 // update keylog
156 snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c",
157 record->event.key.row, record->event.key.col,
158 keycode, name);
159}
160
161void oled_render_keylog(void) {
162 oled_write(keylog_str, false);
163}
164
165void render_bootmagic_status(bool status) {
166 /* Show Ctrl-Gui Swap options */
167 static const char PROGMEM logo[][2][3] = {
168 {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}},
169 {{0x95, 0x96, 0}, {0xb5, 0xb6, 0}},
170 };
171 if (status) {
172 oled_write_ln_P(logo[0][0], false);
173 oled_write_ln_P(logo[0][1], false);
174 } else {
175 oled_write_ln_P(logo[1][0], false);
176 oled_write_ln_P(logo[1][1], false);
177 }
178}
179
180void oled_render_logo(void) {
181 static const char PROGMEM crkbd_logo[] = {
182 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94,
183 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4,
184 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4,
185 0};
186 oled_write_P(crkbd_logo, false);
187}
188
189void oled_task_user(void) {
190 if (is_master) {
191 oled_render_layer_state();
192 oled_render_keylog();
193 } else {
194 oled_render_logo();
195 }
196}
197
198bool process_record_user(uint16_t keycode, keyrecord_t *record) {
199 if (record->event.pressed) {
200 set_keylog(keycode, record);
201 }
202 return true;
203}
204#endif // OLED_DRIVER_ENABLE
diff --git a/keyboards/crkbd/keymaps/xyverz/rules.mk b/keyboards/crkbd/keymaps/xyverz/rules.mk
new file mode 100644
index 000000000..ed8a77f81
--- /dev/null
+++ b/keyboards/crkbd/keymaps/xyverz/rules.mk
@@ -0,0 +1,2 @@
1OLED_DRIVER_ENABLE = no
2RGB_MATRIX_ENABLE = yes \ No newline at end of file
diff --git a/layouts/community/ortho_4x12/xyverz/keymap.c b/layouts/community/ortho_4x12/xyverz/keymap.c
index 19e0e291e..9872a4341 100644
--- a/layouts/community/ortho_4x12/xyverz/keymap.c
+++ b/layouts/community/ortho_4x12/xyverz/keymap.c
@@ -73,7 +73,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
73 * ,-----------------------------------------------------------------------------------. 73 * ,-----------------------------------------------------------------------------------.
74 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | 74 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | |
75 * |------+------+------+------+------+-------------+------+------+------+------+------| 75 * |------+------+------+------+------+-------------+------+------+------+------+------|
76 * | Caps | | Mute | Vol- | Vol+ | | | _ | + | { | } | | | 76 * | Caps | | Mute | Vol- | Vol+ | | | | + | { | } | | |
77 * |------+------+------+------+------+------|------+------+------+------+------+------| 77 * |------+------+------+------+------+------|------+------+------+------+------+------|
78 * | | | Prev | Play | Next | | | | | | | | 78 * | | | Prev | Play | Next | | | | | | | |
79 * |------+------+------+------+------+------+------+------+------+------+------+------| 79 * |------+------+------+------+------+------+------+------+------+------+------+------|
@@ -91,7 +91,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
91 * ,-----------------------------------------------------------------------------------. 91 * ,-----------------------------------------------------------------------------------.
92 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | 92 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
93 * |------+------+------+------+------+-------------+------+------+------+------+------| 93 * |------+------+------+------+------+-------------+------+------+------+------+------|
94 * | Caps | | Mute | Vol- | Vol+ | | | - | = | [ | ] | \ | 94 * | Caps | | Mute | Vol- | Vol+ | | | | = | [ | ] | \ |
95 * |------+------+------+------+------+------|------+------+------+------+------+------| 95 * |------+------+------+------+------+------|------+------+------+------+------+------|
96 * | | | Prev | Play | Next | | | | | | | | 96 * | | | Prev | Play | Next | | | | | | | |
97 * |------+------+------+------+------+------+------+------+------+------+------+------| 97 * |------+------+------+------+------+------+------+------+------+------+------+------|