Skip to content

Commit

Permalink
F6 = F7 + F9
Browse files Browse the repository at this point in the history
  • Loading branch information
kalaposfos13 committed Oct 15, 2024
1 parent 60d9e7b commit a76b792
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions src/sdl_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,20 +173,20 @@ std::map<std::string, u32> string_to_keyboard_key_map = {
{"7", SDLK_7},
{"8", SDLK_8},
{"9", SDLK_9},
{",", SDLK_COMMA},
{".", SDLK_PERIOD},
{"?", SDLK_QUESTION},
{";", SDLK_SEMICOLON},
{"-", SDLK_MINUS},
{"_", SDLK_UNDERSCORE},
{"(", SDLK_LEFTPAREN},
{")", SDLK_RIGHTPAREN},
{"[", SDLK_LEFTBRACKET},
{"]", SDLK_RIGHTBRACKET},
{"{", SDLK_LEFTBRACE},
{"}", SDLK_RIGHTBRACE},
{"\\", SDLK_BACKSLASH},
{"/", SDLK_SLASH},
{"comma", SDLK_COMMA},
{"period", SDLK_PERIOD},
{"question", SDLK_QUESTION},
{"semicolon", SDLK_SEMICOLON},
{"minus", SDLK_MINUS},
{"underscore", SDLK_UNDERSCORE},
{"lparenthesis", SDLK_LEFTPAREN},
{"rparenthesis", SDLK_RIGHTPAREN},
{"lbracket", SDLK_LEFTBRACKET},
{"rbracket", SDLK_RIGHTBRACKET},
{"lbrace", SDLK_LEFTBRACE},
{"rbrace", SDLK_RIGHTBRACE},
{"backslash", SDLK_BACKSLASH},
{"dash", SDLK_SLASH},
{"enter", SDLK_RETURN},
{"space", SDLK_SPACE},
{"tab", SDLK_TAB},
Expand Down Expand Up @@ -650,6 +650,12 @@ void WindowSDL::onKeyboardMouseEvent(const SDL_Event* event) {
else if (binding.key == SDLK_F7) {
mouse_enabled = !mouse_enabled;
}
// F7 + F9
else if (binding.key == SDLK_F6) {
mouse_enabled = !mouse_enabled;
SDL_SetWindowRelativeMouseMode(this->GetSdlWindow(),
!SDL_GetWindowRelativeMouseMode(this->GetSdlWindow()));
}
// Toggle fullscreen
else if (binding.key == SDLK_F11) {
SDL_WindowFlags flag = SDL_GetWindowFlags(window);
Expand Down

0 comments on commit a76b792

Please sign in to comment.