From b842c724e205985a9f9baf2e2b8057d7ee922a7c Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Thu, 28 May 2026 18:10:41 +0900 Subject: [PATCH] add popup toggle --- README.md | 1 + strans.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 79ccc13..c0bbe25 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ Switch input modes with Ctrl + key: T English V Vietnamese (Telex) E Emoji + P Toggle preedit/candidate popup window Type romanized input. Select candidates with 1-9 or arrow keys. Tab or Enter to commit. diff --git a/strans.c b/strans.c index 9a1392e..42c00f5 100644 --- a/strans.c +++ b/strans.c @@ -2,6 +2,7 @@ #include "fn.h" static Im im; +static int popup = 1; static void dictqmap(Im*); static void @@ -45,6 +46,8 @@ show(void) Drawcmd dc; int i, first, n; + if(!popup) + return; sclear(&dc.pre); if(!mapget(im.l->map, &im.pre, &dc.pre)) dc.pre = im.pre; @@ -256,6 +259,10 @@ keystroke(u32int ks, u32int mod, Str *com) reset(); if(ks >= 'a' && ks <= 'z') ks -= 'a' - 1; + if(ks == 0x10){ + popup = !popup; + return 1; + } if(setlang(ks)) return 1; return 0;