-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add gamepad buttons #2
Comments
Definitely! But we might have to add a TCP connection to transmit button events because the current UDP connection might drop the event and that might be frustrating to a user. |
How about transmitting entire state all the time? Then even if packet is dropped, next one will contain missing info. If you can use binary protocol, it should be possible to fit one axis or all buttons into 2 bytes, so entire state should fit into 16B, if I'm counting it correctly. |
Yes, that would be straight forward to implement. We are already transmitting the full state. The problem is if there is packet loss, a fast button press might be completely missed. But maybe that's not actually a big problem in practice. |
Well, there is one way to find out - implement it. It would be nice to have option to configure a button as a toggle button (press once to "press down", press once more to stop "pressing down"). I think transmitting full state with UDP is fine. If someone needs almost-frame-perfect button hits or is fast enough to do them, they won't be using WiFi connection in the first place. |
Hey, I've already forgot that I'm following this :) I've recently implemented support for "Remote RetroPad" in my application, protocol that is used by Retroarch on Android for exactly this. It sends only changes in UDP packet that basically contains 4 numbers and I have yet to see single "lost input" :) |
If someone makes a html/javascript version of a controller interface with two joysticks and buttons I'd be very happy to merge this via implementing #17 . |
I have gamepads as svgs here, but I'm not sure if it's possible to use js with SVG images. |
It is. SVG elements can have HTML |
Interesting! The main thing would be to do (re-)implement the ontouch (down, move, up) lifecycle. Basically replicating in javascript what has been done in https://github.com/rmst/yoke-android/blob/master/app/src/main/java/com/simonramstedt/yoke/JoystickView.java . Here is a tutorial on how this works in javascript https://seb.ly/2011/04/multi-touch-game-controller-in-javascripthtml5-for-ipad/ . |
I'll try implementing it |
I hate Javascript and Samsung OS is garbage, but there you go https://github.com/pzmarzly/html-touch-joystick. With right config (see It was made with user in mind - by editing CSS, user can easily change layout and behavior ( I added 32 buttons in code, but user can disable any unwanted button in UI settings |
Done in #19 . Thanks |
Basically #17 is implemented in master now and serves the html/javascript client that @pzmarzly built. The android app (experimental version in this repo under |
Updating my repository before making a commit.
Hi ! Seems yoke is exactly what I was looking for, except for this "almost available" feature. Seems only windows is yet to be finished, can I use the RC for linux ? F-Droid release is 7 months old, I guess that's not it. |
RC is a redesign, you are welcome to test it (works fine for us, but since it uses Android Webview results may vary depending on the device). Here's the latest APK. You can clone the repo and run |
Thanks @pzmarzly. Tried it. Honestly it's too raw for me. I found an alternative meanwhile, controlloid, which fit my needs. |
This is a very cool concept! However to be usable in vast majority of games, one would need at least A, B, X, Y buttons. Best of luck with the project. :)
The text was updated successfully, but these errors were encountered: