I have the following function:
gameActions(e: KeyboardEvent) {
if (e.keyCode === 27 || e.keyCode === 9 || (e.keyCode === 9 && e.shiftKey)) {
this.LaunchInventory();
}
else if (e.keyCode === 13) { //Enter
this.Shoot();
}
else if (e.keyCode === 40) { //Down
this.Crouch();
}
else if (e.keyCode === 38) { //Up
this.Jump();
}
}
How can I implement this code using switch case? I am just unable to figure out how to pass the conditional statement e.shiftKey && e.keyCode
to the case statement.