use KeyCode MouseButton replace int

This commit is contained in:
2025-07-06 12:56:22 +08:00
parent 52463322dd
commit ab4ca6285e

View File

@ -8,14 +8,14 @@
namespace Hazel
{
bool Input::IsKeyPressed(const int key)
bool Input::IsKeyPressed(const KeyCode key)
{
const auto state = SDL_GetKeyboardState(nullptr);
return state[key];
}
bool Input::IsMouseButtonPressed(const int button)
bool Input::IsMouseButtonPressed(const MouseButton button)
{
const auto mod = SDL_GetMouseState(nullptr, nullptr);
return mod & SDL_BUTTON_MASK(button);