on_player_selected_area + control shift

Things that already exist in the current mod API
Post Reply
User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 711
Joined: Sun Nov 23, 2014 11:57 am
Contact:

on_player_selected_area + control shift

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: on_player_selected_area + control shift

Post 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.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 711
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: on_player_selected_area + control shift

Post by Earendel »

Blueprints have different functionality when shift is held. Can't the area select tool allow for the same?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: on_player_selected_area + control shift

Post 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.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Already exists”