Avoid repetition for some shortcuts

Keeping the key pressed generate "repeat" events. It does not make sense
to repeat the event for rotation or turn screen off.
This commit is contained in:
Romain Vimont 2020-05-29 22:02:41 +02:00
parent 0e4a6f462b
commit e4efd75766

View file

@ -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;
@ -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;