qmk / qmk_firmware

Open-source keyboard firmware for Atmel AVR and Arm USB families
https://qmk.fm
GNU General Public License v2.0
17.46k stars 37.68k forks source link

[Core] Feature: Add Key interrupt #24000

Open Xelus22 opened 5 days ago

Xelus22 commented 5 days ago

Description

TODO: ADD DOCS

(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_INTERRUPT_ENABLE
const uint16_t PROGMEM key_interrupt_list[][NUM_INTERRUPT_KEYCODES] = {
    [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

Issues Fixed or Closed by This PR

Checklist