mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2024-09-20 02:46:23 +00:00
fix value error
This commit is contained in:
parent
e5c7e27526
commit
eaac8e0992
2 changed files with 7 additions and 6 deletions
|
@ -2720,18 +2720,19 @@ class EmulatorJS {
|
|||
setupKeys(){
|
||||
for (let i=0; i<4; i++) {
|
||||
for (let j=0; j<30; j++) {
|
||||
if (this.controls[i][j] && this.controls[i][j].value === this.keyMap[this.keyLookup(this.controls[i][j].value)]) {
|
||||
if (this.controls[i][j] && this.controls[i][j].value === this.keyMap[this.keyLookup(this.controls[i][j])]) {
|
||||
this.controls[i][j].keycode = Number(this.keyLookup(this.controls[i][j]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
keyLookup(k){
|
||||
keyLookup(controllerkey){
|
||||
console.log(controllerkey);
|
||||
for (var key in this.keyMap) {
|
||||
if (this.keyMap[key] === k.value) {
|
||||
if (this.keyMap[key] === controllerkey.value) {
|
||||
return key;
|
||||
}else if (k.keycode !== undefined) {
|
||||
return k.keycode;
|
||||
}else if (controllerkey.keycode !== undefined) {
|
||||
return controllerkey.keycode;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
2
data/emulator.min.js
vendored
2
data/emulator.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue