Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Change Keyboard Shortcut for Fill with Foreground/Background Color

Explorer ,
Mar 18, 2025 Mar 18, 2025

How do I change the default keyboard shortcuts for filling selections with the foreground/background color?

TOPICS
Windows
168
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 18, 2025 Mar 18, 2025

The script/s would be installed in Presets/Scripts directory and Photoshop restarted. Then custom keyboard shortcuts would be assigned to the installed script/s under the File > Scripts menu.

 

EDIT: It looks like there's no need for a script as the Fill command is already available for a custom keyboard shortcut:

2025-03-19_20-30-09.png

 

EDIT 2: Here are the scripts to directly fill with fore/back swatches (not Fill... with dialog):

 

// Fill with foreground color
#target photoshop;
var s2t = function (s) {
    retur
...
Translate
Adobe
Community Expert ,
Mar 18, 2025 Mar 18, 2025

If you are referring to:

 

   Alt Backspace (fill with forground colour)

   Ctrl Delete (fill with background colour)

 

...I think they are hard coded, so can't be changed.

 

What you can do is choose nearly any shortcut you like to open the Fill Dialog panel, but it's not going to be a one click solution — you'd need to use the dropdown and choose.

image.png

 

The test for making, or changing shortcuts is if they appear in a menu or toolbar, then you can change or set them.  If they do not appear in a menu then you are out of luck.   If you _really_ wanted to do this, then maybe the scripting people could help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 18, 2025 Mar 18, 2025

You mean I have to change the script in order to change the shortcuts? How?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 18, 2025 Mar 18, 2025
quote

You mean I have to change the script in order to change the shortcuts? How?


By @Jalen30051005ql1u

 

No, it wouldn't work like that, and I don't know if forum scripting experts like @Stephen Marsh could do anything.  The Alt Backspace shortcut can't be changed, but maybe the Edit > Fill dialog could be accessed automatically.  I don't know the first thing about scripting, so you'll need someone like Stephen.  

 

What would you like to achieve? How would you like it to work?

 

One way that would definitely work is using a gaming keyboard or MMO Mouse.  This would not be one of the little TKL keyboards, but a full size keyboard with number pad and additional G keys.  You can remap the G keys with sharacter strings, so you set up G1 to do Alt Backspace.  I have a Logitech G515 on which every single key can be remapped that way, but if you take that route, you'd have to use iot as a second keyboard.  It gets a bit crazy, and I am currently thinking that I'll abondon my plan to use the second keyboard, as I am not making it work for me.  The idea works fine, but it is getting in the way.  Oh well.  It was only NZ$200 😞

image.png

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 18, 2025 Mar 18, 2025
LATEST

The script/s would be installed in Presets/Scripts directory and Photoshop restarted. Then custom keyboard shortcuts would be assigned to the installed script/s under the File > Scripts menu.

 

EDIT: It looks like there's no need for a script as the Fill command is already available for a custom keyboard shortcut:

2025-03-19_20-30-09.png

 

EDIT 2: Here are the scripts to directly fill with fore/back swatches (not Fill... with dialog):

 

// Fill with foreground color
#target photoshop;
var s2t = function (s) {
    return app.stringIDToTypeID(s);
};
var descriptor = new ActionDescriptor();
descriptor.putEnumerated(s2t("using"), s2t("fillContents"), s2t("foregroundColor"));
descriptor.putUnitDouble(s2t("opacity"), s2t("percentUnit"), 100.000000);
descriptor.putEnumerated(s2t("mode"), s2t("blendMode"), s2t("normal"));
executeAction(s2t("fill"), descriptor, DialogModes.NO);

 

// Fill with background color
#target photoshop;
var s2t = function (s) {
    return app.stringIDToTypeID(s);
};
var descriptor = new ActionDescriptor();
descriptor.putEnumerated(s2t("using"), s2t("fillContents"), s2t("backgroundColor"));
descriptor.putUnitDouble(s2t("opacity"), s2t("percentUnit"), 100.000000);
descriptor.putEnumerated(s2t("mode"), s2t("blendMode"), s2t("normal"));
executeAction(s2t("fill"), descriptor, DialogModes.NO);

 

  1. Copy the code text to the clipboard
  2. Open a new blank file in a plain-text editor (not in a word processor)
  3. Paste the code in
  4. Save as a plain text format file – .txt
  5. Rename the saved file extension from .txt to .jsx
  6. Install or browse to the .jsx file to run (see below)

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines