This PR modifies the key down event listener. Previously this was discarding any events targeting anything below the <body>, but this meant that the "when key pressed" block didn't trigger if the Blockly environment (as opposed to e.g. the stage or other bit of the UI) had focus. It's unclear to me why this behavior changed, but based on the existing comment I think adjusting the check to check for events targeted at an input element and discard only those is safe, and allows the "when key pressed" block to function as expected.
This PR modifies the key down event listener. Previously this was discarding any events targeting anything below the
<body>
, but this meant that the "when key pressed" block didn't trigger if the Blockly environment (as opposed to e.g. the stage or other bit of the UI) had focus. It's unclear to me why this behavior changed, but based on the existing comment I think adjusting the check to check for events targeted at an input element and discard only those is safe, and allows the "when key pressed" block to function as expected.This fixes https://github.com/gonfunko/scratch-blocks/issues/72.