Allow temporarily to grab keyboard and/or mouse events

Things that we aren't going to implement
tux_mark_5
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Thu Jan 15, 2015 2:20 pm
Contact:

Allow temporarily to grab keyboard and/or mouse events

Post by tux_mark_5 »

It would be nice if there was a way to temporarily grab keyboard and/or mouse events (similarly to the way focused text fields intercept most of keystokes).

This event grab could be implemented by adding an additional lua event and a LuaPlayer.grab_input_events(grab_keyboard, grab_mouse) (or similar) method(s) that would initiate the grab.

Grabbing keyboard events would allow to implement more interesting custom GUI elements, while allowing to grab mouse events would enable creating interactive game overlays (when done in conjunction with the rendering API).

The new mouse event could be similar to on_gui_click, but it could contain entity instead of LuaGuiElement. The location of the click in surface coordinates would also be useful.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14301
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Allow temporarily to grab keyboard and/or mouse events

Post by Rseding91 »

Sorry but no. Mods will never be allowed to read keyboard/mouse events directly. Not even the base game is allowed to do that. It completely breaks multiplayer determinism where you don't have access to other players keyboard/mouse events.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Won't implement”