Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions _web/_includes/go-js.html
Original file line number Diff line number Diff line change
Expand Up @@ -1144,10 +1144,6 @@
}


if (evt.which === 17) { // control
controlled = true;
}

if (evt.which === 72) { // h
jukeboxData.infiniteMode = !jukeboxData.infiniteMode;
if (jukeboxData.infiniteMode) {
Expand All @@ -1157,10 +1153,6 @@
}
}

if (evt.which === 16) { // shift
shifted = true;
}

if (evt.which === 32) { // space
evt.preventDefault();
if (driver.isRunning()) {
Expand All @@ -1172,13 +1164,14 @@

}

function keyup(evt) {
if (evt.which == 17) { // control
controlled = false;
}
if (evt.which == 16) { // shift
shifted = false;
}
function updateCtrlShift(evt) {
controlled = evt.ctrlKey
shifted = evt.shiftKey
}

function resetCtrlShit() {
controlled = false;
shifted = false;
}

function getShareURL(callback) {
Expand Down Expand Up @@ -1207,7 +1200,12 @@
};

$(document).keydown(keydown);
$(document).keyup(keyup);

window.addEventListener('keydown', updateCtrlShift)
window.addEventListener('keyup', updateCtrlShift)
window.addEventListener('keypress', updateCtrlShift)
document.addEventListener('blur', resetCtrlShit);
window.addEventListener('blur', resetCtrlShit);

paper = Raphael("tiles", W, H);

Expand Down