From 6286d4338ae484d157c7ad661669819092e3a08f Mon Sep 17 00:00:00 2001 From: under Date: Wed, 20 Mar 2024 14:27:51 -0700 Subject: [PATCH] Alt+up/down minimize/windowed/maximized shortcuts Instead of the same way that you can win+up/down in windows. --- RetroWindowsGUI/DesktopWindow.gd | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/RetroWindowsGUI/DesktopWindow.gd b/RetroWindowsGUI/DesktopWindow.gd index 43ee0e6..f50b428 100755 --- a/RetroWindowsGUI/DesktopWindow.gd +++ b/RetroWindowsGUI/DesktopWindow.gd @@ -18,6 +18,23 @@ func _input(event: InputEvent): if event.pressed: if desktop.current_window == self: toggle_maximized() + elif event.alt_pressed and event.keycode == KEY_UP: + if event.pressed: + if desktop.current_window == self: + if not visible: + visible = true + elif not anchors_preset == Control.PRESET_FULL_RECT: + windowed_rect = get_global_rect() + set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT) + elif event.alt_pressed and event.keycode == KEY_DOWN: + if event.pressed: + if desktop.current_window == self: + if anchors_preset == Control.PRESET_FULL_RECT: + set_anchors_and_offsets_preset(Control.PRESET_TOP_LEFT) + position = windowed_rect.position + size = windowed_rect.size + elif visible: + visible = false # toggle maximized func toggle_maximized():