X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=st.c;h=932253c3953566b7892411be73603c9e4873d739;hb=16ccf344deccbae53865b6efbe9dc23ebdceccb7;hp=dbbc1f69b66596683d4bf19d5f88e4c5d777b006;hpb=7474a2fc3785eb1aad00f8cf2b50711bbe1fff0b;p=st.git diff --git a/st.c b/st.c index dbbc1f6..932253c 100644 --- a/st.c +++ b/st.c @@ -2699,18 +2699,22 @@ kmap(KeySym k, uint state) { if(kp->k != k) continue; + if((state & mask) != mask && (mask == XK_NO_MOD && state)) { continue; } + if((kp->appkey < 0 && IS_SET(MODE_APPKEYPAD)) || (kp->appkey > 0 && !IS_SET(MODE_APPKEYPAD))) { continue; } + if((kp->appcursor < 0 && IS_SET(MODE_APPCURSOR)) || (kp->appcursor > 0 && !IS_SET(MODE_APPCURSOR))) { continue; } + if((kp->crlf < 0 && IS_SET(MODE_CRLF)) || (kp->crlf > 0 && !IS_SET(MODE_CRLF))) { continue; @@ -2718,6 +2722,7 @@ kmap(KeySym k, uint state) { return kp->s; } + return NULL; }