aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormzuther <mzuther@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2010-01-20 14:53:56 +0000
committermzuther <mzuther@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2010-01-20 14:53:56 +0000
commit28645bbb94cd7448f7dba407a8fb6693f5dd670d (patch)
tree3faf6aa0a4e1facec040c77c8937f7711279d2c1
parent7f823fa243530072bfb6cd451c56886b0c3c3bfa (diff)
downloadlcd4linux-28645bbb94cd7448f7dba407a8fb6693f5dd670d.tar.gz
X11 driver: do not display key strokes that do not map to a button
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1090 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to '')
-rw-r--r--drv_X11.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/drv_X11.c b/drv_X11.c
index b9b7854..8b80b4b 100644
--- a/drv_X11.c
+++ b/drv_X11.c
@@ -406,14 +406,16 @@ static void drv_X11_timer( __attribute__ ((unused))
btn = 0;
}
/* only register key press if button is defined on GUI */
- if ((btn > 0) && (btn <= buttons)) {
- debug("key for button %i pressed", btn);
- drv_X11_color(BG_COL, 255);
- XFillRectangle(dp, w, gc, xoffset + 1, yoffset + (btn - 1) * (btnheight + pgap) + 1, btnwidth - 1,
- btnheight - 2 - 1);
- drv_generic_keypad_press(btn);
- } else {
- debug("key press for button %i ignored", btn);
+ if (btn > 0) {
+ if (btn <= buttons) {
+ debug("key for button %i pressed", btn);
+ drv_X11_color(BG_COL, 255);
+ XFillRectangle(dp, w, gc, xoffset + 1, yoffset + (btn - 1) * (btnheight + pgap) + 1, btnwidth - 1,
+ btnheight - 2 - 1);
+ drv_generic_keypad_press(btn);
+ } else {
+ debug("key press for button %i ignored", btn);
+ }
}
break;
@@ -440,12 +442,14 @@ static void drv_X11_timer( __attribute__ ((unused))
break;
}
/* only register key release if button is defined on GUI */
- if ((btn > 0) && (btn <= buttons)) {
- debug("key for button %i released", btn);
- XClearArea(dp, w, xoffset, yoffset + (btn - 1) * (btnheight + pgap), btnwidth, btnheight - 2,
- 1 /* true */ );
- } else {
- debug("key release for button %i ignored", btn);
+ if (btn > 0) {
+ if (btn <= buttons) {
+ debug("key for button %i released", btn);
+ XClearArea(dp, w, xoffset, yoffset + (btn - 1) * (btnheight + pgap), btnwidth, btnheight - 2,
+ 1 /* true */ );
+ } else {
+ debug("key release for button %i ignored", btn);
+ }
}
break;