sekigon-gonnoc / qmk_firmware

keyboard controller firmware for Atmel AVR and ARM USB families
http://qmk.fm
GNU General Public License v2.0
208 stars 84 forks source link

[Feature Request] Quantizer mini - config with own forked firmware #60

Open tcastelly opened 1 year ago

tcastelly commented 1 year ago

Feature Request Type

Description

Be able to use his own Quantizer Mini fork

I've defined custom tap dance, I would want to use them like this, of course it's not possible:

- application:
    keymaps:
      - layer:
          id: 0
          keys:
            KC_CAPS: TD(TD_TAB)

image

Is there an easy way to do this?

Thank you very much.

marfrit commented 1 year ago

For this, the keymap has to be changed, for instance:

enum custom_keycodes {
    MUTE_TEAMS = QK_USER_0,
    MUTE_SKYPE = QK_USER_1,
    DRAG_SCROLL = QK_USER_2,
    NEW_SAFE_RANGE = SAFE_RANGE,
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
    bool cont = process_record_dynamic_config(keycode, record) //
                && process_record_mouse(keycode, record);
    switch (keycode) {
        case MUTE_TEAMS:
            if (record->event.pressed) {
                mute_hold_timert = timer_read();
                tap_code16(LCTL(LSFT(KC_M)));
            } else {
                if (timer_elapsed(mute_hold_timert) > MUTE_HOLD_DELAY) tap_code16(LCTL(LSFT(KC_M)));
            }
            break;

        default:
            break;
    }
    return cont;
}

Then you can use QK_USER_n in the configurator.

tcastelly commented 1 year ago

Thank you so much for your help!

It's the first time I saw QK_USER_[0;...]. Do you know what is the maximum index? I found nothing on the official documentation. Only someone on redit said "QK_USER_31" should be the last.

Thx again for your help. I really appreciate.