qmk/qmk_firmware

[Bug] combo_should_trigger doesn't activate for any layer.

Open

#20.479 aperta il 17 apr 2023

Vedi su GitHub
 (5 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

This is my combo.c that doesn't work.

bool combo_should_trigger(uint16_t combo_index, combo_t *combo, uint16_t keycode, keyrecord_t *record) {
    /* Enable ARTSEY combos on layer `_ARTSEY` */
    switch (combo_index) {
#if defined(ARTSEY_ENABLE) && !defined(NO_ACTION_ONESHOT)
        case ARTSEY_B ... ARTSEY_EXLM:
            return layer_state_is(_ARTSEY);

#endif
    }
    return true;
}

I want to only activate those _ARTSEY_* keycodes when _ARTSEY layer is on. But with the code above, none of the layers have those _ARTSEY_* combos.

Keyboard Used

sofle

Link to product page (if applicable)

No response

Operating System

Windows

qmk doctor Output

Ψ QMK Doctor is checking your environment.
Ψ CLI version: 1.1.1
Ψ QMK home: D:/qmk_firmware
Ψ Detected Windows 10 (10.0.19045).
Ψ QMK MSYS version: 1.7.2
Ψ Git branch: feature/combo_should_trigger
⚠ The official repository does not seem to be configured as git remote "upstream".
Ψ All dependencies are installed.
Ψ Found arm-none-eabi-gcc version 12.2.0
Ψ Found avr-gcc version 12.2.0
⚠ We do not recommend avr-gcc newer than 8. Downgrading to 8.x is recommended.
Ψ Found avrdude version 7.0
Ψ Found dfu-programmer version 0.7.2
Ψ Found dfu-util version 0.11
Ψ Submodules are up to date.
Ψ Submodule status:
Ψ - lib/chibios: 2023-01-03 19:29:26 +0000 --  (0062927)
Ψ - lib/chibios-contrib: 2023-01-11 16:42:27 +0100 --  (a224be1)
Ψ - lib/googletest: 2021-06-11 06:37:43 -0700 --  (e2239ee)
Ψ - lib/lufa: 2022-08-26 12:09:55 +1000 --  (549b973)
Ψ - lib/vusb: 2022-06-13 09:18:17 +1000 --  (819dbc1)
Ψ - lib/printf: 2022-06-29 23:59:58 +0300 --  (c2e3b4e)
Ψ - lib/pico-sdk: 2023-02-12 20:19:37 +0100 --  (a3398d8)
Ψ - lib/lvgl: 2022-04-11 04:44:53 -0600 --  (e19410f)
Ψ QMK is ready to go, but minor problems were found

Is AutoHotKey / Karabiner installed

  • AutoHotKey (Windows)
  • Karabiner (macOS)

Other keyboard-related software installed

No response

Additional Context

uint8_t combo_ref_from_layer(uint8_t layer) {
    switch (get_highest_layer(layer_state)) {
        case _ARTSEY:
            return _ARTSEY;
        default:
            return _QWERTY;
    }
    return layer; // important if default is not in case.
}

Also doesn't work for me, but I don't know if it's related

Guida contributor