Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a (well) working draft for using gamepads with Emscripten (tested with an xbox one controller).
https://emscripten.org/docs/api_reference/html5.h.html#gamepad
I got most of the code from this test / example: https://chromium.googlesource.com/external/github.com/emscripten-core/emscripten/+/refs/tags/1.38.39/tests/test_gamepad.c
Here is a good page for reference: https://gamepad-tester.com/
The event array:
Could be useful for other events to.
The gamepad events need to be updated every draw cycle (or as often as you want to get the output).
Not sure, if I put the things at the right place, but I think its a good start.
Where it hangs again is, that I do not now how to pass those values in the best way to
ofApp.cpp
.Once I made a simple class, there I used
notify
: https://github.com/Jonathhhan/OF-GUI-libraryAnd then I have a general question about formatting the code correct (in OF style), sometimes not sure where to leave a space and where not etc....