1

I'm pretty sure I've read some stuff about pygame being mentioned  on this forum, but I must know how menus and text is handled for the sake of screen readers. Is there an accessibility library that is commonly used? I know java has this sort of thing built in, but what does python have. I have seen one library,but it seemed to cover mac.

Thumbs up

2

You probably want accessible_output2, if you want to develop programs that can explicitly communicate with screen readers and braille devices. . Pygame's ability to display text isn't inherently accessible, in the sense that java.awt.Graphics.drawString isn't inherently accessible.

Some of my games
Keep up to date by following @Jeqofire on twitter!
Ear Ninja?

Thumbs up

3 (edited by magurp244 2017-09-15 21:58:13)

Generally libraries like pygame and pyglet are not screen reader accessible without external support libraries such as accessible_output2 as already mentioned, along with other libraries like Tolk or Pyttsx. Wxpython is considerably more accessible because it uses the operating systems native widgets, although that accessibility can be a bit patchy in places such as wx.Notebook being mostly accessible, but wx.AuiNotebook isn't.

-BrushTone v1.3.0: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

Thumbs up

4

I'd go for Tolk. It's far more stable.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.

Thumbs up

5

Hmm, actually regarding tolk, it does work for python? I don't know a lot about the library, to be honest. Just that it is used for adding accessibility, and that I think Skullgirls uses it for it's accessibility. Does anyone have any good resources for setting it up? Actually, any resources for accessible_output2 would also be nice as well.

Thumbs up

6

you can find the repository for accessible output at:
http://hg.q-continuum.net

You can follow me on twitter @cartertemm

Thumbs up

7

One thing you might want to keep in mind. IF you wish to have cross platform support for your game, only accessible_output2 is cross platform of the options mention. I've talked to the developer of tolk and to some up, he doesn't want to have to completely  rewrite tolk to work with multiple platforms. Quentin C has a library for speech as well, but thats windows specific again and while he says he'd like people to try and port it to Mac and other os's, it would need a lot of work too.
just some thoughts. hope this helps.

I don’t believe in fighting unnecessarily.  But if something is worth fighting for, then its always a fight worth winning.
check me out on Twitter and on GitHub

Thumbs up

8

Okay, I tried setting up Accessible_Output2, but it seems the dependencies it wants are not installing correctly. I have no idea, I know at least two of the setup.py files threw some sort of syntax error complaining about one of the print statements. Those were the platform_utils and Accessible_Output2 itself. Is Tolk less of a pain in the neck to get working on python?

Thumbs up

9

Yes, it is. AO2 appears to be -- if your right -- python 2.x only, which is a shame. Tolk is Python 2/3.x compatible.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.

Thumbs up

10

@8
Can you provide the exact traceback?
@9
accessible_output2 works just fine on py3

You can follow me on twitter @cartertemm

Thumbs up

11

Great, does anyone know how to install Tolk for python? I've only seen one library that seems to be a networking thing.

Thumbs up

12

if non-cross platform support doesn't matter in your situation:
https://github.com/dkager/tolk

Otherwise, I don't really know why your having difficulty with accessible_output2. Do you have pywin32?

You can follow me on twitter @cartertemm

Thumbs up

13

Okay, I have a snippet from the installation messages.

Start

    code = compile(script, filename, 'exec')
  File "C:\Users\Owner\AppData\Local\Temp\easy_install-gmy3mah_\pypiwin32-219\se
tup.py", line 121
    print "Building pywin32", pywin32_version
                           ^
SyntaxError: Missing parentheses in call to 'print'


End

Also, yes, I did install pywin32. Though, I wonder if the Antivirus messed with it. I doubt it, though, after all, I made sure to have it off at the time I first ran this setup process.

Thumbs up

14

Looks like your using the python 2 build script.
Run setup3 from:
https://github.com/mhammond/pywin32.git

Looks like the project was moved just a couple days ago from sourceforge. I wonder where the simple installers went?

You can follow me on twitter @cartertemm

Thumbs up

15

Hmm, that seems wierd. I have a 3.6 32 bit installer which matches the python version I am running. It doesn't seem to be version mismatch on the part of pywin.

Thumbs up

16

Ah, here are the installers I used. No problems here
https://sourceforge.net/projects/pywin3 … uild%20221

You can follow me on twitter @cartertemm

Thumbs up

17

Wait, does the libloader dependency also make use of pywin32? That was the only one that seems to have installed successfully, though, it seems to be recognizing Accessible_output2, it complains more about platform utils more than anything.

My test code

import accessible_output2 as ao2

# List the screen readers that accessible_output2 can work with.
# Note that just because a screen reader is in this list, it does not mean that the user has it installed.
ao2.get_output_classes()

# Create an instance of a class using the SAPI output class.
# Note that it is item 6 on my system, but I'm not sure if it will be the same on yours.
sapi = ao2.get_output_classes()[6]()

# List the methods and other attributes of the output class.
# The dir() function is a Python programmer's best friend.
dir(sapi)

# Speak the text "Hello, World!" using SAPI:
sapi.speak("Hello, World!")

end

Now I'm wondering if it has something to do with the more obvious thing about that list might have changed, thus it is using the wrong index.

the error

Traceback (most recent call last):
  File "HelloWorld.py", line 1, in <module>
    import accessible_output2 as ao2
  File "C:\Python36-32\lib\site-packages\accessible_output2-0.13-py3.6.egg\acces
sible_output2\__init__.py", line 5, in <module>
    from platform_utils import paths
  File "C:\Python36-32\lib\site-packages\platform_utils-0.4-py3.6.egg\platform_u
tils\paths.py", line 19, in <module>
    import winpaths
ModuleNotFoundError: No module named 'winpaths'

end

Hmm, if it is pywin32 I wonder... I may have to try a new installation. If that occurs, will I need to try again with the rest of the libraries as well?

Thumbs up

18

Okay, I've decided to give Tolk a go. The readme mentions a Tolk.pyo file, but I have no idea where to find the thing much less what to do with it once I have it. I'd like to try to avoid hand building all of this if possible. I doubt a simple pip install will help here as I think that's going to get me a networking library. Not useful.

Thumbs up

19

You don't have to build any files, although you may have to shuffle around a few. You can download the current Tolk binaries from the AppVeyor link [here] which has everything you'll need, specifically tolk.py and its dependancies. In order to use it you'll also need tolk.dll and the individual screen reader dll's to support them for either x64 or x86 architecture, you can find them all in the "src/python/", "bin", and "lib" folders respectively. Once you have all the files in your working directory using it is easy, example:

import Tolk

Tolk.load()

print Tolk.detect_screen_reader()
print Tolk.has_braille()
print Tolk.has_speech()
print Tolk.is_loaded()

Tolk.silence()
Tolk.output("Saying something!")
Tolk.braille("Sending to braille display!")

Tolk.unload()
-BrushTone v1.3.0: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

Thumbs up