aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorridingqwerty <george.g.koenig@gmail.com>2019-08-16 19:54:16 -0400
committerDrashna Jaelre <drashna@live.com>2019-08-16 16:54:16 -0700
commit0c03811d6affb31d9952e9b4c9c0f5e10fddee8a (patch)
tree25e10a61ed0e40ee7852fc9bcdc2f1571b288fa1
parent36dd261d06e86ed90997486776f06b286a163cd8 (diff)
downloadqmk_firmware-0c03811d6affb31d9952e9b4c9c0f5e10fddee8a.tar.gz
qmk_firmware-0c03811d6affb31d9952e9b4c9c0f5e10fddee8a.zip
[Keymap] add "ridingqwerty" user and keymap for atreus keyboard (#6533)
* add userspace and atreus keymap * cleaning up notes/comments * Update keyboards/atreus/keymaps/ridingqwerty/atreus.c Co-Authored-By: Joel Challis <git@zvecr.com> * Update keyboards/atreus/keymaps/ridingqwerty/atreus.c Co-Authored-By: Joel Challis <git@zvecr.com> * Create readme.md * remove reference to matrix_init_kb from atreus.c * correct atreus.c * remove unnecessary defines * merge register/unregister sequence into single tapcode * move 'LAYOUT to keymap.c; remove atreus.h * remove TAPPING_TERM from keyboard-level config.h
-rw-r--r--keyboards/atreus/keymaps/ridingqwerty/config.h13
-rw-r--r--keyboards/atreus/keymaps/ridingqwerty/keymap.c116
-rw-r--r--keyboards/atreus/keymaps/ridingqwerty/readme.md1
-rw-r--r--keyboards/atreus/keymaps/ridingqwerty/rules.mk17
-rw-r--r--users/ridingqwerty/config.h3
-rw-r--r--users/ridingqwerty/process_records.c33
-rw-r--r--users/ridingqwerty/process_records.h29
-rw-r--r--users/ridingqwerty/ridingqwerty.c1
-rw-r--r--users/ridingqwerty/ridingqwerty.h37
-rw-r--r--users/ridingqwerty/rules.mk8
10 files changed, 258 insertions, 0 deletions
diff --git a/keyboards/atreus/keymaps/ridingqwerty/config.h b/keyboards/atreus/keymaps/ridingqwerty/config.h
new file mode 100644
index 000000000..349d7b1c4
--- /dev/null
+++ b/keyboards/atreus/keymaps/ridingqwerty/config.h
@@ -0,0 +1,13 @@
1#pragma once
2
3#undef MATRIX_ROWS
4#define MATRIX_ROWS 8
5
6#undef MATRIX_COLS
7#define MATRIX_COLS 6
8
9#undef MATRIX_ROW_PINS
10#define MATRIX_ROW_PINS { A6, A7, A8, A15, B11, B12, A14, A13 }
11
12#undef MATRIX_COL_PINS
13#define MATRIX_COL_PINS { B5, B4, B3, B2, B1, B0 }
diff --git a/keyboards/atreus/keymaps/ridingqwerty/keymap.c b/keyboards/atreus/keymaps/ridingqwerty/keymap.c
new file mode 100644
index 000000000..336df4973
--- /dev/null
+++ b/keyboards/atreus/keymaps/ridingqwerty/keymap.c
@@ -0,0 +1,116 @@
1/* Copyright 2019 George Koenig
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include QMK_KEYBOARD_H
18#include "ridingqwerty.h"
19
20/* Atreus
21 ┏━━━━━━━━┯━━━━━━━━┯━━━━━━━━┯━━━━━━━━┯━━━━━━━━┓ ┏━━━━━━━━┯━━━━━━━━┯━━━━━━━━┯━━━━━━━━┯━━━━━━━━┓
22 ┃ Q │ W │ E │ R │ T ┃ ┃ Y │ U │ I │ O │ P ┃
23 ┠────────┼────────┼────────┼────────┼────────┨ ┠────────┼────────┼────────┼────────┼────────┨
24 /┃ ¶ A │ S │ D │ F │ G ┃ ┃ H │ J │ K │ L │ 🔢 ; ┃
25 ┠────────┼────────┼────────┼────────┼────────┞━━━━━━━━┳━━━━━━━━┞────────┼────────┼────────┼────────┼────────┨
26 /┃ ⇧ Z │ X │ C │ V │ B │ ┃ │ N │ M │ , │ 𝔽 . │ ⇧ / ┃
27 ┠────────┼────────┼────────┼────────┼────────┤ ¶ ⎋ ┃ ❦ ⇥ ├────────┼────────┼────────┼────────┼────────┨
28 ┃ ⎈ ⎋ │ ⌘ ⇥ │ ⎇ [ │ ⇧ ] │ 🔢 ⌫ │ ┃ │ ★ ␣ │ ⇧ - │ ⎇ = │ ⌘ ' │ ⎈ ↵ ┃
29 ┗━━━━━━━━┷━━━━━━━━┷━━━━━━━━┷━━━━━━━━┷━━━━━━━━┷━━━━━━━━┻━━━━━━━━┷━━━━━━━━┷━━━━━━━━┷━━━━━━━━┷━━━━━━━━┷━━━━━━━━┛
30 MODS // LAYERS // MODS //
31*/
32
33#ifdef LAYOUT
34#undef LAYOUT
35#define LAYOUT( \
36 K00, K01, K02, K03, K04, K40, K41, K42, K43, K44, \
37 K10, K11, K12, K13, K14, K50, K51, K52, K53, K54, \
38 K20, K21, K22, K23, K24, K60, K61, K62, K63, K64, \
39 K30, K31, K32, K33, K34, K35, K70, K71, K72, K73, K74, K75 \
40) { \
41 { K00, K01, K02, K03, K04, KC_NO }, \
42 { K10, K11, K12, K13, K14, KC_NO }, \
43 { K20, K21, K22, K23, K24, KC_NO }, \
44 { K30, K31, K32, K33, K34, K35 }, \
45 { K44, K43, K42, K41, K40, KC_NO }, \
46 { K54, K53, K52, K51, K50, KC_NO }, \
47 { K64, K63, K62, K61, K60, KC_NO }, \
48 { K75, K74, K73, K72, K71, K70 } \
49}
50#endif
51
52const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
53 [_QWERTY] = LAYOUT( /* Qwerty */
54 KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
55 ED_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NM_SCLN,
56 LS_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, FK_DOT, RS_SLSH,
57 LC_ESC, LG_TAB, LA_LBRC, LS_RBRC, NM_BSPC, ED_ESC, SC_TAB, SM_SPC, RS_MINS, RA_EQL, RG_QUOT, RC_ENT
58 ),
59 [_EDITOR] = LAYOUT( /* ED_A, ED_ESC */
60 KC_GRV, _______, KC_END, _______, KC_TAB, _______, _______, KC_INS, _______, KC_PGUP,
61 KC_HOME, _______, KC_DELT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_ENT,
62 _______, _______, _______, _______, _______, KC_PGDN, _______, _______, _______, KC_BSLS,
63 _______, _______, _______, _______, _______, _______, KC_ENT, _______, _______, _______, _______, _______
64 ),
65 [_NUMBER] = LAYOUT( /* NM_SCLN, NM_BSPC */
66 KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,
67 KC_6, KC_7, KC_8, KC_9, KC_0, _______, KC_4, KC_5, KC_6, _______,
68 _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, KC_BSLS,
69 _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_0, KC_0, KC_DOT, _______, _______
70 ),
71 [_SYMBOL] = LAYOUT( /* SM_SPC */
72 KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN,
73 KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, _______, _______, _______, KC_COLN,
74 _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSLS,
75 _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, _______, _______, _______, _______, _______
76 ),
77 [_F_KEYS] = LAYOUT( /* FK_DOT */
78 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10,
79 KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, _______, _______, _______, KC_F11,
80 KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, KC_F12,
81 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
82 ),
83 [_SECRET] = LAYOUT( /* shhhh... */
84 RESET, _______, _______, RUSTY, FUEL, KC_F13, _______, _______, _______, _______,
85 AR1ST, SYSNOC, _______, _______, _______, _______, _______, _______, OS_LAB, _______,
86 CDLOCAL, _______, C0RE, VAXIS, _______, _______, MUNKY, _______, _______, _______,
87 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
88 ),
89 [_FINAL] = LAYOUT( /* . */
90 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
91 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
92 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
93 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
94 )
95};
96
97// custom tap/hold keys
98uint16_t key_timer;
99bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
100 switch(keycode) {
101 case RG_QUOT:
102 if (record->event.pressed) {
103 key_timer = timer_read();
104 layer_on(_NUMBER);
105 register_mods(MOD_BIT(KC_RGUI));
106 } else {
107 unregister_mods(MOD_BIT(KC_RGUI));
108 layer_off(_NUMBER);
109 if (timer_elapsed(key_timer) < TAPPING_TERM) {
110 tap_code(KC_QUOT);
111 }
112 }
113 return false; break;
114 }
115 return true;
116};
diff --git a/keyboards/atreus/keymaps/ridingqwerty/readme.md b/keyboards/atreus/keymaps/ridingqwerty/readme.md
new file mode 100644
index 000000000..936df3609
--- /dev/null
+++ b/keyboards/atreus/keymaps/ridingqwerty/readme.md
@@ -0,0 +1 @@
This is a handwired Atreus42 using a Proton C
diff --git a/keyboards/atreus/keymaps/ridingqwerty/rules.mk b/keyboards/atreus/keymaps/ridingqwerty/rules.mk
new file mode 100644
index 000000000..95b257f75
--- /dev/null
+++ b/keyboards/atreus/keymaps/ridingqwerty/rules.mk
@@ -0,0 +1,17 @@
1MCU = STM32F303
2
3# Build Options
4# comment out to disable the options.
5#
6BACKLIGHT_ENABLE = no
7BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
8#MOUSEKEY_ENABLE = yes # Mouse keys
9EXTRAKEY_ENABLE = yes # Audio control and System control
10CONSOLE_ENABLE = yes # Console for debug
11COMMAND_ENABLE = yes # Commands for debug and configuration
12#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
13NKRO_ENABLE = yes # USB Nkey Rollover
14AUDIO_ENABLE = yes
15RGBLIGHT_ENABLE = no
16# SERIAL_LINK_ENABLE = yes
17#TAP_DANCE_ENABLE = yes
diff --git a/users/ridingqwerty/config.h b/users/ridingqwerty/config.h
new file mode 100644
index 000000000..2461b8b8d
--- /dev/null
+++ b/users/ridingqwerty/config.h
@@ -0,0 +1,3 @@
1#pragma once
2#define TAPPING_TERM 175
3#define MACRO_TIMER 5
diff --git a/users/ridingqwerty/process_records.c b/users/ridingqwerty/process_records.c
new file mode 100644
index 000000000..be72883ec
--- /dev/null
+++ b/users/ridingqwerty/process_records.c
@@ -0,0 +1,33 @@
1#include "ridingqwerty.h"
2
3__attribute__ ((weak))
4bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
5 return true;
6}
7
8__attribute__ ((weak))
9bool process_record_secrets(uint16_t keycode, keyrecord_t *record) {
10 return true;
11}
12
13uint16_t user_key_timer;
14bool process_record_user(uint16_t keycode, keyrecord_t *record) {
15 switch(keycode) {
16 case RG_QUOT:
17 if (record->event.pressed) {
18 user_key_timer = timer_read();
19 layer_on(_NUMBER);
20 register_mods(MOD_BIT(KC_RGUI));
21 } else {
22 unregister_mods(MOD_BIT(KC_RGUI));
23 layer_off(_NUMBER);
24 if (timer_elapsed(user_key_timer) < TAPPING_TERM) {
25 register_code(KC_QUOT);
26 unregister_code(KC_QUOT);
27 }
28 }
29 return false; break;
30 }
31 return process_record_keymap(keycode, record) &&
32 process_record_secrets(keycode, record);
33}
diff --git a/users/ridingqwerty/process_records.h b/users/ridingqwerty/process_records.h
new file mode 100644
index 000000000..2c453bcd9
--- /dev/null
+++ b/users/ridingqwerty/process_records.h
@@ -0,0 +1,29 @@
1#pragma once
2#include "ridingqwerty.h"
3
4#if defined(KEYMAP_SAFE_RANGE)
5 #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE
6#else
7 #define PLACEHOLDER_SAFE_RANGE SAFE_RANGE
8#endif
9
10bool process_record_secrets(uint16_t keycode, keyrecord_t *record);
11bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
12
13enum userspace_custom_keycodes {
14 FIRST = PLACEHOLDER_SAFE_RANGE,
15 RUSTY,
16 FUEL,
17 C0RE,
18 MUNKY,
19 AR1ST,
20 VAXIS,
21 OS_LAB,
22 CDLOCAL,
23 SYSNOC,
24 RG_QUOT,
25 LAST
26};
27
28bool process_record_secrets(uint16_t keycode, keyrecord_t *record);
29bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
diff --git a/users/ridingqwerty/ridingqwerty.c b/users/ridingqwerty/ridingqwerty.c
new file mode 100644
index 000000000..fd39021da
--- /dev/null
+++ b/users/ridingqwerty/ridingqwerty.c
@@ -0,0 +1 @@
#include "ridingqwerty.h"
diff --git a/users/ridingqwerty/ridingqwerty.h b/users/ridingqwerty/ridingqwerty.h
new file mode 100644
index 000000000..ae5262567
--- /dev/null
+++ b/users/ridingqwerty/ridingqwerty.h
@@ -0,0 +1,37 @@
1#pragma once
2
3#include "quantum.h"
4#include "process_records.h"
5
6enum userspace_layers
7{
8 _QWERTY = 0,
9 _EDITOR,
10 _NUMBER,
11 _SYMBOL,
12 _F_KEYS,
13 _DEBUG,
14 _SECRET,
15 _FINAL
16};
17
18// modtaps
19#define LS_Z MT(MOD_LSFT, KC_Z)
20#define LC_ESC MT(MOD_LCTL, KC_ESC)
21#define LG_TAB MT(MOD_LGUI, KC_TAB)
22#define LA_LBRC MT(MOD_LALT, KC_LBRC)
23#define LS_RBRC MT(MOD_LSFT, KC_RBRC)
24#define RS_MINS MT(MOD_RSFT, KC_MINS)
25#define RA_EQL MT(MOD_RALT, KC_EQL)
26//RG_LMOT defined in process_records.h
27#define RC_ENT MT(MOD_RCTL, KC_ENT)
28#define RS_SLSH MT(MOD_RSFT, KC_SLSH)
29// layertaps
30#define ED_A LT(_EDITOR, KC_A)
31#define ED_ESC LT(_EDITOR, KC_ESC)
32#define NM_SCLN LT(_NUMBER, KC_SCLN)
33#define NM_BSPC LT(_NUMBER, KC_BSPC)
34#define SM_SPC LT(_SYMBOL, KC_SPC)
35#define SC_TAB LT(_SECRET, KC_TAB)
36#define FK_DOT LT(_F_KEYS, KC_DOT)
37
diff --git a/users/ridingqwerty/rules.mk b/users/ridingqwerty/rules.mk
new file mode 100644
index 000000000..9c3846744
--- /dev/null
+++ b/users/ridingqwerty/rules.mk
@@ -0,0 +1,8 @@
1#LEADER_ENABLE = yes
2
3SRC += ridingqwerty.c \
4 process_records.c
5
6ifneq ("$(wildcard $(USER_PATH)/secrets.c)","")
7 SRC += secrets.c
8endif