You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Greetings and I hope this finds you safe and well.
My application is a robotic device, (Dexter Industries GoPiGo), that has some example project code that allows you to "drive the robot around" using a virtual joystick, (nipple.js), controlled by your mouse or touchscreen.
The way it works is that when you do something with the mouse in the window that nipple.js is running in, it fires off data to the host/server system, (the robot), via a POST message from the browser.
However, it does this in a very complicated way because it also shows a "nipple" on the screen, (which fades in and out, and is animated based on how you move your mouse or finger), as it is primarily intended for touch-screen applications. The "nipple" graphic shows it has detected the touch and shows how you are moving with respect to that touch.
I have researched using a real joystick in a browser based application, but everything I find assumes that you are developing a browser-based game and all the logic and events are contained within the browser instance the game is running within.
I, myself, don't care about game frame loops, or frame-rates, or anything like that. All I need is for the script to detect the presence of a game controller and fire off events when the controller does something.
My questions for you, if I may:
Do you know of a JavaScript library that will do what I want.
Assuming that this does not exist, what would be the best way to send joystick axis/button events to the host server using your application?
Thanks again for all your help!
Jim "JR"
The text was updated successfully, but these errors were encountered:
Hi @jharris1993,
I am well, thank you. Hope the same for you.
As long as the browser is involved and there is a need to use a gamepad with it, joypad.js can work well. It can detect the presence of a gamepad in the browser (since it's built on top of the web gamepad API) and can fire off events when the user performs an action (button press or axis movement).
You can use something like socket.io to publish real-time gamepad event data to the host server. Hope that helps!
Greetings and I hope this finds you safe and well.
My application is a robotic device, (Dexter Industries GoPiGo), that has some example project code that allows you to "drive the robot around" using a virtual joystick, (nipple.js), controlled by your mouse or touchscreen.
The way it works is that when you do something with the mouse in the window that nipple.js is running in, it fires off data to the host/server system, (the robot), via a POST message from the browser.
However, it does this in a very complicated way because it also shows a "nipple" on the screen, (which fades in and out, and is animated based on how you move your mouse or finger), as it is primarily intended for touch-screen applications. The "nipple" graphic shows it has detected the touch and shows how you are moving with respect to that touch.
I have researched using a real joystick in a browser based application, but everything I find assumes that you are developing a browser-based game and all the logic and events are contained within the browser instance the game is running within.
I, myself, don't care about game frame loops, or frame-rates, or anything like that. All I need is for the script to detect the presence of a game controller and fire off events when the controller does something.
My questions for you, if I may:
Thanks again for all your help!
Jim "JR"
The text was updated successfully, but these errors were encountered: