aboutsummaryrefslogtreecommitdiff
path: root/keyboards/keyboardio
diff options
context:
space:
mode:
authorAntoine R. Dumont <ardumont@users.noreply.github.com>2021-04-19 00:14:23 +0200
committerGitHub <noreply@github.com>2021-04-18 18:14:23 -0400
commitfd6545167962c0761e7797e786bc7ce8e0481f02 (patch)
treef4cb94c009fe9c09f2d81c33b0941cdf235367bc /keyboards/keyboardio
parentd0973e1cfb9f0a2643a30128ba119e76c6fe2f3c (diff)
downloadqmk_firmware-fd6545167962c0761e7797e786bc7ce8e0481f02.tar.gz
qmk_firmware-fd6545167962c0761e7797e786bc7ce8e0481f02.zip
keyboardio/atreus: Add ardumont keymap (#12479)
Diffstat (limited to 'keyboards/keyboardio')
-rw-r--r--keyboards/keyboardio/atreus/keymaps/ardumont/keymap.c132
-rw-r--r--keyboards/keyboardio/atreus/keymaps/ardumont/readme.md23
2 files changed, 155 insertions, 0 deletions
diff --git a/keyboards/keyboardio/atreus/keymaps/ardumont/keymap.c b/keyboards/keyboardio/atreus/keymaps/ardumont/keymap.c
new file mode 100644
index 000000000..3bde667ee
--- /dev/null
+++ b/keyboards/keyboardio/atreus/keymaps/ardumont/keymap.c
@@ -0,0 +1,132 @@
1// Copyright (C) 2019, 2020 Keyboard.io, Inc
2// 2021 Antoine R. Dumont (@ardumont) <antoine.romain.dumont@gmail.com>
3//
4// this is the style you want to emulate.
5// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
6
7#include QMK_KEYBOARD_H
8
9// Each layer gets a name for readability, which is then used in the keymap matrix below.
10// The underscores don't mean anything - you can have a layer called STUFF or any other name.
11// Layer names don't all need to be of the same length, obviously, and you can also skip them
12// entirely and just use numbers.
13enum layer_names {
14 _QW,
15 _RS,
16 _LW,
17};
18
19// tap: z // hold: SHIFT
20#define Z_SFT SFT_T(KC_Z)
21// tap: / // hold: SHIFT
22#define SLSH_SFT SFT_T(KC_SLSH)
23
24// tap: ` // hold: SHIFT
25#define GRAVE_SFT SFT_T(KC_GRAVE)
26// tap: [ // hold: SHIFT
27#define RBRC_SFT SFT_T(KC_RBRC)
28
29// Layer movment
30#define FN0 MO(_RS) // move to layer 1 (L1)
31#define FN1 TG(_LW) // move to layer 2 (L2)
32#define FN2 TO(_QW) // move to layer 0 (L0)
33
34 /*
35 * q w e r t || y u i/tab o p
36 * a s d f g || h j k l ;
37 * z/sft x c v b ` || \ n m , . //sft
38 * ctl esc super alt L1 spc || spc L1 alt - ' ctl
39 */
40
41const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
42 [_QW] = LAYOUT( /* Qwerty */
43 KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P ,
44 KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN ,
45 Z_SFT, KC_X, KC_C, KC_V, KC_B, KC_GRAVE, KC_BSLS, KC_N, KC_M, KC_COMM, KC_DOT, SLSH_SFT,
46 KC_LCTRL, KC_ESC, KC_LGUI, KC_LALT, KC_SPC, FN0, FN0, KC_SPC, KC_LALT, KC_MINS, KC_QUOT, KC_LCTRL
47 ),
48
49 /*
50 * 1 2 3 4 5 || 6 7 8 9 0
51 * ! @ # $ % || ^ & * ( )
52 * `/sft ~ ? ? ? ~ || | + - / [ ]/sft
53 * ctl esc super alt spc L2 || L2 spc alt = esc ctl
54 */
55 [_RS] = LAYOUT( /* [> RAISE <] */
56 KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0 ,
57 KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN ,
58 GRAVE_SFT, KC_TILD, KC_NO, KC_NO, KC_NO, _______, _______, KC_PLUS, KC_MINS, KC_SLSH, KC_LBRC, RBRC_SFT,
59 _______, _______, _______, _______, _______, FN1, FN1, _______, _______, KC_EQL, _______, _______
60 ),
61
62 /*
63 * F1 F2 F3 F4 F5 || F6 F7 F8 F9 F10
64 * __ __ __ __ F11 || F12 __ __ __ __
65 * __ __ __ dbg rst eep-rst || __ __ __ __ __ __
66 * ctl esc super alt __ L0 || L0 __ alt __ esc ctl
67 */
68 [_LW] = LAYOUT( /* [> LOWER <] */
69 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10,
70 KC_NO, KC_NO, KC_NO, KC_NO, KC_F11, KC_F12, KC_NO, KC_NO, KC_NO, KC_NO ,
71 KC_NO, KC_NO, KC_NO, DEBUG, RESET, EEP_RST, _______, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO ,
72 _______, _______, _______, _______, _______, FN2, FN2, _______, _______, KC_NO, KC_ESC, _______
73 )
74};
75
76// Initialize variable holding the binary
77// representation of active modifiers.
78uint8_t mod_state;
79
80bool substitute_keycode(uint16_t keycode, keyrecord_t *record, uint8_t mod_state, uint16_t substitute_keycode) {
81 /* Substitute keycode if condition matches */
82 // Initialize a boolean variable that keeps track
83 // of the delete key status: registered or not?
84 static bool key_registered;
85 // ctrl activated?
86 if ((mod_state & MOD_BIT(KC_LCTRL)) == MOD_BIT(KC_LCTRL)) {
87 if (record->event.pressed) {
88 // No need to register KC_LCTRL because it's already active.
89 unregister_code(KC_LCTRL);
90 // Send substitute code
91 register_code(substitute_keycode);
92 // Update the boolean variable to reflect the status of the register
93 key_registered = true;
94 // Reapplying modifier state so that the held shift key(s)
95 // still work even after having tapped the Backspace/Delete key.
96 set_mods(mod_state);
97 // Do not let QMK process the keycode further
98 return false;
99 } else {
100 // In case substitude_keycode is still being sent even after the release of
101 // the key
102 if (key_registered) {
103 unregister_code(substitute_keycode);
104 key_registered = false;
105 // Do not let QMK process the keycode further
106 return false;
107 }
108 }
109 }
110 // Else, let QMK process the keycode as usual
111 return true;
112}
113
114bool process_record_user(uint16_t keycode, keyrecord_t *record) {
115 // Store the current modifier state in the variable for later reference
116 mod_state = get_mods();
117 switch (keycode) {
118 case KC_I:
119 return substitute_keycode(keycode, record, mod_state, KC_TAB);
120 case KC_M:
121 return substitute_keycode(keycode, record, mod_state, KC_ENTER);
122 case KC_H:
123 return substitute_keycode(keycode, record, mod_state, KC_BSPC);
124 case KC_D:
125 return substitute_keycode(keycode, record, mod_state, KC_DEL);
126 case KC_N:
127 return substitute_keycode(keycode, record, mod_state, KC_DOWN);
128 case KC_P:
129 return substitute_keycode(keycode, record, mod_state, KC_UP);
130 }
131 return true;
132};
diff --git a/keyboards/keyboardio/atreus/keymaps/ardumont/readme.md b/keyboards/keyboardio/atreus/keymaps/ardumont/readme.md
new file mode 100644
index 000000000..d2532d7e9
--- /dev/null
+++ b/keyboards/keyboardio/atreus/keymaps/ardumont/readme.md
@@ -0,0 +1,23 @@
1![ardumont layout](https://i.imgur.com/tuk64AI.png)
2
3# ardumont layout
4
5This is a qwerty layout for the keyboardio/atreus. For the most part, it's a
6straightforward layout. Only the modifiers key are not organized like the default
7layout. Those modifier keys are mostly symmetrically configured.
8
9The idea is that when using a modifier key, some users may expect to use both side of
10the keyboard symmetrically (as in emacs, qutebrowser, terminal/tmux).
11
12Exceptions to the rules are the `Escape` and the `Super` which only exists on the left
13Side of the keyboard. Those are mostly unused.
14
15Note that some keys are not present in the keyboard (e.g `Tab`, `Enter`, ...) since they
16are available from the legacy terminal bindings:
17
18- Ctrl-i: Tab
19- Ctrl-m: Enter
20- Ctrl-h: Backspace
21- Ctrl-d: Del
22- Ctrl-n: Down
23- Ctrl-p: Up