qmk/qmk_firmware

[Bug] Custom keycode now clears the one shot layer

Open

#9521 aperta il 23 giu 2020

Vedi su GitHub
 (9 commenti) (0 reazioni) (0 assegnatari)C (43.867 fork)batch import
bughelp wanted

Metriche repository

Star
 (20.368 star)
Metriche merge PR
 (Merge medio 20g 9h) (27 PR mergiate in 30 g)

Descrizione

Describe the Bug

Have a double tap function in my keymap, with the commit 9c1097e768aed90e4c56a3a18f6c1cc9cac52391 it now clears my one shot layers, where as before it didn't. The expected behavior for it is to not clear the one shot layer as I mainly use this double tap key to repeat symbols on my symbol layer. Where I'm using my right thumb to first jump to the symbol layer with a one shot layer then with the same thumb press the double tap key.

Here's the code for the double tap function

//...
static bool double_tap_it = false;
//...
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
    if (record->event.pressed) {
        switch (keycode) {
            //...
            case DBL_TAP:
                double_tap_it = !double_tap_it;
                return false;
           //...
        }
    } else if (double_tap_it && keycode != DBL_TAP) {
        double_tap_it = false;
        tap_code16(keycode);
        clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
    }

    return true;
}

System Information

  • Keyboard: Kyria
    • Revision (if applicable): 1.1
    • Operating system: Arch Linux - linux kernel: 5.6.15-arch1-1
  • AVR GCC version:

10.1.0

  • ARM GCC version:
  • QMK Firmware version: 0.8.44
  • Any keyboard related software installed?
    • AutoHotKey
    • Karabiner
    • Other:

Additional Context

Ran a git bisect on a working commit and master. This commit was the one that introduced the bug for me: 9c1097e768aed90e4c56a3a18f6c1cc9cac52391

Guida contributor