Actually Fixed IsKeyDown
This commit is contained in:
4
main.cpp
4
main.cpp
@@ -54,6 +54,10 @@ class MyWindow : public ReWindow::RWindow {
|
||||
if (IsMouseButtonDown(MouseButtons::Mouse5))
|
||||
std::cout << "Mouse5 Mouse Button" << std::endl;
|
||||
|
||||
|
||||
if (IsKeyDown(Keys::N))
|
||||
std::cout << "Gotteem" << std::endl;
|
||||
|
||||
RWindow::OnRefresh(elapsed);
|
||||
}
|
||||
|
||||
|
@@ -141,10 +141,10 @@ void RWindow::SetSize(const Vector2& size) {
|
||||
}
|
||||
|
||||
bool RWindow::IsKeyDown(Key key) const {
|
||||
for (const auto& pair : currentKeyboard.PressedKeys)
|
||||
if (pair.first == key && pair.second)
|
||||
return true;
|
||||
return false;
|
||||
if (currentKeyboard.PressedKeys.contains(key))
|
||||
return currentKeyboard.PressedKeys.at(key);
|
||||
|
||||
return false; // NOTE: Key may not be mapped!!
|
||||
}
|
||||
|
||||
bool RWindow::IsMouseButtonDown(const MouseButton &button) const {
|
||||
|
Reference in New Issue
Block a user