summaryrefslogtreecommitdiffstats
path: root/Graphic_Equalizer/src/mouse.hcc
diff options
context:
space:
mode:
Diffstat (limited to 'Graphic_Equalizer/src/mouse.hcc')
-rw-r--r--Graphic_Equalizer/src/mouse.hcc37
1 files changed, 27 insertions, 10 deletions
diff --git a/Graphic_Equalizer/src/mouse.hcc b/Graphic_Equalizer/src/mouse.hcc
index 8db9c51..4d28097 100644
--- a/Graphic_Equalizer/src/mouse.hcc
+++ b/Graphic_Equalizer/src/mouse.hcc
@@ -25,9 +25,14 @@
#include "pal_mouse.hch"
/******** Application Includes ********/
+#include "configuration.hch"
#include "mouse_shared.hch"
#include "mouse.hch"
+#if HAVE_DEBUG
+ #include "debug.hch"
+#endif
+
/*! \fn void mouse_main(mousedata_t *mousedata);
@@ -54,7 +59,7 @@ macro proc mouse_main(mousedata)
* using newer libs this might be overkill, e.g. smaller values may due
* or sampling all together will be redundant.
*/
- for(touch_sampler = 1;;touch_sampler++) {
+ for(touch_sampler = 1;; touch_sampler++) {
if (!touch_sampler) {
/*
* We are here ready to set mouse states. We compare
@@ -83,19 +88,31 @@ macro proc mouse_main(mousedata)
touched = FALSE;
/*
+ * In the rare occurance that we receive values
+ * beyond our range, we set them to some sane
+ * values here.
+ */
+ x = (x > 639) ? 0 : x;
+ y = (y > 479) ? 0 : y;
+
+ /*
* Compare Previous States and Coordinates to determine
* wether they have changed. If so, Copy them into
* shared memory, notify the listening processes and
- * Set the new as previous values for the next run.
+ * Set the new as previous values for the next run. We
+ * can only do this when the display has handled all
+ * changes.
*/
- if ((oldmousestate != mousestate) || (oldx != x) || (oldy != y)) {
- mousedata.x = x;
- mousedata.y = y;
- mousedata.state = mousestate;
- mousedata.status = MOUSE_UPDATED;
- oldx = x;
- oldy = y;
- oldmousestate = mousestate;
+ if (((oldmousestate != mousestate) || (oldx != x) || (oldy != y)) && (MOUSE_NOT_UPDATED == mousedata.status)) {
+ //par {
+ oldx = x;
+ oldy = y;
+ oldmousestate = mousestate;
+ mousedata.x = x;
+ mousedata.y = y;
+ mousedata.state = mousestate;
+ mousedata.status = MOUSE_UPDATED;
+ //}
}
}