Set keyboard state array to SDL scan code range bound, refactor key state to bitset (#3466)#3472
Conversation
|
Okay, so this essentially doubles it. Makes sense that it was crashing before, then, heh. Wonder if, in the future, it would make sense to use, say, a BitSet here? 512 bytes seems like a lot just for keyboard state. |
|
I agree, to be honest I'll update the implementation to a BitSet directly. No need to delay this from my POV |
|
Thanks, sounds good! Thinking about it, the current data type might've been left as-is for a long time for interop reasons. Not sure if you saw, but we have our own BitSet implementation in the Core subproject, fwiw. |
|
I hope this is the correct usage of the core bitset implementation, I noticed that it's not implementing the Also to test this correctly on my end, how does the hotkey work for cheats so that i can test? I kinda stumbled there. |
Thanks. Looks good to me, though I haven't tested things yet.
In vanilla, the player is supposed to hold down the Insert key while typing one of the cheats. (Bit obscure, yeah.) |
|
Looks working to me when testing the "DRIVER" cheat. |
Setting the bounds for the scan code array to SDL defined safe value
SDL_NUM_SCANCODESfixes #3466https://wiki.libsdl.org/SDL2/SDL_Scancode