Re: How can I formulate a gdkevent?

From: Date: Mon, 11 Jul 2005 12:49:04 +0000
Subject: Re: How can I formulate a gdkevent?
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-5955@lists.php.net to get a copy of this message
Hi Anthony, If you're on Windows then you maybe could give a try to the win32api function 'keybd_event'. It takes some parameters like 'virtual-key code', 'hardware scan code', etc. and it is used to simulate a keypress event. And if somebody needs to generate a mouse event, it can be done with the 'mouse_event' function. Regards, Gonzalo. anthony escribió:
No answer yet, I'll try once more: I want to be able to navigate a ctree using the keyboard. To do that comfortably I need to control focus. However there seem to be no methods to control focus - as opposed to selection - in gtkclist and gtkctree, the only one concerning focus at all is the focus_row property of gtkclist that only reads the row number. So the only way I can see is to simulate key-press events that take me where I want to be. And there are indeed methods, namely event() and main_do_event(), that take a gdkevent as argument. "This method causes event to be triggered. This in turn causes the widget to emit an appropriate signal.", as I read in http://gtk.php.net/manual/en/gtk.gtkwidget.method.event.php. This is just what I want. Now, there is more stuff concerning events in http://gtk.php.net/manual/en/gdk.gdkevent.php and http://gtk.php.net/manual/en/signals.events.php but, sadly, nothing on how to actually formulate one. Everyone seems to think only about events that are already given as input from keyboard or mouse. But should it not be possible to create them using a GdkEventType and property? E.g. for the case in hand GDK_KEY_PRESS and GDK_KEY_Up, GDK_KEY_Down etc., something like "GDK_KEY_PRESS->keyval=GDK_KEY_Down" (which is nonsense and produces a parse error). I tried all kinds of combinations, but of course without success. So please: Does anyone know how to do this? Anthony


« previous php.gtk.general (#5955) next »