The way I would go about this is to store direction key presses as either boolean variables or a vector (I'd prefer vector personally,) controlled by the input function. Then, you can check what the active area is, whether it's the main game or a menu panel, to decide how to apply the 'direction' keys.
In the controller function.
#keep a global variable
var direction = Vector2(0,0)
func _input(event):
if event.is_action("up") and event.is_pressed():
direction.y = -1
elif event.is_action("down") and event.is_pressed():
direction.y = 1
else:
direction.y = 0
if event.is_action("right") and event.is_pressed():
direction.x = -1
elif event.is_action("left") and event.is_pressed():
direction.x = 1
else:
direction.x = 0
in game:
#however you move (I'll use the kinematicbody2d's move for this)
move(direction.normalized() * speed) #speed is how far you want to move per frame
in menu:
use a variable to keep track of position in array
var list_pos = 0
somewhere in process of the menu script
list_pos += direction.y
The code may not be exact as this answer is off the top of my head.