Rectangle icon indicating copy to clipboard operation
Rectangle copied to clipboard

Cannot set shortcuts like ⌥L while Screen Sharing

Open lgarron opened this issue 1 year ago • 2 comments

  • [x] This is a new bug that hasn't been documented in a closed issue or in the Readme.

macOS version: 15.1 Rectangle version: v3.0.37

There's already an issue about disabling Rectangle for the Screen Sharing app: https://github.com/rxhanson/Rectangle/issues/1316

However, I spent a long time being really stuck because it seems Rectangle Pro doesn't support recording certain shortcuts over screen sharing, even if it can receive them.

  • This seems to include all shortcuts with the modifiers , , or ⌥⇧
  • This doesn't seem to include any shortcuts that include either the control or command key.

lgarron avatar Nov 07 '24 10:11 lgarron

Thanks for reporting. It's likely that the shortcut is being intercepted somewhere along the way, despite it bubbling through for the execution. Probably the only way to get by this is to have the shortcut recorder listen to keystrokes globally, rather than just the keystrokes that it receives. There are pros and cons to doing this, and I'm not 100% sold on it at the moment.

rxhanson avatar Nov 08 '24 05:11 rxhanson

Thanks!

btw, I also realized that this is apparently not an issue with Screen Sharing, but a regression of the app in general even outside Screen Sharing? I am certain that it used to work, as I did a lot of debugging that involved setting shortcuts like ⌥L. But now I can't set these at all.

It's not a huge issue for me, as I already have my config and can hack the JSON if needed. But if it's a general regression it might be bisectable?

lgarron avatar Nov 08 '24 10:11 lgarron

btw, I also realized that this is apparently not an issue with Screen Sharing, but a regression of the app in general even outside Screen Sharing? I am certain that it used to work, as I did a lot of debugging that involved setting shortcuts like ⌥L. But now I can't set these at all.

I've run into this again. If I try to set a shortcut like ⌥K or ⌥⇧K the OS I will hear an OS beep and no shortcut can be registered. 😣

lgarron avatar Jun 12 '25 00:06 lgarron

Yeah, looks like a consistent issue for me. However, I'm able to work around this (both for built-in sizes and custom size & position) by modifying the exported JSON by hand.

lgarron avatar Jun 12 '25 00:06 lgarron

I think you're experiencing this issue: https://github.com/rxhanson/Rectangle/issues/1592

rxhanson avatar Jun 12 '25 01:06 rxhanson

I think you're experiencing this issue: #1592

Hmm, that sounds like a complementary issue.

I have no trouble using a shortcut that contains the option key. I'm just not able to use the UI to input the keyboard shortcut.

lgarron avatar Jun 12 '25 01:06 lgarron

Ah, I think you're right. I'm guessing that the shortcut recorder's local event monitor simply isn't picking up your keystroke events over Screen Sharing. It seems like this would break other scenarios over Screen Sharing as well, since local event monitors are pretty commonly used. I have some work to do on the shortcut recorder and will take a look at that time, but it's a ways out before I will get to it.

rxhanson avatar Jun 12 '25 05:06 rxhanson

Ah, I think you're right. I'm guessing that the shortcut recorder's local event monitor simply isn't picking up your keystroke events over Screen Sharing. It seems like this would break other scenarios over Screen Sharing as well, since local event monitors are pretty commonly used. I have some work to do on the shortcut recorder and will take a look at that time, but it's a ways out before I will get to it.

I meant to make clear that this is not an issue with screen sharing. This has been happening to me without screen sharing since November. Let me update the title.

lgarron avatar Jun 12 '25 06:06 lgarron

Oh, my mistake, I missed that when reading back through this. Do you have the checkbox checked in the General tab to Allow any keyboard shortcut (remove safeguards)?

If you do have that checked, then we're back to the original assessment: that keyboard shortcuts are being intercepted before they make it to the shortcut recorder.

rxhanson avatar Jun 12 '25 14:06 rxhanson

Do you have the checkbox checked in the General tab to Allow any keyboard shortcut (remove safeguards)?

Aha! Apologies, I did not know about this setting. This does allow recording the relevant shortcuts for both built-in and custom sizes.

Sounds like it's a duplicate root cause, and I'm able to work around it for now. Thanks!

lgarron avatar Jun 12 '25 20:06 lgarron