Topics

Announcing an non cancelable speech sequence


bering.p
 

Hi to all.
I need  your help to announce a speech sentence without being interrupted by typing on the keyboard (for example pressing "uparrow" or "downarrow" by using a speech sequence.
To clarify things, here is an example:
I want to announce the sentence "My name is Bond. James bond" with a beep before, and a beep after.
This sentence and these beeps must be heard from beginning to end without being interrupted.
How to do it.
Here is my test script.

 def script_test(self, gesture):
 msg = "My name is Bond. James bond"
 seq = []
 seq.append(speech.commands.BeepCommand(600, 40))
 seq.append(speech.commands.EndUtteranceCommand())
 seq.extend([msg])
 seq.append(speech.commands.EndUtteranceCommand())
 seq.append(speech.commands.BeepCommand(400, 40))
 seq.append(speech.commands.EndUtteranceCommand())
 speech.speak(seq)


The beeps and the sentence are announced correctly by NVDA, but as soon as I hit on the "downArrow"key  (for example) the sentence is interrupted.
I explained that it was the writing of the speech sequence that interests me, because I do not control the call to speech.speak (unlike my test script).
Best regards.
Paul.


  


James Scholes
 

There are two preferences within NVDA's Keyboard settings panel which may help: "Speech interrupt for typed characters", and "Speech interrupt for Enter key". These may not control what happens when the arrow keys are used, but you could investigate how the code within NVDA works for those two and then extend it in some way.

2. Be very careful about preventing keystrokes which people expect to cause something to happen. The intended purpose of the two mentioned settings is for places like chat applications or terminals, where you don't want your typing and submission to interrupt. But pressing an Arrow key is an explicit indication that the user wishes to move the cursor or navigate, and preventing immediate feedback for those actions can make NVDA feel sluggish.

Regards,

James Scholes

On 23/04/2020 at 3:22 pm, bering.p wrote:
Hi to all.
I need  your help to announce a speech sentence without being interrupted by typing on the keyboard (for example pressing "uparrow" or "downarrow" by using a speech sequence.
To clarify things, here is an example:
I want to announce the sentence "My name is Bond. James bond" with a beep before, and a beep after.
This sentence and these beeps must be heard from beginning to end without being interrupted.
How to do it.
Here is my test script.
 def script_test(self, gesture):
 msg = "My name is Bond. James bond"
 seq = []
 seq.append(speech.commands.BeepCommand(600, 40))
 seq.append(speech.commands.EndUtteranceCommand())
 seq.extend([msg])
 seq.append(speech.commands.EndUtteranceCommand())
 seq.append(speech.commands.BeepCommand(400, 40))
 seq.append(speech.commands.EndUtteranceCommand())
 speech.speak(seq)
The beeps and the sentence are announced correctly by NVDA, but as soon as I hit on the "downArrow"key  (for example) the sentence is interrupted.
I explained that it was the writing of the speech sequence that interests me, because I do not control the call to speech.speak (unlike my test script).
Best regards.
Paul.


Robert Hänggi
 

On 23/04/2020, James Scholes <james@...> wrote:
There are two preferences within NVDA's Keyboard settings panel which
may help: "Speech interrupt for typed characters", and "Speech interrupt
for Enter key". These may not control what happens when the arrow keys
are used, but you could investigate how the code within NVDA works for
those two and then extend it in some way.

2. Be very careful about preventing keystrokes which people expect to
cause something to happen. The intended purpose of the two mentioned
settings is for places like chat applications or terminals, where you
don't want your typing and submission to interrupt. But pressing an
Arrow key is an explicit indication that the user wishes to move the
cursor or navigate, and preventing immediate feedback for those actions
can make NVDA feel sluggish.
The problem is that the feedback itself is interrupted.
I see that with the alpha build. If I change the tab Firefox, the
title is only occasionally spoken while this was always announced in
NVDA 2018.2.1
Robert
Regards,

James Scholes

On 23/04/2020 at 3:22 pm, bering.p wrote:
Hi to all.
I need your help to announce a speech sentence without being
interrupted by typing on the keyboard (for example pressing "uparrow" or
"downarrow" by using a speech sequence.
To clarify things, here is an example:
I want to announce the sentence "My name is Bond. James bond" with a
beep before, and a beep after.
This sentence and these beeps must be heard from beginning to end
without being interrupted.
How to do it.
Here is my test script.

def script_test(self, gesture):
msg = "My name is Bond. James bond"
seq = []
seq.append(speech.commands.BeepCommand(600, 40))
seq.append(speech.commands.EndUtteranceCommand())
seq.extend([msg])
seq.append(speech.commands.EndUtteranceCommand())
seq.append(speech.commands.BeepCommand(400, 40))
seq.append(speech.commands.EndUtteranceCommand())
speech.speak(seq)


The beeps and the sentence are announced correctly by NVDA, but as soon
as I hit on the "downArrow"key (for example) the sentence is
interrupted.
I explained that it was the writing of the speech sequence that
interests me, because I do not control the call to speech.speak (unlike
my test script).
Best regards.
Paul.




bering.p
 

Hi James.
Thank you for your reply and suggestions.
But this does not permit me to resolve my problem.
However I managed to find a solution and for information, here it is.
- I created a speechCommand "DisableCancelSpeechCommand" to enable and disable an indicator,
- I also created my own method to my"cancelSpeech" that monitors this indicator, and does not call the method "speech.cancelSpeech" when this flag is True.
- Finally, I have to hijack the method "speech.cancelSpeech to my own "myCancelSpeech".


And now by writing the following sequence:

textList = []
textList.append(DisableCancelSpeechCommand(True))
textList.append(speech.commands.EndUtteranceCommand())
textList.append(msg)
textList.append(speech.commands.EndUtteranceCommand())
textList.append(DisableCancelSpeechCommand(False))
textList.append(speech.commands.EndUtteranceCommand())

The string is not more canceled by an arrow key or other input key.

Best regards
Paul.

Le 23/04/2020 22:46, James Scholes a écrit :
There are two preferences within NVDA's Keyboard settings panel which
may help: "Speech interrupt for typed characters", and "Speech interrupt
for Enter key". These may not control what happens when the arrow keys
are used, but you could investigate how the code within NVDA works for
those two and then extend it in some way.

2. Be very careful about preventing keystrokes which people expect to
cause something to happen. The intended purpose of the two mentioned
settings is for places like chat applications or terminals, where you
don't want your typing and submission to interrupt. But pressing an
Arrow key is an explicit indication that the user wishes to move the
cursor or navigate, and preventing immediate feedback for those actions
can make NVDA feel sluggish.

Regards,

James Scholes

On 23/04/2020 at 3:22 pm, bering.p wrote:
Hi to all.
I need your help to announce a speech sentence without being
interrupted by typing on the keyboard (for example pressing "uparrow" or
"downarrow" by using a speech sequence.
To clarify things, here is an example:
I want to announce the sentence "My name is Bond. James bond" with a
beep before, and a beep after.
This sentence and these beeps must be heard from beginning to end
without being interrupted.
How to do it.
Here is my test script.

def script_test(self, gesture):
msg = "My name is Bond. James bond"
seq = []
seq.append(speech.commands.BeepCommand(600, 40))
seq.append(speech.commands.EndUtteranceCommand())
seq.extend([msg])
seq.append(speech.commands.EndUtteranceCommand())
seq.append(speech.commands.BeepCommand(400, 40))
seq.append(speech.commands.EndUtteranceCommand())
speech.speak(seq)


The beeps and the sentence are announced correctly by NVDA, but as soon
as I hit on the "downArrow"key (for example) the sentence is interrupted.
I explained that it was the writing of the speech sequence that
interests me, because I do not control the call to speech.speak (unlike
my test script).
Best regards.
Paul.