aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2009-01-01 08:13:26 +0000
committermichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2009-01-01 08:13:26 +0000
commitb4225ee09adb53c6f25d8596d5f6fb1a845678c4 (patch)
tree5b6e54441a8b541481668033db756d5529cee0dd
parent4e402d79e57475289e753365c2563e16beffed75 (diff)
downloadlcd4linux-b4225ee09adb53c6f25d8596d5f6fb1a845678c4.tar.gz
button debugging changed
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@935 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
-rw-r--r--drv_X11.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drv_X11.c b/drv_X11.c
index 0c6e41b..7310cd1 100644
--- a/drv_X11.c
+++ b/drv_X11.c
@@ -204,7 +204,6 @@ static int drv_X11_keypad(const int num)
error("%s: unknown keypad value %d", Name, num);
}
- debug("%s: key %c (0x%x) pressed", Name, num, num);
return val;
}
@@ -300,29 +299,35 @@ static void drv_X11_timer( __attribute__ ((unused))
if (XCheckWindowEvent(dp, w, ExposureMask | ButtonPressMask | ButtonReleaseMask, &ev) == 0)
return;
+
switch (ev.type) {
+
case Expose:
drv_X11_expose(ev.xexpose.x, ev.xexpose.y, ev.xexpose.width, ev.xexpose.height);
break;
+
case ButtonPress:
if (ev.xbutton.x >= xoffset && ev.xbutton.x <= xoffset + btnwidth
&& ev.xbutton.y >= yoffset && ev.xbutton.y <= yoffset + buttons * btnheight + (buttons - 1) * pgap) {
btn = (ev.xbutton.y - yoffset) / (btnheight + pgap) + 1; /* btn 0 is unused */
+ debug("button %d pressed", btn);
drv_X11_color(BG_COL);
XFillRectangle(dp, w, gc, xoffset + 1, yoffset + (btn - 1) * (btnheight + pgap) + 1, btnwidth - 1,
btnheight - 2 - 1);
drv_generic_keypad_press(btn);
}
break;
+
case ButtonRelease:
if (ev.xbutton.x >= xoffset && ev.xbutton.x <= xoffset + btnwidth
&& ev.xbutton.y >= yoffset && ev.xbutton.y <= yoffset + buttons * btnheight + (buttons - 1) * pgap) {
+ btn = (ev.xbutton.y - yoffset) / (btnheight + pgap) + 1; /* btn 0 is unused */
+ debug("button %d released", btn);
XClearArea(dp, w, xoffset, yoffset + (btn - 1) * (btnheight + pgap), btnwidth, btnheight - 2,
1 /* true */ );
- btn = (ev.xbutton.y - yoffset) / (btnheight + pgap) + 1; /* btn 0 is unused */
- info("%s: Button %d released", Name, btn);
}
break;
+
default:
debug("%s: unknown XEvent %d", Name, ev.type);
}