nyx: Allow screenshots only every 2s

This commit is contained in:
CTCaer 2020-04-30 14:08:06 +03:00
parent f5432c734c
commit 2f7be43ccb

View file

@ -205,8 +205,17 @@ static bool _fts_touch_read(lv_indev_data_t *data)
// Take a screenshot if 3 fingers. // Take a screenshot if 3 fingers.
if (touchpad.fingers > 2) if (touchpad.fingers > 2)
{ {
_save_fb_to_bmp(); // Disallow screenshots if less than 2s passed.
msleep(200); static u32 timer = 0;
if (get_tmr_ms() > timer)
{
_save_fb_to_bmp();
timer = get_tmr_ms() + 2000;
}
data->state = LV_INDEV_STATE_REL;
return false;
} }
if (console_enabled) if (console_enabled)