From 07bf167503e4ea2f6787d9f4f931681771b51045 Mon Sep 17 00:00:00 2001 From: Tobias Schaffner Date: Wed, 6 Mar 2024 13:05:46 +0100 Subject: [PATCH] feat(www): Enable the usage of modifier keys Send the modifier keys (ctrl, shift, alt, meta) together with the send key. This allows for example allows to hit crtl-c. Signed-off-by: Tobias Schaffner --- mtda/assets/keysight.js | 8 ++++++-- mtda/templates/index.html | 13 +++++++++---- mtda/www.py | 8 +++++++- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/mtda/assets/keysight.js b/mtda/assets/keysight.js index 489b3d0a..482325a7 100644 --- a/mtda/assets/keysight.js +++ b/mtda/assets/keysight.js @@ -60,7 +60,7 @@ 12: "num", 13: "\n", 16: "shift", - 17: "meta", + 17: "ctrl", 18: "alt", 19: "pause", 20: "caps", @@ -156,7 +156,11 @@ else var f = t.toUpperCase(); return { "char": f, - key: t + key: t, + ctrl: e.ctrlKey, + shift: e.shiftKey, + alt: e.altKey, + cmd: e.metaKey, } }, e.exports.unprintableKeys = { "\b": 1, diff --git a/mtda/templates/index.html b/mtda/templates/index.html index d30fa49b..d6589607 100644 --- a/mtda/templates/index.html +++ b/mtda/templates/index.html @@ -108,10 +108,15 @@