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

[Core] Feature: Add Key Cancellation #24000

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

Xelus22
Copy link
Contributor

@Xelus22 Xelus22 commented Jun 26, 2024

Description

Edit: renamed to Key Cancellation

(Also open to different naming suggestions)

This adds a feature where it is a key interrupt and forces another key to be un-pressed when one key is pressed.

Usage:
keymap.c

#ifdef KEY_CANCELLATION_ENABLE
const key_cancellation_t PROGMEM key_cancellation_list[] = {
    // on key down
    //       |    key to be released
    //       |     |
    [0] = {KC_D, KC_A},
    [1] = {KC_A, KC_D}
};
#endif

This example shows on the first interrupt pair, when D is held, A will be interrupted and unpressed.
The second interrupt pair is when A is held, D will be unpressed.
This means that A and D can never be in the same packet (from a normal keystroke).

Types of Changes

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

Issues Fixed or Closed by This PR

  • Add new feature key interrupt

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).

docs/_aliases.json Outdated Show resolved Hide resolved
quantum/keymap_introspection.h Outdated Show resolved Hide resolved
@Xelus22 Xelus22 force-pushed the core_key_interrupts branch 2 times, most recently from b37b2ce to 8a05410 Compare July 7, 2024 05:47
@Xelus22 Xelus22 marked this pull request as ready for review July 7, 2024 06:09
@drashna drashna requested a review from a team July 9, 2024 21:19
@drashna
Copy link
Member

drashna commented Jul 9, 2024

(Also open to different naming suggestions)

As long as it's not snap tap or rappy snappy.

@dexter93
Copy link
Contributor

Some nice graphics for docs can be found here

Oh wait..

Copy link
Member

@tzarc tzarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some quick cleanup.

quantum/process_keycode/process_key_interrupt.h Outdated Show resolved Hide resolved
quantum/keymap_introspection.h Outdated Show resolved Hide resolved
quantum/keymap_introspection.c Outdated Show resolved Hide resolved
docs/features/key_interrupt.md Outdated Show resolved Hide resolved
quantum/keymap_introspection.c Outdated Show resolved Hide resolved
Copy link
Member

@KarlK90 KarlK90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Xelus22 Thanks for the PR, here is my first round of review. As the implementation is still changing I only had a look at the test cases.

tests/key_interrupt/test_key_interrupt.cpp Outdated Show resolved Hide resolved
tests/key_interrupt/test_key_interrupt.cpp Outdated Show resolved Hide resolved
tests/key_interrupt/test_key_interrupt.cpp Outdated Show resolved Hide resolved
tests/key_interrupt/test_key_interrupt.cpp Outdated Show resolved Hide resolved
tests/key_interrupt/test_key_interrupt.cpp Outdated Show resolved Hide resolved
@Xelus22 Xelus22 changed the title [Core] Feature: Add Key interrupt [Core] Feature: Add Key Cancellation Jul 17, 2024
@Xelus22 Xelus22 force-pushed the core_key_interrupts branch 3 times, most recently from 6865f04 to 837ac1b Compare July 17, 2024 09:48
@tzarc
Copy link
Member

tzarc commented Jul 22, 2024

That's phase 2 -- @Xelus22 split things up so they were easier to review. There was a WIP branch of his floating about, IIRC.

Copy link
Contributor

@dexter93 dexter93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed aliases to reflect the feature title - however not sure if optimal ( KC also might stand for keycode). Some thoughts from core team?

data/constants/keycodes/keycodes_0.0.5_quantum.hjson Outdated Show resolved Hide resolved
data/constants/keycodes/keycodes_0.0.5_quantum.hjson Outdated Show resolved Hide resolved
data/constants/keycodes/keycodes_0.0.5_quantum.hjson Outdated Show resolved Hide resolved
docs/features/key_cancellation.md Outdated Show resolved Hide resolved
data/schemas/keyboard.jsonschema Outdated Show resolved Hide resolved
@a-a-r-o-n-z-h-u

This comment was marked as off-topic.

Smirnoffq

This comment was marked as off-topic.

Co-authored-by: Drashna Jaelre <drashna@live.com>
@w00tazn

This comment was marked as off-topic.

@ext4xfs

This comment was marked as off-topic.

@qmk qmk locked as off-topic and limited conversation to collaborators Jul 24, 2024
@tzarc
Copy link
Member

tzarc commented Jul 24, 2024

Locked as this is deviating from the intent of a PR.

@drashna drashna requested a review from a team July 24, 2024 02:55
quantum/process_keycode/process_key_cancellation.c Outdated Show resolved Hide resolved
docs/features/key_cancellation.md Outdated Show resolved Hide resolved
docs/features/key_cancellation.md Outdated Show resolved Hide resolved
docs/features/key_cancellation.md Outdated Show resolved Hide resolved
quantum/process_keycode/process_key_cancellation.c Outdated Show resolved Hide resolved
quantum/process_keycode/process_key_cancellation.c Outdated Show resolved Hide resolved
docs/features/key_cancellation.md Outdated Show resolved Hide resolved
docs/features/key_cancellation.md Show resolved Hide resolved
quantum/process_keycode/process_key_cancellation.h Outdated Show resolved Hide resolved
docs/features/key_cancellation.md Outdated Show resolved Hide resolved
Xelus22 and others added 6 commits July 25, 2024 17:49
Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: Joel Challis <git@zvecr.com>
docs/features/key_cancellation.md Outdated Show resolved Hide resolved
docs/features/key_cancellation.md Outdated Show resolved Hide resolved
docs/features/key_cancellation.md Show resolved Hide resolved
Co-authored-by: Joel Challis <git@zvecr.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
core dd Data Driven Changes documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.