KeyboardButton/JoystickButton use enum class instead of enum

This commit is contained in:
2021-09-15 19:15:08 +08:00
parent 7a5040224a
commit c1a4276533
4 changed files with 265 additions and 258 deletions

View File

@@ -4,17 +4,17 @@ namespace hgl
{
void Window::ProcKeyPressed(KeyboardButton kb)
{
if(key_push[kb])
if(key_push[size_t(kb)])
ProcKeyRepeat(kb);
else
key_push[kb]=true;
key_push[size_t(kb)]=true;
SafeCallEvent(OnKeyPressed,(kb));
}
void Window::ProcKeyReleased(KeyboardButton kb)
{
key_push[kb]=false;
key_push[size_t(kb)]=false;
SafeCallEvent(OnKeyReleased,(kb));
}