Skip to content

Add shortcat integration#1940

Open
NLCas8 wants to merge 7 commits intotalonhub:mainfrom
NLCas8:add-shortcat
Open

Add shortcat integration#1940
NLCas8 wants to merge 7 commits intotalonhub:mainfrom
NLCas8:add-shortcat

Conversation

@NLCas8
Copy link
Copy Markdown

@NLCas8 NLCas8 commented Jul 13, 2025

Integrates Shortcat with Talon.

This allows you to say for example sot click [BUTTON LABEL] where BUTTON LABEL is the label of a button anywhere on the screen (it works in almost any application, so not only the browser). I have done the same for right click, hover, and double click.

See screenshot where I said sot click landscape. It also works with button labels that are not visible on the screen, but only appear when hovering over the button.
image

@jaresty
Copy link
Copy Markdown
Contributor

jaresty commented Jul 13, 2025

I didn't know about shortcat. Cool!

@auscompgeek
Copy link
Copy Markdown
Collaborator

FWIW I think a bunch of folks moved on from Shortcat to Homerow.

Comment thread apps/shortcat/shortcat.py Outdated
mod = Module()

# Hotkey that is configured to activate Shortcat
SHORTCAT_HOTKEY = "cmd-shift-space"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a setting so it can be changed by users without modifying the code.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replaced both constants with settings

@NLCas8
Copy link
Copy Markdown
Author

NLCas8 commented Jul 14, 2025

FWIW I think a bunch of folks moved on from Shortcat to Homerow.

I didn't know about Homerow. I will look into this, thanks!

Copy link
Copy Markdown
Collaborator

@nriley nriley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, we appreciate your contribution, and it has certainly caused me to take a second look at Shortcat — it has grown a lot of features since the last time I checked!

Since not everybody will be using Shortcat on their Mac, you should be able to scope your changes to Shortcat appearing in user.running.

Comment thread apps/shortcat/shortcat.py
def shortcat_click(text: str, click_delay: str = "0ms"):
"Click a button using shortcat"
actions.user.shortcat_hover(text)
actions.sleep(click_delay)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the community backlog session, we had a couple comments on this behavior.

If the delay is to give you time to cancel if the wrong button is about to be clicked, then using actions.sleep will block Talon and not allow you to cancel using a voice command or other Talon action. A couple options:

  • Having a separate confirmation action. This is how my Homerow support works
  • Using cron such that Talon is active while it is waiting.

Our preference is for the first option as we feel that any substantial delay long enough to give you a chance to cancel would be frustrating to use in practice.

Comment thread apps/shortcat/shortcat.py
actions.key("enter")
actions.sleep("100ms")
actions.mouse_click(0)
actions.mouse_click(0)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a single action for single and multiple clicks.


^(shot | sot) click [<user.text>]:
# Add some delay to cancel click if needed
user.shortcat_click(text or "", "1500ms")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this delay would be incredibly frustrating in practice, not to mention it is likely to trigger Talon's watchdog timer and spam your log. I would recommend that you have this as a configurable setting, if you decide to use the cancel delay rather than a confirmation action.

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

Successfully merging this pull request may close these issues.

4 participants