From eda5e2f9d1542b4bf77780bb45147bdc7c805df2 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 16 Nov 2019 23:27:07 +0100 Subject: [PATCH] Implement fullscreen toggle by pressing F11 or Alt + Enter --- addons/material_maker/main_window.gd | 4 ++++ project.godot | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/addons/material_maker/main_window.gd b/addons/material_maker/main_window.gd index 389db14..ca10c0c 100644 --- a/addons/material_maker/main_window.gd +++ b/addons/material_maker/main_window.gd @@ -89,6 +89,10 @@ func _ready() -> void: m.connect("about_to_show", self, "menu_about_to_show", [ m.name, menu ]) new_material() +func _input(event: InputEvent) -> void: + if event.is_action_pressed("toggle_fullscreen"): + OS.window_fullscreen = !OS.window_fullscreen + func get_current_graph_edit() -> MMGraphEdit: var graph_edit = projects.get_current_tab_control() if graph_edit != null and graph_edit is GraphEdit: diff --git a/project.godot b/project.godot index 19058c1..9ac7bcc 100644 --- a/project.godot +++ b/project.godot @@ -211,6 +211,15 @@ enabled=PoolStringArray( "material_maker" ) timers/tooltip_delay_sec=0.1 +[input] + +toggle_fullscreen={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777254,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":true,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"unicode":0,"echo":false,"script":null) + ] +} + [logging] file_logging/enable_file_logging=true