diff options
| author | Gubolin <gubolin@fantasymail.de> | 2014-11-03 16:32:17 +0100 |
|---|---|---|
| committer | Gubolin <gubolin@fantasymail.de> | 2014-11-03 16:32:17 +0100 |
| commit | 1f750eb56047320f5c835c8b997f75e5e513d4eb (patch) | |
| tree | a7ebc72198e802ac31e8fccc781a5ab26c28dbe2 | |
| parent | 5f3279990be3478fde79b94f7dbd5d7da80df84b (diff) | |
| download | snap-1f750eb56047320f5c835c8b997f75e5e513d4eb.tar.gz snap-1f750eb56047320f5c835c8b997f75e5e513d4eb.zip | |
add ANY KEY to key hat block (fix #387)
| -rw-r--r-- | blocks.js | 1 | ||||
| -rw-r--r-- | objects.js | 10 |
2 files changed, 10 insertions, 1 deletions
@@ -953,6 +953,7 @@ SyntaxElementMorph.prototype.labelPart = function (spec) { null, false, { + 'any key': ['any key'], 'up arrow': ['up arrow'], 'down arrow': ['down arrow'], 'right arrow': ['right arrow'], @@ -3483,7 +3483,15 @@ SpriteMorph.prototype.allHatBlocksForKey = function (key) { return this.scripts.children.filter(function (morph) { if (morph.selector) { if (morph.selector === 'receiveKey') { - return morph.inputs()[0].evaluate()[0] === key; + var selectedOption = morph.inputs()[0].evaluate()[0]; + + if (selectedOption === 'any key') { + return true; + } + if (selectedOption === key) { + return true; + } + return false; } } return false; |
