From what I can tell, there is no way to receive mouse or keyboard events with a mod. Also there is no way to poll for the keyboard or mouse state per game tick. I am trying to find some way to activate the function of my mod. If those options are not available then the next best thing I can think of is to let the player toggle the function on and off using the in-game console. However, I cannot figure out how to add a custom console command -- it may also be impossible.
Thanks for your help.
Custom console commands
Re: Custom console commands
I found that with "Script Interfaces" (see https://forums.factorio.com/wiki/inde ... interfaces) you can also use the interface from the in-game console. In this way the player can communicate with your mod. However, it is unfortunately verbose, especially since the ideal solution is a single key press or button click.
Additionally, game.local_player is not defined when the player issues a remote.call from the console.
Additionally, game.local_player is not defined when the player issues a remote.call from the console.
Re: Custom console commands
You can also add custom guis, which many mods do. Can't actually override the gui that opens when you click a building, but you can create guis that are always visible, or that are created when the player is in proximity to something and removed when they leave.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections