[nostalgia/core] Add key event handler

This commit is contained in:
2022-03-20 01:42:08 -05:00
parent 2223fe7863
commit ea318bb6c8
5 changed files with 120 additions and 24 deletions
+3 -2
View File
@@ -74,8 +74,9 @@ uint64_t ticksMs(Context *ctx) noexcept {
return static_cast<uint64_t>(now - id->startTime);
}
bool buttonDown(Context*, Key) noexcept {
return false;
bool buttonDown(Context *ctx, Key key) noexcept {
const auto id = ctx->windowerData<GlfwImplData>();
return (id->keysDown >> static_cast<int>(key)) & 1;
}
ox::Error shutdown(Context *ctx) noexcept {