1
0
Fork 0

Alt+up/down minimize/windowed/maximized shortcuts

Instead of the same way that you can win+up/down in windows.
This commit is contained in:
under 2024-03-20 14:27:51 -07:00
parent d47c6ed935
commit 6286d4338a
1 changed files with 17 additions and 0 deletions

View File

@ -18,6 +18,23 @@ func _input(event: InputEvent):
if event.pressed: if event.pressed:
if desktop.current_window == self: if desktop.current_window == self:
toggle_maximized() 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 # toggle maximized
func toggle_maximized(): func toggle_maximized():