diff options
| author | michael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2009-01-01 08:13:26 +0000 | 
|---|---|---|
| committer | michael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2009-01-01 08:13:26 +0000 | 
| commit | b4225ee09adb53c6f25d8596d5f6fb1a845678c4 (patch) | |
| tree | 5b6e54441a8b541481668033db756d5529cee0dd | |
| parent | 4e402d79e57475289e753365c2563e16beffed75 (diff) | |
| download | lcd4linux-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.c | 11 | 
1 files changed, 8 insertions, 3 deletions
| @@ -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);      } | 
