From ddf69615ce400628c729f39218fff365d7ccfe95 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Fri, 1 Oct 2021 11:22:52 +0200 Subject: [PATCH] tweaked detectable keynames and representations --- HISTORY.md | 3 +++ snap.html | 2 +- src/objects.js | 11 ++++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 70be4791..86278400 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -35,6 +35,9 @@ * German * Chinese, thanks, Simon! +### 2021-10-01 +* objects: tweaked detectable keynames and representations + ### 2021-09-30 * blocks, objects, threads, gui: optional upvars referencing event data for message, key and scene hat blocks * blocks: disabled dropping reporters onto message hat block input slots diff --git a/snap.html b/snap.html index 91f3c413..fe0f8cb6 100755 --- a/snap.html +++ b/snap.html @@ -18,7 +18,7 @@ - + diff --git a/src/objects.js b/src/objects.js index 0f5f2514..954f5055 100644 --- a/src/objects.js +++ b/src/objects.js @@ -86,7 +86,7 @@ AlignmentMorph, Process, WorldMap, copyCanvas, useBlurredShadows*/ /*jshint esversion: 6*/ -modules.objects = '2021-September-30'; +modules.objects = '2021-October-01'; var SpriteMorph; var StageMorph; @@ -8377,7 +8377,9 @@ StageMorph.prototype.processKeyEvent = function (event, action) { event.keyCode || event.charCode ); if (event.ctrlKey || event.metaKey) { - keyName = 'ctrl ' + (event.shiftKey ? 'shift ' : '') + keyName; + keyName = + (keyName === 'Control' || keyName === 'Meta' ? '' : 'ctrl ') + + (event.shiftKey ? 'shift ' : '') + keyName; } } action.call(this, keyName); @@ -8433,7 +8435,10 @@ StageMorph.prototype.fireKeyEvent = function (key) { varFrame; if (varName) { varFrame = new VariableFrame(); - varFrame.addVar(varName, key); // original, not lowercased + varFrame.addVar( + varName, + key === 'space' ? ' ' : key // not lowercased + ); } procs.push(this.threads.startProcess( block,