Home

ShortcutPrototype

Definition for a shortcut button in the shortcut bar.

This is **not** a custom keybinding (keyboard shortcut), for that see CustomInputPrototype.

Parent

Properties

action

If this is "lua", on_lua_shortcut is raised when the shortcut is clicked.

icons

Can't be an empty array.

icon

Path to the icon file.

Only loaded, and mandatory if icons is not defined.

icon_size

The size of the square icon, in pixels. E.g. 32 for a 32px by 32px icon. Must be larger than 0.

The base game uses 32px icons for shortcuts.

Only loaded if icons is not defined.

small_icons

Can't be an empty array.

small_icon

Path to the icon file. Used in the shortcut selection popup.

Only loaded, and mandatory if small_icons is not defined.

small_icon_size

The size of the small icon, in pixels. E.g. 32 for a 32px by 32px icon. Must be larger than 0.

The base game uses 24px small icons for shortcuts.

Only loaded if small_icons is not defined.

item_to_spawn

The item to create when clicking on a shortcut with the action set to "spawn-item". The item must have the spawnable flag set.

technology_to_unlock

The technology that must be researched before this shortcut can be used. Once a shortcut is unlocked in one save file, it is unlocked for all future save files.

unavailable_until_unlocked

If true, the shortcut will not be available until its technology_to_unlock is researched, even if it was already researched in a different game.

toggleable

Must be enabled for the Factorio API to be able to set the toggled state on the shortcut button, see LuaPlayer::set_shortcut_toggled.

associated_control_input

Name of a custom input or vanilla control. This is **only** used to show the keybind in the tooltip of the shortcut.

style

order

Used to order the shortcuts in the quick panel, which replaces the shortcut bar when using a controller (game pad). It is recommended to order modded shortcuts after the vanilla shortcuts.