X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=st.c;h=538ed9a4c21695bf2be39bed9fa6e8c7f1f5beb1;hb=2f215654a4b27eb573fb6551d28bdf760e95ef58;hp=4c8d67f9155a63930c6de72bc98743b259d0d593;hpb=b6cfff16254bb9014f27ff4c5c9e49953ee91735;p=st.git diff --git a/st.c b/st.c index 4c8d67f..538ed9a 100644 --- a/st.c +++ b/st.c @@ -110,7 +110,8 @@ enum term_mode { MODE_MOUSEBTN = 32, MODE_MOUSEMOTION = 64, MODE_MOUSE = 32|64, - MODE_REVERSE = 128 + MODE_REVERSE = 128, + MODE_KBDLOCK = 256 }; enum escape_state { @@ -292,7 +293,7 @@ static void tfulldirt(void); static void ttynew(void); static void ttyread(void); -static void ttyresize(int, int); +static void ttyresize(void); static void ttywrite(const char *, size_t); static void xdraws(char *, Glyph, int, int, int, int); @@ -899,7 +900,7 @@ ttywrite(const char *s, size_t n) { } void -ttyresize(int x, int y) { +ttyresize(void) { struct winsize w; w.ws_row = term.row; @@ -1328,6 +1329,9 @@ tsetmode(bool priv, bool set, int *args, int narg) { } } else { switch(*args) { + case 2: + MODBIT(term.mode, set, MODE_KBDLOCK); + break; case 4: MODBIT(term.mode, set, MODE_INSERT); break; @@ -2257,6 +2261,8 @@ kpress(XEvent *ev) { int shift; Status status; + if (IS_SET(MODE_KBDLOCK)) + return; meta = e->state & Mod1Mask; shift = e->state & ShiftMask; len = XmbLookupString(xw.xic, e, buf, sizeof(buf), &ksym, &status); @@ -2327,7 +2333,7 @@ resize(XEvent *e) { xclear(0, 0, xw.w, xw.h); tresize(col, row); xresize(col, row); - ttyresize(col, row); + ttyresize(); } void