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

Joystick support #128

Open
mattgodbolt opened this issue Sep 25, 2016 · 10 comments
Open

Joystick support #128

mattgodbolt opened this issue Sep 25, 2016 · 10 comments

Comments

@mattgodbolt
Copy link
Owner

No description provided.

@richard-broadhurst
Copy link

If possible, two joystick support would be good, but even if only one is possible, supporting both fire buttons would be good.

@richard-broadhurst
Copy link

Looks like browsers now have good joystick support https://gamepad-tester.com/ although it looks like it might only be xinput drivers on windows.

@murkle
Copy link
Collaborator

murkle commented Aug 23, 2020

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 :)

@mattgodbolt
Copy link
Owner Author

Another request over email (for BBC Joystick emulation to a PC joypad).

@murkle
Copy link
Collaborator

murkle commented Nov 28, 2020

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

@mattgodbolt
Copy link
Owner Author

mattgodbolt commented Nov 28, 2020 via email

@murkle
Copy link
Collaborator

murkle commented Dec 6, 2020

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

@murkle
Copy link
Collaborator

murkle commented Dec 6, 2020

@murkle
Copy link
Collaborator

murkle commented Dec 7, 2020

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

            // often <Return> = "Fire"
            this.gamepadMapping[0] = BBC.RETURN;

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

3 participants