This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via a9486419936ccda09e41e401ae9481915aeb8ec8 (commit) via 778ffdcb824b9141f5f6f13de981ed62827cab52 (commit) from 36e390ff64ddb40ea5c6cc58ed6e74db02252b09 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/a9486419936ccda09e41e401ae9481915aeb8...
commit a9486419936ccda09e41e401ae9481915aeb8ec8 Author: Cyril Hrubis metan@ucw.cz Date: Sat Feb 25 23:23:11 2012 +0000
input: Fix a few problems with absolute input device.
diff --git a/include/input/GP_InputDriverLinux.h b/include/input/GP_InputDriverLinux.h index ea5b370..4f7283f 100644 --- a/include/input/GP_InputDriverLinux.h +++ b/include/input/GP_InputDriverLinux.h @@ -45,12 +45,13 @@ typedef struct GP_InputDriverLinux { int abs_x; int abs_y; int abs_press; - + int abs_x_max; int abs_y_max; int abs_press_max;
- uint8_t abs_flag; + uint8_t abs_flag:1; + uint8_t abs_pen_flag:1; } GP_InputDriverLinux;
/* diff --git a/libs/input/GP_InputDriverLinux.c b/libs/input/GP_InputDriverLinux.c index 05557dd..f140d9e 100644 --- a/libs/input/GP_InputDriverLinux.c +++ b/libs/input/GP_InputDriverLinux.c @@ -82,17 +82,20 @@ void try_load_callibration(struct GP_InputDriverLinux *self) }
if (!ioctl(self->fd, EVIOCGABS(ABS_X), abs)) { - GP_DEBUG(3, "ABS X = <%i,%i>", abs[1], abs[2]); + GP_DEBUG(3, "ABS X = <%i,%i> Fuzz %i Flat %i", + abs[1], abs[2], abs[3], abs[4]); self->abs_x_max = abs[2]; } if (!ioctl(self->fd, EVIOCGABS(ABS_Y), abs)) { - GP_DEBUG(3, "ABS Y = <%i,%i>", abs[1], abs[2]); + GP_DEBUG(3, "ABS Y = <%i,%i> Fuzz %i Flat %i", + abs[1], abs[2], abs[3], abs[4]); self->abs_y_max = abs[2]; } if (!ioctl(self->fd, EVIOCGABS(ABS_PRESSURE), abs)) { - GP_DEBUG(3, "ABS P = <%i,%i>", abs[1], abs[2]); + GP_DEBUG(3, "ABS P = <%i,%i> Fuzz %i Flat %i", + abs[1], abs[2], abs[3], abs[4]); self->abs_press_max = abs[2]; } } @@ -136,6 +139,7 @@ struct GP_InputDriverLinux *GP_InputDriverLinuxOpen(const char *path) ret->abs_y = 0; ret->abs_press = 0; ret->abs_flag = 0; + ret->abs_pen_flag = 0;
try_load_callibration(ret);
@@ -177,10 +181,12 @@ static void input_abs(struct GP_InputDriverLinux *self, struct input_event *ev) case ABS_X: self->abs_x = ev->value; self->abs_flag = 1; + GP_DEBUG(4, "ABS X %i", ev->value); break; case ABS_Y: self->abs_y = ev->value; self->abs_flag = 1; + GP_DEBUG(4, "ABS Y %i", ev->value); break; case ABS_PRESSURE: self->abs_press = ev->value; @@ -194,8 +200,17 @@ static void input_abs(struct GP_InputDriverLinux *self, struct input_event *ev) static void input_key(struct GP_InputDriverLinux *self, struct input_event *ev) { GP_DEBUG(4, "Key event"); - - (void) self; + + /* + * We need to postpone btn touch down until + * we read new coordinates for cursor. + */ + if (ev->code == BTN_TOUCH) { + if (ev->value == 0) + self->abs_pen_flag = 1; + else + return; + }
GP_EventPushKey(ev->code, ev->value, NULL); } @@ -211,12 +226,30 @@ static void do_sync(struct GP_InputDriverLinux *self)
if (self->abs_flag) { self->abs_flag = 0; + + if (self->abs_x > self->abs_x_max) + self->abs_x = self->abs_x_max; + + if (self->abs_y > self->abs_y_max) + self->abs_y = self->abs_y_max; + + if (self->abs_x < 0) + self->abs_x = 0; + + if (self->abs_y < 0) + self->abs_y = 0; + GP_EventPushAbs(self->abs_x, self->abs_y, self->abs_press, self->abs_x_max, self->abs_y_max, self->abs_press_max, NULL); self->abs_x = 0; self->abs_y = 0; self->abs_press = 0; + + if (self->abs_pen_flag) { + GP_EventPushKey(BTN_TOUCH, 1, NULL); + self->abs_pen_flag = 0; + } } }
http://repo.or.cz/w/gfxprim.git/commit/778ffdcb824b9141f5f6f13de981ed62827ca...
commit 778ffdcb824b9141f5f6f13de981ed62827cab52 Author: Cyril Hrubis metan@ucw.cz Date: Sat Feb 25 22:46:16 2012 +0000
input: Fix Absolute event to cursor overflow.
diff --git a/libs/input/GP_Event.c b/libs/input/GP_Event.c index 01afef2..e223ab3 100644 --- a/libs/input/GP_Event.c +++ b/libs/input/GP_Event.c @@ -255,8 +255,8 @@ void GP_EventPushAbs(uint32_t x, uint32_t y, uint32_t pressure,
/* set global cursor, pressure == 0 is penup */ if (pressure != 0) { - cur_state.cursor_x = x * screen_w / x_max; - cur_state.cursor_y = y * screen_h / y_max; + cur_state.cursor_x = x * (screen_w - 1) / x_max; + cur_state.cursor_y = y * (screen_h - 1) / y_max; }
/* put it into queue */
-----------------------------------------------------------------------
Summary of changes: include/input/GP_InputDriverLinux.h | 5 ++- libs/input/GP_Event.c | 4 +- libs/input/GP_InputDriverLinux.c | 43 ++++++++++++++++++++++++++++++---- 3 files changed, 43 insertions(+), 9 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.