NVDA automatically switches to Forms Mode - reactjs

Currently my React component consists of a few labels and one input box. And it has a view mode and en edit mode.
When I go into edit mode, NVDA automatically goes into forms mode, due to which I'm not able to enter any text in input box or navigate through labels using arrow keys.
By default, on pressing Enter, NVDA goes in forms mode (see NVDA's keyboard shortcuts for forms) which takes all next keyboard input as shortcut to some command. To come out of that mode, we need to use the NVDA key (Default is insert key) + space. After that, we can resume typing. We are not even able to navigate through arrow key as it begins reading each character.
Readonly : ReadOnly Looks like this
Edit Mode: Edit Mode looks like this
Is there a way to prevent NVDA from going into forms mode automatically?
Any help would be appreciated.
NVDA Version : 2018.11
Firefox: 60.0.1 (64-bit)

I'm not sure I follow what the question is.
You have forms mode backwards. When in forms mode (meaning, that you're in a <form>), you want to type stuff into input fields and such. The keyboard events go to the form instead of to the screen reader so that what you type is what you see.
When you exit forms mode, you're back in "screen reader mode" and characters that you type will be interpreted as screen reader quicknav keys (such as 'B' to go to the next button, 'T' to go to the next table, etc).
NVDA (and JAWS) have options on whether to automatically go into forms mode when focus goes to a form element.
So given that, are you asking how you can force a screen reader to switch modes?

Related

WPF Avalon Edit Make text upper case

I am using C# WPF with Avalon Edit Text Box.
I am trying to make all of the text in the text box uppercase and I get an error with additional message 'No undo group should be open at this point'.
I am using the following code:
a.Text = a.Text.ToUpper();
where "a" is the AvalonEdit.TextEditor
Thank you.
Setting the TextEditor.Text property has the side-effect of clearing the undo stack (just as with the normal WPF TextBox). Clearing the undo stack is only allowed when there's no open undo group.
If you did not intend to clear the undo stack, use the methods on textEditor.Document instead to modify the document. You'll want to avoid replacing the whole text, because that would also reset the selection and caret position (after all, AvalonEdit can't know how your new text is related to the old text).
If you do want to clear the undo stack (e.g. you're switching the view to a different document), you'll have to figure out why an undo group is open. Most likely, your code is running from the event handler of an event that is called while the undo group is still open (e.g. document.TextChanged) -- you might want to switch to a different event instead (e.g. document.UpdateFinished is called after the undo group was closed).
If all you want to do is to upper-case text as it is being input, it's better to modify the text before it is added to the document: handle the TextArea.TextEntering event to cancel any lower-case input (set e.Handled = true;), and instead call TextArea.PerformTextInput() to repeat the text input process with the corresponding upper-case text instead.
For copy-paste, you could handle the attached DataObject.PastingEvent and modify the data to be pasted.

Problem with Combobox in ExtJS

I am developing a website, which is going to be accessed by an embedded system with a touchscreen interface. In order to provide the data to an ExtJS combobox, the user uses an on-screen keyboard (such as the add-ons provided by chrome and firefox, which are developed in javascript). When I select the combobox, I can type the first character (the combobox looses the focus when the keyboard button is pressed and then focuses once again when the key in the keyboard is released). When I try to insert the second character, the first one is erased instead of being concatenated to the end.
Is there any way to make sure that the new characters are appended to ones that are already in the combobox?(instead of erasing them).
Any help on this matter would be nice.
Would need to see code like the previous answerer, but make sure selectOnFocus is false on the combobox, or else you would be typing over everything for each letter the way you described it.

A terminal-like WPF textbox?

I am looking for an embeddable interactive console. I want the user to be able to type in some custom commands, and the application to write command responses in it. Would be awesome if it would understand powershell or python, ans supports command completion.
I already built my own bash-like terminal, but I do not want to totally reinvent the wheel, so I'm looking for a third-party stable component before going any further with it.
If someone is interested, I found PoshConsole, a powershell console:
http://poshconsole.codeplex.com/
Thanks
PS: you can find a screen of what I am trying to achieve here:
http://www.hiboox.fr/go/images-100/codein,0a2809b63e05c3d0cac678962e0e3d5a.jpg.html
Nothing found since I asked the question, and to stick with the "do it yourself" way of thinking:
I wrote a terminal-like control in .NET.
http://wpfterminal.codeplex.com/
You can see an example in this screenshot (terminal is integrated in a bigger project) :
http://images4.hiboox.com/images/4210/0a2809b63e05c3d0cac678962e0e3d5a.jpg
Basic mechanisms
Actually what I did was to define a lastPromptIndex integer, and everytime a user presses the ENTER key and a new prompt appears, this value is updated.
After that, it's simple, you just need to process any text input before the textbox validates the input. If the textbox caret was located before your lastPromptIndex, you need to raise an error (usually a beep sound) and you must invalidate the text input, so nothing is written in the textbox. I also automatically set the caret position to the end of the textbox, so the user can immediatly input some text.
Extensions
You can enable command completion by looking for an "UP key" input if the caret is before the prompt index, etc. What you need is just to process input events before they are sent to the textbox internal mechanisms. I don't know if SWT controls allow it, but I'm pretty sure they do, like any serious UI system.

Create a WPF text box which only responds to character key presses and few selected editing key presses

The WPF text box responds to quite a number of editing commands. I want to eliminate the vast majority and have it respond to any text input and few editing commands like backspace & delete. I know I can handle the KeyDown event but I can't see any easy way of distinguishing between character input and editing key strokes.
You can use the Preview events. They happen before the actual key events that actually perform the work. For instance, if you want to disable the down arrow for moving up and down in text, in the PreviewKeyDownEvent you would check 'e.Key' for the down key, and if found, and set e.Handled = true. This effectively removes that key press from the processing. As such, KeyDown will never get called.
Using this method you can remove specific keys, or combinations of keys and modifiers (such as CTRL-C if you wanted to disable the 'copy' shortcut).
Hope this helps! If so, don't forget to vote it up and/or mark it as accepted.
WPF does not have a built-in masked text box under .NET 3.5.
You will find lots of starting places if you search google and stackoverflow for: WPF Masked TextBox

WPF Accelerator Keys like Visual Studio

I'm developing a large line of business app with C# and WPF. Our standard is to include accelerator keys for buttons on all forms (Save, Cancel, Search, etc.). I've recently noticed that when a form is loaded, the accelerator key is active even when the user does not press the "Alt" key. For example, our Search button uses "Alt-H" as the accelerator, but the user can initiate a search by simply pressing "H". I'm using the standard "_" in the button content to create the accelerator key.
<Button Content="Searc_h"/>
Has anyone else noticed this behavior and has anyone found a suitable workaround that requires the "Alt" key to be pressed?
This is standard behaviour for accelerator keys on Windows whenever no text input is focused. Please don’t break it, just leave it in.
You can check this yourself. Press Win+R to bring up the "Run..." dialog, then Tab so one of the buttons is focused, then press "B". The "Browse" button will get activated.
This is also why you can answer those MessageBox prompts with a simple Y/N (instead of Alt+Y / Alt+N).
Don't put the underscore in at all, then add this to the window.
<Window.InputBindings>
<KeyBinding Command="Help" Key="H" Modifiers="Alt"/>
</Window.InputBindings>
Menu and ToolBar mnemonics work without pressing Alt key in WPF. This is the microsoft standard.
Refer the this link http://social.msdn.microsoft.com/Forums/en/wpf/thread/14f6f49f-0027-471b-b68c-e7f6ba012012
This article on Sara Ford's Weblog discusses this phenomenon.
A commenter mentions this as a solution:
"If you're writing an application and you don't like this behavior, look up WM_CHANGEUISTATE and specifically the UISF_HIDEFOCUS flag."
Actually, the Command pattern in WPF allows you more granular control over what keyboard shortcuts are allowed. It goes a step further than the "_" in your button text.
Check the following link for more information:
http://www.switchonthecode.com/tutorials/wpf-tutorial-command-bindings-and-custom-commands
Edit: previous link was dead - provided a new link.
-Doug

Resources