Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
var KEY = {
UP: 38,
DOWN: 40,
W: 87,
S: 83
};
// Objekt erzeugen
var pingpong = {}
// array pressedKeys anlegen
pingpong.pressedKeys = [];
$(function() {
// Zustand der keys in array() schreiben
$(document).keydown(function(e){
pingpong.pressedKeys[e.which] = true;
});
$(document).keyup(function(e){
pingpong.pressedKeys[e.which] = false;
});
});
function moveSliders() {
// identisch mit: if (pingpong.pressedKeys[38] == true)
if (pingpong.pressedKeys[KEY.UP]) { // arrow up
// tu was
}
}
Mit den F-Tasten wird es wohl nicht hinhauen...
wie muss ich da des Java-Scribt reinschreiben ?