diff --git a/project.godot b/project.godot index cd2334a..25a40bc 100644 --- a/project.godot +++ b/project.godot @@ -13,7 +13,7 @@ config_version=5 config/name="SoundThread" config/description="Node based interface for the Composers Desktop Project" run/main_scene="uid://bcs87y7ptx3ke" -config/features=PackedStringArray("4.4", "Forward Plus") +config/features=PackedStringArray("4.5", "Forward Plus") run/max_fps=30 run/low_processor_mode=true boot_splash/bg_color=Color(0.160784, 0.25098, 0.247059, 1) @@ -93,6 +93,11 @@ redo={ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"command_or_control_autoremap":true,"alt_pressed":false,"shift_pressed":false,"pressed":false,"keycode":0,"physical_keycode":89,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) ] } +quit={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"command_or_control_autoremap":true,"alt_pressed":false,"shift_pressed":false,"pressed":false,"keycode":0,"physical_keycode":81,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} [rendering] diff --git a/scenes/main/scripts/audiosettings.gd b/scenes/main/scripts/audiosettings.gd index 1800e80..66a9223 100644 --- a/scenes/main/scripts/audiosettings.gd +++ b/scenes/main/scripts/audiosettings.gd @@ -21,6 +21,14 @@ func _on_about_to_popup() -> void: func _on_close_requested() -> void: device_timer.stop() + hide() + + +func _input(event: InputEvent) -> void: + if visible and event is InputEventKey and event.pressed and event.keycode == KEY_ESCAPE: + device_timer.stop() + hide() + get_viewport().set_input_as_handled() func update_device_list(): diff --git a/scenes/main/scripts/control.gd b/scenes/main/scripts/control.gd index d278d34..5a7fe5e 100644 --- a/scenes/main/scripts/control.gd +++ b/scenes/main/scripts/control.gd @@ -340,6 +340,10 @@ func _input(event): elif event.is_action_pressed("save_as"): savestate = "saveas" $SaveDialog.popup_centered() + + elif event.is_action_pressed("quit"): + # same logic que le Window cliose button + get_tree().root.propagate_notification(NOTIFICATION_WM_CLOSE_REQUEST) func simulate_mouse_click(): #simulates clicking the middle mouse button in order to hide any visible tooltips diff --git a/scenes/main/scripts/settings.gd b/scenes/main/scripts/settings.gd index 8b07d7c..d18b62f 100644 --- a/scenes/main/scripts/settings.gd +++ b/scenes/main/scripts/settings.gd @@ -16,6 +16,12 @@ func _ready() -> void: pass +func _input(event: InputEvent) -> void: + if visible and event is InputEventKey and event.pressed and event.keycode == KEY_ESCAPE: + hide() + get_viewport().set_input_as_handled() + + func _on_change_cdp_button_down() -> void: self.hide() open_cdp_location.emit() diff --git a/scenes/main/shortcuts.json b/scenes/main/shortcuts.json index 8ad904f..6b46d42 100644 --- a/scenes/main/shortcuts.json +++ b/scenes/main/shortcuts.json @@ -3,7 +3,8 @@ "Run Thread": "Ctrl + R", "New Thread": "Ctrl + N", "Save Thread": "Ctrl + S", - "Save Thread As": "Ctrl + Shift + S" + "Save Thread As": "Ctrl + Shift + S", + "Quit": "Ctrl + Q" }, "Building a Thread":{ "Add Node (Open Search)": "Right click empty space or Ctrl + F", @@ -21,5 +22,8 @@ "Navigating a Thread":{ "Zoom": "Mouse wheel", "Move": "Middle click + drag or Ctrl + Mouse wheel" + }, + "Dialogs":{ + "Close Settings/Audio Settings": "Escape" } }