Hi ALl,
I am working on contributing to some open source projects written in Java, and ran into some accessibility issues I'd appreciate help with. I'm trying to figure out how Java and the Java Access Bridge interface with NVDA, as follows…
One of the projects I'm working on is an implementation of Magic: The Gathering. I did some kind of hackish accessibility already, basically I needed a way to tell the player that a card was tapped, among other states, which is a thing conveyed visually for sighted people and will make sense to anyone who has played the game before.
I ended up using the AccessibleDescription property to do this, which isn't ideal, and have been trying to figure out an alternative. I thought that using Java's AccessibleState class might do the trick. I created a custom subclass for AccessibleCardState, since none of the pre-existing states seemed to quite fit what I needed to convey.
The state is being passed through the Java Access Bridge, but NVAD isn't using it to describe the card in the way I thought it would. I was expecting it to say something like "CardName Tapped," in the same way it might say "Checkbox checked."
My code in progress can be found here on Gitlab. I added a couple classes to the bottom of the CardPanel.java file, which is where the bulk of the logic around displaying cards takes place.
If I'm missing something about the way states work, or how Java interfaces with NVDA, I'd love to be enlightened. I'm certainly willing to work with my previous solution of setting the AccessibleDescription, but thought states were closer to how the accessibility API is intended to be used.
Thanks all.