aboutsummaryrefslogtreecommitdiffstats
path: root/x.c
diff options
context:
space:
mode:
authorjoe <rbo@gmx.us>2025-09-27 18:26:49 +0200
committerjoe <rbo@gmx.us>2025-09-27 18:26:49 +0200
commitfe05bb9fa96d789f2836b64c1f35c75f1d52d129 (patch)
tree4566a7ca96565740f45a2ad781eca1404f969109 /x.c
parentpatches (diff)
downloadst-fe05bb9fa96d789f2836b64c1f35c75f1d52d129.tar.gz
st-fe05bb9fa96d789f2836b64c1f35c75f1d52d129.tar.bz2
st-fe05bb9fa96d789f2836b64c1f35c75f1d52d129.tar.xz
st-fe05bb9fa96d789f2836b64c1f35c75f1d52d129.tar.zst
st-fe05bb9fa96d789f2836b64c1f35c75f1d52d129.zip
up
Diffstat (limited to 'x.c')
-rw-r--r--x.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/x.c b/x.c
index ae1ea78..0cc8958 100644
--- a/x.c
+++ b/x.c
@@ -1876,6 +1876,13 @@ kpress(XEvent *ev)
} else {
len = XLookupString(e, buf, sizeof buf, &ksym, NULL);
}
+ if ( IS_SET(MODE_KBDSELECT) ) {
+ if ( match(XK_NO_MOD, e->state) ||
+ (XK_Shift_L | XK_Shift_R) & e->state )
+ win.mode ^= trt_kbdselect(ksym, buf, len);
+ return;
+ }
+
/* 1. shortcuts */
for (bp = shortcuts; bp < shortcuts + LEN(shortcuts); bp++) {
if (ksym == bp->keysym && match(bp->mod, e->state)) {
@@ -2053,6 +2060,14 @@ usage(void)
" [stty_args ...]\n", argv0, argv0);
}
+void toggle_winmode(int flag) {
+ win.mode ^= flag;
+}
+
+void keyboard_select(const Arg *dummy) {
+ win.mode ^= trt_kbdselect(-1, NULL, 0);
+}
+
int
main(int argc, char *argv[])
{