add popup toggle

This commit is contained in:
2026-05-28 18:10:41 +09:00
parent 403f5d52f1
commit b842c724e2
2 changed files with 8 additions and 0 deletions

View File

@@ -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.

View File

@@ -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;