Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add next tapping record user callback #20768

Closed
wants to merge 1 commit into from

Conversation

filterpaper
Copy link
Contributor

@filterpaper filterpaper commented May 7, 2023

Description

Add a new get_next_tapping_record() function that allows user space read access to the next buffered tapping key. This can provide more granular control to tap-hold decision function based on that key.

Example:

bool get_permissive_hold(uint16_t keycode, keyrecord_t *record) {
    keyrecord_t next = get_next_tapping_record();
    // row > 3 on a 3x5_2 split is the right side
    // enable permissive hold for left-shift with right-side keys
    if (keycode == LSFT_T(KC_A) && next.event.key.row > 3 && next.event.pressed) {
        return true;
    }
    return false;
}

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions bot added the core label May 7, 2023
@drashna drashna requested a review from a team May 7, 2023 20:10
@filterpaper filterpaper force-pushed the next-tapping-record branch from 473d7e8 to 06cfb89 Compare May 11, 2023 01:28
@filterpaper filterpaper marked this pull request as draft May 14, 2023 01:29
@filterpaper
Copy link
Contributor Author

The same information can be extracted with pre_process_record_user (#20584). Closing this to avoid cluttering action_tapping with more shims.

@filterpaper filterpaper deleted the next-tapping-record branch May 14, 2023 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants