Author Topic: Accessibility  (Read 23947 times)

Offline Lava

  • Single posting newcomer
  • *
  • Posts: 3
Accessibility
« on: January 19, 2010, 09:16:43 am »
Hi,
i'm in a little group of blind's programmers, and we use a ScreenReader, like JAWS or NVDA.
CodeBlock seems wonderful but it is not totaly accessible for us...

1) In Windows settings :
the Tab Key doesn't move the focus correctly.
2) In editing code :
The ScreenReader can't say selected text.

The Jaws ScreenReader have script langage to improve accessibility.
With Scintilla editor, like NotePad2 or Scite, i use SendMessage( HandleSCI, CommandSCI,...) and made a script to get the selected text and say it.
But with WxScintilla, use in CodeBlock, the SendMessage doesn't work...

Could someone help us ?

Thanks

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Accessibility
« Reply #1 on: January 19, 2010, 10:43:36 am »
Could someone help us ?
I think I can tell that we would love to help. However, I personally have no experience and would need some guidance how we actually can support such effort.
We are having another branch (called "scintilla") where we are testing a way more recent version of (wx)scintilla. You might want to give it a try at:
http://svn.berlios.de/svnroot/repos/codeblocks/branches/scintilla/
Maybe the message works there already?

I am also aware of the AXTK project (for wxWidgets):
http://code.google.com/p/axtk/
...which may provide additional features needed, too.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Lava

  • Single posting newcomer
  • *
  • Posts: 3
Re: Accessibility
« Reply #2 on: January 19, 2010, 11:34:14 pm »
Ok, i explain

You know, we don't use the mouse but only use the keyboard.
Tab and Arrow keys move the focus to select objects.
Space and/or Enter Keys execute action.

If you want to testing the most popular screenreader, it works for a 45m démo.
http://www.freedomscientific.com/downloads/JAWS/JAWS-downloads.asp

So, you can check :
1) go to the Setting / Envirronnement Menu
Make some Tab and arrow keys hit.
You will see that we can't access to the checkBox, PanelGroup, ...

2) On principal windows
You may add new KeyboardShortcut to set the focus on the Editing, Manager and Log zone.

3) reading text correctly.
Generaly, screenReaders use function like SendMessage(hwnd, WM_GetText,..) to get text of application.
But Scintilla don't use Window constant value, ex WM_GetText = 13 and SCI_GetText=2132, and scrrenreader can't get text.
Then, I made some JAWS Script who use Scintilla constant and editor using SCINTILLA works fine.

With CodeBlock, using WxScintilla, no sendmessage works and i don't know why.
Is CodeBlock who block sendmessage handled for WxScintilla ?
Is WxScintilla limited ?
To read text correctly, ScreenReader need answer for Wm_GetText, WM_GetSel, .. commands.

I've tried to test the revision 906x but i'm not able to built it... could you indicate me a executable file ?

The AxTK project is very intersting, but i don't think it can help for CodeBlock accessibility.
Thanks

Offline nanyu

  • Almost regular
  • **
  • Posts: 188
  • nanyu
Re: Accessibility
« Reply #3 on: January 20, 2010, 02:07:21 am »
Hi,
i'm in a little group of blind's programmers, and we use a ScreenReader, like JAWS or NVDA.
CodeBlock seems wonderful but it is not totaly accessible for us...

1) In Windows settings :
the Tab Key doesn't move the focus correctly.
2) In editing code :
The ScreenReader can't say selected text.

The Jaws ScreenReader have script langage to improve accessibility.
With Scintilla editor, like NotePad2 or Scite, i use SendMessage( HandleSCI, CommandSCI,...) and made a script to get the selected text and say it.
But with WxScintilla, use in CodeBlock, the SendMessage doesn't work...

Could someone help us ?

Thanks

AND,
1、How set the focus to "Project Manager" panel or "Messages" panel from editor.
2、The "Project Manager " panel have got the focus,  but I couldn't  change it's tabs by hot key "Ctrl + Tab"
     (It allway show a dialog which let me to change tab of editor, even the focues isn't on editor)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Accessibility
« Reply #4 on: January 20, 2010, 07:41:34 pm »
In the settings dialog, please try navigating with Control-Tab, this will eventually give you access to the checkboxes.

There are 3 main areas in that dialog:
  • a list view where you can select which configuration panel to show, there are about 8-10 of them
  • the current configuration panel
  • the two buttons "OK" and "Cancel"

Pressing Control-Tab 3 times will place focus into the list view, you can navigate through the different control panels with the up / down or page up / page down keys.

Pressing Control-Tab 4 times will place focus on the first checkbox.

Control-Shift-Tab works in reverse order.

For some reason which I don't curently know, the focus is on the "OK/Cancel" group by default, which is the reason why you have trouble accessing the checkboxes. If I can figure out how to do it, I will change that so the focus is in the current configuration panel by default.
This may take some time though (if someone knows how to do it without having to search, please step forward).

Also we should set up some callback function that catches keypresses and streamlines the focus switching etc. a bit. Page up / page down could generally be used to switch between control panel pages, in that case Control-Tab could be used to switch between the panels and the OK/Cancel buttons with only one keypress.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Accessibility
« Reply #5 on: January 20, 2010, 08:18:40 pm »
For some reason which I don't curently know, the focus is on the "OK/Cancel" group by default,
Isn't that the default if you use a wxStdDialogButtonSizer?!
So you'd have to force setting the focus to another element (the tab bar?!).

Also we should set up some callback function that catches keypresses [...]
Do you think that possible via a plugin? I think an accessibility plugin (architecture) would come in quite nice. We could even add some notification to the SDK as helper. Why I'm asking: (Speaking for myself): I hardly know what exactly is needed, but I believe Lava knows. Giving him the ability to implement what's needed goes definitely in the right direction I'd guess. ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Accessibility
« Reply #6 on: January 20, 2010, 08:24:05 pm »
So you'd have to force setting the focus to another element (the tab bar?!).
Looking e.g. at "app_compiler_settings.xrc":
Lava: Can you try the attached XRC resource file, please? I've set the focus to the main notebook "nbMain".
Probably that's already a bit better...?!
What to do:
This XRC file is part of [CodeBlocks Install Directory]\share\CodeBlocks\resources.zip.
Just extract the ZIP archive, replace the file and re-create the ZIP archive overwriting the old one.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Accessibility
« Reply #7 on: January 21, 2010, 01:12:30 am »
I think you forgot to attach the attached xrc file :)

Putting all that's needed for accessibility into a plugin might be hard in my opionon, though some could probably be done. Still, the fact that it can be done doesn't mean it's necessarily good... I think we should try to make the main application more accessible from the beginning.

If I understood the screenreader problem right, we need to reply to a WM_GETTEXT message, which is harder than it sounds, since we don't get to see these easily.

The other problems are comparatively easy. The most difficult thing about adding a key to switch from the editor to the project window is to agree on what key to use.
Adding arrow up / down to the settings dialog should be as much as adding one more message listener and sending a list select event.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Accessibility
« Reply #8 on: January 21, 2010, 10:38:45 am »
I think you forgot to attach the attached xrc file :)
Call me an idiot. I've attached it now.

If I understood the screenreader problem right, we need to reply to a WM_GETTEXT message, which is harder than it sounds, since we don't get to see these easily.
I am not sure about that. The equivalent to WM_GETTEXT in Scintilla is SCI_GETTEXT which is processed (look at wxString wxScintilla::GetText() in wxscintilla.cpp. If I got Lava right than this is only a problem with Code::Blocks and not with Scintilla itself. I would like to have that clarified:
@Lava: Do other application like e.g. SciTE or Notepad++ work correctly with Screenreader?

Ps: Is it correct that the Screenreader software actually costs more than 1000 US$? Profit is all that counts here, right?!

[attachment deleted by admin]
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Accessibility
« Reply #9 on: January 21, 2010, 11:31:34 am »
...need to reply to a WM_GETTEXT message, which is harder than it sounds
I am not sure about that. The equivalent to WM_GETTEXT in Scintilla is SCI_GETTEXT which is processed...
As I understand it, the screen reader uses SendMessage with WM_GETTEXT, which will target the main window as well as the first-class windows owned by it. Or, if a dialog comes up, then this window and its children... whichever window has focus.

It probably has to do some nasty DLL injection hackery too, since the WM_GETTEXT message includes a writeable data pointer, so it would have to own a memory range in the same address space as the application -- but that isn't our problem, JAWS has to deal with that.
Now the thing is, this message arrives in the main window's message loop which is handled by wxWidgets. The main window does not own the Scintilla control. wxAUI, or rather wxAUI panels (which are not first-class windows) own all the editors, so the Scintilla control never gets to see a message. It doesn't matter if it's SCI_GETTEXT or something else, because still the control won't get to see it.
What we would need to do is intercept the message, then see which wxAUI panel has the focus, and forward the message to that panel's child. So we would need to insert our own low-level message handling into wxWidget's. Or, we would have to patch wxAUI into forwarding messages, which probably isn't much easier.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Lava

  • Single posting newcomer
  • *
  • Posts: 3
Re: Accessibility
« Reply #10 on: January 21, 2010, 03:32:45 pm »
Hi,
yes..., JAWS costs 1000$, but i'm french and i bought it for 1400€
A free, but less efficient, screenreades is NVDA.

1) i have tried the ressources.Xrc.
CodeBlock start correctly, but when i click on "Compiler & debug" menu, it Crash...

2) for the settings windows
I'm confused because i did not found the use of Control+Tab.
 But, generaly Control+Tab is only used to move in panel control...
Like this, it's not very pratical but usable.

3) For the project windows
Simply, i think you can use the F2 and Shift+F2 toogle display.
  F2 => Display Manager window and set focus on tree.
  F2 => Hide Manger Window and set focus on code editor
But Control+Tab for directly change the setting in ManagerPanel and LogPanel, only when there are the focus respectively.

3) The JAWS methods for reading text
 - sending message to the application
 - using MSAA and iaccessible2
 - and VideoInterceptor, like an OCR on videoscreen.

4) reading Text with application using Scintilla class like NotePad++, SCITE, NotePad2, ...
JAWS read text with videointerceptor but can't read selected text in this application.
WM_GetText reply random text.
I made JAWS Script, with sendmessage, handled to the scintilla object.

5) Reading text in CodeBlock
JAWS read text with videointerceptor but can't read selected text in this application.
WM_GetText always reply "SCIWindow"
SendMessage handled to the "wxWindowClassNR" (Scintilla) object don't reply.


MortenMacFly have said me to test the Scintilla branch.
Could someone give me the runtime or setup for testing it ?
Or, maybe, a codeblock with the last WxScintilla ?

Thanks

Offline tdstedman

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Accessibility
« Reply #11 on: February 01, 2011, 02:02:58 pm »
Hello All,

I teach an introductory programming class at a community college and have been using Code::Blocks the last two semesters as our development platform.  This term, I have a blind student who uses JAWS as his screen reader, and I wanted to know if there had been any further development on this topic since the last post a year ago.  In trying the software with our adaptive technology specìalist on campus, I think JAWS would do fairly well if there was a keyboard shortcut that would just toggle between the Editor window and the Build Log.  I tried all the usual combinations of keys with TAB, and they pretty much all cycle through the different tabs of the Editor window.

Thanks for all your work on this,
Tim
« Last Edit: February 01, 2011, 02:10:35 pm by jens »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Accessibility
« Reply #12 on: February 01, 2011, 05:31:04 pm »
In recent Code::Blocks builds (aka trunk, not yet in a nightly) i you are hovering with the mouse over a tab in either project manager, logs & others or the editors the tab become activated and would allow to scroll/select between the tabs. This may already been an option for you, hence what's needed is menu entries to focus project manager, the logs and the editors. I'll try to implement this, when I find the time.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline tdstedman

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Accessibility
« Reply #13 on: February 01, 2011, 07:30:49 pm »
MortenMacFly,

Thanks for looking into this issue.  I am not sure how difficult this request would be to implement, but I am thinking that if standard usage is for Alt+Tab to toggle through applications and for Ctrl+Tab to toggle through the tabs/documents of an individual application, then perhaps a combo of Ctrl+Alt+Tab could set the focus to the different panes/windows within Code::Blocks.  If so, Ctrl+Tab can still be used to cycle through the different tabs of that particular pane/window.

Thanks again,
Tim

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Accessibility
« Reply #14 on: February 05, 2011, 03:36:15 pm »
I am not sure how difficult this request would be to implement, [...]
Ok, here we go with a first trial. You'll find a patch attached that adds two menu entries: One for focussing to the management panels and one for focussing the "Logs and others".

In fact, I wasn't exactly sure what to focus, so it focusses to the active's tab for now. There is an interference with the new feature I had just mentioned previously, so you probably need to turn this off through the options (on Windows, at least).

EDIT:
Cycling with a shortcut might be possible, too. I could do this in a second step after I got feedback on the current implementation.

Please try and talk back here. Thanks!

Ps.: Cycling was actually an easy thing to do, so I did it and updated the patch accordingly. The key combinaton is as suggested: CTRL + ALT + TAB. Please re-download the patch to get its currrent version... if needed.
« Last Edit: February 05, 2011, 04:23:42 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ