Add shortcat integration#1940
Conversation
|
I didn't know about shortcat. Cool! |
|
FWIW I think a bunch of folks moved on from Shortcat to Homerow. |
| mod = Module() | ||
|
|
||
| # Hotkey that is configured to activate Shortcat | ||
| SHORTCAT_HOTKEY = "cmd-shift-space" |
There was a problem hiding this comment.
This should be a setting so it can be changed by users without modifying the code.
There was a problem hiding this comment.
I replaced both constants with settings
I didn't know about Homerow. I will look into this, thanks! |
nriley
left a comment
There was a problem hiding this comment.
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.
| def shortcat_click(text: str, click_delay: str = "0ms"): | ||
| "Click a button using shortcat" | ||
| actions.user.shortcat_hover(text) | ||
| actions.sleep(click_delay) |
There was a problem hiding this comment.
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
cronsuch 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.
| actions.key("enter") | ||
| actions.sleep("100ms") | ||
| actions.mouse_click(0) | ||
| actions.mouse_click(0) |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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.
Integrates Shortcat with Talon.
This allows you to say for example
sot click [BUTTON LABEL]whereBUTTON LABELis 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.