Skip to content

Commit

Permalink
Fix space key triggering error in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
xfangfang committed Feb 19, 2024
1 parent 0910a7b commit cc9bf1e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ if (PLATFORM_DESKTOP)
set(SDL_TEST_ENABLED_BY_DEFAULT OFF)
add_subdirectory(${BOREALIS_PATH}/lib/extern/SDL EXCLUDE_FROM_ALL)
endif ()
list(APPEND BRLS_PLATFORM_LIBS SDL2::SDL2-static)
list(APPEND BRLS_PLATFORM_LIBS SDL2::SDL2-static SDL2::SDL2main)
list(APPEND BRLS_PLATFORM_OPTION -D__SDL2__)
list(APPEND BOREALIS_SOURCE ${BOREALIS_PATH}/lib/platforms/sdl)
if (APPLE)
Expand Down
6 changes: 3 additions & 3 deletions library/lib/platforms/glfw/glfw_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ void GLFWInputManager::updateUnifiedControllerState(ControllerState* state)

state->buttons[BUTTON_X] |= (glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_MIDDLE) == GLFW_PRESS);

state->buttons[BUTTON_BACKSPACE] |= glfwGetKey(this->window, GLFW_KEY_BACKSPACE);
state->buttons[BUTTON_SPACE] |= glfwGetKey(this->window, GLFW_KEY_SPACE);
state->buttons[BUTTON_F] |= glfwGetKey(this->window, GLFW_KEY_F);
state->buttons[BUTTON_BACKSPACE] = glfwGetKey(this->window, GLFW_KEY_BACKSPACE);
state->buttons[BUTTON_SPACE] = glfwGetKey(this->window, GLFW_KEY_SPACE);
state->buttons[BUTTON_F] = glfwGetKey(this->window, GLFW_KEY_F);

state->buttons[BUTTON_NAV_UP] |= state->buttons[BUTTON_UP];
state->buttons[BUTTON_NAV_RIGHT] |= state->buttons[BUTTON_RIGHT];
Expand Down
6 changes: 3 additions & 3 deletions library/lib/platforms/sdl/sdl_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ void SDLInputManager::updateUnifiedControllerState(ControllerState* state)
state->buttons[BUTTON_B] |= getKeyboardKeys(SDL_SCANCODE_AC_BACK);

// pc shortcuts
state->buttons[BUTTON_SPACE] |= getKeyboardKeys(SDL_SCANCODE_SPACE);
state->buttons[BUTTON_BACKSPACE] |= getKeyboardKeys(SDL_SCANCODE_BACKSPACE);
state->buttons[BUTTON_F] |= getKeyboardKeys(SDL_SCANCODE_F);
state->buttons[BUTTON_SPACE] = getKeyboardKeys(SDL_SCANCODE_SPACE);
state->buttons[BUTTON_BACKSPACE] = getKeyboardKeys(SDL_SCANCODE_BACKSPACE);
state->buttons[BUTTON_F] = getKeyboardKeys(SDL_SCANCODE_F);

state->buttons[BUTTON_NAV_UP] |= state->buttons[BUTTON_UP];
state->buttons[BUTTON_NAV_RIGHT] |= state->buttons[BUTTON_RIGHT];
Expand Down

0 comments on commit cc9bf1e

Please sign in to comment.