PDA

View Full Version : receive the word above which there is a cursor of mouse



ufo-vl
23rd July 2007, 03:21
Hello,

Can I receive the word above which there is a cursor of mouse?
It is necessary, that it extended on all working applications.

For example,
I have moved cursor in TextEditor,
I leave the cursor of a mouse above a word "check" for 2 seconds, as result - in a variable wordString it is necessary to bring a word "check".

Thanks.

macias
23rd July 2007, 07:58
I guess you should obtain text cursor for the given position, then having text cursor you "move" left to the beginning of the word and right to the end. You get your word.

have a nice day, bye

ufo-vl
24th July 2007, 02:20
It's clear.
I do not know, how I can receive the text cursor in the another's application. :o
Thanks.

ufo-vl
25th July 2007, 00:58
Nobody knows as?:( Can be, then prompt programs written on Qt with this opportunity, and having license GPL?

jpn
25th July 2007, 20:23
I don't think there is any way to pick text from any arbitrary application on the desktop. The closest you can get to is to take a screenshot. :)

marcel
25th July 2007, 20:34
On what platform do you need to do this?
Because it is not possible to do this with Qt only on all platforms.
On Windows you could take a look at Spy++-like tools(even Spy++, I think the sources are available).

On KDE, it might be possible to use only Qt but I guess KDE has some API to examine all the widgets on the screen.

On MAC, like in Windows, you'll have to use platform API. Since they have a manager for everything, there has to be a manager for it too:).

Regards

ufo-vl
26th July 2007, 13:11
Thanks for clearing of a situation :)