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

Joypad and joystick support #2

Open
bjorndm opened this issue Mar 10, 2024 · 3 comments
Open

Joypad and joystick support #2

bjorndm opened this issue Mar 10, 2024 · 3 comments

Comments

@bjorndm
Copy link

bjorndm commented Mar 10, 2024

I am not sure but for portable game engines we will also need joystick and joypad support. Please consider it.

@kanryu
Copy link
Owner

kanryu commented Mar 10, 2024

@bjorndm Yes, glfw is known to have pretty strong joystick support.

I just checked the source code, and it seems that gioui does not include joystick support. Therefore, it is necessary to port all glfw joystick implementations.

However, the original purpose of mado is window control and support for rendering engines including OpenGL. Joystick support will come later.

I'll be happy to check it out if you send me a PullRequest.

@bjorndm
Copy link
Author

bjorndm commented Mar 10, 2024

I can probably help with a joystick driver for Linux/Android in pure Go. On that platform it boils down to reading a device file.

@kanryu
Copy link
Owner

kanryu commented Mar 10, 2024

The purpose of mado is to have the same behavior as glfw, and some code is already implemented in glfw/input.go and glfw/joystick.go.

Joystick support in glfw is a highly independent feature, and you can easily identify the implementation location by searching the source code for '_glfwInputJoystick'.
On Linux, it seems to simply read the device file at /dev/event[0-9].
If you can read the C language source code, I think porting is quite possible.

I look forward to your activities. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants