From: Ian Jackson Date: Mon, 13 Jun 2022 00:11:40 +0000 (+0100) Subject: script: Leave wresting mode on space X-Git-Tag: otter-1.2.0~19 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=b65cc273d1b082872ad96838103f7dee7a316d03;p=otter.git script: Leave wresting mode on space Signed-off-by: Ian Jackson --- 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; }