Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor customizable key mapping #149

Open
bfirsh opened this issue Dec 8, 2018 · 0 comments
Open

Refactor customizable key mapping #149

bfirsh opened this issue Dec 8, 2018 · 0 comments

Comments

@bfirsh
Copy link
Owner

bfirsh commented Dec 8, 2018

From review in #136:

  • Did you consider lifting the state up? I think this might make the implmentation a bit neater. keyboardController.keys could be passed to ControlsModal. You could then have a setKey method on KeyboardController that was passed all the way down to each row. That way the state management and business logic is all in KeyboardController.
  • Is there a reason why it is persisted on unload rather than on every key change? I would have thought setting local storage is pretty cheap. That way you wouldn't have to check if state were modified and the keys would still persist if unload wasn't called for whatever reason.
bfirsh added a commit that referenced this issue Jan 16, 2019
This allows embedding just the emulator as a React component by
passing ROM data as a string to Emulator. It handles writing to
canvas, sound, keyboard events, mouse events, etc etc.

Minimal viable emulator:

```javascript
<Emulator romData="..." />
```

Boom.

There is still some refactoring to do to clean up keyboard/gamepad
customisation. See also #149.

Also, to make this work we need to release jsnes-web as a package
on npm and document how to embed it.
bfirsh added a commit that referenced this issue Jan 20, 2019
This allows embedding just the emulator as a React component by
passing ROM data as a string to Emulator. It handles writing to
canvas, sound, keyboard events, mouse events, etc etc.

Minimal viable emulator:

```javascript
<Emulator romData="..." />
```

Boom.

There is still some refactoring to do to clean up keyboard/gamepad
customisation. See also #149.

Also, to make this work we need to release jsnes-web as a package
on npm and document how to embed it.
ds17f added a commit to ds17f/jsnes-web that referenced this issue Aug 29, 2022
This allows embedding just the emulator as a React component by
passing ROM data as a string to Emulator. It handles writing to
canvas, sound, keyboard events, mouse events, etc etc.

Minimal viable emulator:

```javascript
<Emulator romData="..." />
```

Boom.

There is still some refactoring to do to clean up keyboard/gamepad
customisation. See also bfirsh#149.

Also, to make this work we need to release jsnes-web as a package
on npm and document how to embed it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant