aboutsummaryrefslogtreecommitdiff
path: root/keyboards/a_dux
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/a_dux')
-rw-r--r--keyboards/a_dux/a_dux.c37
-rw-r--r--keyboards/a_dux/a_dux.h47
-rw-r--r--keyboards/a_dux/config.h83
-rw-r--r--keyboards/a_dux/info.json52
-rw-r--r--keyboards/a_dux/keymaps/daliusd/config.h32
-rw-r--r--keyboards/a_dux/keymaps/daliusd/keymap.c349
-rw-r--r--keyboards/a_dux/keymaps/daliusd/oneshot.c195
-rw-r--r--keyboards/a_dux/keymaps/daliusd/oneshot.h65
-rw-r--r--keyboards/a_dux/keymaps/daliusd/readme.md21
-rw-r--r--keyboards/a_dux/keymaps/daliusd/rules.mk5
-rw-r--r--keyboards/a_dux/keymaps/default/keymap.c40
-rw-r--r--keyboards/a_dux/keymaps/jcmkk3/keymap.c130
-rw-r--r--keyboards/a_dux/keymaps/jcmkk3/oneshot.c72
-rw-r--r--keyboards/a_dux/keymaps/jcmkk3/oneshot.h46
-rw-r--r--keyboards/a_dux/keymaps/jcmkk3/rules.mk1
-rw-r--r--keyboards/a_dux/readme.md45
-rw-r--r--keyboards/a_dux/rules.mk20
17 files changed, 1240 insertions, 0 deletions
diff --git a/keyboards/a_dux/a_dux.c b/keyboards/a_dux/a_dux.c
new file mode 100644
index 000000000..16bac16fa
--- /dev/null
+++ b/keyboards/a_dux/a_dux.c
@@ -0,0 +1,37 @@
1/* Copyright 2018-2020
2 * ENDO Katsuhiro <[email protected]>
3 * David Philip Barr <@davidphilipbarr>
4 * Pierre Chevalier <[email protected]>
5 * @filterpaper
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#include "a_dux.h"
21
22#ifdef SWAP_HANDS_ENABLE
23__attribute__ ((weak))
24const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
25 // Left
26 {{4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}},
27 {{4, 5}, {3, 5}, {2, 5}, {1, 5}, {0, 5}},
28 {{4, 6}, {3, 6}, {2, 6}, {1, 6}, {0, 6}},
29 {{1, 7}, {0, 7}, {2, 7}, {3, 7}, {4, 7}},
30 // Right
31 {{4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
32 {{4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}},
33 {{4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}},
34 {{1, 3}, {0, 3}, {2, 3}, {3, 3}, {4, 3}}
35};
36#endif
37
diff --git a/keyboards/a_dux/a_dux.h b/keyboards/a_dux/a_dux.h
new file mode 100644
index 000000000..d14329584
--- /dev/null
+++ b/keyboards/a_dux/a_dux.h
@@ -0,0 +1,47 @@
1/* Copyright 2018-2020 ENDO Katsuhiro <[email protected]> David Philip Barr <@davidphilipbarr> Pierre Chevalier <[email protected]>
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 "quantum.h"
18
19/* This a shortcut to help you visually see your layout.
20 *
21 * The first section contains all of the arguments representing the physical
22 * layout of the board and position of the keys.
23 *
24 * The second converts the arguments into a two-dimensional array which
25 * represents the switch matrix.
26 */
27
28// readability
29#define ___ KC_NO
30
31#define LAYOUT( \
32 L01, L02, L03, L04, L05, R01, R02, R03, R04, R05, \
33 L06, L07, L08, L09, L10, R06, R07, R08, R09, R10, \
34 L11, L12, L13, L14, L15, R11, R12, R13, R14, R15, \
35 L16, L17, R16, R17 \
36 ) \
37 { \
38 { L01, L02, L03, L04, L05 }, \
39 { L06, L07, L08, L09, L10 }, \
40 { L11, L12, L13, L14, L15 }, \
41 { L16, L17, ___, ___, ___ }, \
42 { R01, R02, R03, R04, R05 }, \
43 { R06, R07, R08, R09, R10 }, \
44 { R11, R12, R13, R14, R15 }, \
45 { R16, R17, ___, ___, ___ } \
46 }
47
diff --git a/keyboards/a_dux/config.h b/keyboards/a_dux/config.h
new file mode 100644
index 000000000..b00794577
--- /dev/null
+++ b/keyboards/a_dux/config.h
@@ -0,0 +1,83 @@
1/* Copyright 2018-2020 ENDO Katsuhiro <[email protected]> David Philip Barr <@davidphilipbarr> Pierre Chevalier <[email protected]>
2
3This program is free software: you can redistribute it and/or modify
4it under the terms of the GNU General Public License as published by
5the Free Software Foundation, either version 2 of the License, or
6(at your option) any later version.
7
8This program is distributed in the hope that it will be useful,
9but WITHOUT ANY WARRANTY; without even the implied warranty of
10MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License
14along with this program. If not, see <http://www.gnu.org/licenses/>.
15*/
16
17#pragma once
18
19#include "config_common.h"
20
21/* USB Device descriptor parameter */
22#define VENDOR_ID 0xC2AB
23#define PRODUCT_ID 0x3939
24#define DEVICE_VER 0x0001
25#define MANUFACTURER tapioki
26#define PRODUCT Architeuthis dux
27
28/* key matrix size */
29#define MATRIX_ROWS 8
30#define MATRIX_COLS 5
31
32/*
33 * Keyboard Matrix Assignments
34 *
35 * Change this to how you wired your keyboard
36 * COLS: AVR pins used for columns, left to right
37 * ROWS: AVR pins used for rows, top to bottom
38 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
39 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
40 * NO_DIODE = switches are directly connected to AVR pins
41 *
42*/
43#define DIRECT_PINS { \
44 { C6, D2, F7, B2, F4 }, \
45 { D7, D0, F6, B3, F5 }, \
46 { E6, D4, D3, B1, B6 }, \
47 { B4, B5, NO_PIN, NO_PIN, NO_PIN } \
48}
49
50#define DIRECT_PINS_RIGHT { \
51 { F4, B2, F7, D2, C6 }, \
52 { F5, B3, F6, D0, D7 }, \
53 { B6, B1, D3, D4, E6 }, \
54 { B5, B4, NO_PIN, NO_PIN, NO_PIN } \
55}
56
57
58
59#define UNUSED_PINS
60
61/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
62#define DEBOUNCE 5
63
64/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
65#define LOCKING_SUPPORT_ENABLE
66
67/* Locking resynchronize hack */
68#define LOCKING_RESYNC_ENABLE
69
70/* Serial settings */
71#define USE_SERIAL
72
73/* serial.c configuration for split keyboard */
74#define SOFT_SERIAL_PIN D1
75
76#define EE_HANDS
77
78/* Top left key on left half */
79#define BOOTMAGIC_LITE_ROW 0
80#define BOOTMAGIC_LITE_COLUMN 0
81/* Top right key on right half */
82#define BOOTMAGIC_LITE_ROW_RIGHT 4
83#define BOOTMAGIC_LITE_COLUMN_RIGHT 4
diff --git a/keyboards/a_dux/info.json b/keyboards/a_dux/info.json
new file mode 100644
index 000000000..f1869f733
--- /dev/null
+++ b/keyboards/a_dux/info.json
@@ -0,0 +1,52 @@
1{
2 "keyboard_name": "Architeuthis dux",
3 "url": "https://github.com/tapioki/cephalopoda",
4 "maintainer": "@tapioki",
5 "layouts": {
6 "LAYOUT": {
7 "layout": [
8 {"x": 0, "y": 1.33},
9 {"x": 1, "y": 0.31},
10 {"x": 2, "y": 0},
11 {"x": 3, "y": 0.28},
12 {"x": 4, "y": 0.42},
13
14 {"x": 8, "y": 0.42},
15 {"x": 9, "y": 0.28},
16 {"x": 10, "y": 0},
17 {"x": 11, "y": 0.31},
18 {"x": 12, "y": 1.33},
19
20 {"x": 0, "y": 2.33},
21 {"x": 1, "y": 1.31},
22 {"x": 2, "y": 1},
23 {"x": 3, "y": 1.28},
24 {"x": 4, "y": 1.42},
25
26 {"x": 8, "y": 1.42},
27 {"x": 9, "y": 1.28},
28 {"x": 10, "y": 1},
29 {"x": 11, "y": 1.31},
30 {"x": 12, "y": 2.33},
31
32 {"x": 0, "y": 3.33},
33 {"x": 1, "y": 2.31},
34 {"x": 2, "y": 2},
35 {"x": 3, "y": 2.28},
36 {"x": 4, "y": 2.42},
37
38 {"x": 8, "y": 2.42},
39 {"x": 9, "y": 2.28},
40 {"x": 10, "y": 2},
41 {"x": 11, "y": 2.31},
42 {"x": 12, "y": 3.33},
43
44 {"x": 4, "y": 3.75},
45 {"x": 5, "y": 4},
46
47 {"x": 7, "y": 4},
48 {"x": 8, "y": 3.75}
49 ]
50 }
51 }
52}
diff --git a/keyboards/a_dux/keymaps/daliusd/config.h b/keyboards/a_dux/keymaps/daliusd/config.h
new file mode 100644
index 000000000..42e88a687
--- /dev/null
+++ b/keyboards/a_dux/keymaps/daliusd/config.h
@@ -0,0 +1,32 @@
1/*
2Copyright 2021 Dalius Dobravolskas <[email protected]>
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
11MERCHANTABILITY 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
20#define UNICODE_SELECTED_MODES UC_MAC, UC_LNX
21
22#define MOUSEKEY_INTERVAL 12
23#define MOUSEKEY_MAX_SPEED 6
24#define MOUSEKEY_TIME_TO_MAX 50
25
26#define MOUSEKEY_DELAY 20
27// It makes sense to use the same delay for the mouseweel
28#define MOUSEKEY_WHEEL_DELAY 100
29// The default is 100
30#define MOUSEKEY_WHEEL_INTERVAL 50
31// The default is 40
32#define MOUSEKEY_WHEEL_TIME_TO_MAX 100
diff --git a/keyboards/a_dux/keymaps/daliusd/keymap.c b/keyboards/a_dux/keymaps/daliusd/keymap.c
new file mode 100644
index 000000000..2a65ce458
--- /dev/null
+++ b/keyboards/a_dux/keymaps/daliusd/keymap.c
@@ -0,0 +1,349 @@
1/* Copyright 2021 @daliusd
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#include QMK_KEYBOARD_H
17
18#include "oneshot.h"
19
20// Each layer gets a name for readability, which is then used in the keymap matrix below.
21// The underscores don't mean anything - you can have a layer called STUFF or any other name.
22// Layer names don't all need to be of the same length, obviously, and you can also skip them
23// entirely and just use numbers.
24enum layers {
25 _QWERTY,
26 _SYM,
27 _NAV,
28 _NUMB,
29 _TMUX,
30 _MOUSE,
31 _MISC,
32 _FUNC,
33};
34
35enum custom_keycodes {
36 TM_NEXT = SAFE_RANGE,
37 TM_PREV,
38 TM_LEFT,
39 TM_RIGHT,
40 TM_NEW,
41 TM_SLCT,
42 TM_SRCH,
43 TM_URL,
44 OS_CTRL,
45 OS_ALT,
46 OS_GUI,
47 OS_TMUX,
48 OS_MISC,
49 OS_FUNC,
50};
51
52// Shortcut to make keymap more readable
53
54#define L_NAV MO(_NAV)
55#define L_SYM MO(_SYM)
56#define L_MOUSE TG(_MOUSE)
57
58#define K_PRINT (QK_LCTL | QK_LSFT | QK_LGUI | KC_4)
59
60enum unicode_names {
61 SNEK,
62 EURO,
63 LT_S_A,
64 LT_L_A,
65 LT_S_C,
66 LT_L_C,
67 LT_S_E1,
68 LT_L_E1,
69 LT_S_E2,
70 LT_L_E2,
71 LT_S_I,
72 LT_L_I,
73 LT_S_S,
74 LT_L_S,
75 LT_S_U1,
76 LT_L_U1,
77 LT_S_U2,
78 LT_L_U2,
79 LT_S_Z,
80 LT_L_Z,
81 LT_OB,
82 LT_CB,
83};
84
85const uint32_t PROGMEM unicode_map[] = {
86 [SNEK] = 0x1F40D, // 🐍
87 [EURO] = 0x20ac, // €
88 [LT_S_A] = 0x105, // ą
89 [LT_L_A] = 0x104, // Ą
90 [LT_S_C] = 0x10d, // č
91 [LT_L_C] = 0x10c, // Č
92 [LT_S_E1] = 0x119, // ę
93 [LT_L_E1] = 0x118, // Ę
94 [LT_S_E2] = 0x117, // ė
95 [LT_L_E2] = 0x116, // Ė
96 [LT_S_I] = 0x12f, // į
97 [LT_L_I] = 0x12e, // Į
98 [LT_S_S] = 0x161, // š
99 [LT_L_S] = 0x160, // Š'
100 [LT_S_U1] = 0x173, // ų
101 [LT_L_U1] = 0x172, // Ų
102 [LT_S_U2] = 0x16b, // ū
103 [LT_L_U2] = 0x16a, // Ū
104 [LT_S_Z] = 0x17e, // ž
105 [LT_L_Z] = 0x17d, // Ž
106 [LT_OB] = 0x201e, // „
107 [LT_CB] = 0x201c, // “
108};
109
110#define K_SNEK X(SNEK)
111#define K_EURO X(EURO)
112#define K_LT_A XP(LT_S_A, LT_L_A)
113#define K_LT_C XP(LT_S_C, LT_L_C)
114#define K_LT_E1 XP(LT_S_E1, LT_L_E1)
115#define K_LT_E2 XP(LT_S_E2, LT_L_E2)
116#define K_LT_I XP(LT_S_I, LT_L_I)
117#define K_LT_S XP(LT_S_S, LT_L_S)
118#define K_LT_U1 XP(LT_S_U1, LT_L_U1)
119#define K_LT_U2 XP(LT_S_U2, LT_L_U2)
120#define K_LT_Z XP(LT_S_Z, LT_L_Z)
121#define K_LT_OB X(LT_OB)
122#define K_LT_CB X(LT_CB)
123
124const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
125
126 [_QWERTY] = LAYOUT(
127 //┌────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┐
128 KC_Q ,KC_W ,KC_E ,KC_R ,KC_T, KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,
129 //├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
130 KC_A ,KC_S ,KC_D ,KC_F ,KC_G , KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,
131 //├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
132 KC_Z ,KC_X ,KC_C ,KC_V ,KC_B , KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH,
133 //└────────┴────────┴────────┴────┬───┴────┬───┼────────┐ ┌────────┼───┬────┴───┬────┴────────┴────────┴────────┘
134 L_NAV , KC_SPC , KC_LSFT , L_SYM
135 // └────────┘ └────────┘ └────────┘ └────────┘
136 ),
137
138 [_SYM] = LAYOUT(
139 //┌────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┐
140 KC_EXLM ,KC_AT ,KC_HASH ,KC_DLR ,KC_PERC , KC_CIRC ,KC_AMPR ,KC_ASTR ,KC_LPRN ,KC_RPRN ,
141 //├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
142 KC_GRV ,KC_PLUS ,KC_LBRC ,KC_RBRC ,K_LT_OB , KC_MINS ,OS_ALT ,OS_CTRL ,OS_GUI ,KC_PIPE ,
143 //├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
144 K_SNEK ,KC_EQL ,KC_LCBR ,KC_RCBR ,K_LT_CB , KC_UNDS ,KC_QUOT ,KC_DQT ,K_EURO ,KC_BSLS ,
145 //└────────┴────────┴────────┴────┬───┴────┬───┼────────┐ ┌────────┼───┬────┴───┬────┴────────┴────────┴────────┘
146 _______ , _______ , _______ , _______
147 // └────────┘ └────────┘ └────────┘ └────────┘
148 ),
149
150 [_NAV] = LAYOUT(
151 //┌────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┐
152 KC_TILDE,L_MOUSE ,OS_FUNC ,OS_MISC ,OS_TMUX , K_LT_A ,K_LT_C ,K_LT_E1 ,K_LT_E2 ,K_LT_I ,
153 //├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
154 KC_TAB ,OS_GUI ,OS_CTRL ,OS_ALT ,KC_ENT , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,KC_END ,
155 //├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
156 KC_DELT ,KC_BSPC ,KC_ESC ,KC_PGDN ,KC_PGUP , KC_HOME ,K_LT_S ,K_LT_U1 ,K_LT_U2 ,K_LT_Z ,
157 //└────────┴────────┴────────┴────┬───┴────┬───┼────────┐ ┌────────┼───┬────┴───┬────┴────────┴────────┴────────┘
158 _______ , _______ , _______ , _______
159 // └────────┘ └────────┘ └────────┘ └────────┘
160 ),
161
162 [_NUMB] = LAYOUT(
163 //┌────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┐
164 KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
165 //├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
166 KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 , XXXXXXX ,OS_ALT ,OS_CTRL ,OS_GUI ,XXXXXXX ,
167 //├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
168 KC_DELT ,KC_BSPC ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
169 //└────────┴────────┴────────┴────┬───┴────┬───┼────────┐ ┌────────┼───┬────┴───┬────┴────────┴────────┴────────┘
170 _______ , _______ , _______ , _______
171 // └────────┘ └────────┘ └────────┘ └────────┘
172 ),
173
174 [_TMUX] = LAYOUT(
175 //┌────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┐
176 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,TM_URL ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
177 //├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
178 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , TM_LEFT ,TM_NEXT ,TM_PREV ,TM_RIGHT,XXXXXXX ,
179 //├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
180 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , TM_NEW ,TM_SLCT ,XXXXXXX ,XXXXXXX ,TM_SRCH ,
181 //└────────┴────────┴────────┴────┬───┴────┬───┼────────┐ ┌────────┼───┬────┴───┬────┴────────┴────────┴────────┘
182 XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX
183 // └────────┘ └────────┘ └────────┘ └────────┘
184 ),
185
186 [_MOUSE] = LAYOUT(
187 //┌────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┐
188 XXXXXXX ,L_MOUSE ,KC_MS_U ,KC_BTN3 ,KC_WH_U , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
189 //├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
190 XXXXXXX ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_WH_D , XXXXXXX ,KC_LALT ,KC_LCTL ,KC_LGUI ,XXXXXXX ,
191 //├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
192 XXXXXXX ,XXXXXXX ,KC_ESC ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
193 //└────────┴────────┴────────┴────┬───┴────┬───┼────────┐ ┌────────┼───┬────┴───┬────┴────────┴────────┴────────┘
194 KC_BTN1 , KC_BTN2 , XXXXXXX , XXXXXXX
195 // └────────┘ └────────┘ └────────┘ └────────┘
196 ),
197
198 [_MISC] = LAYOUT(
199 //┌────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┐
200 RESET ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_BRID ,KC_BRIU ,XXXXXXX ,KC_PSCR ,K_PRINT ,
201 //├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
202 XXXXXXX ,XXXXXXX ,DEBUG ,XXXXXXX ,XXXXXXX , KC_MPRV ,KC_MPLY ,XXXXXXX ,KC_MNXT ,XXXXXXX ,
203 //├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
204 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_VOLD ,KC_VOLU ,XXXXXXX ,XXXXXXX ,UC_MOD ,
205 //└────────┴────────┴────────┴────┬───┴────┬───┼────────┐ ┌────────┼───┬────┴───┬────┴────────┴────────┴────────┘
206 XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX
207 // └────────┘ └────────┘ └────────┘ └────────┘
208 ),
209
210 [_FUNC] = LAYOUT(
211 //┌────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┐
212 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,
213 //├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
214 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,
215 //├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
216 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_F11 ,KC_F12 ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
217 //└────────┴────────┴────────┴────┬───┴────┬───┼────────┐ ┌────────┼───┬────┴───┬────┴────────┴────────┴────────┘
218 XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX
219 // └────────┘ └────────┘ └────────┘ └────────┘
220 ),
221};
222
223#define TMUX_PREFIX SS_DOWN(X_LCTL) "b" SS_UP(X_LCTL)
224
225bool is_oneshot_cancel_key(uint16_t keycode) {
226 switch (keycode) {
227 case L_SYM:
228 case L_NAV:
229 return true;
230 default:
231 return false;
232 }
233}
234
235bool is_oneshot_layer_cancel_key(uint16_t keycode) {
236 switch (keycode) {
237 case L_SYM:
238 case L_NAV:
239 return true;
240 default:
241 return false;
242 }
243}
244
245bool is_oneshot_ignored_key(uint16_t keycode) {
246 switch (keycode) {
247 case L_SYM:
248 case L_NAV:
249 case OS_CTRL:
250 case OS_ALT:
251 case OS_GUI:
252 case OS_TMUX:
253 case OS_MISC:
254 case KC_LSFT:
255 return true;
256 default:
257 return false;
258 }
259}
260
261bool is_oneshot_mod_key(uint16_t keycode) {
262 switch (keycode) {
263 case OS_CTRL:
264 case OS_ALT:
265 case OS_GUI:
266 return true;
267 default:
268 return false;
269 }
270}
271
272oneshot_state os_ctrl_state = os_up_unqueued;
273oneshot_state os_alt_state = os_up_unqueued;
274oneshot_state os_cmd_state = os_up_unqueued;
275oneshot_state os_tmux_state = os_up_unqueued;
276oneshot_state os_misc_state = os_up_unqueued;
277oneshot_state os_func_state = os_up_unqueued;
278
279bool process_record_user(uint16_t keycode, keyrecord_t *record) {
280 update_oneshot(
281 &os_ctrl_state, KC_LCTL, OS_CTRL,
282 keycode, record
283 );
284 update_oneshot(
285 &os_alt_state, KC_LALT, OS_ALT,
286 keycode, record
287 );
288 update_oneshot(
289 &os_cmd_state, KC_LGUI, OS_GUI,
290 keycode, record
291 );
292
293 bool handled = true;
294 handled = update_oneshot_layer(
295 &os_tmux_state, _TMUX, OS_TMUX,
296 keycode, record
297 ) & handled;
298
299 handled = update_oneshot_layer(
300 &os_misc_state, _MISC, OS_MISC,
301 keycode, record
302 ) & handled;
303
304 handled = update_oneshot_layer(
305 &os_func_state, _FUNC, OS_FUNC,
306 keycode, record
307 ) & handled;
308 if (!handled) return false;
309
310 switch (keycode) {
311 case TM_LEFT:
312 if (!record->event.pressed) return true;
313 SEND_STRING(TMUX_PREFIX "<");
314 return false;
315 case TM_RIGHT:
316 if (!record->event.pressed) return true;
317 SEND_STRING(TMUX_PREFIX ">");
318 return false;
319 case TM_NEXT:
320 if (!record->event.pressed) return true;
321 SEND_STRING(TMUX_PREFIX "n");
322 return false;
323 case TM_PREV:
324 if (!record->event.pressed) return true;
325 SEND_STRING(TMUX_PREFIX "p");
326 return false;
327 case TM_NEW:
328 if (!record->event.pressed) return true;
329 SEND_STRING(TMUX_PREFIX "c");
330 return false;
331 case TM_SLCT:
332 if (!record->event.pressed) return true;
333 SEND_STRING(TMUX_PREFIX "[");
334 return false;
335 case TM_SRCH:
336 if (!record->event.pressed) return true;
337 SEND_STRING(TMUX_PREFIX "\t");
338 return false;
339 case TM_URL:
340 if (!record->event.pressed) return true;
341 SEND_STRING(TMUX_PREFIX SS_LCTL("u"));
342 return false;
343 }
344 return true;
345}
346
347layer_state_t layer_state_set_user(layer_state_t state) {
348 return update_tri_layer_state(state, _SYM, _NAV, _NUMB);
349}
diff --git a/keyboards/a_dux/keymaps/daliusd/oneshot.c b/keyboards/a_dux/keymaps/daliusd/oneshot.c
new file mode 100644
index 000000000..1e7b4d965
--- /dev/null
+++ b/keyboards/a_dux/keymaps/daliusd/oneshot.c
@@ -0,0 +1,195 @@
1/* Copyright 2021 @daliusd
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#include "print.h"
17#include "oneshot.h"
18
19void update_oneshot(
20 oneshot_state *state,
21 uint16_t mod,
22 uint16_t trigger,
23 uint16_t keycode,
24 keyrecord_t *record
25) {
26 if (keycode == trigger) {
27 if (record->event.pressed) {
28 // Trigger keydown
29 if (*state == os_up_unqueued) {
30 register_code(mod);
31 }
32 *state = os_down_unused;
33 dprintf("trigger down (on?), mod: %d, ? -> os_down_unused\n", mod);
34 } else {
35 // Trigger keyup
36 switch (*state) {
37 case os_down_unused:
38 // If we didn't use the mod while trigger was held, queue it.
39 *state = os_up_queued;
40 dprintf("trigger up, mod: %d, os_down_unused -> os_up_queued\n", mod);
41 break;
42 case os_down_used:
43 // If we did use the mod while trigger was held, unregister it.
44 *state = os_up_unqueued;
45 unregister_code(mod);
46 dprintf("trigger up (off), mod: %d, os_down_used -> os_up_unqueued\n", mod);
47 break;
48 default:
49 break;
50 }
51 }
52 } else {
53 if (record->event.pressed) {
54 if (is_oneshot_cancel_key(keycode) && *state != os_up_unqueued) {
55 // Cancel oneshot on designated cancel keydown.
56 *state = os_up_unqueued;
57 unregister_code(mod);
58 dprintf("cancel (off), mod: %d, ? -> os_up_unqueued\n", mod);
59 }
60 if (!is_oneshot_ignored_key(keycode)) {
61 switch (*state) {
62 case os_up_queued:
63 *state = os_up_queued_used;
64 dprintf("key up (off), mod: %d, os_up_queued -> os_up_queued_used\n", mod);
65 break;
66 case os_up_queued_used:
67 *state = os_up_unqueued;
68 unregister_code(mod);
69 dprintf("key up (off), mod: %d, os_up_queued_used -> os_up_unqueued\n", mod);
70 break;
71 default:
72 break;
73 }
74 }
75 } else {
76 if (!is_oneshot_ignored_key(keycode)) {
77 // On non-ignored keyup, consider the oneshot used.
78 switch (*state) {
79 case os_down_unused:
80 *state = os_down_used;
81 dprintf("key up, mod: %d, os_down_unused -> os_down_used\n", mod);
82 break;
83 case os_up_queued:
84 *state = os_up_unqueued;
85 unregister_code(mod);
86 dprintf("key up (off), mod: %d, os_up_queued -> os_up_unqueued\n", mod);
87 break;
88 case os_up_queued_used:
89 *state = os_up_unqueued;
90 unregister_code(mod);
91 dprintf("key up (off), mod: %d, os_up_queued_used -> os_up_unqueued\n", mod);
92 break;
93 default:
94 break;
95 }
96 }
97 }
98 }
99}
100
101bool update_oneshot_layer(
102 oneshot_state *state,
103 uint16_t layer,
104 uint16_t trigger,
105 uint16_t keycode,
106 keyrecord_t *record
107) {
108 if (keycode == trigger) {
109 if (record->event.pressed) {
110 // Trigger keydown
111 if (*state == os_up_unqueued) {
112 layer_on(layer);
113 }
114 *state = os_down_unused;
115 dprintf("trigger down (on?), layer: %d, ? -> os_down_unused\n", layer);
116 return false;
117 } else {
118 // Trigger keyup
119 switch (*state) {
120 case os_down_unused:
121 // If we didn't use the layer while trigger was held, queue it.
122 *state = os_up_queued;
123 dprintf("trigger up, layer: %d, os_down_unused -> os_up_queued\n", layer);
124 return false;
125 case os_down_used:
126 // If we did use the layer while trigger was held, turn off it.
127 *state = os_up_unqueued;
128 layer_off(layer);
129 dprintf("trigger up (off), layer: %d, os_down_used -> os_up_unqueued\n", layer);
130 return false;
131 default:
132 break;
133 }
134 }
135 } else {
136 if (record->event.pressed) {
137 if (is_oneshot_layer_cancel_key(keycode) && *state != os_up_unqueued) {
138 // Cancel oneshot layer on designated cancel keydown.
139 *state = os_up_unqueued;
140 layer_off(layer);
141 dprintf("cancel (off), layer: %d, ? -> os_up_unqueued\n", layer);
142 return false;
143 }
144 uint8_t key_layer = read_source_layers_cache(record->event.key);
145 if (key_layer == layer) {
146 // On non-ignored keyup, consider the oneshot used.
147 switch (*state) {
148 case os_down_unused:
149 *state = os_down_used;
150 dprintf("key down, layer: %d, os_down_unused -> os_down_used\n", layer);
151 return true;
152 case os_up_queued:
153 if (is_oneshot_mod_key(keycode)) {
154 *state = os_up_unqueued;
155 layer_off(layer);
156 dprintf("key down, layer: %d, os_up_queued -> os_up_unqueued\n", layer);
157 return false;
158 } else {
159 *state = os_up_queued_used;
160 dprintf("key down, layer: %d, os_up_queued -> os_up_queued_used\n", layer);
161 }
162 return true;
163 case os_up_queued_used:
164 *state = os_up_unqueued;
165 layer_off(layer);
166 dprintf("key down (off), layer: %d, os_up_queued_used -> os_up_unqueued\n", layer);
167 return false;
168 default:
169 break;
170 }
171 }
172 } else {
173 // Ignore key ups from other layers
174 uint8_t key_layer = read_source_layers_cache(record->event.key);
175 if (key_layer == layer) {
176 // On non-ignored keyup, consider the oneshot used.
177 switch (*state) {
178 case os_up_queued:
179 *state = os_up_unqueued;
180 layer_off(layer);
181 dprintf("key up (off), layer: %d, os_up_queued -> os_up_unqueued\n", layer);
182 return true;
183 case os_up_queued_used:
184 *state = os_up_unqueued;
185 layer_off(layer);
186 dprintf("key up (off), layer: %d, os_up_queued_used -> os_up_unqueued\n", layer);
187 return true;
188 default:
189 break;
190 }
191 }
192 }
193 }
194 return true;
195}
diff --git a/keyboards/a_dux/keymaps/daliusd/oneshot.h b/keyboards/a_dux/keymaps/daliusd/oneshot.h
new file mode 100644
index 000000000..a4ea71b8a
--- /dev/null
+++ b/keyboards/a_dux/keymaps/daliusd/oneshot.h
@@ -0,0 +1,65 @@
1/* Copyright 2021 @daliusd
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#pragma once
17
18#include QMK_KEYBOARD_H
19
20// Represents the four states a oneshot key can be in
21typedef enum {
22 os_up_unqueued,
23 os_up_queued,
24 os_up_queued_used,
25 os_down_unused,
26 os_down_used,
27} oneshot_state;
28
29// Custom oneshot mod implementation that doesn't rely on timers. If a mod is
30// used while it is held it will be unregistered on keyup as normal, otherwise
31// it will be queued and only released after the next non-mod keyup.
32void update_oneshot(
33 oneshot_state *state,
34 uint16_t mod,
35 uint16_t trigger,
36 uint16_t keycode,
37 keyrecord_t *record
38);
39
40// Oneshot implementation for layers
41bool update_oneshot_layer(
42 oneshot_state *state,
43 uint16_t layer,
44 uint16_t trigger,
45 uint16_t keycode,
46 keyrecord_t *record
47);
48
49// To be implemented by the consumer. Layers one shot implementation needs to
50// know which keys are used as oneshot mods
51bool is_oneshot_mod_key(
52 uint16_t keycode
53);
54
55// To be implemented by the consumer. Defines keys to cancel oneshot mods.
56bool is_oneshot_cancel_key(uint16_t keycode);
57
58// To be implemented by the consumer. Defines keys to cancel oneshot layers.
59bool is_oneshot_layer_cancel_key(uint16_t keycode);
60
61// To be implemented by the consumer. Defines keys to ignore when determining
62// whether a oneshot mod has been used. Setting this to modifiers and layer
63// change keys allows stacking multiple oneshot modifiers, and carrying them
64// between layers.
65bool is_oneshot_ignored_key(uint16_t keycode);
diff --git a/keyboards/a_dux/keymaps/daliusd/readme.md b/keyboards/a_dux/keymaps/daliusd/readme.md
new file mode 100644
index 000000000..f6e0efd0e
--- /dev/null
+++ b/keyboards/a_dux/keymaps/daliusd/readme.md
@@ -0,0 +1,21 @@
1# My 34 keys layout
2
3This are my principles for layout:
4
5* I am using Callum style layout. Here you can read explanation by
6 Callum himself and his reasoning for not using mod-tap:
7 [here](../../../../users/callum/readme.md)
8
9* There should be only one way to type key. Key can be on
10 different layer but it must maintain its physical location.
11
12* The less features are used the better.
13
14* trilayer is cool.
15
16* There is 🐍 key for no reason.
17
18As well I have added one shot layers compatible with Callum's one
19shot keys.
20
21There is simple TMUX layer as well.
diff --git a/keyboards/a_dux/keymaps/daliusd/rules.mk b/keyboards/a_dux/keymaps/daliusd/rules.mk
new file mode 100644
index 000000000..0f203f004
--- /dev/null
+++ b/keyboards/a_dux/keymaps/daliusd/rules.mk
@@ -0,0 +1,5 @@
1UNICODE_ENABLE = no
2UNICODEMAP_ENABLE = yes
3#CONSOLE_ENABLE = yes
4
5SRC += oneshot.c
diff --git a/keyboards/a_dux/keymaps/default/keymap.c b/keyboards/a_dux/keymaps/default/keymap.c
new file mode 100644
index 000000000..560c5654e
--- /dev/null
+++ b/keyboards/a_dux/keymaps/default/keymap.c
@@ -0,0 +1,40 @@
1// Copyright 2022 @filterpaper
2// SPDX-License-Identifier: GPL-2.0+
3
4#include QMK_KEYBOARD_H
5
6// Seniply layout
7// https://stevep99.github.io/seniply
8
9const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
10 [0] = LAYOUT(
11 KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
12 KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,
13 KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,
14 LT(3,KC_TAB), KC_LSFT, KC_SPC, LT(1,KC_ENT)
15 ),
16 [1] = LAYOUT(
17 KC_EXLM, KC_AT, KC_SCLN, KC_COLN, KC_UNDS, KC_EQL, KC_7, KC_8, KC_9, KC_PLUS,
18 KC_BSLS, KC_PIPE, KC_LCBR, KC_LPRN, KC_LBRC, KC_ASTR, KC_4, KC_5, KC_6, KC_MINS,
19 KC_NO, KC_NO, KC_RCBR, KC_RPRN, KC_RBRC, KC_0, KC_1, KC_2, KC_3, KC_SLSH,
20 _______, MO(2), _______, _______
21 ),
22 [2] = LAYOUT(
23 RALT(KC_1), RALT(KC_2), RALT(KC_3), RALT(KC_4), KC_BRIU, KC_NO, KC_AMPR, KC_GRV, KC_TILD, KC_NO,
24 KC_MUTE, KC_VOLD, KC_MPLY, KC_VOLU, KC_BRID, KC_NO, KC_DLR, KC_PERC, KC_CIRC, KC_UNDS,
25 KC_EJCT, KC_MPRV, KC_MSTP, KC_MNXT, KC_NO, KC_NO, KC_EXLM, KC_AT, KC_HASH, KC_NO,
26 _______, _______, _______, _______
27 ),
28 [3] = LAYOUT(
29 KC_ESC, LALT(KC_LEFT), LCTL(KC_F), LALT(KC_RGHT), KC_INS, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_CAPS,
30 OSM(MOD_LALT), OSM(MOD_LGUI), OSM(MOD_LSFT), OSM(MOD_LCTL), OSM(MOD_RALT), KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL,
31 LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), KC_TAB, LCTL(KC_V), KC_ENT, KC_BSPC, KC_RCTL, KC_LALT, KC_APP,
32 _______, _______, _______, MO(4)
33 ),
34 [4] = LAYOUT(
35 KC_NO, KC_NO, RCS(KC_F), KC_PSCR, KC_NO, KC_F12, KC_F7, KC_F8, KC_F9, KC_NO,
36 OSM(MOD_LALT), OSM(MOD_LGUI), OSM(MOD_LSFT), OSM(MOD_LCTL), OSM(MOD_RALT), KC_F11, KC_F4, KC_F5, KC_F6, KC_NO,
37 RCS(KC_Z), RCS(KC_X), RCS(KC_C), LSFT(KC_TAB), RCS(KC_V), KC_F10, KC_F1, KC_F2, KC_F3, KC_NO,
38 _______, _______, _______, _______
39 )
40};
diff --git a/keyboards/a_dux/keymaps/jcmkk3/keymap.c b/keyboards/a_dux/keymaps/jcmkk3/keymap.c
new file mode 100644
index 000000000..608e0c522
--- /dev/null
+++ b/keyboards/a_dux/keymaps/jcmkk3/keymap.c
@@ -0,0 +1,130 @@
1/* Copyright 2021 @jcmkk3
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#include QMK_KEYBOARD_H
17
18#include "oneshot.h"
19
20#define LA_UPP OSL(UPP)
21#define LA_SYM OSL(SYM)
22#define LA_NAV MO(NAV)
23
24enum layers {
25 DEF,
26 UPP,
27 SYM,
28 NAV,
29 NUM,
30};
31
32enum keycodes {
33 // Custom oneshot mod implementation with no timers.
34 OS_SHFT = SAFE_RANGE,
35 OS_CTRL,
36 OS_ALT,
37 OS_GUI,
38};
39
40const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
41 [DEF] = LAYOUT(
42 KC_Y, KC_C, KC_L, KC_M, KC_K, KC_Z, KC_F, KC_U, KC_QUOT, KC_DQUO,
43 KC_I, KC_S, KC_R, KC_T, KC_G, KC_P, KC_N, KC_E, KC_A, KC_O,
44 KC_Q, KC_V, KC_W, KC_D, KC_J, KC_B, KC_H, KC_COMM, KC_DOT, KC_X,
45 LA_NAV, KC_SPC, LA_UPP, LA_SYM
46 ),
47
48 [UPP] = LAYOUT(
49 S(KC_Y), S(KC_C), S(KC_L), S(KC_M), S(KC_K), S(KC_Z), S(KC_F), S(KC_U), KC_EXLM, KC_QUES,
50 S(KC_I), S(KC_S), S(KC_R), S(KC_T), S(KC_G), S(KC_P), S(KC_N), S(KC_E), S(KC_A), S(KC_O),
51 S(KC_Q), S(KC_V), S(KC_W), S(KC_D), S(KC_J), S(KC_B), S(KC_H), KC_SCLN, KC_COLN, S(KC_X),
52 _______, _______, _______, _______
53 ),
54
55 [SYM] = LAYOUT(
56 KC_LABK, KC_LCBR, KC_LBRC, KC_LPRN, KC_CIRC, KC_DLR, KC_RPRN, KC_RBRC, KC_RCBR, KC_RABK,
57 KC_HASH, KC_UNDS, KC_EQL, KC_MINS, KC_PLUS, KC_AMPR, OS_CTRL, OS_SHFT, OS_ALT, OS_GUI,
58 KC_PERC, KC_GRV, KC_TILD, KC_SLSH, KC_ASTR, KC_PIPE, KC_BSLS, KC_SCLN, KC_COLN, KC_AT,
59 _______, _______, _______, _______
60 ),
61
62 [NAV] = LAYOUT(
63 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_TAB, KC_UP, KC_ENT, KC_DEL,
64 OS_GUI, OS_ALT, OS_SHFT, OS_CTRL, XXXXXXX, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END,
65 C(KC_Z), C(KC_X), C(KC_C), C(KC_V), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
66 _______, _______, KC_BSPC, _______
67 ),
68
69 [NUM] = LAYOUT(
70 KC_7, KC_5, KC_3, KC_1, KC_9, KC_8, KC_0, KC_2, KC_4, KC_6,
71 OS_GUI, OS_ALT, OS_SHFT, OS_CTRL, XXXXXXX, XXXXXXX, OS_CTRL, OS_SHFT, OS_ALT, OS_GUI,
72 XXXXXXX, XXXXXXX, XXXXXXX, KC_MINS, XXXXXXX, XXXXXXX, XXXXXXX, KC_COMM, KC_DOT, KC_SLSH,
73 _______, _______, KC_BSPC, _______
74 ),
75};
76
77bool is_oneshot_cancel_key(uint16_t keycode) {
78 switch (keycode) {
79 case LA_SYM:
80 case LA_NAV:
81 return true;
82 default:
83 return false;
84 }
85}
86
87bool is_oneshot_ignored_key(uint16_t keycode) {
88 switch (keycode) {
89 case LA_SYM:
90 case LA_NAV:
91 case KC_LSFT:
92 case OS_SHFT:
93 case OS_CTRL:
94 case OS_ALT:
95 case OS_GUI:
96 return true;
97 default:
98 return false;
99 }
100}
101
102oneshot_state os_shft_state = os_up_unqueued;
103oneshot_state os_ctrl_state = os_up_unqueued;
104oneshot_state os_alt_state = os_up_unqueued;
105oneshot_state os_gui_state = os_up_unqueued;
106
107bool process_record_user(uint16_t keycode, keyrecord_t *record) {
108 update_oneshot(
109 &os_shft_state, KC_LSFT, OS_SHFT,
110 keycode, record
111 );
112 update_oneshot(
113 &os_ctrl_state, KC_LCTL, OS_CTRL,
114 keycode, record
115 );
116 update_oneshot(
117 &os_alt_state, KC_LALT, OS_ALT,
118 keycode, record
119 );
120 update_oneshot(
121 &os_gui_state, KC_LGUI, OS_GUI,
122 keycode, record
123 );
124
125 return true;
126}
127
128layer_state_t layer_state_set_user(layer_state_t state) {
129 return update_tri_layer_state(state, SYM, NAV, NUM);
130}
diff --git a/keyboards/a_dux/keymaps/jcmkk3/oneshot.c b/keyboards/a_dux/keymaps/jcmkk3/oneshot.c
new file mode 100644
index 000000000..e84b5a7b1
--- /dev/null
+++ b/keyboards/a_dux/keymaps/jcmkk3/oneshot.c
@@ -0,0 +1,72 @@
1/* Copyright 2021 @jcmkk3
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#include "oneshot.h"
17
18void update_oneshot(
19 oneshot_state *state,
20 uint16_t mod,
21 uint16_t trigger,
22 uint16_t keycode,
23 keyrecord_t *record
24) {
25 if (keycode == trigger) {
26 if (record->event.pressed) {
27 // Trigger keydown
28 if (*state == os_up_unqueued) {
29 register_code(mod);
30 }
31 *state = os_down_unused;
32 } else {
33 // Trigger keyup
34 switch (*state) {
35 case os_down_unused:
36 // If we didn't use the mod while trigger was held, queue it.
37 *state = os_up_queued;
38 break;
39 case os_down_used:
40 // If we did use the mod while trigger was held, unregister it.
41 *state = os_up_unqueued;
42 unregister_code(mod);
43 break;
44 default:
45 break;
46 }
47 }
48 } else {
49 if (record->event.pressed) {
50 if (is_oneshot_cancel_key(keycode) && *state != os_up_unqueued) {
51 // Cancel oneshot on designated cancel keydown.
52 *state = os_up_unqueued;
53 unregister_code(mod);
54 }
55 } else {
56 if (!is_oneshot_ignored_key(keycode)) {
57 // On non-ignored keyup, consider the oneshot used.
58 switch (*state) {
59 case os_down_unused:
60 *state = os_down_used;
61 break;
62 case os_up_queued:
63 *state = os_up_unqueued;
64 unregister_code(mod);
65 break;
66 default:
67 break;
68 }
69 }
70 }
71 }
72}
diff --git a/keyboards/a_dux/keymaps/jcmkk3/oneshot.h b/keyboards/a_dux/keymaps/jcmkk3/oneshot.h
new file mode 100644
index 000000000..b88e68d1d
--- /dev/null
+++ b/keyboards/a_dux/keymaps/jcmkk3/oneshot.h
@@ -0,0 +1,46 @@
1/* Copyright 2021 @jcmkk3
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#pragma once
17
18#include QMK_KEYBOARD_H
19
20// Represents the four states a oneshot key can be in
21typedef enum {
22 os_up_unqueued,
23 os_up_queued,
24 os_down_unused,
25 os_down_used,
26} oneshot_state;
27
28// Custom oneshot mod implementation that doesn't rely on timers. If a mod is
29// used while it is held it will be unregistered on keyup as normal, otherwise
30// it will be queued and only released after the next non-mod keyup.
31void update_oneshot(
32 oneshot_state *state,
33 uint16_t mod,
34 uint16_t trigger,
35 uint16_t keycode,
36 keyrecord_t *record
37);
38
39// To be implemented by the consumer. Defines keys to cancel oneshot mods.
40bool is_oneshot_cancel_key(uint16_t keycode);
41
42// To be implemented by the consumer. Defines keys to ignore when determining
43// whether a oneshot mod has been used. Setting this to modifiers and layer
44// change keys allows stacking multiple oneshot modifiers, and carrying them
45// between layers.
46bool is_oneshot_ignored_key(uint16_t keycode);
diff --git a/keyboards/a_dux/keymaps/jcmkk3/rules.mk b/keyboards/a_dux/keymaps/jcmkk3/rules.mk
new file mode 100644
index 000000000..b7dcd87b1
--- /dev/null
+++ b/keyboards/a_dux/keymaps/jcmkk3/rules.mk
@@ -0,0 +1 @@
SRC += oneshot.c
diff --git a/keyboards/a_dux/readme.md b/keyboards/a_dux/readme.md
new file mode 100644
index 000000000..f709542b3
--- /dev/null
+++ b/keyboards/a_dux/readme.md
@@ -0,0 +1,45 @@
1# Architeuthis Dux
2
3![Architeuthis Dux](https://raw.githubusercontent.com/tapioki/cephalopoda/main/Images/architeuthis_dux.png)
4
5AKA A. dux, A.D., "Giant squid"
6
734 keys, same stagger as [D. gigas](https://github.com/tapioki/cephalopoda/tree/main/Dosidicus%20gigas), but with two thumb keys included. Pinky, ring, index, and inner columns splayed at 15, 5, 0, -5, -5 degrees. SplitKB Tenting Puck support. All PCB files are available on the [project's github page](https://github.com/tapioki/cephalopoda/tree/main/Architeuthis%20dux)
8
9Thank you [Perce](https://madebyperce.com/) for the logo.
10
11## Case Options
12
13* [Flat Case](https://github.com/madebyperce/aduxcase)
14* [Tented Case](https://github.com/jdart/adux-tent)
15* [Case with Plates](https://github.com/sadekbaroudi/cephalopoda/tree/main/Architeuthis%20dux/case)
16
17## Keyboard Info
18
19* Keyboard Maintainer: [@tapioki](https://github.com/tapioki)
20* Hardware Supported: Architeuthis Dux
21* Hardware Availability: Order PCBs with gerber files from the [repository](https://github.com/tapioki/cephalopoda/tree/main/Architeuthis%20dux)
22
23Make example for this keyboard (after setting up your build environment):
24
25 make a_dux:default
26
27See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
28
29## Setting Handedness
30
31Firmware uses [handedness by EEPROM](https://docs.qmk.fm/#/feature_split_keyboard?id=handedness-by-eeprom) as default and it must be *configured once* on each side. The make commands are:
32
33 make a_dux:default:dfu-split-left
34 make a_dux:default:dfu-split-right
35
36[QMK Toolbox](http://qmk.fm/toolbox) can also be used to set EEPROM handedness. Place the controller in bootloader mode and select menu option Tools -> EEPROM -> Set Left/Right Hand
37
38## Bootloader
39
40Enter the bootloader in 3 ways:
41
42* **Bootmagic reset**: Hold down the top left key on the left half (or the top right right key on the right half) and plug in the controller on that side.
43* **Physical reset pins**: Briefly short the RST and GND pins on the microcontroller using tweezers, a paperclip, or any other conductive material.
44* **Keycode in layout**: Press the key mapped to `RESET` if it is configured.
45
diff --git a/keyboards/a_dux/rules.mk b/keyboards/a_dux/rules.mk
new file mode 100644
index 000000000..95847adba
--- /dev/null
+++ b/keyboards/a_dux/rules.mk
@@ -0,0 +1,20 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = atmel-dfu
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
11MOUSEKEY_ENABLE = yes # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = no # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15NKRO_ENABLE = yes # Enable N-Key Rollover
16BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
17RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
18AUDIO_ENABLE = no # Audio output
19UNICODE_ENABLE = yes
20SPLIT_KEYBOARD = yes