jsbeeb
jsbeeb copied to clipboard
Joystick support
If possible, two joystick support would be good, but even if only one is possible, supporting both fire buttons would be good.
Looks like browsers now have good joystick support https://gamepad-tester.com/ although it looks like it might only be xinput drivers on windows.
There's already some undocumented syntax for this in https://github.com/mattgodbolt/jsbeeb/blob/master/main.js
} else if (key.indexOf("GP.") === 0) {
// gamepad mapping
// eg ?GP.FIRE2=RETURN
var gamepadKey = key.substring(3).toUpperCase(); // remove GP. prefix
gamepad.remap(gamepadKey, val.toUpperCase());
} else {
switch (key) {
case "LEFT":
case "RIGHT":
case "UP":
case "DOWN":
case "FIRE":
gamepad.remap(key, val.toUpperCase());
break;
Maybe you can test if this still works :)
Another request over email (for BBC Joystick emulation to a PC joypad).
I just tested on iPad 6 with XBox One controller (need to be careful to get the right model, must be Bluetooth 1708) and my old gamepad code still seems to be working 🎉
Apple actually support this officially! https://support.apple.com/en-us/HT210414c
https://www.macworld.com/article/3410800/how-to-pair-an-xbox-one-controller-with-iphone-or-ipad.html
That's amazing! Thanks Michael!
On Sat, Nov 28, 2020 at 9:08 AM Michael Borcherds [email protected] wrote:
I just tested on iPad 6 with XBox One controller (need to be careful to get the right model, must be Bluetooth 1708) and my old gamepad code still seems to be working 🎉
Apple actually support this officially! https://support.apple.com/en-us/HT210414c
https://www.macworld.com/article/3410800/how-to-pair-an-xbox-one-controller-with-iphone-or-ipad.html
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mattgodbolt/jsbeeb/issues/128#issuecomment-735242260, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE2Y5IXTOCMU74RLJYIAALSSEG77ANCNFSM4CQXR4CQ .
-- Matt (he/him)
Looks like I added support for buttons only, not for the ADC joystick itself
Martin B has made a nice SSD so at least we can test it easily once it's implemented :) https://bbc.godbolt.org/?disc=https://test.geogebra.org/~mike/jsbeeb/JoystickTest.ssd
https://github.com/mattgodbolt/jsbeeb/blob/master/adc.js
@mattgodbolt https://github.com/murkle/jsbeeb/commit/a0816a1295c2afc721d3443a68ff25b0accd0614 https://github.com/murkle/jsbeeb/commit/0d048c6d81f7db92f6bb5e069fd40f5a49067ee6
Seems to work 😇 https://test.geogebra.org/~mike/jsBeebJoysticks/?autoboot&&disc1=sth%3AAcornsoft%2FSnapper-v2.zip#
All good now https://test.geogebra.org/~mike/jsBeebJoysticks/?autorun&loadBasic=https://test.geogebra.org/~mike/jsbeeb/joystickTest.bbc
If we change the "fire" button to A then we should also disable the default mapping of A as <Return>
// often <Return> = "Fire"
this.gamepadMapping[0] = BBC.RETURN;