Skip to content

Commit

Permalink
Merge pull request OpenEnroth#1550 from captainurist/macos_fixes_489
Browse files Browse the repository at this point in the history
  • Loading branch information
captainurist authored Mar 21, 2024
2 parents 35fb5a0 + 7668e13 commit 35c0c46
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Application/GameKeyboardController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ bool GameKeyboardController::ConsumeKeyPress(PlatformKey key) {
if (key == PlatformKey::KEY_NONE)
return false;

// TODO(captainurist): this is false if we have received press & release events inside a single frame.
if (!isKeyDown_[key])
return false;
// Note that we're not checking for isKeyDown_[key] here, and this is intentional. This becomes relevant if both
// key press and key release events happen inside a single frame, and thus even though the player has pressed the
// key, it's not held down when we get around to actually handling it.

if (!isKeyDownReportPending_[key])
return false;
Expand Down
3 changes: 3 additions & 0 deletions src/Io/KeyboardInputHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ void Io::KeyboardInputHandler::GenerateGameplayActions() {
isTriggered = controller->IsKeyDown(key) || controller->IsKeyDown(gamepadkey);
break;
case KeyToggleType::TOGGLE_DelayContinuous:
// TODO(captainurist): This logic breaks down if we press & release a key every frame.
// Better way to implement this would be to generate the input actions from inside
// the event handler.
if (controller->IsKeyDown(key) || controller->IsKeyDown(gamepadkey)) {
resettimer = false;
if (!this->keydelaytimer) {
Expand Down
2 changes: 1 addition & 1 deletion test/Bin/GameTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if(OE_BUILD_TESTS)
ExternalProject_Add(OpenEnroth_TestData
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/test_data_tmp
GIT_REPOSITORY https://github.com/OpenEnroth/OpenEnroth_TestData.git
GIT_TAG c4d5e3c0368158daeca851182134f3feba92ac0b
GIT_TAG 565993c6d8cc70e7cfc4c6286b5138b9e9e0dd20
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/test_data
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
Expand Down

0 comments on commit 35c0c46

Please sign in to comment.