summaryrefslogtreecommitdiff
path: root/users/drashna/keyrecords
diff options
context:
space:
mode:
Diffstat (limited to 'users/drashna/keyrecords')
-rw-r--r--users/drashna/keyrecords/dynamic_macros.c283
-rw-r--r--users/drashna/keyrecords/dynamic_macros.h50
-rw-r--r--users/drashna/keyrecords/process_records.c68
-rw-r--r--users/drashna/keyrecords/process_records.h88
-rw-r--r--users/drashna/keyrecords/tapping.c5
-rw-r--r--users/drashna/keyrecords/unicode.c10
-rw-r--r--users/drashna/keyrecords/unicode.h1
-rw-r--r--users/drashna/keyrecords/wrappers.h2
8 files changed, 421 insertions, 86 deletions
diff --git a/users/drashna/keyrecords/dynamic_macros.c b/users/drashna/keyrecords/dynamic_macros.c
new file mode 100644
index 0000000000..43c2336cb6
--- /dev/null
+++ b/users/drashna/keyrecords/dynamic_macros.c
@@ -0,0 +1,283 @@
+// Copyright 2016 Jack Humbert
+// Copyright 2019 Wojciech Siewierski < wojciech dot siewierski at onet dot pl >
+// Copyright 2023 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "keyrecords/dynamic_macros.h"
+#include "keyrecords/process_records.h"
+#include "wait.h"
+#include "debug.h"
+#include "eeprom.h"
+#include "eeconfig.h"
+#include <string.h>
+
+static uint8_t macro_id = 255;
+static uint8_t recording_state = STATE_NOT_RECORDING;
+
+#if EECONFIG_USER_DATA_SIZE < 4
+# error "EECONFIG_USER_DATA_SIZE not set. Don't step on others eeprom."
+#endif
+#ifndef DYNAMIC_MACRO_EEPROM_BLOCK0_ADDR
+# define DYNAMIC_MACRO_EEPROM_BLOCK0_ADDR (uint8_t*)(EECONFIG_USER_DATABLOCK + 4)
+#endif
+
+dynamic_macro_t dynamic_macros[DYNAMIC_MACRO_COUNT];
+_Static_assert((sizeof(dynamic_macros)) <= (EECONFIG_USER_DATA_SIZE - 4), "User Data Size must be large enough to host all macros");
+
+__attribute__((weak)) void dynamic_macro_record_start_user(void) {}
+
+__attribute__((weak)) void dynamic_macro_play_user(uint8_t macro_id) {}
+
+__attribute__((weak)) void dynamic_macro_record_key_user(uint8_t macro_id, keyrecord_t* record) {}
+
+__attribute__((weak)) void dynamic_macro_record_end_user(uint8_t macro_id) {}
+
+/**
+ * @brief Gets the current macro ID
+ *
+ * @return uint8_t
+ */
+uint8_t dynamic_macro_get_current_id(void) {
+ return macro_id;
+}
+
+/**
+ * @brief Gets the current recording state
+ *
+ * @return uint8_t
+ */
+uint8_t dynamic_macro_get_recording_state(void) {
+ return recording_state;
+}
+
+/**
+ * Start recording of the dynamic macro.
+ *
+ * @param macro_id[in] The id of macro to be recorded
+ */
+bool dynamic_macro_record_start(uint8_t macro_id) {
+ if (macro_id >= (uint8_t)(DYNAMIC_MACRO_COUNT)) {
+ return false;
+ }
+ dprintf("dynamic macro recording: started for slot %d\n", macro_id);
+
+ dynamic_macro_record_start_user();
+
+ clear_keyboard();
+ layer_clear();
+
+ dynamic_macros[macro_id].length = 0;
+ return true;
+}
+
+/**
+ * Play the dynamic macro.
+ *
+ * @param macro_id[in] The id of macro to be played
+ */
+void dynamic_macro_play(uint8_t macro_id) {
+ if (macro_id >= (uint8_t)(DYNAMIC_MACRO_COUNT)) {
+ return;
+ }
+
+ dprintf("dynamic macro: slot %d playback, length %d\n", macro_id, dynamic_macros[macro_id].length);
+
+ layer_state_t saved_layer_state = layer_state;
+
+ clear_keyboard();
+ layer_clear();
+
+ for (uint8_t i = 0; i < dynamic_macros[macro_id].length; ++i) {
+ process_record(&dynamic_macros[macro_id].events[i]);
+ }
+
+ clear_keyboard();
+
+ layer_state_set(saved_layer_state);
+
+ dynamic_macro_play_user(macro_id);
+}
+
+/**
+ * Record a single key in a dynamic macro.
+ *
+ * @param macro_id[in] The start of the used macro buffer.
+ * @param record[in] The current keypress.
+ */
+void dynamic_macro_record_key(uint8_t macro_id, keyrecord_t* record) {
+ dynamic_macro_t* macro = &dynamic_macros[macro_id];
+ uint8_t length = macro->length;
+
+ /* If we've just started recording, ignore all the key releases. */
+ if (!record->event.pressed && length == 0) {
+ dprintln("dynamic macro: ignoring a leading key-up event");
+ return;
+ }
+
+ if (length < DYNAMIC_MACRO_SIZE) {
+ macro->events[length] = *record;
+ macro->length = ++length;
+ } else {
+ dynamic_macro_record_key_user(macro_id, record);
+ }
+
+ dprintf("dynamic macro: slot %d length: %d/%d\n", macro_id, length, DYNAMIC_MACRO_SIZE);
+}
+
+/**
+ * End recording of the dynamic macro. Essentially just update the
+ * pointer to the end of the macro.
+ */
+void dynamic_macro_record_end(uint8_t macro_id) {
+ if (macro_id >= (uint8_t)(DYNAMIC_MACRO_COUNT)) {
+ return;
+ }
+ dynamic_macro_record_end_user(macro_id);
+
+ dynamic_macro_t* macro = &dynamic_macros[macro_id];
+ uint8_t length = macro->length;
+
+ keyrecord_t* events_begin = &(macro->events[0]);
+ keyrecord_t* events_pointer = &(macro->events[length - 1]);
+
+ dprintf("dynamic_macro: macro length before trimming: %d\n", macro->length);
+ while (events_pointer != events_begin && (events_pointer)->event.pressed) {
+ dprintln("dynamic macro: trimming a trailing key-down event");
+ --(macro->length);
+ --events_pointer;
+ }
+
+ macro->checksum = dynamic_macro_calc_crc(macro);
+ dynamic_macro_save_eeprom(macro_id);
+
+ dprintf("dynamic macro: slot %d saved, length: %d\n", macro_id, length);
+}
+
+bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t* record) {
+ if (STATE_NOT_RECORDING == recording_state) {
+ /* Program key pressed to request programming mode */
+ if (keycode == DYN_MACRO_PROG && record->event.pressed) {
+ // dynamic_macro_led_blink();
+
+ recording_state = STATE_RECORD_KEY_PRESSED;
+ dprintf("dynamic macro: programming key pressed, waiting for macro slot selection. %d\n", recording_state);
+
+ return false;
+ }
+ /* Macro key pressed to request macro playback */
+ if (IS_DYN_KEYCODE(keycode) && record->event.pressed) {
+ dynamic_macro_play(keycode - DYN_MACRO_KEY00);
+
+ return false;
+ }
+
+ /* Non-dynamic macro key, process it elsewhere. */
+ return true;
+ } else if (STATE_RECORD_KEY_PRESSED == recording_state) {
+ /* Program key pressed again before a macro selector key, cancel macro recording.
+ Blink leds to indicate cancelation. */
+ if (keycode == DYN_MACRO_PROG && record->event.pressed) {
+ // dynamic_macro_led_blink();
+
+ recording_state = STATE_NOT_RECORDING;
+ dprintf("dynamic macro: programming key pressed, programming mode canceled. %d\n", recording_state);
+
+ return false;
+ } else if (IS_DYN_KEYCODE(keycode) && record->event.pressed) {
+ macro_id = keycode - DYN_MACRO_KEY00;
+
+ if (dynamic_macro_record_start(macro_id)) {
+ /* Macro slot selected, enter recording state. */
+ recording_state = STATE_CURRENTLY_RECORDING;
+ } else {
+ recording_state = STATE_NOT_RECORDING;
+ }
+
+ return false;
+ }
+ /* Ignore any non-macro key press while in RECORD_KEY_PRESSED state. */
+ return false;
+ } else if (STATE_CURRENTLY_RECORDING == recording_state) {
+ /* Program key pressed to request end of macro recording. */
+ if (keycode == DYN_MACRO_PROG && record->event.pressed) {
+ dynamic_macro_record_end(macro_id);
+ recording_state = STATE_NOT_RECORDING;
+
+ return false;
+ }
+ /* Don't record other macro key presses. */
+ else if (IS_DYN_KEYCODE(keycode) && record->event.pressed) {
+ dprintln("dynamic macro: playback key ignored in programming mode.");
+ return false;
+ }
+ /* Non-macro keypress that should be recorded */
+ else {
+ dynamic_macro_record_key(macro_id, record);
+
+ /* Don't output recorded keypress. */
+ return false;
+ }
+ }
+
+ return true;
+}
+
+static inline uint16_t crc16_update(uint16_t crc, uint8_t a) {
+ crc ^= a;
+ for (uint8_t i = 0; i < 8; ++i) {
+ if (crc & 1)
+ crc = (crc >> 1) ^ 0xA001;
+ else
+ crc = (crc >> 1);
+ }
+ return crc;
+}
+
+uint16_t dynamic_macro_calc_crc(dynamic_macro_t* macro) {
+ uint16_t crc = 0;
+ uint8_t* data = (uint8_t*)macro;
+
+ for (uint16_t i = 0; i < DYNAMIC_MACRO_CRC_LENGTH; ++i) {
+ crc = crc16_update(crc, *(data++));
+ }
+ return crc;
+}
+
+inline void* dynamic_macro_eeprom_macro_addr(uint8_t macro_id) {
+ return DYNAMIC_MACRO_EEPROM_BLOCK0_ADDR + sizeof(dynamic_macro_t) * macro_id;
+}
+
+void dynamic_macro_load_eeprom_all(void) {
+ for (uint8_t i = 0; i < DYNAMIC_MACRO_COUNT; ++i) {
+ dynamic_macro_load_eeprom(i);
+ }
+}
+
+void dynamic_macro_load_eeprom(uint8_t macro_id) {
+ dynamic_macro_t* dst = &dynamic_macros[macro_id];
+
+ eeprom_read_block(dst, dynamic_macro_eeprom_macro_addr(macro_id), sizeof(dynamic_macro_t));
+
+ /* Validate checksum, ifchecksum is NOT valid for macro, set its length to 0 to prevent its use. */
+ if (dynamic_macro_calc_crc(dst) != dst->checksum) {
+ dprintf("dynamic macro: slot %d not loaded, checksum mismatch\n", macro_id);
+ dst->length = 0;
+
+ return;
+ }
+
+ dprintf("dynamic macro: slot %d loaded from eeprom, checksum okay\n", macro_id);
+}
+
+void dynamic_macro_save_eeprom(uint8_t macro_id) {
+ dynamic_macro_t* src = &dynamic_macros[macro_id];
+
+ eeprom_update_block(src, dynamic_macro_eeprom_macro_addr(macro_id), sizeof(dynamic_macro_t));
+ dprintf("dynamic macro: slot %d saved to eeprom\n", macro_id);
+}
+
+void dynamic_macro_init(void) {
+ /* zero out macro blocks */
+ memset(&dynamic_macros, 0, DYNAMIC_MACRO_COUNT * sizeof(dynamic_macro_t));
+ dynamic_macro_load_eeprom_all();
+}
diff --git a/users/drashna/keyrecords/dynamic_macros.h b/users/drashna/keyrecords/dynamic_macros.h
new file mode 100644
index 0000000000..5eefb9b268
--- /dev/null
+++ b/users/drashna/keyrecords/dynamic_macros.h
@@ -0,0 +1,50 @@
+// Copyright 2016 Jack Humbert
+// Copyright 2019 Wojciech Siewierski < wojciech dot siewierski at onet dot pl >
+// Copyright 2023 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include "action.h"
+#include "action_layer.h"
+
+#ifndef DYNAMIC_MACRO_COUNT
+# define DYNAMIC_MACRO_COUNT 8
+#endif
+
+#ifndef DYNAMIC_MACRO_SIZE
+# define DYNAMIC_MACRO_SIZE 64
+#endif
+
+enum dynamic_macro_recording_state {
+ STATE_NOT_RECORDING,
+ STATE_RECORD_KEY_PRESSED,
+ STATE_CURRENTLY_RECORDING,
+};
+
+typedef struct {
+ keyrecord_t events[DYNAMIC_MACRO_SIZE];
+ uint8_t length;
+ uint16_t checksum;
+} dynamic_macro_t;
+
+void dynamic_macro_init(void);
+bool dynamic_macro_record_start(uint8_t macro_id);
+void dynamic_macro_play(uint8_t macro_id);
+void dynamic_macro_record_key(uint8_t macro_id, keyrecord_t* record);
+void dynamic_macro_record_end(uint8_t macro_id);
+bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t* record);
+
+void dynamic_macro_record_start_user(void);
+void dynamic_macro_play_user(uint8_t macro_id);
+void dynamic_macro_record_key_user(uint8_t macro_id, keyrecord_t* record);
+void dynamic_macro_record_end_user(uint8_t macro_id);
+
+#define DYNAMIC_MACRO_CRC_LENGTH (sizeof(dynamic_macro_t) - sizeof(uint16_t))
+#define IS_DYN_KEYCODE(keycode) (keycode >= DYN_MACRO_KEY00 && keycode <= DYN_MACRO_KEY15)
+
+uint16_t dynamic_macro_calc_crc(dynamic_macro_t* macro);
+void dynamic_macro_load_eeprom_all(void);
+void dynamic_macro_load_eeprom(uint8_t macro_id);
+void dynamic_macro_save_eeprom(uint8_t macro_id);
+bool dynamic_macro_header_correct(void);
diff --git a/users/drashna/keyrecords/process_records.c b/users/drashna/keyrecords/process_records.c
index 99d95c3dff..d8d45dcac9 100644
--- a/users/drashna/keyrecords/process_records.c
+++ b/users/drashna/keyrecords/process_records.c
@@ -6,9 +6,11 @@
#ifdef OS_DETECTION_ENABLE
# include "os_detection.h"
#endif
+#ifdef CUSTOM_DYNAMIC_MACROS_ENABLE
+# include "keyrecords/dynamic_macros.h"
+#endif
uint16_t copy_paste_timer;
-bool host_driver_disabled = false;
// Defines actions tor my global custom keycodes. Defined in drashna.h file
// Then runs the _keymap's record handier if not processed here
@@ -56,29 +58,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#if defined(CUSTOM_POINTING_DEVICE)
&& process_record_pointing(keycode, record)
#endif
+#ifdef CUSTOM_DYNAMIC_MACROS_ENABLE
+ && process_record_dynamic_macro(keycode, record)
+#endif
&& true)) {
return false;
}
switch (keycode) {
- case FIRST_DEFAULT_LAYER_KEYCODE ... LAST_DEFAULT_LAYER_KEYCODE:
- if (record->event.pressed) {
- uint8_t mods = mod_config(get_mods() | get_oneshot_mods());
- if (!mods) {
- set_single_persistent_default_layer(keycode - FIRST_DEFAULT_LAYER_KEYCODE);
-#if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 3)
- } else if (mods & MOD_MASK_SHIFT) {
- set_single_persistent_default_layer(keycode - FIRST_DEFAULT_LAYER_KEYCODE + 4);
-# if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 7)
-
- } else if (mods & MOD_MASK_CTRL) {
- set_single_persistent_default_layer(keycode - FIRST_DEFAULT_LAYER_KEYCODE + 8);
-# endif
-#endif
- }
- }
- break;
-
case VRSN: // Prints firmware version
if (record->event.pressed) {
send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY);
@@ -111,7 +98,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
userspace_config.rgb_layer_change ^= 1;
dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change);
- eeconfig_update_user(userspace_config.raw);
+ eeconfig_update_user_config(&userspace_config.raw);
if (userspace_config.rgb_layer_change) {
# if defined(CUSTOM_RGB_MATRIX)
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW | LED_FLAG_KEYLIGHT | LED_FLAG_INDICATOR);
@@ -168,38 +155,16 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
# endif
if (is_eeprom_updated) {
- eeconfig_update_user(userspace_config.raw);
+ eeconfig_update_user_config(&userspace_config.raw);
}
}
break;
#endif
- case KEYLOCK: {
- static host_driver_t *host_driver = 0;
-
+ case KEYLOCK:
if (record->event.pressed) {
- if (host_get_driver()) {
- host_driver = host_get_driver();
- clear_keyboard();
- host_set_driver(0);
- host_driver_disabled = true;
- } else {
- host_set_driver(host_driver);
- host_driver_disabled = false;
- }
+ toggle_keyboard_lock();
}
break;
- }
- case OLED_LOCK: {
-#if defined(OLED_ENABLE) && defined(CUSTOM_OLED_DRIVER)
- extern bool is_oled_locked;
- if (record->event.pressed) {
- is_oled_locked = !is_oled_locked;
- if (is_oled_locked) {
- oled_on();
- }
- }
-#endif
- } break;
#if defined(OS_DETECTION_ENABLE) && defined(OS_DETECTION_DEBUG_ENABLE)
case STORE_SETUPS:
if (record->event.pressed) {
@@ -218,5 +183,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
__attribute__((weak)) void post_process_record_keymap(uint16_t keycode, keyrecord_t *record) {}
void post_process_record_user(uint16_t keycode, keyrecord_t *record) {
+#if defined(OS_DETECTION_ENABLE) && defined(UNICODE_COMMON_ENABLE)
+ switch (keycode) {
+ case QK_MAGIC_SWAP_LCTL_LGUI:
+ case QK_MAGIC_SWAP_RCTL_RGUI:
+ case QK_MAGIC_SWAP_CTL_GUI:
+ case QK_MAGIC_UNSWAP_LCTL_LGUI:
+ case QK_MAGIC_UNSWAP_RCTL_RGUI:
+ case QK_MAGIC_UNSWAP_CTL_GUI:
+ case QK_MAGIC_TOGGLE_CTL_GUI:
+ set_unicode_input_mode_soft(keymap_config.swap_lctl_lgui ? UNICODE_MODE_MACOS : UNICODE_MODE_WINCOMPOSE);
+ break;
+ }
+#endif
post_process_record_keymap(keycode, record);
}
diff --git a/users/drashna/keyrecords/process_records.h b/users/drashna/keyrecords/process_records.h
index 8073b7adb0..0137976580 100644
--- a/users/drashna/keyrecords/process_records.h
+++ b/users/drashna/keyrecords/process_records.h
@@ -5,27 +5,21 @@
#include "drashna.h"
enum userspace_custom_keycodes {
- VRSN = QK_USER, // Prints QMK Firmware and board info
- KC_QWERTY, // Sets default layer to QWERTY
- FIRST_DEFAULT_LAYER_KEYCODE = KC_QWERTY, // Sets default layer to QWERTY
- KC_COLEMAK_DH, // Sets default layer to COLEMAK
- KC_COLEMAK, // Sets default layer to COLEMAK
- KC_DVORAK, // Sets default layer to DVORAK
- LAST_DEFAULT_LAYER_KEYCODE = KC_DVORAK, // Sets default layer to WORKMAN
- KC_DIABLO_CLEAR, // Clears all Diablo Timers
- KC_RGB_T, // Toggles RGB Layer Indication mode
- RGB_IDL, // RGB Idling animations
- KC_SECRET_1, // test1
- KC_SECRET_2, // test2
- KC_SECRET_3, // test3
- KC_SECRET_4, // test4
- KC_SECRET_5, // test5
- KC_CCCV, // Hold to copy, tap to paste
- KC_NUKE, // NUCLEAR LAUNCH DETECTED!!!
- UC_FLIP, // (ಠ痊ಠ)┻━┻
- UC_TABL, // ┬─┬ノ( º _ ºノ)
- UC_SHRG, // ¯\_(ツ)_/¯
- UC_DISA, // ಠ_ಠ
+ VRSN = QK_USER, // Prints QMK Firmware and board info
+ KC_DIABLO_CLEAR, // Clears all Diablo Timers
+ KC_RGB_T, // Toggles RGB Layer Indication mode
+ RGB_IDL, // RGB Idling animations
+ KC_SECRET_1, // test1
+ KC_SECRET_2, // test2
+ KC_SECRET_3, // test3
+ KC_SECRET_4, // test4
+ KC_SECRET_5, // test5
+ KC_CCCV, // Hold to copy, tap to paste
+ KC_NUKE, // NUCLEAR LAUNCH DETECTED!!!
+ UC_FLIP, // (ಠ痊ಠ)┻━┻
+ UC_TABL, // ┬─┬ノ( º _ ºノ)
+ UC_SHRG, // ¯\_(ツ)_/¯
+ UC_DISA, // ಠ_ಠ
UC_IRNY,
UC_CLUE,
KEYLOCK, // Locks keyboard by unmounting driver
@@ -40,11 +34,33 @@ enum userspace_custom_keycodes {
KC_COMIC,
KC_ACCEL,
OLED_LOCK,
+ OLED_BRIGHTNESS_INC,
+ OLED_BRIGHTNESS_DEC,
STORE_SETUPS,
PRINT_SETUPS,
- USER_SAFE_RANGE, // use "NEWPLACEHOLDER for keymap specific codes
+ PD_JIGGLER,
+
+ DYN_MACRO_PROG,
+ DYN_MACRO_KEY00,
+ DYN_MACRO_KEY01,
+ DYN_MACRO_KEY02,
+ DYN_MACRO_KEY03,
+ DYN_MACRO_KEY04,
+ DYN_MACRO_KEY05,
+ DYN_MACRO_KEY06,
+ DYN_MACRO_KEY07,
+ DYN_MACRO_KEY08,
+ DYN_MACRO_KEY09,
+ DYN_MACRO_KEY10,
+ DYN_MACRO_KEY11,
+ DYN_MACRO_KEY12,
+ DYN_MACRO_KEY13,
+ DYN_MACRO_KEY14,
+ DYN_MACRO_KEY15,
+
+ USER_SAFE_RANGE,
};
bool process_record_secrets(uint16_t keycode, keyrecord_t *record);
@@ -69,27 +85,15 @@ bool process_record_unicode(uint16_t keycode, keyrecord_t *record);
#define KC_SEC4 KC_SECRET_4
#define KC_SEC5 KC_SECRET_5
+#define KC_QWERTY DF(_QWERTY)
+#define KC_COLEMAK_DH DF(_COLEMAK_DH)
+#define KC_COLEMAK DF(_COLEMAK)
+#define KC_DVORAK DF(_DVORAK)
+
#define QWERTY KC_QWERTY
#define DVORAK KC_DVORAK
#define COLEMAK KC_COLEMAK
-#define COLEMAKDH KC_COLEMAK_DH
-
-#define DEFLYR1 FIRST_DEFAULT_LAYER_KEYCODE
-#define DEFLYR2 (FIRST_DEFAULT_LAYER_KEYCODE + 1)
-#define DEFLYR3 (FIRST_DEFAULT_LAYER_KEYCODE + 2)
-#define DEFLYR4 (FIRST_DEFAULT_LAYER_KEYCODE + 3)
-#if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 3)
-# define DEFLYR5 (FIRST_DEFAULT_LAYER_KEYCODE + 4)
-# define DEFLYR6 (FIRST_DEFAULT_LAYER_KEYCODE + 5)
-# define DEFLYR7 (FIRST_DEFAULT_LAYER_KEYCODE + 6)
-# define DEFLYR8 (FIRST_DEFAULT_LAYER_KEYCODE + 7)
-# if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 7)
-# define DEFLYR9 (FIRST_DEFAULT_LAYER_KEYCODE + 8)
-# define DEFLYR10 (FIRST_DEFAULT_LAYER_KEYCODE + 9)
-# define DEFLYR11 (FIRST_DEFAULT_LAYER_KEYCODE + 10)
-# define DEFLYR12 (FIRST_DEFAULT_LAYER_KEYCODE + 11)
-# endif
-#endif
+#define CLMKDH KC_COLEMAK_DH
#ifdef SWAP_HANDS_ENABLE
# define KC_C1R3 SH_T(KC_TAB)
@@ -140,3 +144,7 @@ We use custom codes here, so we can substitute the right stuff
# define KC_D3_3 KC_3
# define KC_D3_4 KC_4
#endif // TAP_DANCE_ENABLE
+
+#define OL_LOCK OLED_LOCK
+#define OL_BINC OLED_BRIGHTNESS_INC
+#define OL_BDEC OLED_BRIGHTNESS_DEC
diff --git a/users/drashna/keyrecords/tapping.c b/users/drashna/keyrecords/tapping.c
index 6a26a02aca..d4a0e16112 100644
--- a/users/drashna/keyrecords/tapping.c
+++ b/users/drashna/keyrecords/tapping.c
@@ -5,9 +5,14 @@
#ifdef TAPPING_TERM_PER_KEY
__attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
+
switch (keycode) {
case BK_LWER:
return TAPPING_TERM + 25;
+ case QK_MOD_TAP ... QK_MOD_TAP_MAX:
+ if (QK_MOD_TAP_GET_MODS(keycode) & MOD_LGUI) {
+ return 300;
+ }
default:
return TAPPING_TERM;
}
diff --git a/users/drashna/keyrecords/unicode.c b/users/drashna/keyrecords/unicode.c
index 16390074ca..a4687d3e59 100644
--- a/users/drashna/keyrecords/unicode.c
+++ b/users/drashna/keyrecords/unicode.c
@@ -434,3 +434,13 @@ bool process_record_unicode(uint16_t keycode, keyrecord_t *record) {
void keyboard_post_init_unicode(void) {
unicode_input_mode_init();
}
+
+/**
+ * @brief Set the unicode input mode without extra functionality
+ *
+ * @param input_mode
+ */
+void set_unicode_input_mode_soft(uint8_t input_mode) {
+ unicode_config.input_mode = input_mode;
+ unicode_input_mode_set_kb(input_mode);
+}
diff --git a/users/drashna/keyrecords/unicode.h b/users/drashna/keyrecords/unicode.h
index 43c2db89c0..fe95e78c3a 100644
--- a/users/drashna/keyrecords/unicode.h
+++ b/users/drashna/keyrecords/unicode.h
@@ -18,3 +18,4 @@ enum unicode_typing_modes {
extern uint8_t unicode_typing_mode;
extern const PROGMEM char unicode_mode_str[UNCODES_MODE_END][13];
+void set_unicode_input_mode_soft(uint8_t input_mode);
diff --git a/users/drashna/keyrecords/wrappers.h b/users/drashna/keyrecords/wrappers.h
index 31efad5f6e..b298ef0628 100644
--- a/users/drashna/keyrecords/wrappers.h
+++ b/users/drashna/keyrecords/wrappers.h
@@ -260,7 +260,7 @@ NOTE: These are all the same length. If you do a search/replace
#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T
#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5
-#define _________________ADJUST_R2_________________ CG_SWAP, DEFLYR1, DEFLYR2, DEFLYR3, DEFLYR4
+#define _________________ADJUST_R2_________________ CG_SWAP, QWERTY, CLMKDH, COLEMAK, DVORAK
#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT
// clang-format on