Closed IAmNotHanni closed 3 years ago
I feel like the
if (key < 0 || key > GLFW_KEY_LAST) {
return;
}
should be moved to the GLFW callback before it calls press_key
and release_key
, and the user facing functions should still have assert
s.
To address your comment on discord:
but the .at method would have saved us, right?
Yes, because the assert
didn't trigger since it was operating on a signed int, so I think that the functions in keyboard_mouse_data.cpp
should take in uint32_t
s instead (which should be ok since the GLFW_KEY_
s are defines), and the GLFW callback can cast the int
is receives.
Closes #410
Thank you @westernheld for finding this issue!