Skip to content

Commit 7a518e5

Browse files
committed
Merge remote-tracking branch 'origin/master' into develop
2 parents 0472399 + b85a9ab commit 7a518e5

File tree

3 files changed

+16
-62
lines changed

3 files changed

+16
-62
lines changed

keyboards/sofle/keymaps/michal/config.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
// Copyright 2022 Michal S. (@ihatethefrench)
2-
// SPDX-License-Identifier: GPL-2.0-only
1+
// Copyright 2023 Michal S. (@not-my-segfault)
2+
// SPDX-License-Identifier: GPL-3.0-only
33

44
#pragma once
55

6-
// Enables features such as octave changer, suspend, etc.
7-
#define MIDI_ADVANCED
8-
9-
// This autoshift delay feels most natural for me I think
10-
#define AUTO_SHIFT_TIMEOUT 165
11-
126
// I don't use too many layers, so this is more than enough
137
#define LAYER_STATE_8BIT
148

keyboards/sofle/keymaps/michal/keymap.c

Lines changed: 14 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
1-
// Copyright 2022 Michal S. (@ihatethefrench)
2-
// SPDX-License-Identifier: GPL-2.0-only
1+
// Copyright 2023 Michal S. (@not-my-segfault)
2+
// SPDX-License-Identifier: GPL-3.0-only
33

44
#include QMK_KEYBOARD_H
55

66
// This specifies the layers that will be used
77
enum sofle_layers {
88
_WORKMAN,
99
_QWERTY,
10-
_MIDI,
1110
_LOWER,
1211
_RAISE,
1312
_ADJUST
1413
};
1514

16-
// This specifies any custom keycodes I might have set
1715
enum custom_keycodes {
1816
KC_WORKMAN = SAFE_RANGE,
1917
KC_QWERTY,
20-
KC_MIDI,
2118
KC_LOWER,
2219
KC_RAISE,
23-
KC_ADJUST
20+
KC_ADJUST,
21+
KC_TOGGLE,
2422
};
2523

2624
// Here the keymaps are defined in matrix form using KC_XYZ form keycodes
@@ -71,36 +69,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
7169
KC_LGUI, KC_LALT, KC_LCTL, KC_LOWER, KC_SPC, KC_ENT, KC_RAISE, KC_RCTL, KC_RALT, KC_RGUI
7270
),
7371

74-
/* MIDI
75-
* ,-----------------------------------------. ,-----------------------------------------.
76-
* | Pnic | OCT0 | OCT1 | OCT2 | OCT3 | OCT4 | | OCT5 | OCT6 | OCT7 | | | MTOG |
77-
* |------+------+------+------+------+------| |------+------+------+------+------+------|
78-
* | |G#/Ab |Bb/A# | |C#/Db |D#/Eb | | |F#/Gb |G#/Ab |Bb/A# | | |
79-
* |------+------+------+------+------+------| |------+------+------+------+------+------|
80-
* | | A | B | C | D | E |-------. ,-------| F | G | A | B | C | Wkmn |
81-
* |------+------+------+------+------+------| | | |------+------+------+------+------+------|
82-
* | | | | | TNSD | TNSU |-------| |-------| BNDD | BNDU | | | | |
83-
* `-----------------------------------------/ / \ \-----------------------------------------'
84-
* | | | | Susd | /OCTDN / \OCTUP \ | | | | |
85-
* | | | | |/ / \ \ | | | | |
86-
* `----------------------------------' '------''---------------------------'
87-
*/
88-
[_MIDI] = LAYOUT(
89-
MI_AOFF, MI_OC0, MI_OC1, MI_OC2, MI_OC3, MI_OC4, MI_OC5, MI_OC6, MI_OC7, _______, _______, MI_TOGG,
90-
_______, MI_Gs, MI_As, _______, MI_Cs1, MI_Ds1, _______, MI_Fs1, MI_Gs1, MI_As1, _______, _______,
91-
_______, MI_A, MI_B, MI_C1, MI_D1, MI_E1, MI_F1, MI_G1, MI_A1, MI_B1, MI_C2, KC_WORKMAN,
92-
_______, _______, _______, _______, MI_TRSD, MI_TRSU, _______, _______, MI_BNDD, MI_BNDU, _______, _______, _______, _______,
93-
_______, _______, _______, MI_SUST, MI_OCTD, MI_OCTU, _______, _______, _______, _______
94-
),
95-
9672
/* LOWER
9773
* ,-----------------------------------------. ,-----------------------------------------.
9874
* | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 |
9975
* |------+------+------+------+------+------| |------+------+------+------+------+------|
10076
* | | | | | | | | | | | | | F12 |
10177
* |------+------+------+------+------+------| |------+------+------+------+------+------|
10278
* | | | | | | |-------. ,-------| | | | | | | |
103-
* |------+------+------+------+------+------| | | Run |------+------+------+------+------+------|
79+
* |------+------+------+------+------+------| | | Togg. |------+------+------+------+------+------|
10480
* | | = | - | + | { | } |-------| |-------| [ | ] | | | \ | |
10581
* `-----------------------------------------/ / \ \-----------------------------------------'
10682
* | | | |LOWER | / / \ \ | | | | |
@@ -111,7 +87,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
11187
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
11288
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F12,
11389
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE,
114-
_______, KC_EQL, KC_MINS, KC_PLUS, KC_LCBR, KC_RCBR, _______, LALT(KC_F2), KC_LBRC, KC_RBRC, _______, _______, KC_BSLS, _______,
90+
_______, KC_EQL, KC_MINS, KC_PLUS, KC_LCBR, KC_RCBR, _______, KC_TOGGLE, KC_LBRC, KC_RBRC, _______, _______, KC_BSLS, _______,
11591
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
11692
),
11793

@@ -121,9 +97,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
12197
* |------+------+------+------+------+------| |------+------+------+------+------+------|
12298
* | | | | | | | | | | Up | | | Del |
12399
* |------+------+------+------+------+------| |------+------+------+------+------+------|
124-
* | | | | | | |-------. ,-------| | Left | Down | Rght | | Wkmn |
100+
* | | | | | | |-------. ,-------| | Left | Down | Rght | | |
125101
* |------+------+------+------+------+------| | | |------+------+------+------+------+------|
126-
* | | | | Midi | | |-------| |-------| | | Home | End | | Qwrt |
102+
* | | | | | | |-------| |-------| | | Home | End | | |
127103
* `-----------------------------------------/ / \ \-----------------------------------------'
128104
* | | | | | / / \ \ |RAISE | | | |
129105
* | | | | |/ / \ \ | | | | |
@@ -132,27 +108,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
132108
[_RAISE] = LAYOUT(
133109
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, AS_TOGG,
134110
_______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, KC_DEL,
135-
_______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_WORKMAN,
136-
_______, _______, _______, KC_MIDI, _______, _______, _______, _______, _______, _______, KC_HOME, KC_END, _______, KC_QWERTY,
111+
_______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, XXXXXXX,
112+
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_END, _______, _______,
137113
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
138114
)};
139115

140-
// This section only compiles if OLED_ENABLE is set to `yes` in rules.mk
141116
#ifdef OLED_ENABLE
142117

143-
// Defining my custom text to draw to the screen :)
144118
static void oled_screen(void) {
145-
oled_write_ln_P(PSTR(""), false);
146-
oled_write_ln_P(PSTR(">nix "), false);
147-
oled_write_ln_P(PSTR(">rust"), false);
148-
oled_write_ln_P(PSTR(">hs &"), false);
149-
oled_write_ln_P(PSTR(">rum"), false);
150-
oled_write_ln_P(PSTR(""), false);
151-
oled_write_ln_P(PSTR(" . ."), false);
152-
oled_write_ln_P(PSTR(" u "), false);
153-
oled_write_ln_P(PSTR(" d"), false);
154-
oled_write_ln_P(PSTR(""), false);
155-
oled_write_ln_P(PSTR("mchal"), false);
119+
oled_set_cursor(0, 0); // Write nothing
156120
}
157121

158122
// Set correct rotation so the text doesn't end up sideways
@@ -174,7 +138,6 @@ bool oled_task_user(void) {
174138

175139
#endif
176140

177-
// This section defines custom keycodes, which I use to manage layers
178141
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
179142
switch (keycode) {
180143
case KC_QWERTY:
@@ -187,9 +150,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
187150
set_single_persistent_default_layer(_WORKMAN);
188151
}
189152
return false;
190-
case KC_MIDI:
153+
case KC_TOGGLE: // Toggle between QWERTY and WORKMAN
191154
if (record->event.pressed) {
192-
set_single_persistent_default_layer(_MIDI);
155+
layer_invert(_QWERTY);
156+
layer_invert(_WORKMAN);
193157
}
194158
return false;
195159
case KC_LOWER:
@@ -214,7 +178,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
214178
return true;
215179
}
216180

217-
// This section only compiles if ENCODER_ENABLE is set to `yes` in rules.mk
218181
#ifdef ENCODER_ENABLE
219182

220183
// This section is like the keymap matrix, but for rotary encoders
@@ -224,7 +187,6 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
224187
[_QWERTY] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(KC_VOLD, KC_VOLU )},
225188
[_LOWER] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN)},
226189
[_RAISE] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______ )},
227-
[_ADJUST] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______ )},
228190
};
229191

230192
#endif

keyboards/sofle/keymaps/michal/rules.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ MAGIC_ENABLE = no
1111
SPACE_CADET_ENABLE = no
1212

1313
# I actually use these features
14-
AUTO_SHIFT_ENABLE = yes
1514
ENCODER_ENABLE = yes
1615
ENCODER_MAP_ENABLE = yes
1716
EXTRAKEY_ENABLE = yes
18-
MIDI_ENABLE = yes
1917
MOUSEKEY_ENABLE = yes
2018

2119
# More space-saving

0 commit comments

Comments
 (0)