Page 1 of 1

on_player_selected_area + control shift

Posted: Fri Mar 02, 2018 9:42 pm
by Earendel
When an on_player_selected_area or on_player_alt_selected_area event is fired, please can the event return whether the control and/or shift held are being held (similar to the GUI interaction events)

event.control :: boolean: If control was pressed.
event.shift :: boolean: If shift was pressed.

Also using setting an alt flag on on_player_selected_area would make sense if tying to keep things consistent but would make on_player_alt_selected_area obsolete.
event.alt :: boolean: If alt was pressed.

Re: on_player_selected_area + control shift

Posted: Sat Mar 03, 2018 4:30 pm
by Rseding91
Those events have nothing to do with those keys - the player could be holding down half the keyboard and if the event keys are pressed it's still fired.

So, what I'm saying is: this won't be done. Mods don't get to care about what keys triggered an event when it's not GUI button related because even the game has no idea.

Re: on_player_selected_area + control shift

Posted: Sat Mar 03, 2018 4:54 pm
by Earendel
Blueprints have different functionality when shift is held. Can't the area select tool allow for the same?

Re: on_player_selected_area + control shift

Posted: Sat Mar 03, 2018 5:09 pm
by Rseding91
Earendel wrote:Blueprints have different functionality when shift is held. Can't the area select tool allow for the same?
It already does. It will fire 1 of the 2 events: http://lua-api.factorio.com/latest/even ... ected_area when shift isn't held and http://lua-api.factorio.com/latest/even ... ected_area when it is.

It has nothing to do with the shift key specifically - that's just the default modifier. A player could change it to ctrl + click to mean alt-select.