From b65cc273d1b082872ad96838103f7dee7a316d03 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 13 Jun 2022 01:11:40 +0100 Subject: [PATCH] script: Leave wresting mode on space Signed-off-by: Ian Jackson --- templates/script.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/script.ts b/templates/script.ts index ce6a395c..dc279f2e 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -397,7 +397,7 @@ function recompute_keybindings() { } } add_uo(null, { - def_key: 'W', + def_key: wresting ? 'W SPC' /* won't match, handle ad-hoc */ : 'W', kind: 'ClientExtra', opname: 'wrest', desc: wresting ? 'Exit wresting mode' : 'Enter wresting mode', @@ -495,9 +495,10 @@ function some_keydown(e: KeyboardEvent) { mousecursor_etc_reupdate(); return; } - if (e.key == ' ') { + if (e.key == ' ' || (e.key == 'W' && wresting)) { y(); special_count = null; + wresting = false; mousecursor_etc_reupdate(); return; } -- 2.30.2