[kovarex] [0.17.45][Modded GUI] "Enter" key sets selected state for focused LuaGuiElement button
Posted: Tue Jun 04, 2019 6:08 pm
When hitting Enter or Return (assuming they are not bound via control settings) while a LuaGuiElement of type button is focused, that button shows its selected_graphical_set. No event is triggered and the button keeps the selected appearance until you press Enter/Return again. It is my understanding that 'selected' is not meant to be useable by modded GUI elements.
To reproduce execute
and press 'Enter' (the key on the numpad). Return is by default bound to 'Enter vehicle', but shows the same behavior when unbound.
As an example, this is what can happen when custom button styles are used:
To reproduce execute
Code: Select all
/c game.player.gui.center.add{type = "button", caption = 'Hit the "Enter" key!'}.focus()
As an example, this is what can happen when custom button styles are used: