aboutsummaryrefslogtreecommitdiff
path: root/users/alfrdmalr
diff options
context:
space:
mode:
authorAlfred Maler <alfrdmalr@gmail.com>2020-02-07 21:42:04 -0500
committerGitHub <noreply@github.com>2020-02-07 18:42:04 -0800
commit707c04b4ab588967c803114d7d88ef3fdd934967 (patch)
tree8f786f6371ddbf094d72841749cd40e7e4771b79 /users/alfrdmalr
parentbe05de6a3de19e5641692651ef03ae16f3bf653e (diff)
downloadqmk_firmware-707c04b4ab588967c803114d7d88ef3fdd934967.tar.gz
qmk_firmware-707c04b4ab588967c803114d7d88ef3fdd934967.zip
[Keymap] Add users/alfrdmalr and switch to layouts (#8030)
* WIP do not merge * first pass at custom preonic layout * add auto shift and reset via leader key * Update readme * update copyright notice * formatting changes * fix: use MO instead of process_record_user * added backslash and moved grave position * remove extraneous 'j' characer in NUMPAD template * update template formatting * remove process_record_user * swap "!" with "@" * fix readme formatting * update readme layout image * restore settings layer * add windows minimize sequence * fix: switch to correct seq function for three-key sequence * fix: missing semicolon * refactor: move keymap to userspace and generic 5x12 layout * add numlock to numpad layer * add readme * update readme formatting * remove unused wrappers from layout keymap * update readme title to reflect new location * remove alfrdmalr directory from preonic/keymaps * clean up user config
Diffstat (limited to 'users/alfrdmalr')
-rw-r--r--users/alfrdmalr/alfrdmalr.c44
-rw-r--r--users/alfrdmalr/alfrdmalr.h276
-rw-r--r--users/alfrdmalr/config.h7
-rw-r--r--users/alfrdmalr/readme.md47
-rw-r--r--users/alfrdmalr/rules.mk8
5 files changed, 382 insertions, 0 deletions
diff --git a/users/alfrdmalr/alfrdmalr.c b/users/alfrdmalr/alfrdmalr.c
new file mode 100644
index 000000000..39d2b62e0
--- /dev/null
+++ b/users/alfrdmalr/alfrdmalr.c
@@ -0,0 +1,44 @@
1#include "alfrdmalr.h"
2#include "muse.h"
3
4bool muse_mode = false;
5uint8_t last_muse_note = 0;
6uint16_t muse_counter = 0;
7uint8_t muse_offset = 70;
8uint16_t muse_tempo = 50;
9
10LEADER_EXTERNS();
11
12void matrix_scan_user(void) {
13#ifdef AUDIO_ENABLE
14 if (muse_mode) {
15 if (muse_counter == 0) {
16 uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()];
17 if (muse_note != last_muse_note) {
18 stop_note(compute_freq_for_midi_note(last_muse_note));
19 play_note(compute_freq_for_midi_note(muse_note), 0xF);
20 last_muse_note = muse_note;
21 }
22 }
23 muse_counter = (muse_counter + 1) % muse_tempo;
24 } else {
25 if (muse_counter) {
26 stop_all_notes();
27 muse_counter = 0;
28 }
29 }
30#endif
31
32 LEADER_DICTIONARY() {
33 leading = false;
34 // reset keyboard to bootloader
35 SEQ_FIVE_KEYS(KC_R, KC_E, KC_S, KC_E, KC_T) {
36 reset_keyboard();
37 }
38 // minimize window (Windows)
39 SEQ_THREE_KEYS(KC_M, KC_I, KC_N) {
40 SEND_STRING(SS_LALT(" ")"n");
41 }
42 leader_end();
43 }
44} \ No newline at end of file
diff --git a/users/alfrdmalr/alfrdmalr.h b/users/alfrdmalr/alfrdmalr.h
new file mode 100644
index 000000000..922b7ca40
--- /dev/null
+++ b/users/alfrdmalr/alfrdmalr.h
@@ -0,0 +1,276 @@
1/*
2Copyright 2020 Alfred Maler @alfrdmalr
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu/org/licenses/>.
16*/
17
18#pragma once
19#include QMK_KEYBOARD_H
20
21enum shared_layers {
22 _QWERTY,
23 _SETTINGS,
24 _SYMBOLS,
25 _NAVIGATION,
26 _NUMPAD
27};
28
29// KEYCODES ============================================================================
30#define NUMSPACE LT(_NUMPAD, KC_SPC)
31#define NAVLAYER MO(_NAVIGATION)
32#define SYMLAYER MO(_SYMBOLS)
33#define SETLAYER MO(_SETTINGS)
34#define CTRLSHFT C(KC_LSFT)
35#define WINUNDO C(KC_Z)
36#define WINCOPY C(KC_C)
37#define WINCUT C(KC_X)
38#define WINPASTE C(KC_V)
39
40// convenience keycodes/aliases for base modifiers
41// bottom row
42#define K41 CTRLSHFT
43#define K42 KC_LGUI
44#define K43 KC_LALT
45#define K44 SYMLAYER
46#define K45 NUMSPACE
47#define K46 NUMSPACE
48#define K47 SYMLAYER
49#define K48 KC_RALT
50#define K49 SETLAYER
51#define K4A MU_TOG
52
53// leftmost column
54#define K00 KC_ESC
55#define K10 KC_TAB
56#define K20 NAVLAYER
57#define K30 KC_LSFT
58#define K40 KC_LCTL
59
60// rightmost column
61#define K0B KC_BSPC
62#define K1B KC_BSPC
63#define K1B_ALT KC_DEL // for 5x12 boards, keep backspace as the top-left key and add delete key
64#define K2B KC_QUOT
65#define K3B KC_RSFT
66#define K4B KC_LEAD
67
68// LAYOUT WRAPPERS =====================================================================
69#if (!defined(LAYOUT) && defined(KEYMAP))
70# define LAYOUT KEYMAP
71#endif
72
73#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__)
74#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__)
75#define LAYOUT_ortho_5x12_wrapper(...) LAYOUT_ortho_5x12(__VA_ARGS__)
76
77// KEYCODE GROUPS ======================================================================
78// MISC
79#define ______TRANS______ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
80#define ____NUMROW_L0____ KC_1, KC_2, KC_3, KC_4, KC_5
81#define ____NUMROW_R0____ KC_6, KC_7, KC_8, KC_9, KC_0
82#define _____BASE_L4_____ K41, K42, K43, K44, K45
83#define _____BASE_R4_____ K46, K47, K48, K49, K4A
84
85/* QWERTY ==============================================================================
86 * ,-----------------------------------------------------------------------------------.
87 * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | BKSP |
88 * |------+------+------+------+------+------+------+------+------+------+------+------|
89 * | TAB | Q | W | E | R | T | Y | U | I | O | P | DEL |
90 * |------+------+------+------+------+------+------+------+------+------+------+------|
91 * | NAV | A | S | D | F | G | H | J | K | L | ; | " |
92 * |------+------+------+------+------+------+------+------+------+------+------+------|
93 * | SHFT | Z | X | C | V | B | N | M | , | . | / | SHFT |
94 * |------+------+------+------+------+------+------+------+------+------+------+------|
95 * | CTRL | C/S | LGUI | LALT | SYMB | NUM/SPACE | SYMB | RALT | SETT | MUTG | LEAD |
96 * `-----------------------------------------------------------------------------------'
97 */
98
99// LEFT
100// - CORE
101#define ____QWERTY_L1____ KC_Q, KC_W, KC_E, KC_R, KC_T
102#define ____QWERTY_L2____ KC_A, KC_S, KC_D, KC_F, KC_G
103#define ____QWERTY_L3____ KC_Z, KC_X, KC_C, KC_V, KC_B
104
105// RIGHT
106// - CORE
107#define ____QWERTY_R1____ KC_Y, KC_U, KC_I, KC_O, KC_P
108#define ____QWERTY_R2____ KC_H, KC_J, KC_K, KC_L, KC_SCLN
109#define ____QWERTY_R3____ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH
110
111/* NUMPAD ==============================================================================
112 * ,-----------------------------------------------------------------------------------.
113 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
114 * |------+------+------+------+------+------+------+------+------+------+------+------|
115 * | TRNS | F9 | F10 | F11 | F12 | | NLCK | 7 | 8 | 9 | - | DEL |
116 * |------+------+------+------+------+------+------+------+------+------+------+------|
117 * | ESC | F5 | F6 | F7 | F8 | SPC | SPC | 4 | 5 | 6 | + | ENTR |
118 * |------+------+------+------+------+------+------+------+------+------+------+------|
119 * | TRNS | F1 | F2 | F3 | F4 | ALT | CAPS | 1 | 2 | 3 | / | TRNS |
120 * |------+------+------+------+------+------+------+------+------+------+------+------|
121 * | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | 0 | , | . | * | TRNS |
122 * `-----------------------------------------------------------------------------------'
123 */
124
125// LEFT
126// - CORE
127#define ____NUMPAD_L1____ KC_F9, KC_F10, KC_F11, KC_F12, KC_NO
128#define ____NUMPAD_L2____ KC_F5, KC_F6, KC_F7, KC_F8, KC_SPC
129#define ____NUMPAD_L3____ KC_F1, KC_F2, KC_F3, KC_F4, KC_LALT
130
131// - MODS
132#define ____NUMPAD_L4____ ______TRANS______
133#define K00_NUM KC_TRNS
134#define K10_NUM KC_TRNS
135#define K20_NUM KC_TRNS
136#define K30_NUM KC_TRNS
137#define K40_NUM KC_TRNS
138
139// RIGHT
140// - CORE
141#define ____NUMPAD_R1____ KC_NLCK, KC_7, KC_8, KC_9, KC_MINS
142#define ____NUMPAD_R2____ KC_SPC, KC_4, KC_5, KC_6, KC_PLUS
143#define ____NUMPAD_R3____ KC_CAPS, KC_1, KC_2, KC_3, KC_SLSH
144
145// - MODS
146#define ____NUMPAD_R4____ KC_TRNS, KC_0, KC_COMM, KC_DOT, KC_ASTR
147#define K0B_NUM KC_TRNS
148#define K1B_NUM KC_TRNS
149#define K2B_NUM KC_ENT
150#define K3B_NUM KC_TRNS
151#define K4B_NUM KC_TRNS
152
153/* SYMBOLS =============================================================================
154 * ,-----------------------------------------------------------------------------------.
155 * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | BKSP |
156 * |------+------+------+------+------+------+------+------+------+------+------+------|
157 * | TRNS | # | $ | { | } | | | ^ | * | | | ~ | TRNS |
158 * |------+------+------+------+------+------+------+------+------+------+------+------|
159 * | TRNS | < | > | ( | ) | | | - | + | & | \ | ` |
160 * |------+------+------+------+------+------+------+------+------+------+------+------|
161 * | TRNS | ! | @ | [ | ] | | | _ | = | % | / | SHFT |
162 * |------+------+------+------+------+------+------+------+------+------+------+------|
163 * | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS |
164 * `-----------------------------------------------------------------------------------'
165 */
166
167// LEFT
168// - CORE
169#define ____SYMBOL_L1____ KC_HASH, KC_DOLLAR, KC_LCBR, KC_RCBR, KC_NO
170#define ____SYMBOL_L2____ KC_LABK, KC_RABK, KC_LPRN, KC_RPRN, KC_NO
171#define ____SYMBOL_L3____ KC_EXCLAIM, KC_AT, KC_LBRC, KC_RBRC, KC_NO
172
173// - MODS
174#define ____SYMBOL_L4____ ______TRANS______
175#define K00_SYM KC_TRNS
176#define K10_SYM KC_TRNS
177#define K20_SYM KC_TRNS
178#define K30_SYM KC_TRNS
179#define K40_SYM KC_TRNS
180
181// RIGHT
182// - CORE
183#define ____SYMBOL_R1____ KC_NO, KC_CIRC, KC_ASTR, KC_PIPE, KC_TILD
184#define ____SYMBOL_R2____ KC_NO, KC_MINS, KC_PLUS, KC_AMPR, KC_BSLS
185#define ____SYMBOL_R3____ KC_NO, KC_UNDS, KC_EQL, KC_PERC, KC_SLSH
186
187// - MODS
188#define ____SYMBOL_R4____ ______TRANS______
189#define K0B_SYM KC_TRNS
190#define K1B_SYM KC_TRNS
191#define K2B_SYM KC_GRV
192#define K3B_SYM KC_TRNS
193#define K4B_SYM KC_TRNS
194
195/* NAVIGATION ==========================================================================
196 * ,-----------------------------------------------------------------------------------.
197 * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | BKSP |
198 * |------+------+------+------+------+------+------+------+------+------+------+------|
199 * | TRNS | | | SPC | F5 | | INS | HOME | END | TAB | DEL | TRNS |
200 * |------+------+------+------+------+------+------+------+------+------+------+------|
201 * | TRNS | SHFT | CTRl | ALT | GUI | | LEFT | DOWN | UP | RGHT | | ENTR |
202 * |------+------+------+------+------+------+------+------+------+------+------+------|
203 * | TRNS | UNDO | CUT | COPY | PSTE | | SPC | PGDO | PGUP | | | TRNS |
204 * |------+------+------+------+------+------+------+------+------+------+------+------|
205 * | TRNS | TRNS | TRNS | TRNS | TRNS | ESC | TRNS | TRNS | TRNS | TRNS | TRNS |
206 * `-----------------------------------------------------------------------------------'
207 */
208
209// LEFT
210// - CORE
211#define __NAVIGATION_L1__ KC_NO, KC_NO, KC_SPC, KC_F5, KC_NO
212#define __NAVIGATION_L2__ KC_LSFT, KC_LCTRL, KC_LALT, KC_LGUI, KC_NO
213#define __NAVIGATION_L3__ WINUNDO, WINCUT, WINCOPY, WINPASTE, KC_NO
214
215// - MODS
216#define __NAVIGATION_L4__ _______, _______, _______, _______, KC_ESC
217#define K00_NAV KC_TRNS
218#define K10_NAV KC_TRNS
219#define K20_NAV KC_TRNS
220#define K30_NAV KC_TRNS
221#define K40_NAV KC_TRNS
222
223// RIGHT
224// - CORE
225#define __NAVIGATION_R1__ KC_INS, KC_HOME, KC_END, KC_TAB, KC_DEL
226#define __NAVIGATION_R2__ KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_NO
227#define __NAVIGATION_R3__ KC_SPC, KC_PGDN, KC_PGUP, KC_NO, KC_NO
228
229// - MODS
230#define __NAVIGATION_R4__ KC_ESC, _______, _______, _______, _______
231#define K0B_NAV KC_TRNS
232#define K1B_NAV KC_TRNS
233#define K2B_NAV KC_ENT
234#define K3B_NAV KC_TRNS
235#define K4B_NAV KC_TRNS
236
237/* SETTINGS ============================================================================
238 * ,-----------------------------------------------------------------------------------.
239 * | | | | | | | | | | | | |
240 * |------+------+------+------+------+------+------+------+------+------+------+------|
241 * | | | DBUG | | | | | | | | | |
242 * |------+------+------+------+------+-------------+------+------+------+------+------|
243 * | | | |Aud on|AudOff|AGnorm|AGswap| | | | | |
244 * |------+------+------+------+------+------|------+------+------+------+------+------|
245 * | ASTG |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | |
246 * |------+------+------+------+------+------+------+------+------+------+------+------|
247 * | | | | | | | | | | | |
248 * `-----------------------------------------------------------------------------------'
249 */
250// LEFT
251// - CORE
252#define ___SETTINGS_L1___ _______, DEBUG, _______, _______, _______
253#define ___SETTINGS_L2___ _______, MU_MOD, AU_ON, AU_OFF, AG_NORM
254#define ___SETTINGS_L3___ MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON
255
256// - MODS
257#define ___SETTINGS_L4___ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO
258#define K00_SET KC_NO
259#define K10_SET KC_NO
260#define K20_SET KC_NO
261#define K30_SET KC_ASTG
262#define K40_SET KC_NO
263
264// RIGHT
265// - CORE
266#define ___SETTINGS_R1___ TERM_ON, TERM_OFF, _______, _______, _______
267#define ___SETTINGS_R2___ _______, _______, _______, _______, _______
268#define ___SETTINGS_R3___ _______, _______, _______, _______, _______
269
270// - MODS
271#define ___SETTINGS_R4___ KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO
272#define K0B_SET KC_NO
273#define K1B_SET KC_NO
274#define K2B_SET KC_NO
275#define K3B_SET KC_NO
276#define K4B_SET KC_NO \ No newline at end of file
diff --git a/users/alfrdmalr/config.h b/users/alfrdmalr/config.h
new file mode 100644
index 000000000..502d3158b
--- /dev/null
+++ b/users/alfrdmalr/config.h
@@ -0,0 +1,7 @@
1#pragma once
2
3#define MUSIC_MASK (keycode != KC_NO)
4#define MIDI_BASIC
5
6#define LEADER_TIMEOUT 400
7#define LEADER_PER_KEY_TIMING
diff --git a/users/alfrdmalr/readme.md b/users/alfrdmalr/readme.md
new file mode 100644
index 000000000..d462a5baf
--- /dev/null
+++ b/users/alfrdmalr/readme.md
@@ -0,0 +1,47 @@
1# alfrdmalr's userspace
2## Overview
3The alphanumeric characters and symbols are spread between three main 'typing' layers: REGULAR, NUMPAD, and SYMBOLS.
4
5A fourth layer, NAVIGATION, contains useful modifiers, shortcuts, and navigation functions like the arrow keys and page up/down. This layer also provides access to the `ENTER` and `ESC` keys.
6
7Finally, a SETTINGS layer can be used to adjust certain keyboard-related options.
8
9A visual representation of each layer can be found in [alfrdmalr.h](./alfrdmalr.h)
10
11### Layers
12
13#### REGULAR
14Right now this is just a QWERTY layer, but other layouts (DVORAK, COLEMAK, etc.) could easily be added. The REGULAR layer uses the default modifiers.
15
16The default modifiers are defined in the style `K00`, where the first digit is the row index and the second digit is the column index. These indices are based on the Preonic's 5x12 grid, and are **not** adjusted for a board of different size; for instance, the upper-leftmost key in the preonic layout is `K00`, whereas the upper-leftmost key on a Planck would be `K10`.
17
18This convention is designed to work nicely with layout wrappers.
19
20#### NUMPAD
21The NUMPAD layer puts a numpad under the right hand, surrounding the home row position. Several basic arithmetic operators are also provided, as well as comma/decimal symbols, to emulate a traditional numpad. The numlock/capslock keys are accessible from this layer as well, though it should be noted that the actual keycodes being sent by the numpad are NOT the numpad versions of the numbers - this is to prevent the normal numlock behavior from blocking numbers from being sent.
22
23This layer also holds the first twelve function keys.
24
25#### SYMBOLS
26This layer holds all the symbols that are not accessible from the REGULAR layer. There is some redundancy (for instance, `/` exists in both the REGULAR and SYMBOLS layer; its position, however, remains consistent) but with the exception of single and double quotes, all symbols are available from this layer.
27
28#### NAVIGATION
29The primary function of this layer is to provide arrow keys under hjkl. The surrounding keys contain similar functionality - for instance, the keys directly below `DOWN` and `UP` are `PAGEDOWN` and `PAGEUP`, respectively. `HOME` and `END` are inverted from this convention, simply because I kept hitting the wrong key when trying to jump to the beginning/end of lines when editing text.
30
31To the immediate right of the NAVIGATION layer key are the following modifiers: `SHIFT`, `CONTROL`, `ALT`, `GUI`. All modifiers are the "left" variants. The idea is to use the left hand to hold different modifiers as necessary while using the right hand to navigate and format.
32
33`ESCAPE` is located on the spacebar from this layer, and `DELETE` is placed next to `BACKSPACE`, for convenience when formatting text. There are also four Windows shortcuts for undo, cut, copy, and paste, located in the same position as the relevant keys on the base layer (undo, for example, is in the same place as the `Z` key).
34
35#### SETTINGS
36Right now, this is pretty similar to the default settings layer (the planck's ADJUST layer).
37
38Primary differences are the inclusion of an autoshift toggle and the removal of the reset button. The bootloader functionality has been moved to a leader key sequence: LEAD - R - E - S - E - T.
39
40### Leader Key Sequences
41A complete list of leader sequences can be found below:
42
43#### Reset
44LEAD - R - E - S - E - T
45
46#### Minimize (Windows)
47LEAD - M - I - N
diff --git a/users/alfrdmalr/rules.mk b/users/alfrdmalr/rules.mk
new file mode 100644
index 000000000..1b674c04e
--- /dev/null
+++ b/users/alfrdmalr/rules.mk
@@ -0,0 +1,8 @@
1SRC += alfrdmalr.c
2
3ifdef AUDIO_ENABLE
4 SRC += muse.c
5endif
6
7AUTO_SHIFT_ENABLE = yes
8LEADER_ENABLE = yes