fix shift wasd bug
This commit is contained in:
parent
c68110c9fa
commit
49c8eaa468
|
@ -26,16 +26,16 @@ export function initUX(context: any, canvas: any) {
|
|||
}
|
||||
});
|
||||
$(document).keydown((event) => {
|
||||
if (event.key == 'w') {
|
||||
if (event.key == 'w' || event.key == 'W') {
|
||||
context.params.keyboard.w = true;
|
||||
}
|
||||
if (event.key == 's') {
|
||||
if (event.key == 's' || event.key == 'S') {
|
||||
context.params.keyboard.s = true;
|
||||
}
|
||||
if (event.key == 'a') {
|
||||
if (event.key == 'a' || event.key == 'A') {
|
||||
context.params.keyboard.a = true;
|
||||
}
|
||||
if (event.key == 'd') {
|
||||
if (event.key == 'd' || event.key == 'D') {
|
||||
context.params.keyboard.d = true;
|
||||
}
|
||||
if (event.key == 'Shift') {
|
||||
|
@ -46,16 +46,16 @@ export function initUX(context: any, canvas: any) {
|
|||
}
|
||||
});
|
||||
$(document).keyup((event) => {
|
||||
if (event.key == 'w') {
|
||||
if (event.key == 'w' || event.key == 'W') {
|
||||
context.params.keyboard.w = false;
|
||||
}
|
||||
if (event.key == 's') {
|
||||
if (event.key == 's' || event.key == 'S') {
|
||||
context.params.keyboard.s = false;
|
||||
}
|
||||
if (event.key == 'a') {
|
||||
if (event.key == 'a' || event.key == 'A') {
|
||||
context.params.keyboard.a = false;
|
||||
}
|
||||
if (event.key == 'd') {
|
||||
if (event.key == 'd' || event.key == 'D') {
|
||||
context.params.keyboard.d = false;
|
||||
}
|
||||
if (event.key == 'Shift') {
|
||||
|
|
Loading…
Reference in New Issue