Skip to content

Commit

Permalink
Avoid repetition for some shortcuts
Browse files Browse the repository at this point in the history
Keeping the key pressed generate "repeat" events. It does not make sense
to repeat the event for rotation or turn screen off.
  • Loading branch information
rom1v committed May 29, 2020
1 parent 0e4a6f4 commit e4efd75
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/input_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ input_manager_process_key(struct input_manager *im,
}
return;
case SDLK_o:
if (control && cmd && down) {
if (control && cmd && !repeat && down) {
enum screen_power_mode mode = shift
? SCREEN_POWER_MODE_NORMAL
: SCREEN_POWER_MODE_OFF;
Expand All @@ -341,12 +341,12 @@ input_manager_process_key(struct input_manager *im,
}
return;
case SDLK_LEFT:
if (cmd && !shift && down) {
if (cmd && !shift && !repeat && down) {
rotate_client_left(im->screen);
}
return;
case SDLK_RIGHT:
if (cmd && !shift && down) {
if (cmd && !shift && !repeat && down) {
rotate_client_right(im->screen);
}
return;
Expand Down

0 comments on commit e4efd75

Please sign in to comment.