This is more of a hypothetical question, I’m brainstorming some ideas for a project that I’m planning, and was curious if anyone knew of any APIs or methods of getting any highlighted text instantly on any window, for example from a browser or word processor. It could also have possibly a key command that would only read when pressed (Akin to CTRL+C adding the selected text to a clipboard)
Any knowledge in what APIs exist for this would be greatly appreciated.
You can use JNA to actually emulate a
Ctrl-C(copy action) on the foreground window, and then read what is in the clipboard, after that you just need to restore what was in the clipboard.This is a short sample:
When you run it, you will have two seconds to select some text somewhere on any application, and then it will normally print it.
You don’t need to accept my answer, it was just to show you what I said in my comment above.