Called when a CustomInputPrototype is activated.
player_index: uint32 — The player that activated the custom input.input_name: string — The prototype name of the custom input that was activated.cursor_position: MapPosition — The mouse cursor position when the custom input was activated.cursor_direction?: defines.direction — Cursor direction.cursor_display_location: GuiLocation — The mouse cursor display location when the custom input was activated.selected_prototype?: SelectedPrototypeData — Information about the prototype that is selected when the custom input is used. Needs to be enabled on the custom input's prototype. nil if none is selected.element?: LuaGuiElement — The GUI element under the cursor when the custom input was activated.in_gui: boolean — If the cursor was over any GUI when the custom input was activated.name: defines.events — Identifier of the eventtick: uint32 — Tick the event was generated.-- This will be raised when a custom input with the name "my-potato-control" and action "lua" is pressed
script.on_event("my-potato-control", function(event)
game.print("Keyboard shortcut pressed on tick: " ..tostring(event.tick))
end)