Can't assign shortcut to button

Hi,
While working on my personal shortcut system in darktable, I noticed that I could not assign a shortcut to the button in the snapshots module to show image and snapshot side by side. Have I missed something, is this intentional or should I report a bug?
DT 5.3.0-git857 from OBS, on Linux Mint.

1 Like

I searched for this to. Not there. You can assign the action to ā€˜show/toggle on the last snapshot’.
So I activate the side by side button manually , without activating a snapshot. Then use the shortcut to do what you ask. Just keep the side side button turned on.

Best wishes.

Yes, that’s certainly possible, but it only brings us half way there. And as long as most buttons can have shortcuts, why not all of them? Maybe @dterrahe, who made the button can chime in?

That just needs a

  dt_action_define(DT_ACTION(self), NULL,
                   N_("side-by-side"), d->sidebyside_button, &dt_action_def_toggle);
4 Likes

As a non programmer I feel very much lost now… :upside_down_face:
I guess one may add this somewhere in the code, build a new dt and test?
Would love to learn to do this, by the way.

Maybe not even to perform this myself but at least to better understand what you programmers are doing!

Kind regards, Jetze

1 Like

Let’s just hope @dterrahe does the magic and wait for the resultšŸ˜€

Yep. One would do this immediately after sidebyside_button was created.

I could easily submit this change to the codebase. But these are also the simple changes that a newcomer might have a look at. Possibly there are other buttons that are currently not shortcuttable. So the ā€œprojectā€ here would be to find similar situations and deal with all in one go.

Any takers?

1 Like

I’ll start with a guess… around maybe just after line 871 in snapshots.c ??

If I have time I will try to test it later…

1 Like

Will at first try to find the code… would be a first for me…

Any time after 866 and before the end of the function.

Look at other uses of dt_action_define to get ā€œa feel for itā€. This is a relatively simple case of ā€œif it works, you did it rightā€. Of course there may still be a little bit of ā€œtasteā€ in how to name actions. And if there are many of them in one module, one might want to group them in a section. Stuff like that. But that would all be reviewed once a (draft) PR is submitted.

And to be clear, I’m not saying there are any other instances like this to be found anymore. Maybe I took care of all of them in the past. But it would be a useful check to do.

2 Likes

I missed the ā€œside by sideā€ part. Ignore me. :grimacing:

I could not assign a shortcut to this buttons.
DT: 5.3.0+882~g916b7e4c99

Bildschirmfoto_20251115_213914
Bildschirmfoto_20251115_213900
Bildschirmfoto_20251115_213845
Bildschirmfoto_20251115_213748

I tried awhile ago, and it seems the only one available for shortcuts is the ā€œactiveā€ group (maybe the quick access one, but can’t remember for sure). I wanted to make a shortcut to my own personal groups.