qmk/qmk_firmware

ALT + KC_GRV doesn't work to input an accent

已关闭

#25,893 创建于 2025年12月20日

 (2 条评论) (0 个反应) (0 位负责人)C (43,867 个派生)batch import
help wantedquestion

仓库指标

星标
 (20,368 个星标)
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!

贡献者指南