engine: Ctrl+Shift chords belong to the application
Ctrl+Shift+V switched to Vietnamese and ate the key, in every terminal where it pastes; Ctrl+Shift+T and N opened no tab. Only a plain Ctrl+letter is a strans command now; a chord with Shift, Alt, or Super commits what is pending and passes, as Alt and Super chords already did. Caps Lock still works: the keysym's case never mattered.
This commit is contained in:
19
strans.c
19
strans.c
@@ -615,6 +615,16 @@ searchlang(Rune c)
|
||||
return c == LangEMOJI || c == LangHANJA ? c : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* A chord with Alt or Super, or Ctrl with Shift, is the application's
|
||||
* (Ctrl+Shift+V pastes); only a plain Ctrl+letter is a strans command.
|
||||
*/
|
||||
static int
|
||||
chord(u32int mod)
|
||||
{
|
||||
return (mod & ~Mshift) != 0 && mod != Mctrl;
|
||||
}
|
||||
|
||||
static void
|
||||
endsearch(void)
|
||||
{
|
||||
@@ -722,12 +732,11 @@ searchkey(u32int ks, u32int mod, Str *com)
|
||||
endsearch();
|
||||
return 1;
|
||||
}
|
||||
if(ks >= Kspec || (ks < ' ' && !(mod & Mctrl)) ||
|
||||
(mod & (Malt|Msuper))){
|
||||
if(ks >= Kspec || (ks < ' ' && !(mod & Mctrl)) || chord(mod)){
|
||||
flush(com);
|
||||
return 0;
|
||||
}
|
||||
if(mod & Mctrl){
|
||||
if(mod == Mctrl){
|
||||
c = ctrlkey(ks);
|
||||
n = searchlang(c);
|
||||
if(n != 0 && n != search.lang){
|
||||
@@ -821,11 +830,11 @@ transition(u32int ks, u32int mod, Str *com)
|
||||
reset();
|
||||
return 1;
|
||||
}
|
||||
if(ks >= Kspec || (mod & (Malt|Msuper))){
|
||||
if(ks >= Kspec || chord(mod)){
|
||||
flush(com);
|
||||
return 0;
|
||||
}
|
||||
if(mod & Mctrl){
|
||||
if(mod == Mctrl){
|
||||
c = ctrlkey(ks);
|
||||
n = searchlang(c);
|
||||
if(n != 0){
|
||||
|
||||
Reference in New Issue
Block a user