This commit is contained in:
Pascal Grossé 2020-06-22 14:53:56 +02:00
commit ebcc52374e
3 changed files with 12 additions and 3 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);

View File

@ -275,7 +275,7 @@ export class HubGoals extends BasicSerializableObject {
* @param {string} upgradeId
* @returns {boolean}
*/
tryUnlockUgprade(upgradeId) {
tryUnlockUpgrade(upgradeId) {
if (!this.canUnlockUpgrade(upgradeId)) {
return false;
}