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

Have a way to skip sending Keyboard shortcut to apps that use float windows (like Raycast/Alfred) #510

Open
bjrmatos opened this issue Mar 13, 2024 · 4 comments

Comments

@bjrmatos
Copy link
Sponsor

example use case:

Chrome has a keyboard shortcut (⇧⌘A) to open a search tabs feature, i don't like that keyboard shortcut, instead, i want to use ⌘P, so i have created this workflow:

Screenshot 2024-03-13 at 1  41 12@2x

this works as expected, however, I've noticed that this breaks the keyboard shortcuts in Raycast if they have some action attached to ⌘P

i think the problem is that Cowboy still thinks that chrome is active and at the front, so when i press ⌘P with Raycast launched it sends ⇧⌘A to Raycast (which is not what i want), i want that Raycast receives just the original ⌘P.
just for the sake of testing i have tried enabling the "Passthrough" and it makes it work with Raycast, however now when doing the keyboard shortcut with just Chrome it trigger both the Search Tabs and a Printing Dialog, so likely the "Passthrough" is not good solution for this case.

i have tried other apps trying to fix this specific problem (Keyboard Maestro, BetterTouchTool) but they fail to handle it, it will be a major killer feature for me if you somehow manage to do it.

this is a video that shows the case: https://share.cleanshot.com/lkkCpgYv

thanks!

@zenangst
Copy link
Owner

zenangst commented Mar 14, 2024

@bjrmatos

Interesting, I see the problem and know why it happens.
Keyboard Cowboy doesn't care about which apps has focus, it checks which is front most. Raycast never becomes front most, unless the preference is actually opened.

There is workaround that could be applied here, but it would involve using the Accessibility API, which is known to be slow.

We could consider enabling an additional flag on the group, that it should only be applied if the currently focused element belongs to the application attached in the group rules. That might work, it would be an opt-in feature in that case.

I'll have to do some additional investigation to figure out if this solution is viable.

@zenangst
Copy link
Owner

And again, thanks for bringing this to my attention, I've never stumbled upon this issue before.

As a workaround, you should be able to rebind the key in Google Chrome by using the System Settings way of rebinding it (if the shortcut is located in the menu for the app). Have you tried that already?

@bjrmatos
Copy link
Sponsor Author

We could consider enabling an additional flag on the group, that it should only be applied if the currently focused element belongs to the application attached in the group rules. That might work, it would be an opt-in feature in that case.

I'll have to do some additional investigation to figure out if this solution is viable.

oh yes, excellent, i will keep an eye for any updates, thank you!

As a workaround, you should be able to rebind the key in Google Chrome by using the System Settings way of rebinding it (if the shortcut is located in the menu for the app). Have you tried that already?

hmm no, i have not tried it, it is a good idea, i will check. it may be great for this case however i have plans for other shortcuts that are not in the menu, i just don't want to have conflicts with Raycast shortcuts :)

thanks again for looking into this

@zenangst
Copy link
Owner

Thought a little more about this problem and it is not as easy as I thought it would be.
Mainly because we don't have a subscription mechanism in place for when the currently focused element changes. Will have to do a little more tinkering before we can come up with a viable solution.

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

No branches or pull requests

2 participants