Bug 500196 - Add custom shortcuts for post-crop actions
Summary: Add custom shortcuts for post-crop actions
Status: REPORTED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 24.12.2
Platform: Fedora RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: Noah Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-16 15:55 UTC by EpicTux123
Modified: 2025-02-18 22:02 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description EpicTux123 2025-02-16 15:55:54 UTC
I would like to be able to add custom shortcuts for Spectacle post-crop actions. Mainly, I would like to use Spacebar to Copy the screenshot to the clipboard in addition to Ctrl+C. If possible, adding custom shortcuts (user-defined) for other actions would be cool too.

Thanks.
Comment 1 Noah Davis 2025-02-17 04:51:06 UTC
Custom shortcuts is an interesting suggestion. Spacebar in particular may not be a good choice, unfortunately. The issue is that Spacebar is an accepted key for most focusable controls, so you may not be able to reliably use it for copying. Alt+Space or some other combination might work fine.
Comment 2 EpicTux123 2025-02-17 18:17:08 UTC
Would it be possible to make it so only Spectacle receives keyboard input (has high-priority over other apps) when taking screenshots? This could solve the issue you presented.
Comment 3 Noah Davis 2025-02-18 03:31:59 UTC
The issue isn't making sure Spectacle keeps the input, it's making sure Spectacle's own controls don't accept the Space key. The behavior is baked into Qt because it's standard behavior for controls like buttons.

Unless by "post-crop", you mean after completing a rectangle mode crop from a global shortcut?
In that case, Space would still be a bad idea because we'd have no way to know what the user wants to happen at that point. If you finish the screenshot and a text box in your browser is now focused since the browser was the last focused window before you activated Spectacle, how would we know if Space should copy or enter a space into the text box? I'm also not sure if such a thing would be possible since Wayland has a lot more restrictions than X11.
Comment 4 EpicTux123 2025-02-18 03:57:25 UTC
By "post-crop" I mean when you finish the selection in the rectangle capture mode. When Save/Copy and edit buttons appear.

Regarding the spacebar, it currently does nothing on Spectacle. I don't think it could be a issue because there's an app called Flameshot (https://github.com/flameshot-org/flameshot) that gives me the power to add the Copy (or Save) action to the Spacebar without any problems (it also has a text entry bot IIRC). (That app doesn't work too greatly under Wayland, however.)

To clarify, I'm not saying to make spacebar a default shortcut. The spacebar is what I want to use personally, but what I'm asking is for the ability to use custom shortcuts, without pre-defining any new ones.