forked from LGDG/ExampleProject
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:
parent
d47c6ed935
commit
6286d4338a
|
@ -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():
|
||||||
|
|
Loading…
Reference in New Issue