Regression

This commit is contained in:
tobspr 2020-06-22 14:46:33 +02:00
parent 231a3c81f4
commit c5613f6eee
2 changed files with 11 additions and 2 deletions

View File

@ -15,7 +15,6 @@ export const CHANGELOG = [
"Improve visibility of shape background in dark mode",
"Added sound when destroying a building",
"Update tutorial image for tier 2 tunnels to explain mix/match (by jimmyshadow1)",
"Prevent default actions on all keybindings in the web version so you don't accidentally use builtin browser shortcuts",
],
},
{

View File

@ -191,7 +191,17 @@ export class InputDistributor {
*/
handleKeyMouseDown(event) {
const keyCode = event instanceof MouseEvent ? event.button + 1 : event.keyCode;
event.preventDefault();
if (
keyCode === 4 || // MB4
keyCode === 5 || // MB5
keyCode === 9 || // TAB
keyCode === 16 || // SHIFT
keyCode === 17 || // CTRL
keyCode === 18 || // ALT
(keyCode >= 112 && keyCode < 122) // F1 - F10
) {
event.preventDefault();
}
const isInitial = !this.keysDown.has(keyCode);
this.keysDown.add(keyCode);