summaryrefslogtreecommitdiffstats
path: root/keyboards
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards')
-rw-r--r--keyboards/a_dux/keymaps/daliusd/config.h5
-rw-r--r--keyboards/a_dux/keymaps/daliusd/flow.c336
-rw-r--r--keyboards/a_dux/keymaps/daliusd/flow.h27
-rw-r--r--keyboards/a_dux/keymaps/daliusd/keymap.c219
-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.md299
-rw-r--r--keyboards/a_dux/keymaps/daliusd/rules.mk2
-rw-r--r--keyboards/aurora65/info.json74
-rw-r--r--keyboards/bpiphany/ghost_squid/ghost_squid.h69
-rw-r--r--keyboards/bpiphany/ghost_squid/info.json123
-rw-r--r--keyboards/bpiphany/ghost_squid/keymaps/default/keymap.c57
-rw-r--r--keyboards/bpiphany/ghost_squid/keymaps/default/readme.md34
-rw-r--r--keyboards/cannonkeys/ellipse/config.h20
-rw-r--r--keyboards/cannonkeys/ellipse/halconf.h27
-rw-r--r--keyboards/cannonkeys/ellipse/info.json108
-rw-r--r--keyboards/cannonkeys/ellipse/keymaps/default/keymap.c45
-rw-r--r--keyboards/cannonkeys/ellipse/keymaps/via/keymap.c45
-rw-r--r--keyboards/cannonkeys/ellipse/keymaps/via/rules.mk1
-rw-r--r--keyboards/cannonkeys/ellipse/mcuconf.h28
-rw-r--r--keyboards/cannonkeys/ellipse/readme.md25
-rw-r--r--keyboards/cannonkeys/ellipse/rules.mk2
-rw-r--r--keyboards/cannonkeys/ellipse_hs/info.json94
-rw-r--r--keyboards/cannonkeys/ellipse_hs/keymaps/default/keymap.c45
-rw-r--r--keyboards/cannonkeys/ellipse_hs/keymaps/via/keymap.c45
-rw-r--r--keyboards/cannonkeys/ellipse_hs/keymaps/via/rules.mk1
-rw-r--r--keyboards/cannonkeys/ellipse_hs/readme.md25
-rw-r--r--keyboards/cannonkeys/ellipse_hs/rules.mk2
-rw-r--r--keyboards/controllerworks/mini36/config.h64
-rw-r--r--keyboards/controllerworks/mini36/halconf.h22
-rw-r--r--keyboards/controllerworks/mini36/info.json154
-rw-r--r--keyboards/controllerworks/mini36/keymaps/default/config.h79
-rw-r--r--keyboards/controllerworks/mini36/keymaps/default/keymap.c68
-rw-r--r--keyboards/controllerworks/mini36/keymaps/via/config.h79
-rw-r--r--keyboards/controllerworks/mini36/keymaps/via/keymap.c68
-rw-r--r--keyboards/controllerworks/mini36/keymaps/via/rules.mk1
-rw-r--r--keyboards/controllerworks/mini36/mcuconf.h23
-rw-r--r--keyboards/controllerworks/mini36/mini36.c82
-rw-r--r--keyboards/controllerworks/mini36/readme.md43
-rw-r--r--keyboards/controllerworks/mini36/rules.mk3
-rw-r--r--keyboards/han60/han60.h106
-rw-r--r--keyboards/han60/info.json658
-rw-r--r--keyboards/han60/keymaps/default/keymap.c27
-rw-r--r--keyboards/han60/keymaps/default_ansi_arrow_tsangan/keymap.c35
-rw-r--r--keyboards/han60/keymaps/default_ansi_tsangan/keymap.c35
-rw-r--r--keyboards/han60/keymaps/default_iso_arrow_tsangan/keymap.c35
-rw-r--r--keyboards/han60/keymaps/default_iso_tsangan/keymap.c35
-rw-r--r--keyboards/huytbt/h50/config.h42
-rw-r--r--keyboards/huytbt/h50/h50.c17
-rw-r--r--keyboards/huytbt/h50/h50.h35
-rw-r--r--keyboards/huytbt/h50/info.json72
-rw-r--r--keyboards/huytbt/h50/keymaps/default/keymap.c51
-rw-r--r--keyboards/huytbt/h50/keymaps/via/keymap.c51
-rw-r--r--keyboards/huytbt/h50/keymaps/via/rules.mk1
-rw-r--r--keyboards/huytbt/h50/readme.md27
-rw-r--r--keyboards/huytbt/h50/rules.mk16
-rw-r--r--keyboards/kprepublic/bm40hsrgb/keymaps/dan/config.h7
-rw-r--r--keyboards/kprepublic/bm40hsrgb/keymaps/dan/keymap.c89
-rw-r--r--keyboards/kprepublic/bm40hsrgb/keymaps/dan/readme.md25
-rw-r--r--keyboards/kprepublic/bm40hsrgb/keymaps/dan/rules.mk1
-rw-r--r--keyboards/macro3/info.json5
-rw-r--r--keyboards/macro3/keymaps/default/keymap.c4
-rw-r--r--keyboards/macro3/macro3.h2
-rw-r--r--keyboards/mechbrewery/mb65s/info.json312
-rw-r--r--keyboards/mechbrewery/mb65s/keymaps/ansi_blocker_7u_spc/keymap.c4
-rw-r--r--keyboards/mechbrewery/mb65s/keymaps/ansi_blocker_7u_spc/readme.md2
-rw-r--r--keyboards/mechbrewery/mb65s/keymaps/iso_blocker_tsangan/keymap.c6
-rw-r--r--keyboards/mechbrewery/mb65s/mb65s.h87
-rw-r--r--keyboards/mechbrewery/mb65s/rules.mk2
-rw-r--r--keyboards/mode/m65hi_alpha/info.json80
-rwxr-xr-xkeyboards/mode/m65hi_alpha/keymaps/default/keymap.c52
-rwxr-xr-xkeyboards/mode/m65hi_alpha/keymaps/via/keymap.c54
-rw-r--r--keyboards/mode/m65hi_alpha/m65hi_alpha.h34
-rw-r--r--keyboards/mwstudio/mw65_black/info.json82
-rw-r--r--keyboards/mwstudio/mw65_black/keymaps/default/keymap.c8
-rw-r--r--keyboards/mwstudio/mw65_black/keymaps/via/keymap.c8
-rw-r--r--keyboards/mwstudio/mw65_black/mw65_black.h43
-rw-r--r--keyboards/studiokestra/galatea/rev1/rev1.h2
-rw-r--r--keyboards/studiokestra/galatea/rev2/rev2.h2
79 files changed, 3895 insertions, 963 deletions
diff --git a/keyboards/a_dux/keymaps/daliusd/config.h b/keyboards/a_dux/keymaps/daliusd/config.h
index 42e88a687f..786451768a 100644
--- a/keyboards/a_dux/keymaps/daliusd/config.h
+++ b/keyboards/a_dux/keymaps/daliusd/config.h
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
-#define UNICODE_SELECTED_MODES UC_MAC, UC_LNX
+#define UNICODE_SELECTED_MODES UC_LNX
#define MOUSEKEY_INTERVAL 12
#define MOUSEKEY_MAX_SPEED 6
@@ -30,3 +30,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MOUSEKEY_WHEEL_INTERVAL 50
// The default is 40
#define MOUSEKEY_WHEEL_TIME_TO_MAX 100
+
+#define FLOW_COUNT 6
+#define FLOW_LAYERS_COUNT 5
diff --git a/keyboards/a_dux/keymaps/daliusd/flow.c b/keyboards/a_dux/keymaps/daliusd/flow.c
new file mode 100644
index 0000000000..6e4db873fe
--- /dev/null
+++ b/keyboards/a_dux/keymaps/daliusd/flow.c
@@ -0,0 +1,336 @@
+/* Copyright 2022 @daliusd
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#include "flow.h"
+
+extern const uint16_t flow_config[FLOW_COUNT][2];
+extern const uint16_t flow_layers_config[FLOW_LAYERS_COUNT][2];
+
+// Represents the states a flow key can be in
+typedef enum {
+ flow_up_unqueued,
+ flow_up_queued,
+ flow_up_queued_used,
+ flow_down_unused,
+ flow_down_used,
+} flow_state_t;
+
+#ifdef FLOW_ONESHOT_TERM
+const int g_flow_oneshot_term = FLOW_ONESHOT_TERM;
+#else
+const int g_flow_oneshot_term = 500;
+#endif
+
+#ifdef FLOW_ONESHOT_WAIT_TERM
+const int g_flow_oneshot_wait_term = FLOW_ONESHOT_WAIT_TERM;
+#else
+const int g_flow_oneshot_wait_term = 500;
+#endif
+
+flow_state_t flow_state[FLOW_COUNT] = { [0 ... FLOW_COUNT - 1] = flow_up_unqueued };
+bool flow_pressed[FLOW_COUNT][2] = { [0 ... FLOW_COUNT - 1] = {false, false} };
+uint16_t flow_timers[FLOW_COUNT] = { [0 ... FLOW_COUNT - 1] = 0 };
+bool flow_timeout_timers_active[FLOW_COUNT] = { [0 ... FLOW_COUNT - 1] = false };
+uint16_t flow_timeout_timers_value[FLOW_COUNT] = { [0 ... FLOW_COUNT - 1] = 0 };
+uint16_t flow_timeout_wait_timers_value[FLOW_COUNT] = { [0 ... FLOW_COUNT - 1] = 0 };
+
+flow_state_t flow_layers_state[FLOW_LAYERS_COUNT] = {
+ [0 ... FLOW_LAYERS_COUNT - 1] = flow_up_unqueued
+};
+bool flow_layer_timeout_timers_active[FLOW_LAYERS_COUNT] = { [0 ... FLOW_LAYERS_COUNT - 1] = false };
+uint16_t flow_layer_timeout_timers_value[FLOW_LAYERS_COUNT] = { [0 ... FLOW_LAYERS_COUNT - 1] = 0 };
+uint16_t flow_layer_timeout_wait_timers_value[FLOW_LAYERS_COUNT] = { [0 ... FLOW_LAYERS_COUNT - 1] = 0 };
+
+bool is_flow_ignored_key(uint16_t keycode) {
+ for (int i = 0; i < FLOW_COUNT; i++) {
+ if (flow_config[i][0] == keycode) {
+ return true;
+ }
+ }
+
+ for (int i = 0; i < FLOW_LAYERS_COUNT; i++) {
+ if (flow_layers_config[i][0] == keycode) {
+ return true;
+ }
+ }
+
+ if (keycode == KC_LSFT || keycode == KC_RSFT
+ || keycode == KC_LCTL || keycode == KC_RCTL
+ || keycode == KC_LALT || keycode == KC_RALT
+ || keycode == KC_LGUI || keycode == KC_RGUI) {
+ return true;
+ }
+
+ return false;
+}
+
+bool update_flow_mods(
+ uint16_t keycode,
+ bool pressed
+) {
+ bool pass = true;
+ bool flow_key_list_triggered[FLOW_COUNT] = { [0 ... FLOW_COUNT - 1] = false };
+ bool flow_key_list_pressed[FLOW_COUNT] = { [0 ... FLOW_COUNT - 1] = false };
+
+ bool flow_triggered = false;
+
+ for (uint8_t i = 0; i < FLOW_COUNT; i++) {
+ // Layer key
+ if (keycode == flow_config[i][0]) {
+ if (pressed) {
+ flow_pressed[i][0] = true;
+ } else {
+ flow_pressed[i][0] = false;
+ }
+ // KC mod key
+ } else if (keycode == flow_config[i][1]) {
+ if (pressed) {
+ if (flow_pressed[i][0]) {
+ flow_pressed[i][1] = true;
+ flow_key_list_triggered[i] = true;
+ flow_triggered = true;
+ flow_key_list_pressed[i] = true;
+ pass = false;
+ }
+ } else if (flow_pressed[i][1]) {
+ flow_pressed[i][1] = false;
+ if (flow_pressed[i][0]) {
+ flow_key_list_triggered[i] = true;
+ flow_triggered = true;
+ pass = false;
+ } else if ((flow_state[i] == flow_down_unused)
+ || (flow_state[i] == flow_down_used)) {
+ flow_key_list_triggered[i] = true;
+ flow_triggered = true;
+ pass = false;
+ }
+ }
+ }
+ }
+
+ for (uint8_t i = 0; i < FLOW_COUNT; i++) {
+ if (flow_key_list_triggered[i]) {
+ if (flow_key_list_pressed[i]) {
+ if (flow_state[i] == flow_up_unqueued) {
+ register_code(flow_config[i][1]);
+ }
+ flow_timeout_wait_timers_value[i] = timer_read();
+ flow_state[i] = flow_down_unused;
+ } else {
+ // Trigger keyup
+ switch (flow_state[i]) {
+ case flow_down_unused:
+ if (!flow_pressed[i][1]) {
+ if (timer_elapsed(flow_timeout_wait_timers_value[i]) > g_flow_oneshot_wait_term) {
+ flow_state[i] = flow_up_unqueued;
+ unregister_code(flow_config[i][1]);
+ } else {
+ // If we didn't use the mod while trigger was held, queue it.
+ flow_state[i] = flow_up_queued;
+ flow_timeout_timers_active[i] = true;
+ flow_timeout_timers_value[i] = timer_read();
+ }
+ }
+ break;
+ case flow_down_used:
+ // If we did use the mod while trigger was held, unregister it.
+ if (!flow_pressed[i][1]) {
+ flow_state[i] = flow_up_unqueued;
+ unregister_code(flow_config[i][1]);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ } else if (!flow_triggered) {
+ if (pressed) {
+ if (!is_flow_ignored_key(keycode)) {
+ switch (flow_state[i]) {
+ case flow_up_queued:
+ flow_state[i] = flow_up_queued_used;
+ flow_timeout_timers_active[i] = false;
+ break;
+ case flow_up_queued_used:
+ flow_state[i] = flow_up_unqueued;
+ unregister_code(flow_config[i][1]);
+ break;
+ default:
+ break;
+ }
+ }
+ } else {
+ if (!is_flow_ignored_key(keycode)) {
+ // On non-ignored keyup, consider the oneshot used.
+ switch (flow_state[i]) {
+ case flow_down_unused:
+ flow_state[i] = flow_down_used;
+ break;
+ case flow_up_queued:
+ flow_state[i] = flow_up_unqueued;
+ unregister_code(flow_config[i][1]);
+ break;
+ case flow_up_queued_used:
+ flow_state[i] = flow_up_unqueued;
+ unregister_code(flow_config[i][1]);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return pass;
+}
+
+void change_pressed_status(uint16_t keycode, bool pressed) {
+ for (int i = 0; i < FLOW_COUNT; i++) {
+ if (flow_config[i][0] == keycode) {
+ flow_pressed[i][0] = pressed;
+ }
+ }
+}
+
+bool update_flow_layers(
+ uint16_t keycode,
+ bool pressed,
+ keypos_t key_position
+) {
+ uint8_t key_layer = read_source_layers_cache(key_position);
+ bool pass = true;
+
+ for (int i = 0; i < FLOW_LAYERS_COUNT; i++) {
+ uint16_t trigger = flow_layers_config[i][0];
+ uint16_t layer = flow_layers_config[i][1];
+
+ if (keycode == trigger) {
+ if (pressed) {
+ // Trigger keydown
+ if (flow_layers_state[i] == flow_up_unqueued) {
+ layer_on(layer);
+ change_pressed_status(trigger, true);
+ }
+ flow_layer_timeout_wait_timers_value[i] = timer_read();
+ flow_layers_state[i] = flow_down_unused;
+ pass = false;
+ } else {
+ // Trigger keyup
+ switch (flow_layers_state[i]) {
+ case flow_down_unused:
+ if (timer_elapsed(flow_layer_timeout_wait_timers_value[i]) > g_flow_oneshot_wait_term) {
+ flow_layers_state[i] = flow_up_unqueued;
+ layer_off(layer);
+ change_pressed_status(trigger, false);
+ pass = false;
+ } else {
+ // If we didn't use the layer while trigger was held, queue it.
+ flow_layers_state[i] = flow_up_queued;
+ flow_layer_timeout_timers_active[i] = true;
+ flow_layer_timeout_timers_value[i] = timer_read();
+ pass = false;
+ change_pressed_status(trigger, true);
+ }
+ break;
+ case flow_down_used:
+ // If we did use the layer while trigger was held, turn off it.
+ flow_layers_state[i] = flow_up_unqueued;
+ layer_off(layer);
+ change_pressed_status(trigger, false);
+ pass = false;
+ break;
+ default:
+ break;
+ }
+ }
+ } else {
+ if (pressed) {
+ if (key_layer == layer) {
+ // On non-ignored keyup, consider the oneshot used.
+ switch (flow_layers_state[i]) {
+ case flow_down_unused:
+ flow_layers_state[i] = flow_down_used;
+ break;
+ case flow_up_queued:
+ flow_layers_state[i] = flow_up_queued_used;
+ flow_layer_timeout_timers_active[i] = false;
+ break;
+ case flow_up_queued_used:
+ flow_layers_state[i] = flow_up_unqueued;
+ layer_off(layer);
+ change_pressed_status(trigger, false);
+ pass = false;
+ break;
+ default:
+ break;
+ }
+ }
+ } else {
+ // Ignore key ups from other layers
+ if (key_layer == layer) {
+ // On non-ignored keyup, consider the oneshot used.
+ switch (flow_layers_state[i]) {
+ case flow_up_queued:
+ flow_layers_state[i] = flow_up_unqueued;
+ layer_off(layer);
+ change_pressed_status(trigger, false);
+ break;
+ case flow_up_queued_used:
+ flow_layers_state[i] = flow_up_unqueued;
+ layer_off(layer);
+ change_pressed_status(trigger, false);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return pass;
+}
+
+bool update_flow(
+ uint16_t keycode,
+ bool pressed,
+ keypos_t key_position
+) {
+ bool pass = update_flow_mods(keycode, pressed);
+ pass = update_flow_layers(keycode, pressed, key_position) & pass;
+ return pass;
+}
+
+void flow_matrix_scan(void) {
+ for (int i = 0; i < FLOW_COUNT; i++) {
+ if (flow_timeout_timers_active[i]
+ && timer_elapsed(flow_timeout_timers_value[i]) > g_flow_oneshot_term) {
+ flow_timeout_timers_active[i] = false;
+ flow_state[i] = flow_up_unqueued;
+ unregister_code(flow_config[i][1]);
+ }
+ }
+
+ for (int i = 0; i < FLOW_LAYERS_COUNT; i++) {
+ if (flow_layer_timeout_timers_active[i]
+ && timer_elapsed(flow_layer_timeout_timers_value[i]) > g_flow_oneshot_term) {
+ flow_layer_timeout_timers_active[i] = false;
+ flow_layers_state[i] = flow_up_unqueued;
+ layer_off(flow_layers_config[i][1]);
+ change_pressed_status(flow_layers_config[i][0], false);
+ }
+ }
+}
diff --git a/keyboards/a_dux/keymaps/daliusd/flow.h b/keyboards/a_dux/keymaps/daliusd/flow.h
new file mode 100644
index 0000000000..e9ac32c8ed
--- /dev/null
+++ b/keyboards/a_dux/keymaps/daliusd/flow.h
@@ -0,0 +1,27 @@
+/*
+Copyright 2022 Dalius Dobravolskas <dalius.dobravolskas@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+#pragma once
+
+#include QMK_KEYBOARD_H
+
+bool update_flow(
+ uint16_t keycode,
+ bool pressed,
+ keypos_t key_position
+);
+
+void flow_matrix_scan(void);
diff --git a/keyboards/a_dux/keymaps/daliusd/keymap.c b/keyboards/a_dux/keymaps/daliusd/keymap.c
index 71e8f3e88e..3da9b76057 100644
--- a/keyboards/a_dux/keymaps/daliusd/keymap.c
+++ b/keyboards/a_dux/keymaps/daliusd/keymap.c
@@ -15,7 +15,7 @@
*/
#include QMK_KEYBOARD_H
-#include "oneshot.h"
+#include "flow.h"
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
@@ -25,11 +25,12 @@ enum layers {
_QWERTY,
_SYM,
_NAV,
- _NUMB,
+ _MISC,
_TMUX,
_MOUSE,
- _MISC,
_FUNC,
+ _LT_MAC,
+ _LT_LINUX,
};
enum custom_keycodes {
@@ -41,22 +42,40 @@ enum custom_keycodes {