Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some output in command consoels spelled with speak typed characters enabled #513

Closed
nvaccessAuto opened this issue Jan 1, 2010 · 19 comments · Fixed by #9915
Closed

Some output in command consoels spelled with speak typed characters enabled #513

nvaccessAuto opened this issue Jan 1, 2010 · 19 comments · Fixed by #9915
Labels
bug feature/windows-command-console p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority
Milestone

Comments

@nvaccessAuto
Copy link

Reported by aleksey_s on 2009-12-17 16:39
Sometimes, NVDA is too verbose in console windows.
STR:

@nvaccessAuto
Copy link
Author

Comment 1 by aleksey_s on 2009-12-17 16:44
A simple script to demonstrate a bug:
s=raw_input("enter string: ")
print "you entered ",s
print "press enter to exit"
raw_input()

@nvaccessAuto
Copy link
Author

Comment 2 by mdcurran on 2009-12-17 20:42
Sorry, could you please provide a little more information.

  • What happens for you exactly?
  • I assume that I save that code in a .py file and run it in a Windows CMD shell?

@nvaccessAuto
Copy link
Author

Comment 3 by mdcurran on 2009-12-17 20:48
I apologize. I missed your first description. Sorry its very early morning.

Yes, I also get this problem quite a bit. However, only if Speak Typed characters is enabled.

I'm not sure how to fix it yet, but I can explain why it happens.

In XP and Vista, we are not aloud to hook window messages in dos consoles. So therefore we can not detect wm_char messages, and therefore not announce typed characters the normal way.
So, we detect, as part of our console diff code, when a single character seems to appear, in relation to where the caret is, and then we assume its a typed character and pass it through to speakTypedCharacters.
This happens quite a bit too often so it seems.
We need to stop doing this. However, what to replace it with?

@nvaccessAuto
Copy link
Author

Comment 5 by jteh on 2014-05-07 19:21
We should be able to fix this for Windows 7 and later, since we get WM_CHAR there. We can't fix it this way for XP or Vista, but I don't see why we should disadvantage 7 and later because of a deficiency in earlier Windows versions.

@nvaccessAuto
Copy link
Author

Comment 7 by jteh on 2014-05-07 19:23
Changes:
Changed title from "Incorrect console reading" to "Some output in command consoels spelled with speak typed characters enabled"

@nvaccessAuto
Copy link
Author

Comment 8 by briang1 on 2014-05-07 20:00
Well, in XP I've never encountered this issue. I do have speak typed characters on as well. Under what conditions does it manifest itself?

@nvaccessAuto
Copy link
Author

Comment 9 by jteh on 2014-09-09 07:44
Mick pointed out that WM_CHAR is problematic for password entry. We don't want the user's password to be echoed.

@nvaccessAuto
Copy link
Author

Comment 11 by Michael Curran <mick@... on 2015-04-02 04:39
In [a0d15ab]:

Merge branch 't513' into next. Incubates #513

Changes:
Added labels: incubating

@nvaccessAuto
Copy link
Author

Comment 12 by Michael Curran <mick@... on 2015-04-06 03:24
In [091a0e4]:

Merge branch 't513' into next. Incubates #513

@nvaccessAuto
Copy link
Author

Comment 14 by jteh on 2015-05-01 12:26
It seems that some applications such as Cygwin disable the console's native key echo and use their own (#5027). One possibility is that when we handle a typedCharacter event (WM_CHAR), we could check whether the character typed is the same as the character just before the caret. If it is, we can assume key echo is enabled.

@nvaccessAuto
Copy link
Author

Comment 15 by James Teh <jamie@... on 2015-07-15 07:41
In [c8a721b]:

Revert "Windows command consoles: support wm_char for announcing typed characters if it is available, and disable our older character handling code in win7 and above (wm_char is better). Also don't allow announcing of characters if the console's input echo mode is not on (e.g. password entry)."

It looks like Cygwin and probably other apps disable the console's native key echo and manage key echo themselves, so key echo stops working in those apps with this implementation. We'll need to rethink this approach, but it's better to revert it completely until someone has time.
This reverts commits daf65862f53f57aec99b115cc2ad4eb54dcf37d7 and 115be898d170b6461b92970239465607a9d2a6aa.
Fixes #5027. Re #513.

@nvaccessAuto
Copy link
Author

Comment 16 by jteh on 2015-07-15 07:42
Changes:
Removed labels: incubating

@Adriani90
Copy link
Collaborator

I cannot reproduce this with NVDA 2018.2.1 on Windows 10.

@Adriani90
Copy link
Collaborator

@aleksey_s is this still an issue for you?

@Brian1Gaff
Copy link

Brian1Gaff commented Jul 28, 2018 via email

@LeonarddeR
Copy link
Collaborator

I've seen it happening with Windows 10 as well

@codeofdusk
Copy link
Contributor

Once #9771 is merged, this issue will be resolved on Windows 10 version 1803 and later due to the new typedCharacter implementation for UIA consoles. However, it is still not fixed on Windows Server and LTSC 2016 (Windows 10 1607), which will still be supported for many years to come. I've considered using keyboardHandler for legacy consoles (similar to UIA), but it is unsupported on 1607. I've also considered using NVDAHelper to receive wm_char messages, but they are unreliable (characters are sometimes doubled). Therefore, it seems that we cannot fix this bug on older Windows releases. Since the issue has either been resolved or resolution is impossible, I vote to close it. You are, of course, welcome to investigate further for legacy consoles and propose a solution if one exists!

@nvaccessAuto nvaccessAuto modified the milestone: 2019.3 Aug 1, 2019
feerrenrut pushed a commit that referenced this issue Aug 1, 2019
Previously:
NVDA failed to announce typed characters and/or words in Mintty, and spells output close to the caret in 
legacy Windows consoles.

This commit factors out much of the code for handling typed characters in UIA consoles into a new
`NVDAObjects.behaviors.TerminalWithoutTypedCharDetection class`. The class is now used in 
Mintty (PuTTY, Git Bash) and legacy Windows consoles on Windows 10 version 1607 and later.

In legacy Windows consoles, the old keyboard handling code is disabled when the class is in use, and the
new support can be disabled in the advanced preferences in case it is incompatible with some programs 
or if suppression of passwords is critical.

Since legacy Windows consoles fire textChange rather slowly, this commit prefers faster responsiveness at 
the cost of offscreen characters (such as passwords) always being reported. Users may disable "speak typed 
characters" and/or "speak typed words" (using the existing scripts) when entering passwords to suppress 
this output.

On Windows 10 version 1607 with the new keyboard support enabled, spurious characters are reported 
when the dead key (if available) is pressed.

Fixes #513 
Fixes #1348
Related to #9614
@Adriani90
Copy link
Collaborator

What about People working on Windows 8.1 and Windows 7 in Consoles not using UIA?

@codeofdusk
Copy link
Contributor

What about People working on Windows 8.1 and Windows 7 in Consoles not using UIA?

The above comment is outdated, see #9915. This is fixed on a few Windows versions without UIA, but any more isn't possible due to doubled wm_char messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug feature/windows-command-console p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants