Topics

Object properties in speech functions

Alberto Buffolino
 

Hi all,
I'm investigating about NVDA verbosity/object information order, for a possible add-on or pr.
If I understand correctly, at this time the more important point concerns speech.getPropertiesSpeech, that provides the main speech sequence according to a passed dictionary of properties to process (name, role, etc). But, I suppose, there is no guarantee that properties passed will have a value in speech sequence, so no mapping property->value is possible (from an add-on perspective).
Right?
Thanks for replies.
Alberto

James Scholes
 

I'm not sure what you're asking. Could you expand on your use case, and why you believe it is currently not feasible?

Regards,

James Scholes

On 28/01/2020 at 12:43 pm, Alberto Buffolino wrote:
Hi all,
I'm investigating about NVDA verbosity/object information order, for a possible add-on or pr.
If I understand correctly, at this time the more important point concerns speech.getPropertiesSpeech, that provides the main speech sequence according to a passed dictionary of properties to process (name, role, etc). But, I suppose, there is no guarantee that properties passed will have a value in speech sequence, so no mapping property->value is possible (from an add-on perspective).
Right?
Thanks for replies.
Alberto

Alberto Buffolino
 

James Scholes, il 28/01/2020 21.01, ha scritto:
I'm not sure what you're asking.  Could you expand on your use case, and why you believe it is currently not feasible?
Alberto:
Hi James,
some users have asked me to provide a way to customize NVDA when it speaks objects, so to sort or hide some information. For example, to have "checked Save configuration on exit Checkbox", instead of "Save configuration on exit checkbox checked".
I was asking for a confirmation about my comprehension of object information processing. If it is as I think, I can do nothing with a add-on that simply changes order of information in properties/speechSequence before/after getPropertiesSpeech execution.
Ok, I'm not sure it's more clear now... 😅
Alberto

James Scholes
 

Makes sense, and from a glance over the code, your assertion is correct. You would need to monkey-patch that function, presumably, to achieve what you're after. But the comment before the function in question seems to indicate that this part of the code is crying out for a refactor anyway:

# C901 'getPropertiesSpeech' is too complex
# Note: when working on getPropertiesSpeech, look for opportunities to simplify
# and move logic out into smaller helper functions.

Regards,

James Scholes

On 28/01/2020 at 2:21 pm, Alberto Buffolino wrote:
James Scholes, il 28/01/2020 21.01, ha scritto:
I'm not sure what you're asking.  Could you expand on your use case, and why you believe it is currently not feasible?
Alberto:
Hi James,
some users have asked me to provide a way to customize NVDA when it speaks objects, so to sort or hide some information. For example, to have "checked Save configuration on exit Checkbox", instead of "Save configuration on exit checkbox checked".
I was asking for a confirmation about my comprehension of object information processing. If it is as I think, I can do nothing with a add-on that simply changes order of information in properties/speechSequence before/after getPropertiesSpeech execution.
Ok, I'm not sure it's more clear now... 😅
Alberto

Alberto Buffolino
 

James Scholes, il 28/01/2020 21.31, ha scritto:
But the comment before the function in question seems to indicate that this part of the code is crying out for a refactor anyway:
Alberto:
true. As many other functions of speech module.
So... I'll see in future :)
Thanks James for replies.
Alberto

Reef Turner
 

I think this would be quite hard to achieve currently. Note that we have previously recommended this as a project for Google Summer of Code: https://github.com/nvaccess/nvda/wiki/GSOC-2019-Ideas-List#customize-order-and-inclusion-of-object-and-formatting-information-to-speech-and-braille.

My thoughts on a pathway towards this, is gradually convert all items in a speech sequence to some kind of speech command. Wrapping string items with a class that includes some metadata about it's origin. Eventually disallowing str objects in the speech sequence. Tagging speech that is essentially "NVDA UI" (eg "focus mode", or "selected" in "x selected"), as well tagging "name", "role", "value", "description" text could allow for some interesting innovation in how speech is presented.

I don't have a timeline on this. Note, this would be a compatibility breaking change.