You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, January 19th 2005, 2:32pm

Interprocess communication and KDE

I am a newbie in Qt programming (and also in C++).
I have read several books & manuals but I lack experience.
In order to learn Qt I have to build up a project (the best way to learn): at the moment I am interested in interprocess communication.
I use Linux Mandrake and KDE. Due to the fact that KDE has been written in Qt, and has embedded a tool like DCOP (Desktop Communication Protocol), is it possible to make a Qt sw that send simulated keystrokes (or even simulated mouse moves/clicks) to Konqueror browser to operate it?

e8johan

Beginner

Posts: 27

Location: Sweden

  • Send private message

2

Wednesday, January 19th 2005, 3:35pm

RE: Interprocess communication and KDE

DCOP is not used to send key strikes, for that, the X11 event queues are used and they can be used from Qt. DCOP can, however, be used to control Konqueror.

3

Thursday, January 20th 2005, 12:37pm

Thank you for your replay, but it's not very useful.
I explain why (at least for me...):
You say:

Quoted

DCOP is not used to send key strikes, for that, the X11 event queues are
used and they can be used fromQt. DCOP can, however, be used to control
Konqueror.


I did not say that "DCOP is used to send keystrokes" but I asked for any information (mainly in the form of web references) on:

Quoted

Qt sw that send simulated keystrokes
(or even simulated mouse moves/clicks) to Konqueror browser
My Reference to DCOP was merely to remind that a lightweight mechanism for inter-process communication already exists and it is used by KDE.Correctly you said that in your opinion the kestroke's simulation can be achieved by "X11 event queues", but for me (beeing a newbie) that is too generic.
Googling around I did not find much on the subject, expecially considering the fact that the event (the keystroke) must be sent to a process not created by me (I'm not a Konqueror's programmer!).
Your last assertion on "DCOP used to control Konqueror" is very interesting, but we must agree on what "control" means.
I know that using dcop from consolle, you can start Konqueror with a given URL and perhaps even open from it a new window of Kmail with the "To" field filled with a string of your choice, but I want to completely control Konqueror from sw simulating my keystrokes and/or mouse operations.
This is similar to what that can be achieved in Windows by macro languages like AutoIt or Macro Express or even by macro registration in Office.

I am surprised that Linux in this field is not up to date...

This post has been edited 2 times, last edit by "fiomba" (Jan 20th 2005, 12:48pm)


wysota

Trainee

Posts: 65

Location: Warsaw, POLAND

  • Send private message

4

Thursday, January 20th 2005, 2:27pm

Quoted

Originally posted by fiomba
I am surprised that Linux in this field is not up to date...


As Johan already said -- X protocol is used for that. Go http://www.xfree.org/ for details and documentation.

And just for explanation to the above quoted statement -- Windows and X have completely different architectures. I might say: "Linux can run a program on one machine and display it on the other, I am surprised that Windows in this field is not up to date". Think about it...

And I wouldn't use the term "Inter Process Communication" when refering to sending keystrokes and mouseclicks to another application. IPC is a well defined term and means something else.
Live and let live - use the search engine.
"Use the docs Luke, use the docs!"

e8johan

Beginner

Posts: 27

Location: Sweden

  • Send private message

5

Thursday, January 20th 2005, 2:28pm

Quoted

Originally posted by fiomba
Thank you for your replay, but it's not very useful.


Ok, I understand you. Have you looked at any of these links?

http://lukeplant.me.uk/articles.php?id=1
http://www.volny.cz/bwian/dcop.html

Using the dcop command, you can explore what you can do with dcop and what level of control that you can achieve.

6

Thursday, January 20th 2005, 5:23pm

Hi,
thanks again to e8johan and wysota.
Two days ago I found "The Indipendent Qt Tutorial" by e8johan; I am studying it together with the Trolltech's Tutorials. Thanks also for that!
Of the two web reference given by e8johan, the second was already known, but the first one seems interesting.
As far as my incorrect use of the term "inter-process communication", call it as you like, but the result does not change (I have not seen any example of keyboard/mouse emulation to control from sw another application!).

wysota

Trainee

Posts: 65

Location: Warsaw, POLAND

  • Send private message

7

Thursday, January 20th 2005, 8:11pm

Live and let live - use the search engine.
"Use the docs Luke, use the docs!"

wysota

Trainee

Posts: 65

Location: Warsaw, POLAND

  • Send private message

9

Thursday, January 20th 2005, 9:53pm

Quoted

Originally posted by fiomba
http://www.x.org/X11_clientdesign.html
does not work!


You mean the link? Works fine for me...
Live and let live - use the search engine.
"Use the docs Luke, use the docs!"

10

Thursday, January 20th 2005, 10:03pm

...for me, no! And unluckily I havent found no web mirroring for the html file.

wysota

Trainee

Posts: 65

Location: Warsaw, POLAND

  • Send private message

11

Thursday, January 20th 2005, 10:40pm

Live and let live - use the search engine.
"Use the docs Luke, use the docs!"

12

Thursday, January 20th 2005, 10:56pm

It does not work either, but thanks all the same!

wysota

Trainee

Posts: 65

Location: Warsaw, POLAND

  • Send private message

13

Thursday, January 20th 2005, 11:08pm

Then you must have a broken network :)

I'll quote some part of it:

Quoted

The X server therefore:

* displays drawing requests on the screen.
* replies to information requests.
* reports an error in a request.
* Manages the keyboard, mouse and display device.
o Multiplexes keyboard and mouse input onto the network (or via local IPC) to the respective X clients. (X events)
* creates, maps and destroys windows.
o writes and draws in windows.
Live and let live - use the search engine.
"Use the docs Luke, use the docs!"

14

Thursday, January 20th 2005, 11:22pm

I am grateful for your interest... but it is not so important.
Anyway I am contacting a guy that claims to controll an application by means of keypresses sent to the window .

This post has been edited 2 times, last edit by "fiomba" (Jan 20th 2005, 11:23pm)


guest

Unregistered

15

Monday, February 14th 2005, 9:32pm

For a purely non-DCOP X protocol example, see:
http://freshmeat.net/projects/x2x/

That application allows removal of mouse/keyboard switches in controlling 2 separate X11 machines from a single mouse and keyboard. In a nutshell, mouse and keystrokes are diverted from one machine to another and the other machine thinks the mouse and key events orginated on itself.

Keep in mind though that security settings in most machines will by default force this to fail until you use a mechanism (such as xhost) to tell one machine that another is allowed to display itself on the other machine. It's quite possible some of the things you feel don't work do work, but are disabled via security settings.

16

Tuesday, February 15th 2005, 12:30am

Thank you for your replay and for the web reference. Unfortunately the target is a little different :

Quoted


x2x allows the keyboard and mouse on one ("from") X display to control another ("to") X display.

I don't want to control another display, unless another X application can be considered "another X display".
I hoped to have found the solution with a guy who pretended to control another application by means of simulated keypresses but also in this case it was only a method to implement shortcuts.
By sending keystrokes to a window I do not intend to launch a shortcut for a given action, but merely simulating what I do by hand.

I tought that was easy like under Windows with the macro languages like AutoIt, Macro Express, Macro Scheduler or even the macro registration in Office).

But I mailed one of the programmers of KDE and DCOP and he said that this was not so easy.

I refer his exact words:

Quoted


"Well, it would be in principle possible, if someone would add DCOP wrappers around a general event handler.
But I doubt such a mechanism already exists.
Konqueror's (or any KDE app's) ensemble of keyboard strokes and mouse events is in fact the result of the reunion of a large number of such notions that
are configured and provided at multiple levels in the KDE framework.
Some of these events are configured at Qt level (e.g. the TAB keystroke that moves the cursor from widget to widget).
Others are offered by the KDE libs (e.g. the Ctrl+C that allows copying). Others by the application itself (e.g. Ctrl+Home for going to the home page in konqueror).
Thus, making a wrapper around all this multitude is probably a very involved task."

So I gave up, expecting that someone else solved the problem, beeing all that too far from my knowledges.
And, in effect, I know that there is a working group, to add automation tools to linux but it is in a too early stage.