Unity Accessibility Plugin – Update 4 – Popup Windows

Thanks to the power of Antibiotics I’m back on my feet and back working on the Unity Accessibility Plugin. This week, I implemented support for popup dialogs.

If you want to start reading about the plugin from the beginning, you can find the first post here.

Popup Menus and Overlays

Not all user interfaces in an app are full screen menus with one clear list of items. There are also partial screen overlays and popup menus. Just think of a level end screen that grays out the game screen in the background and overlays itself in the front. In an app for seeing users this is easy to achieve. Simply put a full screen panel behind the popup and voila – the buttons and elements below it cannot be pressed.

A notification window asking the user for confirmation. There are other buttons grayed out in the back behind the confirmation window..

An example of a popup confirmation window.

Automatic vs. Manual Setup

However – the accessibility plugin can’t know that a button cannot be pressed because something is laying over it. Yes, I know, I could do raycasts and see if there is something blocking it. But that wouldn’t end up being a very clean solution. I would have to do those checks every frame on every UI component – and even then it might be tricky in special cases (which every project always has). It also would contradict the ideally very small footprint the plugin should have.

When a popup menu or dialog window opens, the expected behavior is very clear. The input should focus to that window, and that window alone.

The simplest solution I found was to simply add a little checkbox to my UI Container component: [ ] IsPopup.
This tells the plugin that the other UI elements on the screen are no longer accessible for as long as this popup is open. The plugin will then push all those elements onto a stack, and then restrict focus to the newly opened dialog. It will then get those elements back once the popup closes. All of that happens automatically. The checkbox is the only manual action needed from the developer. Seems like a fair trade off between performance, clean functionality and required manual setup.

 

Continue Reading with the next part here

Sick Again

Almost to the date one year ago everyone here in the office and at home was sick – except for Sascha. I blogged about it back then (see here). Back then I swore to get a flu shot like him this time.

Woman sitting in bed, looking ill and unhappy. She holds an ice bag to her head.

Well, I did, even at the same place as him. And now I am sick – again. And guess what? Sascha is healthy as a horse – again. How does he do it?

I know a flu shot doesn’t protect you from the common cold, but when you’re feeling as horrible as I am right now, you’re willing to try out everything.

Muscle Memory and our Office Alarm System

Do you sometimes notice yourself doing things without thinking about it, and without actively making the decision to do them?

One example that gets me a lot is locking the door after I leave the house. And then five minutes later I wonder whether I locked the door, can’t remember, frantically turn around and run back to check – only to find the door locked – of course. Because I always lock it, and it’s become so practiced a routine that I don’t even spend enough conscious effort on it to remember it. At least that’s how I explain it to myself.

A woman is walking to work and her steps become insecure as she wonders whether she locked the door, turned off the stove or left the lights on at home.

Is it Muscle Memory?

Another thing I noticed is that when I step in front of my piano, I can still play some of the tunes that I learned when I was 16. Even though I stopped playing since then. My hands just play and hit all the right keys – until the moment I look down on them. That’s when I mess up. But it’s still kinda cool.

Where this really gets me in trouble is our office alarm system. I am so used to turning it on when I leave at night, that I don’t even think about punching in the code anymore. But, on the rare occasion that I am the first in in the morning, my fingers won’t cooperate. They punch the keys to arm the system, not to disarm it. It wouldn’t be so bad – the system allows me a second chance – but I don’t even notice that it is wrong! A few seconds later, when the countdown is over, a blaring siren sets off. I know, because this happens to me about every third time I do this. To really rub it in, our security system sends out alert text messages and emails to every cellphone on their notification roster, making sure my slip up doesn’t go unnoticed by anyone…

I’ve switched now to using the app instead. It has just one big round button that will either arm or disarm the system, depending on what state it is in. Almost foolproof.

 

Unity Accessibility Plugin – Update 3 – You’re Using It Wrong!

Time for an update on the progress of the Unity Plugin to make the Unity UI (uGUI) accessible for blind and sight-impaired users. This is part four in this dev blog. You can read the first three parts here, here and here.

You’re using it wrong!

I am a big fan of writing software that requires only a minimal amount manual setup. Do you know Doctor House’s motto “Everybody lies”? Well, as coders we live by a similar motto: “Everybody uses our software wrong.”

A alien is telling a human to stand back and not touch any of the controls in his space ship.

This might be a horrible generalization, but it’s always best to assume that your users don’t read the documentation, don’t follow tutorials and don’t ask for help unless they have to. They rather wildly click on all kinds of buttons and see what blows up. Therefore good software best works out of the box and doesn’t need the average user to click anything.

I couldn’t agree more, which means I am trying to make it so that this plugin requires no more than a minimal amount of setup. Just add the accessibility component to all relevant UI elements and you’re close to being done. I am actually considering a semi-automatic markup feature, that goes through the scene and adds the component automatically to every UI element it finds.

 

Continue Reading with the next part here