Example #1
0
void
KdeGui::handleKeyEvent(QKeyEvent *event, bool down)
{
    gnash::key::code c = qtToGnashKey(event);
    int mod = qtToGnashModifier(event->state());
    notify_key_event(c, mod, down);
}
Example #2
0
static void handle_input_event(struct usf_type *usf_info,
			       uint16_t event_counter,
			       struct usf_event_type *event)
{
	struct input_dev *input_if = NULL;
	uint16_t ind = 0;

	if ((usf_info == NULL) || (usf_info->input_if == NULL) ||
	    (event == NULL) || (!event_counter)) {
		return;
	}

	input_if = usf_info->input_if;

	for (ind = 0; ind < event_counter; ++ind) {
		event += ind;
		if (event->event_type & usf_info->event_types) {
			/* the event is supported */
			if (event->event_type & USF_TSC_EVENT) {
				struct point_event_type *pe =
					&(event->event_data.point_event);
				if (pe->coordinates_type ==
				    USF_PIX_COORDINATE) {
					notify_tsc_event(input_if,
							 pe->coordinates[0],
							 pe->coordinates[1],
							 pe->pressure);
				} else
					pr_debug("%s: wrong coord type:%d\n",
						 __func__,
						 pe->coordinates_type);

				continue;
			}

			if (event->event_type & USF_MOUSE_EVENT) {
				notify_mouse_event(input_if,
					&(event->event_data.mouse_event));
				continue;
			}

			if (event->event_type & USF_KEYBOARD_EVENT) {
				notify_key_event(input_if,
					&(event->event_data.key_event));
				continue;
			}
		} /* the event is supported */
	}
}