Support "last key pressed" outside of compiler

This commit is contained in:
Thomas Weber committed 2020-09-17 14:20:34 -05:00
1 parent f380960e25
commit bb64cd7ec8
1 file changed
+4
+4
View File
@@ -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;