summaryrefslogtreecommitdiff
path: root/quantum/process_keycode
AgeCommit message (Collapse)Author
2022-11-06Fix keycode parameter extraction to match the new DD keycodes (#18977)Sergey Vlasov
* Add macros to extract parameters from keycode values Implement both encoding and decoding for keycodes like TO(layer) or LM(layer, mod) in one place, so that the decoding won't get out of sync with the encoding. While at it, fix some macros for creating keycode values that did not apply the appropriate masks to parameters (and therefore could allow the result to be out of range if a wrong parameter was passed). * keymap_common: Use extraction macros for keycodes * pointing_device_auto_mouse: Use extraction macros for keycodes Fixes #18970. * process_autocorrect: Use extraction macros for keycodes * process_caps_word: Use extraction macros for keycodes (Also fix a minor bug - SH_TG was not handled properly) * process_leader: Use extraction macros for keycodes (Technically the code is not 100% correct, because it always assumes that the LT() or MT() action was a tap, but it's a separate issue that already existed before the keycode changes.) * process_unicode: Use extraction macros for keycodes * process_unicodemap: Use extraction macros for keycodes
2022-11-06Reworked backlight keycodes. (#18961)Nick Brassel
Co-authored-by: Ryan <fauxpark@gmail.com>
2022-11-05Align audio keycode names (#18962)Joel Challis
* Align audio keycode names * Update docs * Update quantum
2022-11-05Align dynamic tapping term keycode names (#18963)Joel Challis
* Align dynamic tapping term keycode names * regen header
2022-11-06Remove thermal printer. (#18959)Nick Brassel
2022-11-05Initial DD keycode migration (#18643)Joel Challis
* Initial DD keycode migration * Sort magic keycodes
2022-11-03Normalise Dynamic Macro keycodes (#18939)Ryan
* `DYN_REC_START1` -> `QK_DYNAMIC_MACRO_RECORD_START_1` * `DYN_REC_START2` -> `QK_DYNAMIC_MACRO_RECORD_START_2` * `DYN_MACRO_PLAY1` -> `QK_DYNAMIC_MACRO_PLAY_1` * `DYN_MACRO_PLAY2` -> `QK_DYNAMIC_MACRO_PLAY_2` * `DYN_REC_STOP` -> `QK_DYNAMIC_MACRO_RECORD_STOP` * Update docs
2022-10-31Normalise Unicode keycodes (#18898)Ryan
* `UC_MOD`/`UC_RMOD` -> `UC_NEXT`/`UC_PREV` * `UNICODE_MODE_*` -> `QK_UNICODE_MODE_*` * `UC_MAC` -> `UNICODE_MODE_MACOS` * `UC_LNX` -> `UNICODE_MODE_LINUX` * `UC_WIN` -> `UNICODE_MODE_WINDOWS` * `UC_BSD` -> `UNICODE_MODE_BSD` * `UC_WINC` -> `UNICODE_MODE_WINCOMPOSE` * `UC_EMACS` -> `UNICODE_MODE_EMACS` * `UC__COUNT` -> `UNICODE_MODE_COUNT` * `UC_M_MA` -> `UC_MAC` * `UC_M_LN` -> `UC_LINX` * `UC_M_WI` -> `UC_WIN` * `UC_M_BS` -> `UC_BSD` * `UC_M_WC` -> `UC_WINC` * `UC_M_EM` -> `UC_EMAC` * Docs * Update quantum/unicode/unicode.h
2022-10-28Normalise Auto Shift keycodes (#18892)Ryan
* Normalise Auto Shift keycodes * Add keycode table to main list * Add old keycodes to legacy header
2022-10-28Normalise Autocorrect keycodes (#18893)Ryan
2022-10-27Normalise Combo keycodes (#18877)Ryan
2022-10-27Normalise Space Cadet keycodes (#18864)Ryan
2022-10-25Deprecate `SECURE_*` keycodes for `QK_SECURE_*` (#18847)Joel Challis
* Deprecate SECURE_* keycodes for QK_SECURE_* * Update keycode process * Update process_secure.c * Apply suggestions from code review Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Ryan <fauxpark@gmail.com>
2022-10-25Deprecate `KEY_OVERRIDE_*` keycodes for `KO_*` (#18843)Ryan
2022-10-24Remove some assumptions on sequential keycode ranges (#18838)Joel Challis
2022-10-24added BS_TOGG so BS_SWAP and BS_NORM can be on a single key (#18837)Selene ToyKeeper
Co-authored-by: Selene ToyKeeper <git@toykeeper.net>
2022-10-24Deprecate `CAPS_WORD`/`CAPSWRD` for `CW_TOGG` (#18834)Ryan
2022-10-24Normalise Joystick and Programmable Button keycodes (#18832)Ryan
2022-10-21Deprecate `KC_LOCK` for `QK_LOCK` (#18796)Ryan
2022-10-21Deprecate `KC_LEAD` for `QK_LEAD` (#18792)Ryan
2022-10-15Programmable Button API refactor and improve docs (#18641)Ryan
2022-10-05Use get_u16_str instead of snprintf in autoshift_timer_report (#18606)precondition
2022-10-03Fix layer switching from tap dances by redoing the keymap lookup (#17935)Sergey Vlasov
2022-10-03Prevent tap dance from wiping dynamic macros (#17880)Jason Ken Adhinarta
2022-09-27Further refactoring of joystick feature (#18437)Ryan
2022-09-17[Core] Add getreuer's Autocorrect feature to core (#15699)Drashna Jaelre
Co-authored-by: Albert Y <76888457+filterpaper@users.noreply.github.com>
2022-09-12Refactor Unicode feature (#18333)Ryan
2022-09-06Remove `UNICODE_KEY_OSX` and `UC_OSX` (#18290)Ryan
2022-09-06Merge remote-tracking branch 'origin/master' into developQMK Bot
2022-09-06Remove use of legacy keycode (#18281)Joel Challis
2022-08-31Add unicode mode change callbacks (#18235)Joshua Diamond
2022-08-30Use a macro to compute the size of arrays at compile time (#18044)Jeff Epler
* Add ARRAY_SIZE and CEILING utility macros * Apply a coccinelle patch to use ARRAY_SIZE * fix up some straggling items * Fix 'make test:secure' * Enhance ARRAY_SIZE macro to reject acting on pointers The previous definition would not produce a diagnostic for ``` int *p; size_t num_elem = ARRAY_SIZE(p) ``` but the new one will. * explicitly get definition of ARRAY_SIZE * Convert to ARRAY_SIZE when const is involved The following spatch finds additional instances where the array is const and the division is by the size of the type, not the size of the first element: ``` @ rule5a using "empty.iso" @ type T; const T[] E; @@ - (sizeof(E)/sizeof(T)) + ARRAY_SIZE(E) @ rule6a using "empty.iso" @ type T; const T[] E; @@ - sizeof(E)/sizeof(T) + ARRAY_SIZE(E) ``` * New instances of ARRAY_SIZE added since initial spatch run * Use `ARRAY_SIZE` in docs (found by grep) * Manually use ARRAY_SIZE hs_set is expected to be the same size as uint16_t, though it's made of two 8-bit integers * Just like char, sizeof(uint8_t) is guaranteed to be 1 This is at least true on any plausible system where qmk is actually used. Per my understanding it's universally true, assuming that uint8_t exists: https://stackoverflow.com/questions/48655310/can-i-assume-that-sizeofuint8-t-1 * Run qmk-format on core C files touched in this branch Co-authored-by: Stefan Kerkmann <karlk90@pm.me>
2022-08-14Fix Caps Word to treat mod-taps more consistently. (#17463)Pascal Getreuer
* Fix Caps Word to treat mod-taps more consistently. Previously, holding any mod-tap key while Caps Word is active stops Caps Word, and this happens regardless of `caps_word_press_user()`. Yet for regular mod keys, AltGr (KC_RALT) is ignored, Shift keys are passed to `caps_word_press_user()` to determine whether to continue, and similarly, a key `RSFT(KC_RALT)` representing Right Shift + Alt is passed to `caps_word_press_user()` to determine whether to continue. This commit makes held mod-tap keys consistent with regular mod keys: * Holding a `RALT_T` mod-tap is ignored. * When holding a shift mod-tap key, `KC_LSFT` or `KC_RSFT` is passed to `caps_word_press_user()` to determine whether to continue. * When holding a Right Shift + Alt (`RSA_T`) mod-tap, `RSFT(KC_RALT)` is passed to `caps_word_press_user()`. Particularly, with this fix a user may choose to continue Caps Word when a shift mod-tap key is held by adding `KC_LSFT` and `KC_RSFT` cases in `caps_word_press_user()`. For instance as ``` bool caps_word_press_user(uint16_t keycode) { switch (keycode) { // Keycodes that continue Caps Word, with shift applied. case KC_A ... KC_Z: case KC_MINS: add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to the next key. return true; // Keycodes that continue Caps Word, without shifting. case KC_1 ... KC_0: case KC_BSPC: case KC_DEL: case KC_UNDS: case KC_LSFT: // <<< Added here. case KC_RSFT: return true; default: return false; // Deactivate Caps Word. } } ``` * Fix Caps Word to treat mod-taps more consistently. Previously, holding any mod-tap key while Caps Word is active stops Caps Word, and this happens regardless of `caps_word_press_user()`. Yet for regular mod keys, AltGr (KC_RALT) is ignored, Shift keys are passed to `caps_word_press_user()` to determine whether to continue, and similarly, a key `RSFT(KC_RALT)` representing Right Shift + Alt is passed to `caps_word_press_user()` to determine whether to continue. This commit makes held mod-tap keys consistent with regular mod keys: * Holding a `RALT_T` mod-tap is ignored. * When holding a shift mod-tap key, `KC_LSFT` or `KC_RSFT` is passed to `caps_word_press_user()` to determine whether to continue. * When holding a Right Shift + Alt (`RSA_T`) mod-tap, `RSFT(KC_RALT)` is passed to `caps_word_press_user()`. Particularly, with this fix a user may choose to continue Caps Word when a shift mod-tap key is held by adding `KC_LSFT` and `KC_RSFT` cases in `caps_word_press_user()`. For instance as ``` bool caps_word_press_user(uint16_t keycode) { switch (keycode) { // Keycodes that continue Caps Word, with shift applied. case KC_A ... KC_Z: case KC_MINS: add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to the next key. return true; // Keycodes that continue Caps Word, without shifting. case KC_1 ... KC_0: case KC_BSPC: case KC_DEL: case KC_UNDS: case KC_LSFT: // <<< Added here. case KC_RSFT: return true; default: return false; // Deactivate Caps Word. } } ``` * Update quantum/process_keycode/process_caps_word.c Co-authored-by: Joel Challis <git@zvecr.com>
2022-08-14Added emacs as an "operating system" for input mode. (#16949)Chewxy
2022-08-13Fix Caps Word capitalization when used with Combos + Auto Shift. (#17549)Pascal Getreuer
2022-07-30Merge remote-tracking branch 'origin/master' into developQMK Bot
2022-07-30Fix check when compiling HID Joystick with digital driver (#17844)Drashna Jaelre
2022-07-28Rename postprocess_steno_user → post_process_steno_user (#17823)precondition
2022-07-02Merge remote-tracking branch 'origin/master' into developQMK Bot
2022-07-02Allow for RGB actions to take place on Keydown instead of Keyup (#16886)CoffeeIsLife
* Allow for switch on keydown * add docs
2022-07-02Feature-ify Send String (#17275)Ryan
2022-07-02PoC: Swap Escape and Caps (#16336)Osamu Aoki
2022-07-02Fix keys being discarded after using the leader key (#17287)torkel104
2022-07-02Added Wait time to sending each Keys for Dynamic Macros function (#16800)FREEWING.JP
Co-authored-by: Joel Challis <git@zvecr.com>
2022-06-23Refactor steno and add `STENO_PROTOCOL = [all|txbolt|geminipr]` (#17065)precondition
* Refactor steno into STENO_ENABLE_[ALL|GEMINI|BOLT] * Update stenography documentation * STENO_ENABLE_TXBOLT → STENO_ENABLE_BOLT TXBOLT is a better name but BOLT is more consistent with the pre-existing TX Bolt related constants, which all drop the "TX " prefix * Comments * STENO_ENABLE_[GEMINI|BOLT|ALL] → STENO_PROTOCOL = [geminipr|txbolt|all] * Add note on lacking V-USB support * Clear chord at the end of the switch(mode){send_steno_chord} block * Return true if NOEVENT * update_chord_xxx → add_xxx_key_to_chord * Enable the defines for all the protocols if STENO_PROTOCOL = all * Mention how to use `steno_set_mode` * Set the default steno protocol to "all" This is done so that existing keymaps invoking `steno_set_mode` don't all suddenly break * Add data driver equivalents for stenography feature * Document format of serial steno packets (Thanks dnaq) * Add missing comma
2022-06-13tap-dance: Restructure code and document in more detail (#16394)Jouke Witteveen
2022-06-05Merge remote-tracking branch 'origin/master' into developQMK Bot
2022-06-05Fix and add unit tests for Caps Word to work with Unicode Map, Auto Shift, ↵Pascal Getreuer
Retro Shift. (#17284) * Fix Caps Word and Unicode Map * Tests for Caps Word + Auto Shift and Unicode Map. * Fix formatting * Add additional keyboard report expectation macros This commit defines five test utilities, EXPECT_REPORT, EXPECT_UNICODE, EXPECT_EMPTY_REPORT, EXPECT_ANY_REPORT and EXPECT_NO_REPORT for use with TestDriver. EXPECT_REPORT sets a gmock expectation that a given keyboard report will be sent. For instance, EXPECT_REPORT(driver, (KC_LSFT, KC_A)); is shorthand for EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT, KC_A))); EXPECT_UNICODE sets a gmock expectation that a given Unicode code point will be sent using UC_LNX input mode. For instance for U+2013, EXPECT_UNICODE(driver, 0x2013); expects the sequence of keys: "Ctrl+Shift+U, 2, 0, 1, 3, space". EXPECT_EMPTY_REPORT sets a gmock expectation that a given keyboard report will be sent. For instance EXPECT_EMPTY_REPORT(driver); expects a single report without keypresses or modifiers. EXPECT_ANY_REPORT sets a gmock expectation that a arbitrary keyboard report will be sent, without matching its contents. For instance EXPECT_ANY_REPORT(driver).Times(1); expects a single arbitrary keyboard report will be sent. EXPECT_NO_REPORT sets a gmock expectation that no keyboard report will be sent at all. * Add tap_key() and tap_keys() to TestFixture. This commit adds a `tap_key(key)` method to TestFixture that taps a given KeymapKey, optionally with a specified delay between press and release. Similarly, the method `tap_keys(key_a, key_b, key_c)` taps a sequence of KeymapKeys. * Use EXPECT_REPORT, tap_keys, etc. in most tests. This commit uses EXPECT_REPORT, EXPECT_UNICODE, EXPECT_EMPTY_REPORT, EXPECT_NO_REPORT, tap_key() and tap_keys() test utilities from the previous two commits in most tests. Particularly the EXPECT_REPORT macro is frequently useful and makes a nice reduction in boilerplate needed to express many tests. Co-authored-by: David Kosorin <david@kosorin.net>
2022-05-30Removes terminal from QMK. (#17258)Nick Brassel
2022-05-20Continue Caps Word when AltGr (right Alt) is held. (#17156)Pascal Getreuer
This is a minor bug fix for Caps Word. Currently, Caps Word turns off whenever a non-shift mod becomes active. This is done to avoid interfering with hotkeys. This commit makes an exception to continue Caps Word when AltGr (right Alt) is held. Outside the US, the AltGr key is used to type additional symbols (https://en.wikipedia.org/wiki/AltGr_key). Depending on the language, these may include symbols used within words like accented letters where it would be desirable to continue Caps Word.