engine: the Korean keyboard's 한/영 and 한자 keys
A Korean keyboard sends Hangul and Hangul_Hanja for its two extra keys; they did nothing but end the composition. Now 한/영 toggles Korean and English and 한자 opens the Hanja search, by standing in for Ctrl+S, Ctrl+T, and Ctrl+H, as fcitx5-hangul binds them.
This commit is contained in:
@@ -16,6 +16,9 @@ Vietnamese Telex is also available as a compatibility mode.
|
||||
| `Ctrl+E` | Emoji and symbol search |
|
||||
| `Ctrl+H` | One-shot Hanja search |
|
||||
|
||||
A Korean keyboard's 한/영 key toggles Korean and English, and its 한자 key
|
||||
is `Ctrl+H`.
|
||||
|
||||
A complete Japanese reading shows its Kanji candidates with none chosen.
|
||||
`Space` chooses the first and then steps on, wrapping (`Shift+Space` steps
|
||||
back); `Up`/`Down` and `PageUp`/`PageDown` move without wrapping. An
|
||||
|
||||
2
ipc.h
2
ipc.h
@@ -39,6 +39,8 @@ enum
|
||||
Kdown = Kspec|0x54,
|
||||
Kpgup = Kspec|0x55,
|
||||
Kpgdown = Kspec|0x56,
|
||||
Khangul = Kspec|0x31,
|
||||
Khanja = Kspec|0x34,
|
||||
Kmodfirst = Kspec|0xe1,
|
||||
Kmodlast = Kspec|0xee,
|
||||
|
||||
|
||||
8
strans.c
8
strans.c
@@ -682,6 +682,14 @@ transition(u32int ks, u32int mod, Str *com)
|
||||
ks = kokey(ks, mod);
|
||||
else if(isjp(&im) && ks >= 'A' && ks <= 'Z')
|
||||
ks += 'a' - 'A'; /* romaji is case-blind, Caps Lock included */
|
||||
/* The Korean keyboard's 한/영 and 한자 keys are Ctrl+S or Ctrl+T, and Ctrl+H. */
|
||||
if(ks == Khangul){
|
||||
ks = im.l->lang == LangKO ? 't' : 's';
|
||||
mod = Mctrl;
|
||||
}else if(ks == Khanja){
|
||||
ks = 'h';
|
||||
mod = Mctrl;
|
||||
}
|
||||
if(search.lang)
|
||||
return searchkey(ks, mod, com);
|
||||
n = movedelta(ks);
|
||||
|
||||
@@ -1855,6 +1855,22 @@ engine_hanja_input_languages(struct ct *t)
|
||||
checkstr(t, "Japanese Hanja commit", "か", &com);
|
||||
CT_EQ_INT(t, LangJP, im.l->lang);
|
||||
|
||||
/* The keyboard's own keys: 한자 seeds like Ctrl+H, 한/영 toggles. */
|
||||
init();
|
||||
im.l = getlang(LangKO);
|
||||
sclear(&com);
|
||||
if(typekeys(t, "gks", &com)){
|
||||
CT_CHECK(t, keystroke(Khanja, 0, &com));
|
||||
checkstr(t, "Hanja key seed", "한", &search.text);
|
||||
CT_EQ_INT(t, 2, im.nkouho);
|
||||
CT_CHECK(t, keystroke(Khangul, 0, &com));
|
||||
checkstr(t, "Hangul key commits the query", "한", &com);
|
||||
CT_EQ_INT(t, 0, search.lang);
|
||||
CT_EQ_INT(t, LangEN, im.l->lang);
|
||||
CT_CHECK(t, keystroke(Khangul, 0, &com));
|
||||
CT_EQ_INT(t, LangKO, im.l->lang);
|
||||
}
|
||||
|
||||
init();
|
||||
im.l = getlang(LangEN);
|
||||
sclear(&com);
|
||||
|
||||
Reference in New Issue
Block a user