pub struct CustomInput {Show 23 fields
pub name: &'static str,
pub key_sequence: &'static str,
pub hidden: Option<bool>,
pub order: Option<&'static str>,
pub subgroup: Option<&'static str>,
pub factoriopedia_description: Option<&'static str>,
pub hidden_in_factoriopedia: Option<bool>,
pub localised_description: Option<&'static str>,
pub localised_name: Option<&'static str>,
pub parameter: Option<bool>,
pub factoriopedia_alternative: Option<&'static str>,
pub action: Option<&'static str>,
pub alternative_key_sequence: Option<&'static str>,
pub block_modifiers: Option<bool>,
pub consuming: Option<&'static str>,
pub controller_alternative_key_sequence: Option<&'static str>,
pub controller_key_sequence: Option<&'static str>,
pub enabled: Option<bool>,
pub enabled_while_in_cutscene: Option<bool>,
pub enabled_while_spectating: Option<bool>,
pub include_selected_prototype: Option<bool>,
pub item_to_spawn: Option<&'static str>,
pub linked_game_control: Option<&'static str>,
}Expand description
Minimal CustomInputPrototype for data.extend.
Used for custom keyboard shortcuts/key bindings in mods. The key associated with the custom input can be changed in the options. This means that key_sequence is simply the default key binding.
type = "custom-input" is injected by the Lua generator.
Fields§
§name: &'static strUnique textual identification of the prototype. May only contain alphanumeric characters, dashes and underscores. May not exceed a length of 200 characters.
For a list of all names used in vanilla, see data.raw.
key_sequence: &'static strThe default key sequence for this custom input. Use "" (empty string) for unassigned.
As modifier keys, these names are used: "CONTROL", "SHIFT", "COMMAND", "ALT". Note that "COMMAND" is loaded as "CONTROL" on Windows and Linux.
" + " is used to separate modifier keys from normal keys, like so: "ALT + G". A key binding can contain any amount of individual modifier keys, but only a single normal mouse button or keyboard key (listed below).
Prototype property hidden.
order: Option<&'static str>Used to order prototypes in inventory, recipes and GUIs. May not exceed a length of 200 characters.
subgroup: Option<&'static str>The name of an ItemSubGroup.
factoriopedia_description: Option<&'static str>Provides additional description used in factoriopedia.
Prototype property hidden_in_factoriopedia.
localised_description: Option<&'static str>Overwrites the description set in the locale file. The description is usually shown in the tooltip of the prototype.
localised_name: Option<&'static str>Overwrites the name set in the locale file. Can be used to easily set a procedurally-generated name because the LocalisedString format allows to insert parameters into the name directly from the Lua script.
parameter: Option<bool>Whether the prototype is a special type which can be used to parametrize blueprints and doesn’t have other function.
factoriopedia_alternative: Option<&'static str>The ID type corresponding to the prototype that inherits from this.
For example, if this is an EntityPrototype, this property’s type is EntityID.
action: Option<&'static str>A Lua event is only raised if the action is “lua”.
alternative_key_sequence: Option<&'static str>The alternative key binding for this control. See key_sequence for the format.
block_modifiers: Option<bool>If true, when the shortcut is activated, the modifiers used for this shortcut can’t be re-used to press something else until unpressed. The example where this is useful is ALT+A to activate spidertron remote, where ALT is consumed, so pressing right mouse button before the ALT is unpressed will not trigger pin creation (ALT + right mouse button), but send the selected unit instead.
consuming: Option<&'static str>Sets whether internal game events associated with the same key sequence should be fired or blocked. If they are fired (“none”), then the custom input event will happen before the internal game event.
controller_alternative_key_sequence: Option<&'static str>The alternative controller (game pad) keybinding for this control. See controller_key_sequence for the format.
controller_key_sequence: Option<&'static str>The controller (game pad) keybinding for this control. Use "" (empty string) for unassigned.
As modifier buttons, these names are used: "controller-righttrigger", "controller-lefttrigger".
" + " is used to separate modifier buttons from normal buttons, like so: "controller-righttrigger + controller-a". A key binding can contain any amount of individual modifier buttons, but only a single normal button (listed below).
enabled: Option<bool>If this custom input is enabled. Disabled custom inputs exist but are not used by the game. If disabled, no event is raised when the input is used.
enabled_while_in_cutscene: Option<bool>Prototype property enabled_while_in_cutscene.
enabled_while_spectating: Option<bool>Prototype property enabled_while_spectating.
include_selected_prototype: Option<bool>If true, the type and name of the currently selected prototype will be provided as “selected_prototype” in the raised Lua event. This also works in GUIs, not just the game world.
This will also return an item in the cursor such as copper-wire or rail-planner, if nothing is beneath the cursor.
item_to_spawn: Option<&'static str>The item will be created when this input is pressed and action is set to “spawn-item”. The item must have the spawnable flag set.
linked_game_control: Option<&'static str>When a custom-input is linked to a game control it won’t show up in the control-settings GUI and will fire when the linked control is pressed.
Trait Implementations§
Source§impl Clone for CustomInput
impl Clone for CustomInput
Source§fn clone(&self) -> CustomInput
fn clone(&self) -> CustomInput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more