simulating a keypress-event
- From: Clemens Kirchgatterer <clemens root at>
- To: gtk-app-devel-list <gtk-app-devel-list gnome org>
- Subject: simulating a keypress-event
- Date: Tue, 3 Oct 2000 21:21:16 +0200
hi!
i'm writing an app for touchscreens and somtimes the the user must
enter some simple words. so build a "mouse-keyboard" where
button-press-events should be send a specific key to a GtkEntry.
so i would like to fill out the GdkEventKey struct and send it with
gtk_signal_emit_by_name(), but my code segfaults and for most members
i don't know what to assign. (just guessing!!!)
here is (a short version of) my callback function:
GtkWidget *entry_typed;
static void
button_callback(GtkWidget *wid, gpinter data) {
GdkEventKey event;
event.type = GDK_KEY_PRESS;
event.window = entry_typed->window;
event.send_event = TRUE;
event.time = gdk_time_get();
event.state = GDK_KEY_PRESS;
event.keyval = (guint *)data;
event.length = 1;
event.string = "";
gtk_signal_emit_by_name(GTK_OBJECT(entry_typed), "key_press_event", &event);
event.type = GDK_KEY_RELEASE;
event.time = gdk_time_get();
event.state = GDK_KEY_RELEASE;
gtk_signal_emit_by_name(GTK_OBJECT(entry_typed), "key_press_event", &event);
}
does anybody know what im talking about? ;-)
thanx ...
clemens
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]