Skip to content

Commit

Permalink
Fix snesmouse
Browse files Browse the repository at this point in the history
  • Loading branch information
binji committed Aug 29, 2023
1 parent b287ff0 commit 4d12ee3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions docs/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,14 +358,14 @@ let vm = new Vue({
this.files.show = !this.files.show;
if (this.files.show) {
this.input.show = false;
this.setPaused(this.paused);
this.setPaused(true);
}
},
toggleInputDialog: function() {
this.input.show = !this.input.show;
if (this.input.show) {
this.files.show = false;
this.setPaused(paused);
this.setPaused(true);
}
},
reset: function(active) {
Expand Down Expand Up @@ -519,6 +519,8 @@ class Emulator {
this.boundGamepadConnected = null;
this.boundGamepadDisconnected = null;
this.boundMouseEvent = null;
this.mouseFracX = 0;
this.mouseFracY = 0;

this.bindEvents();

Expand Down
5 changes: 4 additions & 1 deletion docs/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ onmessage = async function(e) {
case 'snesmouse':
if (emulator) { emulator.inputSnesMouse(e.data.index, e.data.idx, e.data.idy, e.data.lmb, e.data.rmb); }
break;
case 'updateControllerType':
if (emulator) { emulator.updateControllerType(e.data.inputType); }
break;
}
};

Expand Down Expand Up @@ -247,7 +250,7 @@ class Emulator {

inputSnesMouse(index, idx, idy, lmb, rmb) {
this.module._add_snesmouse_delta(this.e, index, idx, idy);
this.module._set_snesmouse_buttons(this.e, indedx, lmb, rmb);
this.module._set_snesmouse_buttons(this.e, index, lmb, rmb);
}
}

Expand Down

0 comments on commit 4d12ee3

Please sign in to comment.