mirror of
https://github.com/LukeSmithxyz/st.git
synced 2024-11-22 07:15:59 +01:00
Simplify logic in kmap().
This commit is contained in:
parent
1fa27b93f9
commit
7263820759
1 changed files with 5 additions and 14 deletions
19
st.c
19
st.c
|
@ -3531,25 +3531,16 @@ kmap(KeySym k, uint state) {
|
||||||
if(!match(kp->mask, state))
|
if(!match(kp->mask, state))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(kp->appkey > 0) {
|
if(IS_SET(MODE_APPKEYPAD) ? kp->appkey < 0 : kp->appkey > 0)
|
||||||
if(!IS_SET(MODE_APPKEYPAD))
|
continue;
|
||||||
continue;
|
if(term.numlock && kp->appkey == 2)
|
||||||
if(term.numlock && kp->appkey == 2)
|
|
||||||
continue;
|
|
||||||
} else if(kp->appkey < 0 && IS_SET(MODE_APPKEYPAD)) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
if((kp->appcursor < 0 && IS_SET(MODE_APPCURSOR)) ||
|
if(IS_SET(MODE_APPCURSOR) ? kp->appcursor < 0 : kp->appcursor > 0)
|
||||||
(kp->appcursor > 0
|
|
||||||
&& !IS_SET(MODE_APPCURSOR))) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
if((kp->crlf < 0 && IS_SET(MODE_CRLF)) ||
|
if(IS_SET(MODE_CRLF) ? kp->crlf < 0 : kp->crlf > 0)
|
||||||
(kp->crlf > 0 && !IS_SET(MODE_CRLF))) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
return kp->s;
|
return kp->s;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue