Re: [fpc-pascal]sendkeys with gtk binding

2004-03-14 Thread Michael . VanCanneyt


On Sun, 14 Mar 2004, Marc Santhoff wrote:

 Hi!
 
 I'm trying to put some key event in the general message queue of an
 application. Think of simulating key presses. Some keypresses should be
 sent to the window and appear in the focussed widget.
 
 On windows there is (or at least was years ago) the sendkeys()
 function. 

This is actually a Visual Basic function :-)

 Does the fcl or gdk/gtk-binding offer similar possibilities?

No. SendKeys() works by grace of sending windows messages to a window
handle. You would need to find the right window handle and send an X event
to it. But to my knowledge, GDK doesn't offer this possibility. I'm not an
expert, though.

 
 Until now i found the function gtk_signal_emit, but it only does
 trigger registered events ... I'm stuck.

I don't think that you should look at the GTK level, but at the GDK level.
Or even the X level.

Michael.

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]sendkeys with gtk binding (solved)

2004-03-14 Thread Marc Santhoff
Am So, den 14.03.2004 schrieb Marc Santhoff um 15:03:
[...]
 
 You're right. In the GDK docs i found gdk_event_put which should do. I
 did not have such nice access violation errors for a long time. =:-()
 But it seems to be a lack of documentation.

In fact the right function is: gtk_propagate_event()

This does work as expected. The only thing to mention is that the focus
has to be at the receiving widget.

Bye,
Marc



___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal