summaryrefslogtreecommitdiff
path: root/gui/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'gui/input.c')
-rw-r--r--gui/input.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gui/input.c b/gui/input.c
index f005527..49e310c 100644
--- a/gui/input.c
+++ b/gui/input.c
@@ -19,6 +19,7 @@
#include "misc/util.h"
#include "misc/diag.h"
+#include "gui/timer.h"
#include "gui/input.h"
@@ -183,6 +184,8 @@ static gboolean motion_notify_event(GtkWidget *widget, GdkEventMotion *event,
progress(3, "motion %s", state());
+ timer_start();
+
switch (sp->state) {
case input_idle:
hover_consider(event->x, event->y);
@@ -224,6 +227,8 @@ static gboolean button_press_event(GtkWidget *widget, GdkEventButton *event,
progress(3, "press %s", state());
+ timer_start();
+
buttons |= 1 << event->button;
switch (sp->state) {
@@ -261,6 +266,8 @@ static gboolean button_release_event(GtkWidget *widget, GdkEventButton *event,
progress(3, "release %s", state());
+ timer_start();
+
buttons &= ~(1 << event->button);
if (buttons)
return TRUE;
@@ -307,6 +314,8 @@ static gboolean button_release_event(GtkWidget *widget, GdkEventButton *event,
static gboolean scroll_event(GtkWidget *widget, GdkEventScroll *event,
gpointer data)
{
+ timer_start();
+
if (!sp || !sp->ops->scroll)
return TRUE;
switch (event->direction) {
@@ -329,6 +338,8 @@ static gboolean scroll_event(GtkWidget *widget, GdkEventScroll *event,
static gboolean key_press_event(GtkWidget *widget, GdkEventKey *event,
gpointer data)
{
+ timer_start();
+
if (sp && sp->ops->key)
sp->ops->key(sp->user, curr_x, curr_y, event->keyval);
return TRUE;