Attempt to fix speech cutoff when reading default text.
This commit is contained in:
8
input.py
8
input.py
@ -35,12 +35,12 @@ def get_input(prompt="Enter text:", text=""):
|
|||||||
text_buffer = list(text) # Use list for easier character manipulation
|
text_buffer = list(text) # Use list for easier character manipulation
|
||||||
cursor_pos = len(text_buffer) # Start at end of initial text
|
cursor_pos = len(text_buffer) # Start at end of initial text
|
||||||
|
|
||||||
# Announce the prompt and initial text
|
# Announce the prompt and initial text as a single message
|
||||||
speak(prompt)
|
|
||||||
if text:
|
if text:
|
||||||
speak(f"Default text: {text}")
|
message = f"{prompt} Default text: {text}"
|
||||||
else:
|
else:
|
||||||
speak("Empty text field")
|
message = f"{prompt} Empty text field"
|
||||||
|
speak(message)
|
||||||
|
|
||||||
# Speak initial cursor position
|
# Speak initial cursor position
|
||||||
if cursor_pos == 0:
|
if cursor_pos == 0:
|
||||||
|
Reference in New Issue
Block a user