Closed haekb closed 3 years ago
This ended up being fairly easy for the gameplay part of it, but annoying for the configure controls screen.
First off this is a giant work-around. The game now has two(!) event loops. The standard C++ event loop that is handled in the engine somewhere, and an SDL2 one in our GameInputMgr. As it turns out DirectInput uses physical keys rather than virtual keys. So I ended up creating a map of direct conversions (DirectInput key codes to SDL2 key codes) and basing everything from there.
I've also tried to make the changes in ScreenConfigure pretty modular. So that when someone eventually pokes into the engine side of things, they can easily throw away my changes.
Still needs some clean up though!
Related to #75
So I can't really fix the "IsCommandOn" getting stuck between menus, but I can expand my GameInputMgr to include keyboard events. Hopefully I can just plug in the engine's "OnKeyDown/Up" events to it.