add popup toggle
This commit is contained in:
@@ -51,6 +51,7 @@ Switch input modes with Ctrl + key:
|
|||||||
T English
|
T English
|
||||||
V Vietnamese (Telex)
|
V Vietnamese (Telex)
|
||||||
E Emoji
|
E Emoji
|
||||||
|
P Toggle preedit/candidate popup window
|
||||||
|
|
||||||
Type romanized input. Select candidates with 1-9 or arrow keys.
|
Type romanized input. Select candidates with 1-9 or arrow keys.
|
||||||
Tab or Enter to commit.
|
Tab or Enter to commit.
|
||||||
|
|||||||
7
strans.c
7
strans.c
@@ -2,6 +2,7 @@
|
|||||||
#include "fn.h"
|
#include "fn.h"
|
||||||
|
|
||||||
static Im im;
|
static Im im;
|
||||||
|
static int popup = 1;
|
||||||
static void dictqmap(Im*);
|
static void dictqmap(Im*);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -45,6 +46,8 @@ show(void)
|
|||||||
Drawcmd dc;
|
Drawcmd dc;
|
||||||
int i, first, n;
|
int i, first, n;
|
||||||
|
|
||||||
|
if(!popup)
|
||||||
|
return;
|
||||||
sclear(&dc.pre);
|
sclear(&dc.pre);
|
||||||
if(!mapget(im.l->map, &im.pre, &dc.pre))
|
if(!mapget(im.l->map, &im.pre, &dc.pre))
|
||||||
dc.pre = im.pre;
|
dc.pre = im.pre;
|
||||||
@@ -256,6 +259,10 @@ keystroke(u32int ks, u32int mod, Str *com)
|
|||||||
reset();
|
reset();
|
||||||
if(ks >= 'a' && ks <= 'z')
|
if(ks >= 'a' && ks <= 'z')
|
||||||
ks -= 'a' - 1;
|
ks -= 'a' - 1;
|
||||||
|
if(ks == 0x10){
|
||||||
|
popup = !popup;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
if(setlang(ks))
|
if(setlang(ks))
|
||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user