qmk/qmk_firmware

[Bug] Custom keycode now clears the one shot layer

Open

#9.521 geöffnet am 23. Juni 2020

Auf GitHub ansehen
 (9 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C (43.867 Forks)batch import
bughelp wanted

Repository-Metriken

Stars
 (20.368 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 20T 9h) (27 gemergte PRs in 30 T)

Beschreibung

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

Contributor Guide