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:
2026-08-17 00:54:36 +09:00
parent 63fc60dc06
commit b77400fa86
4 changed files with 29 additions and 0 deletions

View File

@@ -16,6 +16,9 @@ Vietnamese Telex is also available as a compatibility mode.
| `Ctrl+E` | Emoji and symbol search | | `Ctrl+E` | Emoji and symbol search |
| `Ctrl+H` | One-shot Hanja 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. A complete Japanese reading shows its Kanji candidates with none chosen.
`Space` chooses the first and then steps on, wrapping (`Shift+Space` steps `Space` chooses the first and then steps on, wrapping (`Shift+Space` steps
back); `Up`/`Down` and `PageUp`/`PageDown` move without wrapping. An back); `Up`/`Down` and `PageUp`/`PageDown` move without wrapping. An

2
ipc.h
View File

@@ -39,6 +39,8 @@ enum
Kdown = Kspec|0x54, Kdown = Kspec|0x54,
Kpgup = Kspec|0x55, Kpgup = Kspec|0x55,
Kpgdown = Kspec|0x56, Kpgdown = Kspec|0x56,
Khangul = Kspec|0x31,
Khanja = Kspec|0x34,
Kmodfirst = Kspec|0xe1, Kmodfirst = Kspec|0xe1,
Kmodlast = Kspec|0xee, Kmodlast = Kspec|0xee,

View File

@@ -682,6 +682,14 @@ transition(u32int ks, u32int mod, Str *com)
ks = kokey(ks, mod); ks = kokey(ks, mod);
else if(isjp(&im) && ks >= 'A' && ks <= 'Z') else if(isjp(&im) && ks >= 'A' && ks <= 'Z')
ks += 'a' - 'A'; /* romaji is case-blind, Caps Lock included */ 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) if(search.lang)
return searchkey(ks, mod, com); return searchkey(ks, mod, com);
n = movedelta(ks); n = movedelta(ks);

View File

@@ -1855,6 +1855,22 @@ engine_hanja_input_languages(struct ct *t)
checkstr(t, "Japanese Hanja commit", "", &com); checkstr(t, "Japanese Hanja commit", "", &com);
CT_EQ_INT(t, LangJP, im.l->lang); 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(); init();
im.l = getlang(LangEN); im.l = getlang(LangEN);
sclear(&com); sclear(&com);