Add keyboard shortcut to toggle between "Refer only active layer" and "Refer visible Layers"

Self explanatory title, I should hope. :slight_smile:
Lately I find myself switching back and forth between these two modes ( “Refer only active layer” and “Refer visible Layers”) a lot more than I used to, and it’d be a tremendous workflow boost if I could have these options included in the keyboard shortcuts menu so I didn’t have to mouse over to this tiny dropdown menu and manually switch them with my mouse.

image

1 Like

have you tried to map that in the shortcuts?

Yes. I haven’t been able to find it. So either I’m miserably blind and/or incompetent, or it’s not actually in there lol.

According to C++ source code there is no way to control this Preference tool option (floodfill.refer_to) from keyboard shortcuts for now. I think it will be the best to add Preferences global / tool / document options control by name from keyboard shortcuts.

Like: <key preference="tool.floodfill.refer_to" action="enum_next" value="" shortcut="Ctrl+Shift+R" mac="Cmd+Shift+R" />

@dacap How do you think? Is GUI responsive enough to update on-the-fly from Preferences?

Hi there! :wave:

At the moment I think there is no way to change that with a command, but you can create a script like this:

And then associate a key to that script to switch the option.

It’s quite responsive (as preferences changes are observed), but in some cases the key will not work in some popups (like in this case because when the popup is open the key shortcut doesn’t work). But the option will be changed successfully if the shortcut/script is used without any popup opened.

3 Likes

Couldn’t have asked for a more perfect solution. This is great, thank you!

After plugging it in and testing it out for a while, there is one more smaller thing I’d like to have it do, but is not really necessary per se, is a feedback to let me know which mode it is I just switched it to, since there’s no way to actually see which one I’m on without clicking on the menu, which is the problem I’ve been trying to avoid lol.
I know I can make dialogues in script, and even make it so they don’t lock my inputs and such, but is there a way to add a life-timer to it? In other words can I make it disappear 1 sec later without any input? I basically want a hacky notification text to just tell me which one I’m on.