Prototype/CustomInput: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(overhaul to include Prototype)
(→‎Properties: make it more clear that "name" has some special properties)
Line 4: Line 4:
Inherits all properties from [[Prototype]].
Inherits all properties from [[Prototype]].


Name is also the name for the event that is raised when they key (combination) is pressed, see [[Tutorial:Script interfaces]].
=== name ===
:''See [[Prototype#name]]''
 
Inherited from [[Prototype]]. It is also the name for the event that is raised when they key (combination) is pressed, see [[Tutorial:Script interfaces]].


=== key_sequence ===
=== key_sequence ===

Revision as of 12:58, 23 January 2018

Basics

Used for custom keyboard shortcuts/keybindings in mods.

Properties

Inherits all properties from Prototype.

name

See Prototype#name

Inherited from Prototype. It is also the name for the event that is raised when they key (combination) is pressed, see Tutorial:Script interfaces.

key_sequence

Type: Types/string

The default key sequence for this custom input.

  • " + " is used to seperate two keys: "ALT + G"
  • "CONTROL" works, "CTRL" doesnt.
  • "mouse-button-2" etc for mouse buttons

linked_game_control

Type: Types/string

Default: ""

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. [1]

Example to the same key sequence as the clear-cursor hotkey:

key_sequence = ""
linked_game_control = "clear-cursor"

consuming

Type: Types/ConsumingType

Default: "none"

enabled

Type: Types/bool

Default: true

If this custom input is enabled. Disabled custom inputs exist but are not used by the game.