keyboard: Add rudimentary touch support to keyboard.

At this time there is no way to have a key be activated when
touch_up is called, so all this patch does is activate they
key on touch_down.

Signed-off-by: Brian J Lovin <brian.j.lovin@intel.com>
diff --git a/clients/keyboard.c b/clients/keyboard.c
index a6f7010..9ee4a84 100644
--- a/clients/keyboard.c
+++ b/clients/keyboard.c
@@ -625,6 +625,46 @@
 }
 
 static void
+touch_down_handler(struct widget *widget, struct input *input,
+		   uint32_t serial, uint32_t time, int32_t id,
+		   float x, float y, void *data)
+{
+
+	struct keyboard *keyboard = data;
+	struct rectangle allocation;
+	int row, col;
+	unsigned int i;
+	const struct layout *layout;
+
+	layout = get_current_layout(keyboard->keyboard);
+
+	widget_get_allocation(keyboard->widget, &allocation);
+
+	x -= allocation.x;
+	y -= allocation.y;
+
+	row = (int)y / key_height;
+	col = (int)x / key_width + row * layout->columns;
+	for (i = 0; i < layout->count; ++i) {
+		col -= layout->keys[i].width;
+		if (col < 0) {
+			keyboard_handle_key(keyboard, time, &layout->keys[i], input, WL_POINTER_BUTTON_STATE_PRESSED);
+			break;
+		}
+	}
+
+	widget_schedule_redraw(widget);
+}
+
+static void
+touch_up_handler(struct widget *widget, struct input *input,
+				uint32_t serial, uint32_t time, int32_t id,
+				void *data)
+{
+
+}
+
+static void
 handle_surrounding_text(void *data,
 			struct wl_input_method_context *context,
 			const char *text,
@@ -839,6 +879,9 @@
 	widget_set_redraw_handler(keyboard->widget, redraw_handler);
 	widget_set_resize_handler(keyboard->widget, resize_handler);
 	widget_set_button_handler(keyboard->widget, button_handler);
+	widget_set_touch_down_handler(keyboard->widget, touch_down_handler);
+	widget_set_touch_up_handler(keyboard->widget, touch_up_handler);
+
 
 	window_schedule_resize(keyboard->window,
 			       layout->columns * key_width,