Skip to content

Commit 8834afd

Browse files
committed
SDLBackend: Simplify shortcut consuming
1 parent cad7995 commit 8834afd

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/Backends/SDLBackend.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ namespace gamescope
745745
if ( event.type == SDL_KEYUP && ( event.key.keysym.mod & KMOD_LGUI ) )
746746
{
747747
auto shortcut = g_shortcutHandler.GetShortcut( key );
748-
bool handled = g_shortcutHandler.HandleShortcut( shortcut );
748+
g_shortcutHandler.HandleShortcut( shortcut );
749749

750750
switch ( shortcut )
751751
{
@@ -763,7 +763,7 @@ namespace gamescope
763763
default:
764764
break;
765765
}
766-
if ( handled )
766+
if ( shortcut != GAMESCOPE_SHORTCUT_NONE )
767767
{
768768
break;
769769
}

src/shortcut.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace gamescope
5151
return GAMESCOPE_SHORTCUT_NONE;
5252
}
5353

54-
bool ShortcutHandler::HandleShortcut( GamescopeShortcut shortcut )
54+
void ShortcutHandler::HandleShortcut( GamescopeShortcut shortcut )
5555
{
5656
switch ( shortcut )
5757
{
@@ -82,11 +82,8 @@ namespace gamescope
8282
g_bGrabbed = !g_bGrabbed;
8383
break;
8484
default:
85-
return false;
8685
break;
8786
}
88-
89-
return true;
9087
}
9188

9289
static const char* ShortcutNames[GAMESCOPE_SHORTCUT_COUNT] = {

src/shortcut.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace gamescope
3434

3535
GamescopeShortcut GetShortcut( uint32_t key );
3636

37-
bool HandleShortcut( GamescopeShortcut shortcut );
37+
void HandleShortcut( GamescopeShortcut shortcut );
3838

3939
private:
4040
std::map<uint32_t, GamescopeShortcut> m_binds;

0 commit comments

Comments
 (0)