Skip to content

Commit

Permalink
auto repeat first and next delay
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Aug 24, 2019
1 parent 05b183f commit 6a33ffb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/eez/gui/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@
#include <eez/apps/home/home.h>
//

#define CONF_GUI_LONG_TOUCH_TIMEOUT 1000000L // 1s
#define CONF_GUI_KEYPAD_AUTO_REPEAT_DELAY 100000L // 100ms
#define CONF_GUI_EXTRA_LONG_TOUCH_TIMEOUT 30000000L // 30s
#define CONF_GUI_LONG_TOUCH_TIMEOUT 1000000L // 1s
#define CONF_GUI_KEYPAD_FIRST_AUTO_REPEAT_DELAY 250000L // 250ms
#define CONF_GUI_KEYPAD_NEXT_AUTO_REPEAT_DELAY 75000L // 75ms
#define CONF_GUI_EXTRA_LONG_TOUCH_TIMEOUT 30000000L // 30s

namespace eez {
namespace gui {
Expand Down Expand Up @@ -257,7 +258,7 @@ void touchHandling() {
processTouchEvent(EVENT_TYPE_EXTRA_LONG_TOUCH);
}

if (int32_t(tickCount - m_lastAutoRepeatEventTime) >= CONF_GUI_KEYPAD_AUTO_REPEAT_DELAY) {
if (int32_t(tickCount - m_lastAutoRepeatEventTime) >= (m_lastAutoRepeatEventTime == m_touchDownTime ? CONF_GUI_KEYPAD_FIRST_AUTO_REPEAT_DELAY : CONF_GUI_KEYPAD_NEXT_AUTO_REPEAT_DELAY)) {
processTouchEvent(EVENT_TYPE_AUTO_REPEAT);
m_lastAutoRepeatEventTime = tickCount;
}
Expand Down

0 comments on commit 6a33ffb

Please sign in to comment.