DaveTheCoder I don't know offhand what the code would be.

Something like this:

func _input(event: InputEvent) -> void:
	if event.is_action_pressed("ui_cancel"):
		get_tree().quit() # Quits the game
	
	if event.is_action_pressed("change_mouse_input"):
		match Input.get_mouse_mode():
			Input.MOUSE_MODE_CAPTURED:
				Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
			Input.MOUSE_MODE_VISIBLE:
				Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
	
	if event.is_action_pressed("window_toggle_fullscreen"):
		match get_window().mode:
			Window.MODE_WINDOWED:
				get_window().mode = Window.MODE_FULLSCREEN
			Window.MODE_FULLSCREEN:
				get_window().mode = Window.MODE_WINDOWED
			Window.MODE_EXCLUSIVE_FULLSCREEN:
				#This mode is implemented on Windows only.
				#On other platforms, it is equivalent to MODE_FULLSCREEN.
				get_window().mode = Window.MODE_WINDOWED

This is currently not taking the 'borderless' setting in project settings/window into account. May or may not be relevant. Also better naming scheme for the action so it would be more in line with the built-in actions would have been "wm_toggle_fullscreen" but I figured it would be clearer for the example so I'll leave it as is above. Keys to use could be for an example F11, Enter & KP Enter

2 years later

Megalomaniak This is exactly what I'm looking to do right now, but alas, my brain isn't big enough to make it a reality... Thanks for the link to the paper though, I no longer awkwardly need to explain to people what I want.