fix: normalize Korean shifted input
This commit is contained in:
@@ -189,6 +189,63 @@ engine_telex_history_bound(struct ct *t)
|
||||
CT_EQ_INT(t, 0, im.raw.n);
|
||||
}
|
||||
|
||||
void
|
||||
engine_korean_modifiers_and_backspace(struct ct *t)
|
||||
{
|
||||
static const struct {
|
||||
Rune key;
|
||||
char *plain;
|
||||
char *shifted;
|
||||
} cases[] = {
|
||||
{ 'r', "ㄱ", "ㄲ" }, { 'e', "ㄷ", "ㄸ" },
|
||||
{ 'q', "ㅂ", "ㅃ" }, { 't', "ㅅ", "ㅆ" },
|
||||
{ 'w', "ㅈ", "ㅉ" }, { 'o', "ㅐ", "ㅒ" },
|
||||
{ 'p', "ㅔ", "ㅖ" },
|
||||
};
|
||||
Str com;
|
||||
int i;
|
||||
|
||||
for(i = 0; i < nelem(cases); i++){
|
||||
init();
|
||||
im.l = getlang(LangKO);
|
||||
sclear(&com);
|
||||
CT_CHECK(t, keystroke(cases[i].key, 0, &com));
|
||||
checkstr(t, "plain Korean key", cases[i].plain, &im.pre);
|
||||
|
||||
init();
|
||||
im.l = getlang(LangKO);
|
||||
sclear(&com);
|
||||
CT_CHECK(t, keystroke(cases[i].key, Mshift, &com));
|
||||
checkstr(t, "shifted Korean key", cases[i].shifted, &im.pre);
|
||||
|
||||
init();
|
||||
im.l = getlang(LangKO);
|
||||
sclear(&com);
|
||||
CT_CHECK(t, keystroke(cases[i].key - 'a' + 'A', 0, &com));
|
||||
checkstr(t, "Caps Lock Korean key", cases[i].plain, &im.pre);
|
||||
|
||||
init();
|
||||
im.l = getlang(LangKO);
|
||||
sclear(&com);
|
||||
CT_CHECK(t, keystroke(cases[i].key, Mshift, &com));
|
||||
checkstr(t, "Shift+Caps Korean key", cases[i].shifted, &im.pre);
|
||||
}
|
||||
|
||||
init();
|
||||
im.l = getlang(LangKO);
|
||||
sclear(&com);
|
||||
if(typekeys(t, "rkr", &com)){
|
||||
checkstr(t, "Korean engine preedit", "각", &im.pre);
|
||||
CT_CHECK(t, keystroke(Kback, 0, &com));
|
||||
checkstr(t, "Korean final backspace", "가", &im.pre);
|
||||
CT_CHECK(t, keystroke(Kback, 0, &com));
|
||||
checkstr(t, "Korean vowel backspace", "ㄱ", &im.pre);
|
||||
CT_CHECK(t, keystroke(Kback, 0, &com));
|
||||
CT_EQ_INT(t, 0, im.pre.n);
|
||||
CT_CHECK(t, !keystroke(Kback, 0, &com));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
engine_language_switch_state(struct ct *t)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user