Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
wchill committed May 29, 2018
1 parent d59b623 commit bc9f81b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 33 deletions.
1 change: 0 additions & 1 deletion docs/assets/js/ControlWebSocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export const ControlWs = {
SocketBus.$emit('pong', duration);
}
} else {
console.log(command, args);
SocketBus.$emit(command, args);
}
});
Expand Down
7 changes: 0 additions & 7 deletions docs/assets/js/ControllerRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ export const ControllerRenderer = {
let context = canvas.getContext('2d');
let spriteSheet = this.$refs.spriteSheet;

StatusBus.$emit(BusEvents.RENDER_TIME_START);

context.clearRect(0, 0, this.canvasSize.width, this.canvasSize.height);
context.drawImage(spriteSheet, this.canvasSize.x, this.canvasSize.y, this.canvasSize.width, this.canvasSize.height, 0, 0, this.canvasSize.width, this.canvasSize.height);

Expand Down Expand Up @@ -124,7 +122,6 @@ export const ControllerRenderer = {
that.renderStick(context, spriteSheet, stick, pressed, x, y);
});
}
StatusBus.$emit(BusEvents.RENDER_TIME_END);
},
renderButton: function(context, spriteSheet, name, pressed) {
let sprite = this.buttonSprites[name];
Expand Down Expand Up @@ -251,8 +248,6 @@ export const JoyconStreamRenderer = {
let context = canvas.getContext('2d');
let spriteSheet = this.$refs.spriteSheet;

StatusBus.$emit(BusEvents.RENDER_TIME_START);

context.clearRect(0, 0, this.canvasWidth, this.canvasHeight);
// draw body
context.drawImage(spriteSheet, this.console.body.x, this.console.body.y, this.console.body.w, this.console.body.h, this.controllers.w, this.consoleYOffset, this.console.body.w, this.console.body.h);
Expand Down Expand Up @@ -289,8 +284,6 @@ export const JoyconStreamRenderer = {
self.renderStick(context, spriteSheet, stick, pressed, x, y);
});

StatusBus.$emit(BusEvents.RENDER_TIME_END);

requestAnimationFrame(this.renderImage);
},
renderButton: function(context, spriteSheet, name, pressed) {
Expand Down
11 changes: 3 additions & 8 deletions docs/assets/js/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,6 @@
SocketBus.$emit('pong', duration);
}
} else {
console.log(command, args);
SocketBus.$emit(command, args);
}
});
Expand Down Expand Up @@ -2096,8 +2095,6 @@
let context = canvas.getContext('2d');
let spriteSheet = this.$refs.spriteSheet;

StatusBus.$emit(BusEvents.RENDER_TIME_START);

context.clearRect(0, 0, this.canvasSize.width, this.canvasSize.height);
context.drawImage(spriteSheet, this.canvasSize.x, this.canvasSize.y, this.canvasSize.width, this.canvasSize.height, 0, 0, this.canvasSize.width, this.canvasSize.height);

Expand Down Expand Up @@ -2126,7 +2123,6 @@
that.renderStick(context, spriteSheet, stick, pressed, x, y);
});
}
StatusBus.$emit(BusEvents.RENDER_TIME_END);
},
renderButton: function(context, spriteSheet, name, pressed) {
let sprite = this.buttonSprites[name];
Expand Down Expand Up @@ -2253,8 +2249,6 @@
let context = canvas.getContext('2d');
let spriteSheet = this.$refs.spriteSheet;

StatusBus.$emit(BusEvents.RENDER_TIME_START);

context.clearRect(0, 0, this.canvasWidth, this.canvasHeight);
// draw body
context.drawImage(spriteSheet, this.console.body.x, this.console.body.y, this.console.body.w, this.console.body.h, this.controllers.w, this.consoleYOffset, this.console.body.w, this.console.body.h);
Expand Down Expand Up @@ -2291,8 +2285,6 @@
self.renderStick(context, spriteSheet, stick, pressed, x, y);
});

StatusBus.$emit(BusEvents.RENDER_TIME_END);

requestAnimationFrame(this.renderImage);
},
renderButton: function(context, spriteSheet, name, pressed) {
Expand Down Expand Up @@ -2811,11 +2803,14 @@
},
methods: {
update: function() {

StatusBus.$emit(BusEvents.RENDER_TIME_START);
// Give input sources a chance to perform operations before actually updating
StatusBus.$emit(BusEvents.BEFORE_UPDATE_INPUT);
StatusBus.$emit(BusEvents.UPDATE_INPUT);

requestAnimationFrame(this.update);
StatusBus.$emit(BusEvents.RENDER_TIME_END);
}
}
});
Expand Down
3 changes: 3 additions & 0 deletions docs/assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@ new Vue({
},
methods: {
update: function() {

StatusBus.$emit(BusEvents.RENDER_TIME_START);
// Give input sources a chance to perform operations before actually updating
StatusBus.$emit(BusEvents.BEFORE_UPDATE_INPUT);
StatusBus.$emit(BusEvents.UPDATE_INPUT);

requestAnimationFrame(this.update);
StatusBus.$emit(BusEvents.RENDER_TIME_END);
}
}
});
46 changes: 29 additions & 17 deletions docs/gamepad_help.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@
layout: help
---

## Q: Does it actually work?
### A: Yes, I've personally spent 2 months writing, improving and fine-tuning controller support as best as I possibly can. All the gamepad code is custom and written from scratch so that I can take into account the nuances and quirks of individual controllers on certain browsers/OSes.

## Q: My controller isn't being detected!
### A: This site uses the HTML5 Gamepad API, which should work in all modern desktop browsers with varying degrees of success. Mobile browsers are unlikely to have support. You can try some of the following things:
* Check to see if [this test page](http://html5gamepad.com) recognizes your controller.
* Check if the controller is actually plugged in/turned on/enabled.
* Press some buttons. Some controllers won't be detected until you do this, and Firefox won't let the page know the controller exists until a button is pressed.
* Close other programs using the gamepad.
* Restart your web browser/computer. Chrome especially loves to stop detecting controller input if you close the gamepad page.
* Close other programs using the gamepad, like Steam.
* Restart your web browser/computer.
* Your controller might need some additional configuration, read the sections below for details.
* It might be a bug. [File a bug report](https://github.com/wchill/SwitchInputEmulator/issues/new)

## Q: My controller mapping is wrong!
### A: If your controller is supported, then the browser/OS vendors may have changed the controller mappings. [Please file a bug report](https://github.com/wchill/SwitchInputEmulator/issues/new) so that I can fix it right away.

## Q: Is my controller supported?
### A: I've personally tested and confirmed that the following controllers work:
Expand Down Expand Up @@ -40,16 +47,16 @@ layout: help
<td>Xbox One/360 and XInput controllers</td>
<td>✔️</td>
<td>✔️</td>
<td>❌ (1)</td>
<td>❌</td>
<td>✔️</td>
<td>❗</td>
<td>❔</td>
<td>❌ (2)</td>
<td>❌ (1)</td>
</tr>
<tr>
<td>DualShock 4</td>
<td>✔️</td>
<td>✔️ (3)</td>
<td>✔️ (2)</td>
<td>❔</td>
<td>✔️</td>
<td>✔️</td>
Expand All @@ -58,17 +65,17 @@ layout: help
</tr>
<tr>
<td>Pro Controller</td>
<td>❗ (4)</td>
<td>❗ (3)</td>
<td>✔️ (5)</td>
<td>✔️ (5)</td>
<td>❌ (6)</td>
<td>❌ (7)</td>
<td>✔️ (4)</td>
<td>❔</td>
<td>✔️ (4)</td>
</tr>
<tr>
<td>Joycons</td>
<td> (4)</td>
<td>✔️ (4)</td>
<td>❗ (4)</td>
<td>❔</td>
<td>✔️ (4)</td>
Expand All @@ -79,7 +86,7 @@ layout: help
<tr>
<td>PowerA Wired Controller Plus</td>
<td>✔️</td>
<td>✔️ (7)</td>
<td>✔️ (8)</td>
<td>❔</td>
<td>✔️</td>
<td>✔️</td>
Expand All @@ -88,13 +95,17 @@ layout: help
</tr>
</table>

(1) Technically works, but sometimes Edge does weird things like making the controller control the browser itself. Not recommended.
(2) Crashed my Asus C302 Chromebook when plugged in.
(3) The D-Pad does not work fully in Firefox. The touchpad button on a DualShock 4 has been mapped to D-Pad Up. You can perform additional setup to make it be recognized as an Xbox controller, see below.
(4) You must use Bluetooth unless you are using a 3rd party driver, even on MacOS and Chrome OS. On Windows, Chrome requires a 3rd party driver as it does not pick up the left analog stick.
(1) Crashed my Asus C302 Chromebook when plugged in. Not sure about Bluetooth. See [1](https://productforums.google.com/forum/#!msg/chromebook-central/CpDTBrxMls4/xC23TAhkBAAJ) [2](https://www.reddit.com/r/chromeos/comments/8fo5e7/chromebook_completely_crashes_and_shuts_down_when/) [3](https://www.reddit.com/r/chromeos/comments/74wd6f/xbox_one_s_controller_on_chromebook_needs_to_be/) [4](https://www.reddit.com/r/chromeos/comments/6n2e0g/asus_c302ca_xbox_one_controller_issue/) [5](https://www.reddit.com/r/chromeos/comments/61fni2/xbox_one_s_bluetooth_controller_on_chrome_os/)
(2) The D-Pad does not work fully in Firefox. The touchpad button on a DualShock 4 has been mapped to D-Pad Up. You can perform additional setup to make it be recognized as an Xbox controller, see below. [I have opened a bug in Firefox for this.](https://bugzilla.mozilla.org/show_bug.cgi?id=1464940)
(3) Until browsers implement USB HID initialization, Bluetooth is required. On Windows, Chrome currently requires a 3rd party driver for the Pro Controller as it does not pick up the left analog stick due to incorrect mappings (see [tracking bug](https://bugs.chromium.org/p/chromium/issues/detail?id=801717)).
(4) Until browsers implement USB HID initialization, Bluetooth is required.
(5) Works out of the box, but you cannot be running Steam as it will take over the controller.
(6) Technically works, but the left analog stick is not detected properly by Chrome. Not recommended.
(7) The D-Pad does not work fully in Firefox. The share and home buttons have been mapped to D-Pad Up and D-Pad down, respectively.
(6) The D-Pad does not work fully in Firefox. Works out of the box, but you cannot be running Steam as it will take over the controller.
(7) The left analog stick is not detected properly by Chrome (see [tracking bug](https://bugs.chromium.org/p/chromium/issues/detail?id=801717)).
(8) The D-Pad does not work fully in Firefox. The share and home buttons have been mapped to D-Pad Up and D-Pad down, respectively. [I have opened a bug in Firefox for this.](https://bugzilla.mozilla.org/show_bug.cgi?id=1464940)

## Q: Steam is opening up when I use my controller!
### A: Steam tries to take over controller inputs. I recommend disabling controller support in Steam or exiting Steam.

## Q: My inputs are being overridden/aren't showing up!
### A: In the current iteration, controller input and chat input happens simultaneously and they can override each other. If your input gets overridden, this is completely intentional.
Expand All @@ -107,10 +118,11 @@ layout: help
### A:
* On Windows/Firefox, [try these instructions](http://emulation.gametechwiki.com/index.php/SCP_Driver_Package)

## Q: What do I need to do to make my Pro Controller/Joycons work?
## Q: My Pro Controller/Joycons aren't working. How do I make them work?
### A:
* On Windows, try using [ProconXInput](https://github.com/MTCKC/ProconXInput) or [BetterJoyForCemu](https://github.com/Davidobot/BetterJoyForCemu) or [JoyCon-Driver](https://github.com/mfosse/JoyCon-Driver).
* If using a Pro Controller, MacOS/Chrome will not work. This is a browser limitation.
* If using a Pro Controller, [Chrome has a bug where the left analog stick is not recognized.](https://bugs.chromium.org/p/chromium/issues/detail?id=801717)
* If Steam is running, you must disable controller support or close Steam.
* If not on Windows, you must use Bluetooth. USB will not work.

## Q: I have some other controller that isn't working correctly or isn't supported!
Expand Down

0 comments on commit bc9f81b

Please sign in to comment.