-
How does one use SendMode? My code below: # Enter script code
import time
import random
choices = ["something", "something else", "a third thing"]
keyboard.send_key("<enter>")
time.sleep(0.1)
rn = random.randint(0, 2)
time.sleep(0.1)
clipboard.fill_clipboard(choices[rn])
time.sleep(0.1)
text = str(clipboard.get_clipboard())
keyboard.send_keys(text, keyboard.SendMode.CB_CTRL_V)
keyboard.send_key("<enter>") Gives me |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Welcome to the AutoKey community, @pieroluha ! First, take a look at our wiki. It has a number of useful articles and lots of examples. Start with this. We only have one version of our documentation. It refers to AutoKey 0.96.0 and you probably have 0.95.10 which didn't have that option. Other than that, your script is very close to right.
Pasting from the clipboard should always be your first choice unless you need to send "active" keys that do something on their own like moving the cursor (arrow keys...). Consider upgrading to 0.96.0. It has a lot of bug fixes and a few new features. Here's how. |
Beta Was this translation helpful? Give feedback.
Welcome to the AutoKey community, @pieroluha !
First, take a look at our wiki. It has a number of useful articles and lots of examples. Start with this.
We only have one version of our documentation. It refers to AutoKey 0.96.0 and you probably have 0.95.10 which didn't have that option.
Other than that, your script is very close to right.
The code below should work, but I haven't tested it, so it may have some typos...