Page 1 of 1

How to listen to existing key events?

Posted: Tue Mar 26, 2019 8:51 pm
by jarcionek
I can define a control and then register an event listener to execute a script when user presses that key.

I would like to do similarly but for the base game controls - e.g. when user presses M to open a map.

Is there any way to achieve that or do I have to define my own control and ask the user to set both my control and the base game control to the same key?

Re: How to listen to existing key events?

Posted: Tue Mar 26, 2019 8:54 pm
by Bilka
Link your custom input prototype to a game control using https://wiki.factorio.com/Prototype/Cus ... me_control. Then just treat it like any custom input in your event handling.

Re: How to listen to existing key events?

Posted: Tue Mar 26, 2019 9:00 pm
by jarcionek
Not sure how I missed that... Thanks a lot!