The parallel.waitForAny call should return when one of the functions ends. So, you just have to make the mouse input function end and it will end the other one too. Example:
local input
local function getInput()
print("Type something:")
input = read()
end
local function getMouseInput()
while true do
local evt, btn, x, y = os.pullEvent("mouse_click")
break -- stop the loop when we get a mouse click
end
end
parallel.waitForAny(getInput, getMouseInput)
term.clear()
term.setCursorPos(1, 1)
if input then
print("Your input: ", input)
else
print("You clicked the screen!")
end
If this is not what you need, please explain what you are trying to do, so we can help.