From 5fc04152bd18e78bf8a40b5870e02cd317b21a60 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 1 Dec 2023 21:10:51 +0000 Subject: [PATCH] also handle NumpadEnter --- copyparty/web/browser.js | 8 ++++---- copyparty/web/md2.js | 2 +- copyparty/web/util.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 5a39a3b7..b76f4fcb 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -3656,7 +3656,7 @@ var fileman = (function () { (function (a) { f[a].inew.onkeydown = function (e) { rn_ok(a, true); - if (e.key == 'Enter') + if (e.key.endsWith('Enter')) return rn_apply(); }; QS('.rn_dec' + k).onclick = function (e) { @@ -3751,7 +3751,7 @@ var fileman = (function () { if (e.key == 'Escape') return rn_cancel(); - if (e.key == 'Enter') + if (e.key.endsWith('Enter')) return rn_apply(); }; @@ -4999,7 +4999,7 @@ document.onkeydown = function (e) { } } - if (k == 'Enter' && ae && (ae.onclick || ae.hasAttribute('tabIndex'))) + if (k.endsWith('Enter') && ae && (ae.onclick || ae.hasAttribute('tabIndex'))) return ev(e) && ae.click() || true; if (aet && aet != 'a' && aet != 'tr' && aet != 'pre') @@ -5197,7 +5197,7 @@ document.onkeydown = function (e) { } function ev_search_keydown(e) { - if (e.key == 'Enter') + if (e.key.endsWith('Enter')) do_search(); } diff --git a/copyparty/web/md2.js b/copyparty/web/md2.js index b660ec37..efac945a 100644 --- a/copyparty/web/md2.js +++ b/copyparty/web/md2.js @@ -1009,7 +1009,7 @@ var set_lno = (function () { md_home(ev.shiftKey); return false; } - if (!ev.shiftKey && (ev.code == "Enter" || kc == 13)) { + if (!ev.shiftKey && (ev.code.endsWith("Enter") || kc == 13)) { return md_newline(); } if (!ev.shiftKey && kc == 8) { diff --git a/copyparty/web/util.js b/copyparty/web/util.js index 875fc218..92e1304a 100644 --- a/copyparty/web/util.js +++ b/copyparty/web/util.js @@ -1566,7 +1566,7 @@ var modal = (function () { if (k == 'Space' && ae && (ae === eok || ae === eng)) k = 'Enter'; - if (k == 'Enter') { + if (k.endsWith('Enter')) { if (ae && ae == eng) return ng(e);