Skip to content

Commit 6b8a857

Browse files
committed
Merge remote-tracking branch 'origin/master' into develop
2 parents d35af9f + 832a6e1 commit 6b8a857

File tree

4 files changed

+264
-2
lines changed

4 files changed

+264
-2
lines changed
+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
This is the c configuration file for the keymap
3+
4+
Copyright 2012 Jun Wako <[email protected]>
5+
Copyright 2015 Jack Humbert
6+
7+
This program is free software: you can redistribute it and/or modify
8+
it under the terms of the GNU General Public License as published by
9+
the Free Software Foundation, either version 2 of the License, or
10+
(at your option) any later version.
11+
12+
This program is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
GNU General Public License for more details.
16+
17+
You should have received a copy of the GNU General Public License
18+
along 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"
+204
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
/*
2+
Copyright 2019 @foostan
3+
Copyright 2020 Drashna Jaelre <@drashna>
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 2 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
19+
#include QMK_KEYBOARD_H
20+
21+
enum layer_names {
22+
_DVORAK,
23+
_LOWER,
24+
_RAISE,
25+
_ADJUST
26+
};
27+
28+
enum 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+
47+
const 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+
98+
layer_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
103+
oled_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+
115+
void 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+
137+
char keylog_str[24] = {};
138+
139+
const 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+
147+
void 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+
161+
void oled_render_keylog(void) {
162+
oled_write(keylog_str, false);
163+
}
164+
165+
void 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+
180+
void 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+
189+
void 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+
198+
bool 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
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
OLED_DRIVER_ENABLE = no
2+
RGB_MATRIX_ENABLE = yes

layouts/community/ortho_4x12/xyverz/keymap.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
7373
* ,-----------------------------------------------------------------------------------.
7474
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | |
7575
* |------+------+------+------+------+-------------+------+------+------+------+------|
76-
* | Caps | | Mute | Vol- | Vol+ | | | _ | + | { | } | | |
76+
* | Caps | | Mute | Vol- | Vol+ | | | | + | { | } | | |
7777
* |------+------+------+------+------+------|------+------+------+------+------+------|
7878
* | | | Prev | Play | Next | | | | | | | |
7979
* |------+------+------+------+------+------+------+------+------+------+------+------|
@@ -91,7 +91,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
9191
* ,-----------------------------------------------------------------------------------.
9292
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
9393
* |------+------+------+------+------+-------------+------+------+------+------+------|
94-
* | Caps | | Mute | Vol- | Vol+ | | | - | = | [ | ] | \ |
94+
* | Caps | | Mute | Vol- | Vol+ | | | | = | [ | ] | \ |
9595
* |------+------+------+------+------+------|------+------+------+------+------+------|
9696
* | | | Prev | Play | Next | | | | | | | |
9797
* |------+------+------+------+------+------+------+------+------+------+------+------|

0 commit comments

Comments
 (0)