Issue with cliclick kp: commands on MacBook Sonoma
Hi, I'm on MacBook Sonoma, and currently using cliclick version 5.1, installed via Homebrew. I've successfully implemented commands such as c:123,614, t:hello, and ku:cmd in scripts without any issues using Automator, Script Editor, or Terminal. However, I'm encountering a specific problem with kp: actions such as kp:volume-down, kp:arrow-up, kp:return or similar key press commands do not execute as expected. The script runs without errors, but no action occurs. I've checked command syntax and attempted various actions as listed in the documentation, but none of them for kp: seem to work. Any insights or suggestions on troubleshooting or resolving this issue would be greatly appreciated.
Hi @Pory55. I faced that too. I'm using this workaround with AppleScript. You can use any key on keyboard :)
tell application "System Events"
-- Emulate Enter key
keystroke return
end tell
Hello there. The same issue occurs. I executed this command in my terminal. When the kp: command is used frequently in a while loop, I observed irregular input.
while true; do
cliclick "kp:arrow-left"
sleep 0.1
done
Seeing this too, it is driving me crazy!
Specifically with sleep 3; for i in {1..100}; do cliclick -w 100 -m verbose kp:arrow-down; done
@Pory55: do you experience the kp issue with any key, or just specific ones? And is the problem reproducible (e.g. kp:volume-down never works) or is it randomly? What keyboard layout are you using?
@stephen714: I don’t know what you are trying to accomplish, but maybe you should experiment with executing the commands within a single cliclick invocation. Something like …
commands=$(printf 'kp:arrow-down%.0s ' {1..100})
cliclick -w 100 -m verbose $commands
See comment https://github.com/BlueM/cliclick/issues/164#issuecomment-2466781818 for a potential solution.
To clarify my last comment: “potential solution” does not mean “fix it yourself”, but rather “I’d be interested to hear if the problem can be solved with the small change in above-mentioned comment”.
Copy that! My bad; I think I got a bit excited.
To answer your question, I compiled that small change in your above-mentioned comment and it seems like the problem can be solved (i.e. cliclick kp:arrow-down, and other presses, actually work).
Sorry for being a nuisance! 😄