Sign in to follow this  
Followers 0
batworx

Responsiveness Of AutoIt GUI's With Screen Readers

6 posts in this topic

Hi everyone

I am a blind AutoIt user, and have noticed that when using a screen reader with GUI's I create, the responsiveness while tabbing or arrowing through controls seems to be a little slower than when using other applications. I've tried both MessageLoop mode and OnEvent mode. My code currently looks like this:

#NoTrayIcon

#include "GUIConstantsEx.au3"

AutoItSetOption ("GUIOnEventMode", True)
$MainWindow = GUICreate ("Test")
$OKButton = GUICtrlCreateButton ("&OK", 100, 100)
$CancelButton = GUICtrlCreateButton ("&Cancel", 200, 100)
GUICtrlSetOnEvent ($OKButton, "Handler_OKButton_Click")
GUICtrlSetOnEvent ($CancelButton, "Handler_CancelButton_Click")
GUISetOnEvent ($GUI_EVENT_CLOSE, "Handler_MainWindow_Close")
GUISetState (@SW_SHOW, $MainWindow)
While 1
Sleep (1000)
WEnd

Func Handler_OKButton_Click ()
MsgBox (0, "", "You clicked the OK button.")
EndFunc

Func Handler_CancelButton_Click ()
MsgBox (0, "", "You clicked the Cancel button.")
EndFunc

Func Handler_MainWindow_Close ()
WinClose ("Test")
GUIDelete ($MainWindow)
Exit
EndFunc

Now, if I comment out the Sleep line, effectively telling the While loop to do nothing, the responsiveness increases dramatically. However, Task Manager reports CPU usages of between 20 and 25% when doing this.

Does anyone know what might be causing a screen reader to respond slower with AutoIt GUI's? If anybody wants to run tests of their own, I'm using the free and open source NVDA (Non-Visual Desktop Access) screen reader, available from http://www.nvaccess.org. Thanks in advance for any feedback.

Regards,

Gavin Grundlingh

Share this post


Link to post
Share on other sites



Your sleep doesn't need to be that large, you're effectively slowing it down by a second every time through the loop.  A sleep of around 10 should be enough, although I tend to use 100 to err on the side of caution.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

The Sleep in that While loop shouldn't affect the GUI responsiveness at all - the GUI can process messages during a Sleep. It's there purely to stop the tight While loop from wasting CPU. Sleep(1000) should act the same as Sleep(10). But Sleep(10) - or a Sleep of any kind - stops the While loop burning CPU. It's possible that the screenreader is hooking into the GUI in a way that is affecting performance. has anyone tried the code posted to check it looks OK without a screenreader being active?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I only mentioned it because he also said he was using message loop mode.

EDIT: BTW, i also tested the gui posted and it works fine for me, but I don't have a screen reader running.

Edited by BrewManNH

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

I asked for sighted assistance to see if the responsiveness differs visually, and was told it remains the same. The screen reader I'm using is non-video-based. As far as I know, it uses IAccessible, IAccessible2, and UIA (where possible) to get its information. Screen readers that use custom mirror display drivers to access information, such as Freedom Scientific's Job Access With Speech (JAWS) and GW Micro's WindowEyes, appear to not have this responsiveness problem. I was just curious why NVDA is so affected by AutoIt GUI's when other apps written in C work fine with it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0