From bb64cd7ec8c092f643e23dbdb87240feb9bbbc50 Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Thu, 17 Sep 2020 14:20:34 -0500 Subject: [PATCH] Support "last key pressed" outside of compiler --- src/blocks/scratch3_procedures.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/blocks/scratch3_procedures.js b/src/blocks/scratch3_procedures.js index 56d3f3e7..396e48f1 100644 --- a/src/blocks/scratch3_procedures.js +++ b/src/blocks/scratch3_procedures.js @@ -58,6 +58,10 @@ class Scratch3ProcedureBlocks { argumentReporterStringNumber (args, util) { const value = util.getParam(args.VALUE); if (value === null) { + // tw: support some more blocks + if (`${args.VALUE}`.toLowerCase() === 'last key pressed') { + return util.ioQuery('keyboard', 'getLastKeyPressed'); + } // When the parameter is not found in the most recent procedure // call, the default is always 0. return 0;