Skip to content
Snippets Groups Projects
Commit 85b15090 authored by Ray Schamp's avatar Ray Schamp
Browse files

Send modifier keys to VM but allow bubbling

This allows the keys to be used for developer shortcuts, but also keeps the "if any key pressed" block working (and hacked key blocks).
parent 0bfcd3fe
Branches
Tags
No related merge requests found
......@@ -23,13 +23,14 @@ class VMManager {
// Don't capture keys intended for Blockly inputs.
if (e.target !== document && e.target !== document.body) return;
// Don't capture browser keyboard shortcuts
if (e.metaKey || e.altKey || e.ctrlKey) return;
this.vm.postIOData('keyboard', {
keyCode: e.keyCode,
isDown: true
});
// Don't stop browser keyboard shortcuts
if (e.metaKey || e.altKey || e.ctrlKey) return;
e.preventDefault();
}
onKeyUp (e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment