Don't capture keys intended for the browser
This is mostly because it was annoying that Cmd-Opt-J didn't work, but seems like a good thing to have in general.
This commit is contained in:
1 parent
be82bddd0c
commit
0bfcd3fed2
1 file changed
+5
-3
@@ -21,9 +21,11 @@ class VMManager {
|
||||
}
|
||||
onKeyDown (e) {
|
||||
// Don't capture keys intended for Blockly inputs.
|
||||
if (e.target !== document && e.target !== document.body) {
|
||||
return;
|
||||
}
|
||||
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
|
||||
|
||||
Reference in new issue
Block a user