receive the word above which there is a cursor of mouse
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.
Re: receive the word above which there is a cursor of mouse
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
Re: receive the word above which there is a cursor of mouse
It's clear.
I do not know, how I can receive the text cursor in the another's application. :o
Thanks.
Re: receive the word above which there is a cursor of mouse
Nobody knows as?:( Can be, then prompt programs written on Qt with this opportunity, and having license GPL?
Re: receive the word above which there is a cursor of mouse
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. :)
Re: receive the word above which there is a cursor of mouse
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
Re: receive the word above which there is a cursor of mouse
Thanks for clearing of a situation :)