Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with cliclick kp: commands on MacBook Sonoma #177

Open
Pory55 opened this issue Jul 7, 2024 · 7 comments
Open

Issue with cliclick kp: commands on MacBook Sonoma #177

Pory55 opened this issue Jul 7, 2024 · 7 comments

Comments

@Pory55
Copy link

Pory55 commented Jul 7, 2024

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.

@vitor-rc1
Copy link

vitor-rc1 commented Jul 28, 2024

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

@kazkl
Copy link

kazkl commented Aug 1, 2024

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

@stephen714
Copy link

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

@BlueM
Copy link
Owner

BlueM commented Nov 10, 2024

@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

@BlueM
Copy link
Owner

BlueM commented Nov 10, 2024

See comment #164 (comment) for a potential solution.

@BlueM
Copy link
Owner

BlueM commented Nov 15, 2024

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”.

@stephen714
Copy link

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! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants