Topics

How to make a window element focusable?


Oleksandr Gryshchenko
 

Hi friends,

If you could, please tell me how to make the program window element focusable.
I will demonstrate the situation on my favorite email client, which still has small problems with accessibility.
The window of this email client is divided into areas such as tree of folders, list of messages, and message viewing area.
The user can switch between the specified areas using the Tab key.

When I select a message in the list and press Tab to switch to its viewing area, I first hear the main headers of the message and the focus shifts to viewing message body.
But I can't switch to headers using Tab, they remain out of focus...
Instead, I can read the message headers using the screen view mode (numpad 7 and numpad 9 keys).

When viewing IAccessable objects using the Python console, it was determined that each of the headers (From, To, Subject and Date) is a separate object of type Edit.
And if I move the focus manually to the first header (From) using the setFocus() method in Python console, I can then use Tab to move to other headers:
focus.parent.next.next.next.next.setFocus()
At the end of this letter, I will provide basic information about the first header object (they are all the same type).

Please tell me how to make the headers available for navigation with the Tab key.
I tried to do it in several different ways but to no avail...

Developer info for navigator object:
name: 'From: '
role: ROLE_EDITABLETEXT
roleText: None
states: STATE_READONLY, STATE_FOCUSABLE, STATE_FOCUSED
isFocusable: True
hasFocus: True
description: None
location: RectLTWH(left=242, top=384, width=235, height=20)
value: 'User Name <user@...>'
TextInfo: <class 'NVDAObjects.window.edit.EditTextInfo'>
windowClassName: 'Edit'
windowControlID: 1005
windowText: 'User Name <user@...>'
displayText: 'User Name <user@...>'
IAccessibleChildID: 0
IAccessible event parameters: windowHandle=2884470, objectID=-4, childID=0
IAccessible accName: 'From: '
IAccessible accRole: ROLE_SYSTEM_TEXT
IAccessible accState: STATE_SYSTEM_FOCUSED, STATE_SYSTEM_READONLY, STATE_SYSTEM_FOCUSABLE, STATE_SYSTEM_VALID (1048644)
IAccessible accDescription: None
IAccessible accValue: 'User Name <user@...>'

I will be very grateful for any tips.
Oleksandr


Lukasz Golonka
 

Hello Oleksandr,

On Wed, 13 Jan 2021 08:09:59 -0800
"Oleksandr Gryshchenko" <kita.zup+groups@gmail.com> wrote:

Hi friends,

If you could, please tell me how to make the program window element focusable.
I will demonstrate the situation on my favorite email client, which still has small problems with accessibility.

First of all I'm so happy I'm not the only one on this list who is
using Becky! :-)
Now to your actual question what you want to achieve is not going to be
easy. the closest thing that you can get is to assign a script to the
TAB key when on the message view to move focus to the first message
header.
I've never done this as I personally see not need for such feature.
By the way - I've created an apModule for Becky! just for my personal
use to make selection announced, strip non existent white space in the
message viewer and properly encode Unicode characters in the message
list view.

--
Regards
Lukasz


Oleksandr Gryshchenko
 

Hi Lukasz,

Yes, you are right, this is Becky Internet Mail :)
I have been using this program for many years, and despite the minor drawbacks, I love this small and fast email client.

Thank you for suggesting a way to access message headers.
I tried to force focus directly from the event_loseFocus() method, but it's a bad solution... and it didn't work.

But still I don't understand why the focus does not fall on the headers when navigating with the Tab key...
because these objects have the following attributes:
isFocusable == True
and
states: STATE_FOCUSABLE
For me this is a strange and incomprehensible behavior... I just faced exactly the same situation in another program.

Lukasz, could you share your add-on for Becky?

Thank you and good luck!
Oleksandr


Lukasz Golonka
 

On Wed, 13 Jan 2021 14:05:13 -0800
"Oleksandr Gryshchenko" <kita.zup+groups@gmail.com> wrote:

But still I don't understand why the focus does not fall on the headers when navigating with the Tab key...
because these objects have the following attributes:
isFocusable == True
and
states: STATE_FOCUSABLE
For me this is a strange and incomprehensible behavior... I just faced exactly the same situation in another program.
Focusable just means that the given object can accept focus when
executing obj.setFocus() it does not give an guarantee that it would be
present in the tab order.

Lukasz, could you share your add-on for Becky?
I've attached it. Please note that since I've written it just for
personal usage code quality could certainly be better in some places. Ah
also because I'm mostly using 2019.2.1 you would probably need to adapt
it slightly if your want to get it working with Python 3 versions of
NVDA.

I do intent to make it more official at some point but there are still
some places in Becky! which should be made more accessible but this
cannot be done without changes in the core of NVDA for which I never had
time to work on.

--
Regards
Lukasz


Lukasz Golonka
 

On Wed, 13 Jan 2021 14:05:13 -0800
"Oleksandr Gryshchenko" <kita.zup+groups@gmail.com> wrote:
Thank you for suggesting a way to access message headers.
I tried to force focus directly from the event_loseFocus() method, but it's a bad solution... and it didn't work.

For some discussion regarding similar issue please take a look at:
https://github.com/nvaccess/nvda/issues/5960

Also Derek Riemer did something similar in his Notepad++ add-on. This is
not in the code since Npp was changing too rapidly breaking the fix with
every update, but for a sample implementation you can take a look at:
https://github.com/derekriemer/nvda-notepadPlusPlus/commit/547cd2ab39836462d73e87b75e4a3cd41a8c835c


--
HTH
Lukasz


Oleksandr Gryshchenko
 

Hi friends,

Lukasz, thank you for the informative links!
Looks like it's not as easy to do as I thought.

I use the Notepad++ add-on by Derek Riemer and studied its code. I have not seen this implementation yet, thank you for finding and sending a link to this commit.

Thank you for the application module for Becky! It works greate!
I adapted its code to work in the current version of NVDA 2020.4 beta 4 for last version of Becky Internet Mail 2.7.5.03.
I've attached it to this message, maybe someone else also wants to try this email client.

I am very grateful to you for your help!
Good luck!
Oleksandr


Oleksandr Gryshchenko
 

Sorry,
I've fixed my own bug in the Becky appModule.
Good luck.
Oleksandr


Beqa Gozalishvili
 

Hello.

i've tried this email client with an appmodule, but for some reason
message pane is not accessible.

is it something that should not be accessible or maybe there are some
options have to be checked?




i downloaded latest 2.75.3 version
--
Beqa Gozalishvili <beqaprogger@gmail.com>


Oleksandr Gryshchenko
 

Hello Beqa,

Unfortunately, this email client still has poorly accessible elements.
But using different NVDA modes we can read almost everything with slight inconvenience.
I want to fix this later, but so far I have little experience and ask a lot of questions here * smile *.

Regarding viewing messages.
When you are in the list of messages and want to read one of them - place the cursor on it and press Tab.
You get to a non-voiced viewing window and press Ctrl+A (select all), then Ctrl+C (copy to clipboard) and NVDA+C (read clipboard).
I made a simple script that does this automatically and displays the text of the message in a separate accessible window.
Of course, this is not a very good solution, but it works.

Regarding the appModule created by Lukasz.
He fixed the most important things:
* the number of unread messages in each folder is announced;
* by pressing NVDA+Shift+U you can find out how many messages are in the folder and how many of them are unread;
* the encoding is displayed correctly in the messages list;
* fixed display of some menu items.

Of course, there is still work to be done, but in general the accessability of the application has improved.

Have a nice weekend!
Oleksandr


Lukasz Golonka
 

On Fri, 15 Jan 2021 12:43:37 -0800
"Oleksandr Gryshchenko" <kita.zup+groups@gmail.com> wrote:

Regarding viewing messages.
When you are in the list of messages and want to read one of them - place the cursor on it and press Tab.
You get to a non-voiced viewing window and press Ctrl+A (select all), then Ctrl+C (copy to clipboard) and NVDA+C (read clipboard).
I made a simple script that does this automatically and displays the text of the message in a separate accessible window.
Of course, this is not a very good solution, but it works.
This is not only dam inefficient but also thankfully unnecessary.
While the official Becky! documentation does not mention accessibility
the unofficial one (which is by the way much more extensive than the one
bundled with the program) does.
Please go to https://davidskirk.org/becky/ and after installing the
plugin read the section 'Information for Visually Impaired Users' in the
Appendix chapter. These instructions has been written with the
Window-Eyes in mint but they also improve accessibility of the message
view for NVDA. Since this is getting offtopic it is also worth
mentioning that Becky! has a mailing list available at:
https://groups.io/g/beckymail.
It is not accessibility specific but some blind Becky's! users including
myself are subscribed there.

--
HTH
Lukasz


Oleksandr Gryshchenko
 

Lukasz, it's awesome!
I followed the recommendations you mentioned and, oh miracle, - now the message view is accessible!
I am very grateful to you for all the advice!
Have a nice week-end!
Oleksandr