Browse Source

Check ctrl/shift state when focusing and unfocusing the window

tags/v0.1.0
Fen Dweller 5 years ago
parent
commit
cadb3d470f
No known key found for this signature in database GPG Key ID: E80B35A6F11C3656
2 changed files with 18 additions and 0 deletions
  1. +9
    -0
      gorge.css
  2. +9
    -0
      gorge.js

+ 9
- 0
gorge.css View File

@@ -255,6 +255,15 @@ button {
width: 50%; width: 50%;
} }


#resources-area {
top: 15%;
left: 5%;
}

#tasty-micro {
width: 30vw;
}

#upgrades-list { #upgrades-list {
max-height: 25vh !important; max-height: 25vh !important;
} }


+ 9
- 0
gorge.js View File

@@ -1316,6 +1316,15 @@ window.onload = function () {
setTimeout(autosave, 60000); setTimeout(autosave, 60000);
} }


window.onblur = function() {
controlHeld = false;
shiftHeld = false;
}

window.onfocus = function() {
window.dispatchEvent(new Event("keydown"))
}

function autosave() { function autosave() {
saveGame(); saveGame();
let x = window.innerWidth / 2; let x = window.innerWidth / 2;


Loading…
Cancel
Save