I need to "enforce" autonomic pushing of a key combination in a program, like ctrl + c. I tried with VK_PASTE but on the list of errors I found that there was a problem with invalid key value or something and security issue. Somehow I understand the last one. Java won't let me do anything outside my program. But...
Now more detalis:
I mark with mouse some text, for example in pdf, independently running my program where I click let's say copy button, so I don't have to manually pushing combination on a keyboard. I have got what I wanted - that is a "thing" copied from other window in a clipboard BUT I didn't have to use my keyboard.
Robot class also fails cause it probably allows pushing one VK_key at once. I seen it lets use VK_PASTE, but as mentioned before - throws invalid key code + ...java.security.AccessController.doPrivileged(Nat ive Method)...
I'm little confused about it. Please don't write me that I should write my own OS with native problem solved ; ) Is there really any chance to make pushing virtually two buttons?
THE BEST example of my dissertation ; ) is Screen Keyboard available in WindowsOS. In the background like now writing this thread I mark some text, using my mouse I click on Ctrl, then C and voil'a. It works. So there must be a solution. But please, give me the right pathway to do so. Which library I should use or what technic?
I appreciate anyone who read it (or write me some clues).