Saturday, February 23, 2008

Down With Keyboard Focus Thieves

I know it's a design trade off for an application to steal keyboard focus or not. However, I think when it must be done, it could be done better. I was installing an Office service pack today, which is a lengthy process, and at one point, while I was typing in an IM window, the install grabbed the keyboard focus. Before I noticed, I had hit 'space' and acknowledged whatever button was the default. Then I saw this:

There is no "back"; there is no way to see what happened. A box appeared and disappeared before I saw it, and now the install is cancelled and must be restarted.

Argh! As I'm writing this, it just happened again! I was running the install and it went to completion. It popped up some sort of confirmation box and as I was typing, again acknowledged the default option. In this case that option was "restart your computer". So, as I'm trying to write a blog entry, windows are closing and I'm thinking "I hope Blogger autosaved that entry already!". Luckily Vista popped up with a message about unresponsive programs that couldn't be closed (Firefox, for some reason), so I had a chance to cancel the reboot.

I think if an application has to steal keyboard focus, it might as well steal visual focus too. As much as I dislike the disruptive full screen blankout of the User Account Control system in Vista, at least it gets your attention. The problem with that one is that you can't say "go away, I'll decide later". Something visually unavoidable (even on 2 monitors, which is where I have most trouble with this) but with the option to minimize it for later would be great. Dialogs that appeared on the currently active monitor would also be better. Additionally, when a dialogue box steals keyboard focus, the OS should be smart enough to recognize whether you were vigorously typing before the automatic focus shift occurred, and ignore keyboard events until a short pause in typing occurs, indicating the user probably has stopped typing and has realized their application lost keyboard focus. This would help avoid inadvertent spacebar or enter presses that activate buttons before we see them.

Or, perhaps even better, don't steal focus for events like "the install finished". Flash the orange indicator in the taskbar/dock and wait for the user to be ready to acknowledge it.

No comments: