qmk/qmk_firmware

ALT + KC_GRV doesn't work to input an accent

Open

#25,893 建立於 2025年12月20日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)C (43,867 fork)batch import
help wantedquestion

倉庫指標

Star
 (20,368 star)
PR 合併指標
 (平均合併 20天 9小時) (30 天內合併 27 個 PR)

描述

Issue Description

Hi there! First, let me thank you for your awesome work!

I'm opening this issue to ask a question, and possibly report a bug. I wanted to create shortcuts in my key mappings to put accents on any vowels. I'm on MacOS, and with US language and Unicode Hex keys enabled, you can do so by pressing ALT/OPT + e/u/i/` then whatever vowel you want. For instance, ALT+e+e = é, ALT+`+a=à, ALT+u+i=ï and so on. So I added this function to associate a keycode with these shortcuts:

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
    switch (keycode) {
        case KC_GR:
            if (record->event.pressed) {
                tap_code16(RALT(KC_GRAVE));  // does NOT work
                return false;
            }
            break;
        case KC_SHARP:
            if (record->event.pressed) {
                tap_code16(A(KC_E));  // works
                return false;
            }
            break;
        case KC_CFLEX:
            if (record->event.pressed) {
                tap_code16(A(KC_I));  // works
                return false;
            }
            break;
        case KC_TREMA:
            if (record->event.pressed) {
                tap_code16(A(KC_U));  // works
                return false;
            }
            break;
    }
    return true;
}

And all the cases works, except KC_GR for `. However, I can press ALT+KC_GRAVE on my keyboard and have the expected behaviour. I don't really get why it works for all other accent but not `. Is this a bug, or am I doing something wrong ?

Thanks in advance for your help!

貢獻者指南