From 8e8dd459a49b06afa35fa5d656f9e216e92e1861 Mon Sep 17 00:00:00 2001 From: David Bailes Date: Mon, 25 Mar 2019 14:06:16 +0000 Subject: [PATCH] Accessibility: make TrackPanel more accessible using Narrator Problem: Using the Narrator screen reader on Windows 10, there are a couple of issues: 1. After making a change to solo/mute/selectedness, the name and state of the track is not automatically read. 2. Text sent to TrackPanelAx::MessageForScreenReader() is not read. Fixes: After a focus event, if the focus has not changed, Narrator does not read the name, even if the name has changed. So: 1. In TrackPanelAx::Updated(), add a name change event. (The focus event has been retained to keep Window-Eyes happy until we stop supporting it.) 2. In TrackPanelAx::MessageForScreenReader(), change the focus event to a name change event. Note the Window-Eyes does not read these messages anyway, because when the role is set to wxROLE_NONE it does not read the name. So there's no point in including a focus event for the benefit of Window-Eyes. --- src/TrackPanelAx.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/TrackPanelAx.cpp b/src/TrackPanelAx.cpp index f3b5d5135..f66a93b04 100644 --- a/src/TrackPanelAx.cpp +++ b/src/TrackPanelAx.cpp @@ -191,12 +191,17 @@ void TrackPanelAx::Updated() auto t = GetFocus(); mTrackName = true; - // logically, this should be an OBJECT_NAMECHANGE event, but Window eyes 9.1 - // does not read out the name with this event type, hence use OBJECT_FOCUS. + // The object_focus event is only needed by Window-Eyes + // and can be removed when we cease to support this screen reader. NotifyEvent(wxACC_EVENT_OBJECT_FOCUS, mTrackPanel, wxOBJID_CLIENT, TrackNum(t)); + + NotifyEvent(wxACC_EVENT_OBJECT_NAMECHANGE, + mTrackPanel, + wxOBJID_CLIENT, + TrackNum(t)); #endif } @@ -217,7 +222,7 @@ void TrackPanelAx::MessageForScreenReader(const wxString& message) mMessageCount++; mTrackName = false; - NotifyEvent(wxACC_EVENT_OBJECT_FOCUS, + NotifyEvent(wxACC_EVENT_OBJECT_NAMECHANGE, mTrackPanel, wxOBJID_CLIENT, childId);