Accessibity (Narrator) support #173

Open
opened 2019-06-05 01:52:12 -05:00 by NeomMob · 6 comments
NeomMob commented 2019-06-05 01:52:12 -05:00 (Migrated from github.com)

I would like to implement Narrator support in AvalonEdit but I have absolutly no idea where to start. Any pointer?

I would like to implement Narrator support in AvalonEdit but I have absolutly no idea where to start. Any pointer?
sloutsky commented 2020-11-04 09:30:55 -06:00 (Migrated from github.com)

One particular puzzling item is automation peer events for the completion list. Any hints/pointers will be very helpful

One particular puzzling item is automation peer events for the completion list. Any hints/pointers will be very helpful
guregini commented 2021-07-29 17:34:59 -05:00 (Migrated from github.com)

@dgrunwald, @christophwille, @mkonicek, @siegfriedpammer, any plans/hints/pointers regarding Narrator/JAWS support (for the completion list)?

@dgrunwald, @christophwille, @mkonicek, @siegfriedpammer, any plans/hints/pointers regarding Narrator/JAWS support (for the completion list)?
siegfriedpammer commented 2021-12-20 07:03:59 -06:00 (Migrated from github.com)

I have no experience with JAWS or any other narrator. Would you be able to provide some resources on the topic and then we might be able to add better support to AvalonEdit. From what I can see in the source code, we already have some automation peer support for the text editor itself. Is the completion window the only missing element? I suspect the search panel might need adjustments as well.

Would you be able to gather a list of missing features and bugs? Thanks!

I have no experience with JAWS or any other narrator. Would you be able to provide some resources on the topic and then we might be able to add better support to AvalonEdit. From what I can see in the source code, we already have some automation peer support for the text editor itself. Is the completion window the only missing element? I suspect the search panel might need adjustments as well. Would you be able to gather a list of missing features and bugs? Thanks!
sloutsky commented 2021-12-26 09:14:45 -06:00 (Migrated from github.com)

We don't use SearchPanel of AvalonEdit - but yes, it may have similar issue.

We could work-around a requirement for IntelliSense support by changing next functions in TextRangeProvider.cs:

           public bool Compare(ITextRangeProvider range)
	{
		TextRangeProvider other = (TextRangeProvider)range;
		// KUSTO addition
		if (textArea.ActiveIntelliSenseAutomationPeer != null)
		{
			Log("{0}.Compare({1}) [ActiveIntelliSenseAutomationPeer != null]= false", ID, other.ID);
			return false;
		}
		
		bool result = doc == other.doc
			&& segment.Offset == other.segment.Offset
			&& segment.EndOffset == other.segment.EndOffset;
		Log("{0}.Compare({1}) = {2}", ID, other.ID, result);
		return result;
	}

           public string GetText(int maxLength)
	{
		Log("{0}.GetText({1})", ID, maxLength);
		// KUSTO addition
		if (textArea.ActiveIntelliSenseAutomationPeer != null)
		{
			var result = textArea.ActiveIntelliSenseAutomationPeer.GetName();
			Log("{0}.GetText({1}) --> {2}", ID, maxLength, result);
			return result;
		}
		if (maxLength < 0)
			return doc.GetText(segment);
		else
			return doc.GetText(segment.Offset, Math.Min(segment.Length, maxLength));
	}

... and by adding a property to TextArea.cs:

        #region Kusto: AutomationPeers for IntelliSense
	/// <summary>
	/// Gets or sets active IntelliSense selection item automation peer
	/// </summary>
	public System.Windows.Automation.Peers.AutomationPeer ActiveIntelliSenseAutomationPeer { get; set; }
	#endregion

Then - we set 'ActiveIntelliSenseAutomationPeer' - with the AutomationPeer of the IntelliSense SelectedItem (and unsetting it when the IntelliSense is hidden).

This works fine with JAWS and Narrator. LMK if you would like me to create a PR with these changes - or if you have other ideas how to resolve it.

We don't use SearchPanel of AvalonEdit - but yes, it may have similar issue. We could work-around a requirement for IntelliSense support by changing next functions in TextRangeProvider.cs: public bool Compare(ITextRangeProvider range) { TextRangeProvider other = (TextRangeProvider)range; // KUSTO addition if (textArea.ActiveIntelliSenseAutomationPeer != null) { Log("{0}.Compare({1}) [ActiveIntelliSenseAutomationPeer != null]= false", ID, other.ID); return false; } bool result = doc == other.doc && segment.Offset == other.segment.Offset && segment.EndOffset == other.segment.EndOffset; Log("{0}.Compare({1}) = {2}", ID, other.ID, result); return result; } public string GetText(int maxLength) { Log("{0}.GetText({1})", ID, maxLength); // KUSTO addition if (textArea.ActiveIntelliSenseAutomationPeer != null) { var result = textArea.ActiveIntelliSenseAutomationPeer.GetName(); Log("{0}.GetText({1}) --> {2}", ID, maxLength, result); return result; } if (maxLength < 0) return doc.GetText(segment); else return doc.GetText(segment.Offset, Math.Min(segment.Length, maxLength)); } ... and by adding a property to TextArea.cs: #region Kusto: AutomationPeers for IntelliSense /// <summary> /// Gets or sets active IntelliSense selection item automation peer /// </summary> public System.Windows.Automation.Peers.AutomationPeer ActiveIntelliSenseAutomationPeer { get; set; } #endregion Then - we set 'ActiveIntelliSenseAutomationPeer' - with the AutomationPeer of the IntelliSense SelectedItem (and unsetting it when the IntelliSense is hidden). This works fine with JAWS and Narrator. LMK if you would like me to create a PR with these changes - or if you have other ideas how to resolve it.
siegfriedpammer commented 2021-12-26 12:43:52 -06:00 (Migrated from github.com)

Thank you for posting this! Yes, I would be interested in reviewing and testing a PR from you @sloutsky. However, I might not be able to focus on this topic until end of January/mid February, fyi.

Thank you for posting this! Yes, I would be interested in reviewing and testing a PR from you @sloutsky. However, I might not be able to focus on this topic until end of January/mid February, fyi.
sloutsky commented 2021-12-27 02:55:43 -06:00 (Migrated from github.com)
Please see it here: https://github.com/icsharpcode/AvalonEdit/pull/332
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-icsharpcode/AvalonEdit#173
No description provided.