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

Update readme with updated command set and limitations #16

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 19 additions & 4 deletions README.md
Expand Up @@ -15,26 +15,41 @@ In order to be able to run this emulator, you will need to have [Node.js][] inst
4. Create a copy of the .env_sample file: `cp .env_sample .env`.
5. Update `.env` file to set your environment specific values.
1. Update the value of `BUILD_PATH` to be the build output path of your plugin's executable.
2. Update the value of `WINEXE_NAME` or `OSXEXE_NAME` to be the filename of the your plugin's executable.
*Note*: Make sure you use the correct path syntax for your operating system.
2. Update the value of `WINEXE_NAME` (if you're on Windows) or `OSXEXE_NAME` (if you're on macOS) to be the filename of the your plugin's executable.
6. Run `npm start` to launch the emulator.


### Starting and Stopping the Emulator

1. Open a command prompt/terminal/shell and navigate to the current directory.
2. Start the emulator with the command `npm start`
3. When you are done, press <kbd>Ctrl</kbd>+<kbd>C</kbd> to stop the emulator.
3. When you are done, use the `q` option to shut down the emulator.


### Using the Emulator

#### Simulating events

At this time, the emulator only supports emulating a button press, which results in a `keyUp` event with its respective payload.
At this time, the following are the events supported by the emulator, and their associated keyboard commands.

To simulate the `keyUp` event, press the <kbd>B</kbd> button on your keyboard.
* `keyDown` (<kbd>kd</kbd>)
* `keyUp` (<kbd>ku</kbd>)
* `willAppear` (<kbd>wa</kbd>)
* `willDisappear` (<kbd>wd</kbd>)
* `deviceDidConnect` (<kbd>dc</kbd>)
* `deviceDidDisconnect` (<kbd>dd</kbd>)

#### Caveats, Limitations, and Known Issues

**Caveat**: The emulator will only send events to the first action defined in the `manifest.json` (manifest) file.
**Workaround**: To test a different action, move its definition to the top of the `actions` array in the manifest.

**Issue**: If, for any reason, when sending a command to the plugin, the websocket connection is closed or otherwise broken, no further messages can be sent.
**Workaround**: Quit the emulator (using the <kbd>q</kbd> command) and restart it.

**Issue**: If the emulator is force quit (using <kbd>Ctrl</kbd>+<kbd>C</kbd>), the WebSocket connection *may* not be closed, and the configured port *could* remain in use.
**Workaround**: Find if there is an instance of `node` running for the `index.js` script, and end it. This varies per operating system.


<!-- Reference Links -->
Expand Down