Well say I add $FF to end of each string.
So I need only to know start address of each sentence
and start reading from there in loop, until inputchar=FF
precisely what was offered except using the more useful and commonly accepted null in lieu of the FF

And for the input, I can't relate capacitive input or encoder handling with my task.
These both are yes/no condition, and mine is analog reading.
its the overall concept of key/sw reading to observe, its a universal concept