Screen Reader issues

Posted by: mikedempsey on 8 September 2017, 3:26 pm EST

  • Posted 8 September 2017, 3:26 pm EST

    I am trying to enhance support for the JAWS screen reader in a Read-Only spreadsheet.
    By default it 'reads'
    Spread 1 Sheet 1 Row 0 Column 0 [cell text]
    when focus is first moved to the spreadsheet.

    There are a couple of issues with this:
    1. Users do not use offsets, they use numbers, so the first cell should be Row 1 Column 1.
    2. 'Column 1' is not useful to someone who is blind. It should read the column title.

    I therefore set my own value for AccessibleDescription in OnEnter() as folows:
    History Row 1 Date [cell text]
    (where 'Date' is the column header for the first column)

    Unfortunately, although it does sometimes read the string that I set it often still reads your default value instead.

    If OnEnter() is not the correct place to set this value where should I set it?

    Secondly (and more importantly) I also set the following value in OnEnterCell():
    Row [rowid+1] [column header] [cell text]
    (Normally it seems that a read-only grid does not read anything when moving through the cells)
    I have this working, but only by using a double focus shift where I move focus to my parent window and back to the spreadsheet. This was the only way I could figure to force the screen reader to take notice that the value had changed, but double focus shifts are not a good idea.
    Is there an event I need to register for, or a function I need to call in order to notify a screen reader that the information has changed?

    Thanks, Mike

  • Replied 8 September 2017, 3:26 pm EST

    What you describe is what I'm currently doing in OnEnterCell().
    It does work but I don't like having to force 2 focus shifts.

    Do you know how to prevent it from reading the full
    Spread 1 Sheet 1 Row 0 Column 0 [celltext]
    when spread first gets focus.
    (My override in OnEnter() only works about 1 time in 4 so some other event is apparently causing that.)
  • Replied 8 September 2017, 3:26 pm EST

    Hi Mike,

    1. Row and Column indexes for Spread for Windows Forms are 0 based and not 1 based. You can set the AccessibleDescription in the desired event and read the Row index as "RowIndex +1" to make it 1 based.
    2. For column header text also you can read the Column header name using the code as follows by setting the AccessibleDescription:
      fpSpread1.AccessibleDescription = "Row" + row  + "Column" + fpSpread1.Sheets[0].ColumnHeader.Cells[0, 0].Text; 


    For ReadOnly mode , the behavior you are seeing is correct and the only way to read cell is by shifting the Focus back to Spread.

    Thanks,
    Deepak Sharma
  • Replied 8 September 2017, 3:26 pm EST

    OnEnter() works in your test app but OnEnterCell() does not.
    I had to add a double focus shift [to the form then back to Spread] to make it read the cell text.
    (I also added some cell text for it to read)
    This is exactly what I am doing in my own app. (You don't need to override OnLeaveCell)

    My main question was how do I make it work WITHOUT the double focus shift.
    I assume there must be an event that the screen readers are listening for, or a 'notify' method of some kind.
    I did find a reference to an accessibility 'notify' method but the docs appeared to say it was used by sub components to notify the main component of a change, and it required some kind of component id.

    I also saw interfaces that a component can implement to work with the accessibility features although the sample app pointed to in the link did not exist. Although I do create my own derived object for one use case I just directly use Spread in the other so implementing the interface may only work in the case where I derive my own object.

    Do you add any Accessibility code to Spread itself, or is it simply using a 'default' action for focus shifts between controls.
    If you are adding specific code how do you notify the system that something has changed?

    Thanks
  • Replied 8 September 2017, 3:26 pm EST

    Hello,

    You can check for the first time by using a counter and set the Description as per your choice for OnEnterCell event.

    Thanks,
    Deepak Sharma
  • Replied 8 September 2017, 3:26 pm EST

    I don't understand your comment.
    I am already setting the description on OnEnterCell() but when spread first gets focus it reads the 'default' string instead of what I set.
  • Replied 8 September 2017, 3:26 pm EST


    For the first time you can set the Accessible Description in Spread's Enter event, for example:

     private void fpSpread1_Enter(object sender, EventArgs e)
    {
    fpSpread1.AccessibleName = "Control" + fpSpread1.Name + "Sheet" + fpSpread1.Sheets[0].SheetName + "Row" + fpSpread1.ActiveSheet.ActiveRowIndex + "Column" + fpSpread1.ActiveSheet.ActiveColumnIndex;
    fpSpread1.AccessibleDescription = "Control" + fpSpread1.Name + "Sheet" + fpSpread1.Sheets[0].SheetName + "Row" + fpSpread1.ActiveSheet.ActiveRowIndex + "Column" + fpSpread1.ActiveSheet.ActiveColumnIndex;
    }

    Next you can set the it again in EnterCell event:

    private void fpSpread1_EnterCell(object sender, FarPoint.Win.Spread.EnterCellEventArgs e)
    {
    fpSpread1.AccessibleName = "Cell" + e.Row + e.Column + "got focus";
    fpSpread1.AccessibleDescription = "Cell" + e.Row + e.Column + "got focus";


    }
    private void fpSpread1_LeaveCell(object sender, FarPoint.Win.Spread.LeaveCellEventArgs e)
    {
    fpSpread1.AccessibleName = "";
    }


    I hope it helps.

    Thanks,
    Deepak Sharma
  • Replied 8 September 2017, 3:26 pm EST

    Unfortunately, what you describe is exactly what I am doing, but it still frequently reads the 'default' string when focus first moves to the control. This implies that the default string is being set in a different event handler - not Enter.
    I also tried overriding it in GotFocus() but that did not work either.
  • Replied 8 September 2017, 3:26 pm EST

    Hi Mike,

    It seems to be working fine at my end. I tested this with JAWS and it reads the description as set.
    For the first time load it reads the description from:
     private void fpSpread1_Enter(object sender, EventArgs e)
    {
    fpSpread1.AccessibleName = “Control” + fpSpread1.Name + “Sheet” + fpSpread1.Sheets[0].SheetName + “Row” + fpSpread1.ActiveSheet.ActiveRowIndex + “Column” + fpSpread1.ActiveSheet.ActiveColumnIndex;
    fpSpread1.AccessibleDescription = “Control” + fpSpread1.Name + “Sheet” + fpSpread1.Sheets[0].SheetName + “Row” + fpSpread1.ActiveSheet.ActiveRowIndex + “Column” + fpSpread1.ActiveSheet.ActiveColumnIndex;
    }

    After that every time when the Spread cell gets focus it reads from EnterCell event.

    Please test the attached sample application.

    Thanks,
    Deepak Sharma


    2017/07/SpreadScreenReader.zip
  • Replied 8 September 2017, 3:26 pm EST

    Hi Mike,

    I am discussing this issue with the development team to find out if there is any possible customization we can do to make the screen reader work with Spread's events. I will let you know as soon as I get a final conclusion on this.
    The tracking id for this issue is 240521.

    Thank you for your patience.

    Regards,
    Deepak Sharma

  • Replied 8 September 2017, 3:26 pm EST

    Hello Mike,

    Our developers worked on this issue and found that this is not a bug of Spread. Actually Spread doesn't support notify event to accessibility client apps when accessible name/description changed. So like dataGridView control or any custom controls, Spread doesn't notify when User changes the accessible name/description (example User can change in event Spread EnterCell or dataGridView CellEnter. But control doesn't notify the accessibility client apps).

    You can create a ControlAccessible object for target control. Then call NotifyClients() with parameter is NameChange whenever you want to notify. Please refer to the attached sample application.

    Regards,
    Deepak Sharma

    2017/08/SpreadScreenReader_Support.zip
  • Marked as Answer

    Replied 8 September 2017, 3:26 pm EST

    Thanks. I'll take a look at the sample.

    Mike
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels