nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
Other
2.09k stars 629 forks source link

Adding function to speak pasted text #10709

Open sine-w opened 4 years ago

sine-w commented 4 years ago

10445 # Is your feature request related to a problem? Please describe.

No

Describe the solution you'd like

When typing ctrl v NVDA will read and speak Clipboard text If it is a password field, the function will be disabled.

Describe alternatives you've considered

Probably this function can be added to either one of the addon?

Additional context

I do a lot of typing work. I always have to copy here and there, and sometimes copying repeated words. After typing ctrl v, I have to manually press ctrl left arrow or press up arrow and then down arrow to read what is pasted and it wasted my time, cause it is a repeating job for me.

Adriani90 commented 4 years ago

You can read what's in your clipboard after you pressed ctrl.c or ctrl.x befor you paste the text. You just have to press nvda+c. Closing, because there is already a confortable solution for this.

sine-w commented 4 years ago

No, pressing ctrl and c is the same as doing ctrl left arrow or presssing up arrow and down arrow. What I said here is I want NVDA to speak it automatically not needing extra key press. Please do not close my issue, what you have suggested is not what I proposed here.

Adriani90 commented 4 years ago

Ok reopening. cc: @JulienCochuyt

rkingett commented 4 years ago

I would like this as well, with a toggle in settings so that we can make this work with profiles, and themes. I have to copy a lot of text, as well, and this would really help the pasting process. VoiceOver does this very well. I wouldn't want this as an add on because I'd want to use this only on certain programs.

josephsl commented 4 years ago

Hi,

Note: Clipspeak won't cut it - it only announces clipboard copy/cut/paste operation, not clipboard content.

A few questions:

  1. Can you think of other places where this feature request might be useful? Although some controls are seen as edit fields by NVDA, not all of them support paste operations (Command Prompt, for example, didn't add paste operation officially until Windows 10).
  2. What should NVDA do if something other than text is to be pasted e.g. files? This is in consideration for people doing heavy file copy/paste operations.
  3. Suppose NVDA does come with this feature. Do you want NVDA to announce all the text in the clipboard or just a part of it? It makes sense to let NVDA announce clipboard text if it is short enough, but imagine a case where people would copy and paste several thousand characters' worth of text.

Thanks.

Adriani90 commented 4 years ago

Especially for point 3, performance impact must be considered.

Von meinem iPhone gesendet

Am 21.01.2020 um 17:29 schrieb Joseph Lee notifications@github.com:

 Hi,

Note: Clipspeak won't cut it - it only announces clipboard copy/cut/paste operation, not clipboard content.

A few questions:

Can you think of other places where this feature request might be useful? Although some controls are seen as edit fields by NVDA, not all of them support paste operations (Command Prompt, for example, didn't add paste operation officially until Windows 10). What should NVDA do if something other than text is to be pasted e.g. files? This is in consideration for people doing heavy file copy/paste operations. Suppose NVDA does come with this feature. Do you want NVDA to announce all the text in the clipboard or just a part of it? It makes sense to let NVDA announce clipboard text if it is short enough, but imagine a case where people would copy and paste several thousand characters' worth of text. Thanks.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

Adriani90 commented 4 years ago

Maybe doing this in an addon would be a better option. I.e integrating this in clipspeak

Von meinem iPhone gesendet

Am 21.01.2020 um 17:42 schrieb Adriani Botez adriani.botez@gmail.com:

Especially for point 3, performance impact must be considered.

Von meinem iPhone gesendet

Am 21.01.2020 um 17:29 schrieb Joseph Lee notifications@github.com:

 Hi,

Note: Clipspeak won't cut it - it only announces clipboard copy/cut/paste operation, not clipboard content.

A few questions:

Can you think of other places where this feature request might be useful? Although some controls are seen as edit fields by NVDA, not all of them support paste operations (Command Prompt, for example, didn't add paste operation officially until Windows 10). What should NVDA do if something other than text is to be pasted e.g. files? This is in consideration for people doing heavy file copy/paste operations. Suppose NVDA does come with this feature. Do you want NVDA to announce all the text in the clipboard or just a part of it? It makes sense to let NVDA announce clipboard text if it is short enough, but imagine a case where people would copy and paste several thousand characters' worth of text. Thanks.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

rkingett commented 4 years ago

My responses to Josephs points are below.

  1. Can you think of other places where this feature request might be useful? Although some controls are seen as edit fields by NVDA, not all of them support paste operations (Command Prompt, for example, didn't add paste operation officially until Windows 10).

Could we have it to where it only works in edit fields, like text documents and text areas? I'd want this as a toggle for sure.

  1. What should NVDA do if something other than text is to be pasted e.g. files? This is in consideration for people doing heavy file copy/paste operations.

I'd say have NVDA stay silent when coppying files.

  1. Suppose NVDA does come with this feature. Do you want NVDA to announce all the text in the clipboard or just a part of it? It makes sense to let NVDA announce clipboard text if it is short enough, but imagine a case where people would copy and paste several thousand characters' worth of text.

I think having NVDA speak the first 500 characters of the pasted item would work. Although, you can always press control to stop speech. VoiceOver speaks this no matter how big the text copied is, so, we could always have it say everything and just have people do anything else to interrupt speech if they want to interrupt speech.

sine-w commented 4 years ago
  1. Can you think of other places where this feature request might be useful? Although some controls are seen as edit fields by NVDA, not all of them support paste operations (Command Prompt, for example, didn't add paste operation officially until Windows 10).

I have do something like this for my autohotkey script. I have a script to paste content from selected menu. Then I use nvdaSpeak() to trigger NVDA to report what is in the clipboard whenever I presssed ctrl v

So it doesn't matter what the target control is, whenever user pressed ctrl v, the NVDA will speak clipboard text

  1. What should NVDA do if something other than text is to be pasted e.g. files? This is in consideration for people doing heavy file copy/paste operations.

As what I pointed out in point 1. My autohotkey script detected that if ctrl v is pressed when file explorer is active, then NVDA will not speak clipboard text

So probably this function can be based on the active window, like that of the profile

  1. Suppose NVDA does come with this feature. Do you want NVDA to announce all the text in the clipboard or just a part of it? It makes sense to let NVDA announce clipboard text if it is short enough, but imagine a case where people would copy and paste several thousand characters' worth of text.

Well, I do also agree that Voiceover is doing the same very well, so speaking all the pasted text can be an option. Probably,

  1. adding an option to set max length of text to be reported, any text longer than the length will be replaced by ......
  2. Do not add this option to set max length, and user can press ctrl to stop speech
sine-w commented 4 years ago

To act as an example, I quoted part of my autohotkey script of how to let NVDA speak pasted text.

~^v:: nvdaSpeak(Clipboard) return

if I want to limit the function to certain window only, it will be like ~^v:: if WinActive("Notepad++") or WinActive("ahk_class OpusApp") { nvdaSpeak(Clipboard) } return

josephsl commented 4 years ago

Hi, your answer to point 1 is concerning to me: you can just use NVDA+C command to announce clipboard text, as Adriani pointed out. But can you truly detect that whenever you press Control+V, that: there is valid text in the clipboard, it is a good place to paste text, the control itself supports paste, and paste actually DID occur? If any of these are false (particularly, item 4), chances are that this may need further incubation in the form of an add-on until we get more solid evidence to support bringing this to NVDA Core. Thanks.

From: lstar4ever notifications@github.com Sent: Tuesday, January 21, 2020 3:31 PM To: nvaccess/nvda nvda@noreply.github.com Cc: Joseph Lee joseph.lee22590@gmail.com; Comment comment@noreply.github.com Subject: Re: [nvaccess/nvda] Adding function to speak pasted text (#10709)

  1. Can you think of other places where this feature request might be useful? Although some controls are seen as edit fields by NVDA, not all of them support paste operations (Command Prompt, for example, didn't add paste operation officially until Windows 10).

I have do something like this for my autohotkey script. I have a script to paste content from selected menu. Then I use nvdaSpeak() to trigger NVDA to report what is in the clipboard whenever I presssed ctrl v

So it doesn't matter what the target control is, whenever user pressed ctrl v, the NVDA will speak clipboard text

  1. What should NVDA do if something other than text is to be pasted e.g. files? This is in consideration for people doing heavy file copy/paste operations.

As what I pointed out in point 1. My autohotkey script detected that if ctrl v is pressed when file explorer is active, then NVDA will not speak clipboard text

So probably this function can be based on the active window, like that of the profile

  1. Suppose NVDA does come with this feature. Do you want NVDA to announce all the text in the clipboard or just a part of it? It makes sense to let NVDA announce clipboard text if it is short enough, but imagine a case where people would copy and paste several thousand characters' worth of text.

Well, I do also agree that Voiceover is doing the same very well, so speaking all the pasted text can be an option. Probably,

  1. adding an option to set max length of text to be reported, any text longer than the length will be replaced by ......
  2. Do not add this option to set max length, and user can press ctrl to stop speech

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nvaccess/nvda/issues/10709?email_source=notifications&email_token=AB4AXEBGOJQ3ACAAJZWVS4TQ66ASXA5CNFSM4KJSGGI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJRVRKY#issuecomment-576936107 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4AXEGMFJNVJZW6PYUELADQ66ASXANCNFSM4KJSGGIQ .

josephsl commented 4 years ago

Hi, window class name or executable name will work for trivial cases. But think about cases where you get a window you wish to paste something into, yet the control itself (for whatever reason) doesn’t support this operation. I believe you need to probe the control for that using Windows API. Thanks.

From: lstar4ever notifications@github.com Sent: Tuesday, January 21, 2020 3:34 PM To: nvaccess/nvda nvda@noreply.github.com Cc: Joseph Lee joseph.lee22590@gmail.com; Comment comment@noreply.github.com Subject: Re: [nvaccess/nvda] Adding function to speak pasted text (#10709)

To act as an example, I quoted part of my autohotkey script of how to let NVDA speak pasted text.

~^v:: nvdaSpeak(Clipboard) return

if I want to limit the function to certain window only, it will be like ~^v:: if WinActive("Notepad++") or WinActive("ahk_class OpusApp") { nvdaSpeak(Clipboard) } return

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nvaccess/nvda/issues/10709?email_source=notifications&email_token=AB4AXEC2MXBDN6HMQLV5IGLQ66A7JA5CNFSM4KJSGGI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJRVYPQ#issuecomment-576937022 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4AXEGA6OJPXYP2ZREDTPLQ66A7JANCNFSM4KJSGGIQ .

sine-w commented 4 years ago

Hi, your answer to point 1 is concerning to me: you can just use NVDA+C command to announce clipboard text, as Adriani pointed out. But can you truly detect that whenever you press Control+V, that: there is valid text in the clipboard, it is a good place to paste text, the control itself supports paste, and paste actually DID occur? If any of these are false (particularly, item 4), chances are that this may need further incubation in the form of an add-on until we get more solid evidence to support bringing this to NVDA Core. Thanks. From: lstar4ever notifications@github.com Sent:

Well, as far as I have used the autohotkey script. Most of the time, the text are pasted successfully at the same time speaking the clipboard text. e.g. on word, nopad ++, firefox etc

But on some situation, NVDA do speak the clipboard but no text is pasted. e.g. on lintalist, pressing ctrl v once speak clipboard not pasted, pressing the second time text is pasted. on windows file explorer, pressing ctrl v once, nvda speak the path of the pasted file but no files are pasted, pressing ctrl v the second time the files are pasted

josephsl commented 4 years ago

Hi, I see. In this case, I advise resolving your Auto Hotkey script first, and then let’s think about bringing that to an add-on. Thanks.

From: lstar4ever notifications@github.com Sent: Tuesday, January 21, 2020 5:25 PM To: nvaccess/nvda nvda@noreply.github.com Cc: Joseph Lee joseph.lee22590@gmail.com; Comment comment@noreply.github.com Subject: Re: [nvaccess/nvda] Adding function to speak pasted text (#10709)

Hi, your answer to point 1 is concerning to me: you can just use NVDA+C command to announce clipboard text, as Adriani pointed out. But can you truly detect that whenever you press Control+V, that: there is valid text in the clipboard, it is a good place to paste text, the control itself supports paste, and paste actually DID occur? If any of these are false (particularly, item 4), chances are that this may need further incubation in the form of an add-on until we get more solid evidence to support bringing this to NVDA Core. Thanks. From: lstar4ever notifications@github.com mailto:notifications@github.com Sent:

Well, as far as I have used the autohotkey script. Most of the time, the text are pasted successfully at the same time speaking the clipboard text. e.g. on word, nopad ++, firefox etc

But on some situation, NVDA do speak the clipboard but no text is pasted. e.g. on lintalist, pressing ctrl v once speak clipboard not pasted, pressing the second time text is pasted. on windows file explorer, pressing ctrl v once, nvda speak the path of the pasted file but no files are pasted, pressing ctrl v the second time the files are pasted

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nvaccess/nvda/issues/10709?email_source=notifications&email_token=AB4AXEHKRT3OIBW2YWKLVOLQ66OAHA5CNFSM4KJSGGI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJR4T2Q#issuecomment-576965098 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4AXEDW4H5GH6332WU6XELQ66OAHANCNFSM4KJSGGIQ .

sine-w commented 4 years ago

Hi, I see. In this case, I advise resolving your Auto Hotkey script first, and then let’s think about bringing that to an add-on. Thanks. From: lstar4ever notifications@github.com Sent: Tuesday,

Thanks. Yes, at the moment, I am resolving this through autohotkey script.

But because autohotkey canot configure that much, that's why I want NVDA to have this function. For example, if I allow nvdaspeak to be active on firefox, it is good that if I copy something from text file to the search box on google, it will work as expected. But if I manually copied the password from Keepass to pasted onto the page loaded by firefox, NVDA will also speak the password, and I think this is not good in the sense of security.

So At this moment I can only block the function to work in Firefox totally.

josephsl commented 4 years ago

Hi, as for password announcement, it is really up to the web element to say it expects passwords. As far as Windows sees it, it is plain text apart from when the interacting control on screen notes otherwise. Typically a screen reader should announce what is on screen as shown unless heuristics must be used (additional directions are exposed by accessibility API, the screen reader knows how to deal with similar elements, and other tweaks here and there). Nor you should rely on just one aspect of a control unless you really have to (or forced to do so) – window class name is just one property a control can expose; there are others, including name, role, state, screen position, type of control according to accessibility API’s and so on. Thanks.

From: lstar4ever notifications@github.com Sent: Tuesday, January 21, 2020 9:03 PM To: nvaccess/nvda nvda@noreply.github.com Cc: Joseph Lee joseph.lee22590@gmail.com; Comment comment@noreply.github.com Subject: Re: [nvaccess/nvda] Adding function to speak pasted text (#10709)

Hi, I see. In this case, I advise resolving your Auto Hotkey script first, and then let’s think about bringing that to an add-on. Thanks. From: lstar4ever notifications@github.com mailto:notifications@github.com Sent: Tuesday,

Thanks. Yes, at the moment, I am resolving this through autohotkey script.

But because autohotkey canot configure that much, that's why I want NVDA to have this function. For example, if I allow nvdaspeak to be active on firefox, it is good that if I copy something from text file to the search box on google, it will work as expected. But if I manually copied the password from Keepass to pasted onto the page loaded by firefox, NVDA will also speak the password, and I think this is not good in the sense of security.

So At this moment I can only block the function to work in Firefox totally.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nvaccess/nvda/issues/10709?email_source=notifications&email_token=AB4AXEBGS2A34NGAT4DBJG3Q67HOPA5CNFSM4KJSGGI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJSHJXA#issuecomment-577008860 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4AXEEBP62BUFGDZNOTGJTQ67HOPANCNFSM4KJSGGIQ .

Brian1Gaff commented 4 years ago

Sometimes just the announcement of the fact that the copy occurred was enough of course. with regard to it being read and detecting what is actually inth clipboard to make sure its right first is a hard one and has always been argued about here, siting what sighted users see. Luckily in most cases there is an undo on this.

There is of course application settings already so maybe that should be where this is invoked to avoid it being global to an unsuspecting user. Brian

bglists@blueyonder.co.uk Sent via blueyonder. Please address personal E-mail to:- briang1@blueyonder.co.uk, putting 'Brian Gaff' in the display name field. Newsgroup monitored: alt.comp.blind-users


sine-w commented 4 years ago

Sometimes just the announcement of the fact that the copy occurred was enough of course

Yes, I acknowledged that the function proposed here may not be a needed function for all NVDA users.

with regard to it being read and detecting what is actually inth clipboard to make sure its right first is a hard one and has always been argued about here, siting what sighted users see. Luckily in most cases there is an undo on this

Don't understand what you mean here.

JulienCochuyt commented 4 years ago

Just adding my grain of salt here…

I do not think NVDA should ever try to be too clever about what a particular keystroke sent to a random application will or will not do.

Example: Announcing "Copied to clipboard" when hitting control+c in any context (as regularly requested and still occurring on virtual buffer documents) while in fact this same key stroke might mean "Cancel" in some context, or some other command.

The same logic applies to control+v as well: We for sure are all used to expect a paste operation in many contexts, but surely not all of them. My humble opinion is that we should never provide a best-guess announce while in fact we have no idea about what's going on. The lack of an announce is surely better than a misleading one or worse one that is sometimes right and sometimes wrong.

My stance is that we should never try to read what is in the clipboard except when specifically requested to do so (NVDA+c).

Even when pasting in some text input - eg. a mask-formatted text field - the result of the paste operation might differ from what was in the clipboard.

Hence, I think NVDA should only announce what really changed in the text field, not what it tries to guess might have been inserted.

Regarding whether we should truncate the announce to some reasonable length: Doesn't the recent speech refactor come in handy? I mean, doesn't it now better handle large contents, making them more easily interruptible?

Adriani90 commented 3 months ago

My proposal is as follows:

  1. After press ctrl+v, and assuming the control supports text selection, make NVDA select the text pasted into the edit control automatically
  2. Announce the selected text automatically after it is pasted.

In case of pasted files, select the pasted files automatically after ctrl+v is pressed, and announce selected file names (e.g. in Windows Explorer). This is actually what Voice over does.

If the region where ctrl+v is pressed doesn't support selection, maintain current behavior, and don't select and don't announce anything.

josephsl commented 3 months ago

Hi, what if people press Windows+V instead of Control+V? Wouldn’t selecting text cause visual highlight, and is this the actual experience of visual users? Thanks.

Adriani90 commented 3 months ago

I guess the automatic selection after paste is the standard way for sighted people as well on Mac OS and IOS, but not sure whether text is selected automatically in Windows.I think we need some input from a sighted person on this.Von meinem iPhone gesendetAm 01.07.2024 um 21:54 schrieb Joseph Lee @.***>: Hi, what if people press Windows+V instead of Control+V? Wouldn’t selecting text cause visual highlight, and is this the actual experience of visual users? Thanks.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you modified the open/close state.Message ID: @.***>

ruifontes commented 2 months ago

Hello! ClipSpeak can announce the text pasted as well the name, or number, of files pasted. Regarding selecting pasted text that is not a Windows feature. Files pasted are selected.