Implement fullscreen toggle by pressing F11 or Alt + Enter

This commit is contained in:
Hugo Locurcio 2019-11-16 23:27:07 +01:00
parent cfca689e3f
commit eda5e2f9d1
No known key found for this signature in database
GPG Key ID: 39E8F8BE30B0A49C
2 changed files with 13 additions and 0 deletions

View File

@ -89,6 +89,10 @@ func _ready() -> void:
m.connect("about_to_show", self, "menu_about_to_show", [ m.name, menu ]) m.connect("about_to_show", self, "menu_about_to_show", [ m.name, menu ])
new_material() 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: func get_current_graph_edit() -> MMGraphEdit:
var graph_edit = projects.get_current_tab_control() var graph_edit = projects.get_current_tab_control()
if graph_edit != null and graph_edit is GraphEdit: if graph_edit != null and graph_edit is GraphEdit:

View File

@ -211,6 +211,15 @@ enabled=PoolStringArray( "material_maker" )
timers/tooltip_delay_sec=0.1 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] [logging]
file_logging/enable_file_logging=true file_logging/enable_file_logging=true