I'm working on a framework for making games and i have a function for taking key input.
But since its a framework specific options need to be optional an example would be if you want movement by arrow keys, 'aswd' or maybe even mouse but if you want to use mouse you don't want to have arrow keys activated
so what i need to do is add if statements to the function after its declared.
The function:
Note: there is nothing wrong with the function it works fine
var key = [];
onkeydown = onkeyup = function(e){
e = e || even;
key[e.keyCode] = e.type == 'keydown';
//insert here
};
Is there i can add this:
to the place where it says //insert here
if(map[17] && map[16] && map[65]){ // CTRL+SHIFT+A
alert('Control Shift A');
}
Help would be much appreciated.