Simplify text input coordinates logic.