summaryrefslogtreecommitdiffstats
path: root/users/drashna/keyrecords
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@drashna.net>2023-02-28 11:14:48 -0800
committerGitHub <noreply@github.com>2023-02-28 11:14:48 -0800
commit051401175d98e777a6633445a0275b54ed36e97a (patch)
tree325d717dfbfb12e4cb45c02089602f256ddc36d6 /users/drashna/keyrecords
parent05631b276d557824518cdb0c7d5d78c8f118891c (diff)
[Keymap] Drashna updates for 0.20.0 (#19960)
Diffstat (limited to 'users/drashna/keyrecords')
-rw-r--r--users/drashna/keyrecords/capwords.md36
-rw-r--r--users/drashna/keyrecords/process_records.c35
-rw-r--r--users/drashna/keyrecords/process_records.h9
-rw-r--r--users/drashna/keyrecords/readme.md2
4 files changed, 33 insertions, 49 deletions
diff --git a/users/drashna/keyrecords/capwords.md b/users/drashna/keyrecords/capwords.md
deleted file mode 100644
index 1ca01ed853..0000000000
--- a/users/drashna/keyrecords/capwords.md
+++ /dev/null
@@ -1,36 +0,0 @@
-# Cap Words
-
-This is taken from [Pascal Getreuer's implemenation](https://getreuer.info/posts/keyboards/caps-word/index.html), with a number of modifications.
-
-To enable Caps Word, add `CAPS_WORD_ENABLE = yes` to your `rules.mk`.
-
-This is mostly a reproduction of Pascal's docs:
-
-## Overview
-
-All-caps identifiers like “MOD_MASK_ALT” are awkward to type.
-
-Caps Lock would be the standard solution to this problem, but it is awkward: it needs a dedicated key to toggle it (an imposition on smaller keyboards), and we need to remember to toggle it off after typing the word. Or with normal shifting, we either perform finger gymnastics or need to stop typing in the middle of the word to release shift with one hand to switch to holding shift with the other hand. In my experience, this is a nuisance especially if your shift keys are mod-taps, as in home row mods.
-
-Caps Word, implemented here, is a modern alternative to Caps Lock:
-
-* Caps Word is activated by pressing the left and right shift keys at the same time. This way you don’t need a dedicated key for using Caps Word.
-* Caps Word automatically disables itself at the end of the word.
-
-**Compatibility**: I’ve tested that this implementation works with one-shot mods and Space Cadet Shift, and it predictably handles key repeating.
-
-Unlike some other QMK Caps Word implementations, this library does not use the Caps Lock (KC_CAPS) keycode. It works even if the OS remaps Caps Lock to Ctrl or something else, as Emacs and Vim users often do.
-
-## Using Caps Word
-With the above flashed to your keyboard:
-
-1. **Activating**: Press and release both left and right shift keys at the same time. If your shift keys are mod-taps, activate Caps Word by holding both shift mod-tap keys until the tapping term, then release them.
-2. Then begin typing to get capitalized letters.
-3. **Disabling**: Caps Word disables itself when the next word breaking key is typed.
-
-If you want to explicitly stop Caps Word, press and release Ctrl or another non-shift modifier or layer key. This also disables Caps Word.
-
-## Explanation
-The code checks the mod bits on each key event, enabling Caps Word when both left and right shifts are active.
-
-While enabled, Caps Word automatically presses and releases left shift (KC_LSFT) as needed so that letters are shifted and other keys are not. The word continues while typing a–z, 0–9, -, _, and backspace. Any other key is considered “word breaking” and disables Caps Word. You can edit the switch statement at the end of the process_caps_word() function to adjust which keys count as word breaking.
diff --git a/users/drashna/keyrecords/process_records.c b/users/drashna/keyrecords/process_records.c
index 89d1c80b8f..99d95c3dff 100644
--- a/users/drashna/keyrecords/process_records.c
+++ b/users/drashna/keyrecords/process_records.c
@@ -3,6 +3,9 @@
#include "drashna.h"
#include "version.h"
+#ifdef OS_DETECTION_ENABLE
+# include "os_detection.h"
+#endif
uint16_t copy_paste_timer;
bool host_driver_disabled = false;
@@ -32,15 +35,6 @@ __attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t
* @return false Stop process keycode and do not send to host
*/
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
-#ifdef ENCODER_ENABLE // some debouncing for weird issues
- if (IS_ENCODEREVENT(record->event)) {
- static bool ignore_first = true;
- if (ignore_first) {
- ignore_first = false;
- return false;
- }
- }
-#endif
// If console is enabled, it will print the matrix position and status of each key pressed
#ifdef KEYLOGGER_ENABLE
uprintf("KL: kc: 0x%04X, col: %2u, row: %2u, pressed: %1d, time: %5u, int: %1d, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count);
@@ -195,6 +189,29 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
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) {
+ store_setups_in_eeprom();
+ }
+ return false;
+ case PRINT_SETUPS:
+ if (record->event.pressed) {
+ print_stored_setups();
+ }
+ return false;
+#endif
}
return true;
}
diff --git a/users/drashna/keyrecords/process_records.h b/users/drashna/keyrecords/process_records.h
index 5c8fe889e4..8073b7adb0 100644
--- a/users/drashna/keyrecords/process_records.h
+++ b/users/drashna/keyrecords/process_records.h
@@ -5,7 +5,7 @@
#include "drashna.h"
enum userspace_custom_keycodes {
- VRSN = SAFE_RANGE, // Prints QMK Firmware and board info
+ 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
@@ -39,7 +39,12 @@ enum userspace_custom_keycodes {
KC_SUPER,
KC_COMIC,
KC_ACCEL,
- NEW_SAFE_RANGE // use "NEWPLACEHOLDER for keymap specific codes
+ OLED_LOCK,
+
+ STORE_SETUPS,
+ PRINT_SETUPS,
+
+ USER_SAFE_RANGE, // use "NEWPLACEHOLDER for keymap specific codes
};
bool process_record_secrets(uint16_t keycode, keyrecord_t *record);
diff --git a/users/drashna/keyrecords/readme.md b/users/drashna/keyrecords/readme.md
index 5f708f9edf..b89777db3d 100644
--- a/users/drashna/keyrecords/readme.md
+++ b/users/drashna/keyrecords/readme.md
@@ -1,7 +1,5 @@
# Keycode handling and interception
- * [Autocorrection](autocorrection/readme.md)
- * [Cap Words](capwords.md)
* [Diablo Tap Dancing](tap_dance.md)
* [Keymap Wrappers](wrappers.md)
* [Secret Macros](secrets.md)