Simulate a key press event?
- From: Yu Feng <rainwoodman gmail com>
- To: gtk-app-devel-list <gtk-app-devel-list gnome org>
- Subject: Simulate a key press event?
- Date: Wed, 08 Apr 2009 01:31:30 -0400
Dear list,
Could anyone help me to redirect a key press event from another
application's window to a GtkWidget?
My current solution (which works with a lot of warnings) is
1 Create a Gdk Foreign Window on the XID of the to be grabbed window.
2 Add a gdk filter on the foreign gdk window,
3 Grab the key with XGrabKey
4 in the filter, switch-case on the KeyPress event,
5 change the target window of XEventKey to the GtkWidget's window's xid
event->window = xwin
6 XSendEvent(display, xwin, false, 0, event)
For each redirected key press, the warning is
(lt-GlobalMenu.PanelApplet:19592): Gdk-WARNING **:
gdk_window_set_user_time called on non-toplevel
It is thrown by the set_user_time line immediate after
gtk_key_translate.
How can I avoid them?
Regards,
Yu
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]