fix: normalize Korean shifted input
This commit is contained in:
14
strans.c
14
strans.c
@@ -159,6 +159,8 @@ dictqmap(Im *im)
|
||||
|
||||
clearkouho();
|
||||
show();
|
||||
if(im->l->map == nil)
|
||||
return;
|
||||
if(!mapget(im->l->map, &im->pre, &dict))
|
||||
return;
|
||||
dictsend(im, &dict);
|
||||
@@ -374,6 +376,16 @@ ctrlkey(Rune c)
|
||||
return c;
|
||||
}
|
||||
|
||||
static Rune
|
||||
kokey(Rune c, u32int mod)
|
||||
{
|
||||
if(c >= 'A' && c <= 'Z')
|
||||
c += 'a' - 'A';
|
||||
if((mod & Mshift) && c >= 'a' && c <= 'z')
|
||||
c -= 'a' - 'A';
|
||||
return c;
|
||||
}
|
||||
|
||||
static int
|
||||
ismodkey(u32int ks)
|
||||
{
|
||||
@@ -694,6 +706,8 @@ keystroke(u32int ks, u32int mod, Str *com)
|
||||
reset();
|
||||
return 1;
|
||||
}
|
||||
if(im.l->lang == LangKO)
|
||||
ks = kokey(ks, mod);
|
||||
n = dotrans(ks, com);
|
||||
show();
|
||||
return n;
|
||||
|
||||
Reference in New Issue
Block a user