From fca0d1f01cbd35b620e33edd7720b5a3183d63d2 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Tue, 20 Jul 2021 16:15:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E5=B1=80=E5=95=86=E5=BA=97=E5=8F=AF?= =?UTF-8?q?=E9=95=BF=E6=8C=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/plugins.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/project/plugins.js b/project/plugins.js index e5a14021..68c610bc 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -235,6 +235,22 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.actions._clickAction(core.actions.HSIZE, topIndex + choices.length - 1); return true; } + if (keycode == 13 || keycode == 32) return true; + return false; + }, 60); + + /// 允许长按空格或回车连续执行操作 + core.registerAction('keyDown', 'shops', function (keycode) { + if (!core.status.lockControl || !core.hasFlag("@temp@shop") || core.status.event.id != 'action') return false; + if (core.status.event.data.type != 'choices') return false; + var data = core.status.event.data.current; + var choices = data.choices; + var topIndex = core.actions.HSIZE - parseInt((choices.length - 1) / 2) + (core.status.event.ui.offset || 0); + if (keycode == 13 || keycode == 32) { // Space, Enter + core.actions._clickAction(core.actions.HSIZE, topIndex + core.status.event.selection); + return true; + } + return false; }, 60); },