emscripten-core / emscripten-core/emscripten
The gamepad id item of EmscriptenGamepadEvent
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
Hi,
When I'm using emscripten gamepad api, I found the EmscriptenGamepadEvent's id item is too short:
typedef struct EmscriptenGamepadEvent {
double timestamp;
int numAxes;
int numButtons;
double axis[64];
double analogButton[64];
EM_BOOL digitalButton[64];
EM_BOOL connected;
long index;
EM_UTF8 id[EM_HTML5_MEDIUM_STRING_LEN_BYTES]; ==> the length is 64
EM_UTF8 mapping[EM_HTML5_MEDIUM_STRING_LEN_BYTES];
} EmscriptenGamepadEvent;
But for normal gamepad device, the id is longer than 64, for example:
Microsoft X-Box Series X" (STANDARD GAMEPAD Vendor: 045e Product: 0b12)
so I think the length had better change to EM_HTML5_LONG_STRING_LEN_BYTES which is 128.
Contributor guide
Assessment
This issue has not been assessed yet.