TinyAdventure/ui/game_menu_ui.gd

8 lines
264 B
GDScript
Raw Normal View History

extends PanelContainer
func _unhandled_key_input(event:InputEvent):
var key_event:InputEventKey = event as InputEventKey
if visible and key_event.pressed and key_event.get_keycode_with_modifiers() == KEY_ESCAPE:
get_viewport().set_input_as_handled()
hide()