PDA

View Full Version : keyboard event transfer



vijayabcdef
21st July 2010, 02:50
Hi,

i need to perform same action (if invoked by keyboard) in two machines running same application connected on ethernet.

i dont wanr ro maintain focus widget, current window, main window seaparately in application all that is anyhow maintained by combination of Qt and X-server.

for that how can i transfer key-events to other machine and how other machine will treat it as if it were it's own event

Ginsengelf
21st July 2010, 07:04
Hi, just transfer some message with the event type and necessary information to the second machine. Then use QCoreApplication::sendEvent() to create an event in the application on the second machine.

Ginsengelf

vijayabcdef
21st July 2010, 14:39
but that event is to be performed on particular object whose pointers are different in both machines.
pointer information in one machine is invalid for other.
to be specific, focus widget pointers are different in both machines, but that information is needed to deliver user made event!

Ginsengelf
22nd July 2010, 06:54
Yes, the pointers are of course different. But you can use the objectName and QObject::findChildren () to find the matching object in the other application.

Ginsengelf