Skip to main content


So I understand that NVDA's handle keys from other applications option changes how keyboard keys can be processed, such as handling input from on-screen keyboards and speech recognition, but I'm unclear as to exactly what's happening behind the scenes and the user guide only provides a very brief explanation of why a user may want to disable it. I was just wondering if I could have some clarification on what's happening behind the scenes when this option is used by chance? Thank you very much for your time and I look forward to any input you may have. Thanks. #NVDASR @NVAccess @jcsteh
in reply to Brandon Tyson

When that option is disabled, NVDA ignores all keystrokes with the injected flag set; i.e. all keystrokes simulated by applications rather than physically received from an input device. It does this because when NVDA intercepts a keystroke in order to get information before the application executes it (e.g. the arrow keys or backspace key), NVDA needs to capture the keystroke, do its thing and then re-inject the keystroke. If NVDA didn't ignore injected keystrokes, it would end up in an endless loop, capturing its own injected keystrokes, handling them, re-injecting them, etc.
When that option is enabled, NVDA uses some tricky logic to try to ignore only its own injected keystrokes, but allow others through. This logic involves things like nearby timing, keeping track of keystrokes NVDA itself sent, etc. Unfortunately, it seems this logic isn't perfect and can still interfere with injection by some applications, hence the option.
@NVAccess
in reply to Jamie Teh

Could this result in faster or better performance with that option off, even if I'm working in an application which doesn't inject keys?
in reply to Brandon Tyson

See my answer in the other thread: https://aus.social/@jcsteh/112345948657066389
@NVAccess


I guess it's possible. If that setting is enabled, when NVDA injects a key (arrow key, backspace, etc.), NVDA has to wait to receive the key it just injected before it can proceed further. We use a kernel event to signal that and it should normally happen very quickly, but if something else has a keyboard hook installed or something like that, that could slow things down.
In contrast, if that setting is disabled, NVDA doesn't wait for anything because it just unconditionally ignores all injected keys.
@jscholes

in reply to Jamie Teh

That makes sense. Thanks for clarifying this setting.
in reply to Brandon Tyson

NVDA's low-level keyboard hook determines whether each keyboard event is considered injected or not, via flags passed in the KBDLLHOOKSTRUCT structure. Injected means that the keyboard input was generated by software, rather than a physical device.

For instance, keypresses generated by speech recognition tools will be considered injected, but you typing on your keyboard will not. If the setting is disabled, injected keyboard events are ignored, so you wouldn't be able to e.g. instruct Dragon Naturally Speaking to press NVDA+F12 to give you the time,.

I presume that in some specific cases, NVDA intercepting the input can result in undesirable behaviour, but I'm not sure what those situations would be other than the example mentioned in the user guide.

in reply to James Scholes

@jscholes I do wonder if there's more going on, because I almost feel like it's a bit more responsive having that setting disabled.
in reply to Brandon Tyson

I guess it's possible. If that setting is enabled, when NVDA injects a key (arrow key, backspace, etc.), NVDA has to wait to receive the key it just injected before it can proceed further. We use a kernel event to signal that and it should normally happen very quickly, but if something else has a keyboard hook installed or something like that, that could slow things down.
In contrast, if that setting is disabled, NVDA doesn't wait for anything because it just unconditionally ignores all injected keys.
@jscholes