Reputation: 113
I have a program that calls various functions based on hotkeys and the clipboard. I am using pyperclip
and aoikhotkey
. This combination is working very well. However, I would like to improve it even more if possible. Currently, my workflow is as follows:
I would like to eliminate step 2 and have the function called by the hotkey "scrape" the content on my screen (possibly using mouse or cursor event monitoring).
Does anyone have any ideas about how I can do this? I suspect that I might be able to use Tkinter
somehow to accomplish this, but I don't have any experience working with Tkinter
, so if anyone has any suggestions or hints, I would be grateful.
Here's a post asking a similar question, but using the Autohotkey scripting language:
Get Selected Text Without Using the Clipboard
The title of this question was originally "Getting selected text without using the clipboard". However, I changed it because the comments section to this question helped clarify my actual needs and goals.
Upvotes: 0
Views: 3009
Reputation: 676
Select Text without using the Clipboard is i think not possible, you will need the Clipboard to Copy the Text (Ctrl+c) - you can do that with your Keyboard Device by pressing the keys or you can do that by command Send a Hotkey stroke:
pyautogui.hotkey('Ctrl','c')
With python Packages pyautogui and pywinauto - you can send any text or hotkeys without to having to do a pressing on a Keyboard Device. - and if you want to use with your Mouse device you can use AutoPythonLauncher Software with this you can create Clickable Images on the Screen - watch this video Click Here
Upvotes: 1