-
-
Notifications
You must be signed in to change notification settings - Fork 636
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
Makes the timeout for multiple keypress configurable #12049
Conversation
Cc @josephsl, maybe you would have any advice on how to investigate the wx.SpinCtrlDouble issue given #8517 (comment) ? |
See test results for failed build of commit 4ca7f331f9 |
Hi @seanbudd Also @josephsl, please comment here, especially if you have already tested this component as you write in #8517 (comment); if you just did not test it, please also let us know. |
Hi @CyrilleB79 Thanks for the welcome! I can do an investigation - it might take sometime. There's been a fair few WxPython issues raised in response to the latest release (which we recently incorporated into master with python3.8). Just to get started I found this ancient ticket on WxWidgets that seems related http://trac.wxwidgets.org/ticket/12004. The bug might be fixed by merging the new master with python3.8 into your branch - but this might also introduce some other Wx issues. |
Confirmed that this is still broken on the latest WxPython and I've opened a ticket here, http://trac.wxwidgets.org/ticket/19102 |
I don't think http://trac.wxwidgets.org/ticket/19102 describes the actual problem that @CyrilleB79 mentioned in the PR description. Labels are by design not reachable in the tab order so this is expected. In this particular case text is not associated with the text control because AFAIK MSAA considers only text which is directly to the left of the control as its label. In case of WX's spin control this assumption does not hold as it is contained in the additional, unnamed, window. This can be easily confirmed by turning 'simple review mode' off an inspecting hierarchy with the object nav. I've tested the example and it works as expected in WXPython 2.9.1 which I'm using for a different project so this appears to be a regression on the WX Vidgets side. As to how to fix this I propose to annotate the control using |
Ah that makes a lot more sense, I've closed that ticket then. |
@CyrilleB79 Have you had time to investigate the approach that I've proposed in this comment? There is no rush obviously I'm just curious if my idea works :-) |
5be1b29
to
b0c557e
Compare
Thanks @lukaszgo1 for your first comment and your reminder. I do not have a good knowledge of accessibility APIs (specifically MSAA here) and thus, I left a bit this PR aside. Today I have upmerged from master branch. I have also removed the code for spin control value selection when it is focused since this seems to be automatic now. And I have made some tries to have the component named, but without success. Let me add my reactions to what you wrote:
Strangely, inspecting the hierarchy with object nav,
Is there already a ticket for this issue? If not, would you accept to open it? You have the ideas much clearer than I on this topic and on the accessibility API more generally.
Regarding Regarding the control annotation, I have understood that we should now use wx.Accessible to annotate controls rather than In either case I do not know how to implement the solution, either the one proposed by you @lukaszgo1 or the one indicated in PR #12215 change log:
I have tried to implement wx.Accessible but I can only make it apply to the container window, not to the edit field.
@LeonarddeR do you have any advice? |
source/gui/nvdaControls.py
Outdated
@@ -68,22 +68,6 @@ def sendListItemFocusedEvent(self, index): | |||
evt.Index = index | |||
self.ProcessEvent(evt) | |||
|
|||
class SelectOnFocusSpinCtrl(wx.SpinCtrl): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless you expect this to be merged before 2021.1 this class should stay since some add-ons may rely on it (certainly one of mine does). Since we don't know if selecting content of spin controls by default was a deliberate decision on the WX Vidgets side it would be good to have a system test ensuring that this behaviour persists when we update wxPython. My preference would be for both removal of this class and eventual automated test to happen in a separate pr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless you expect this to be merged before 2021.1 this class should stay since some add-ons may rely on it (certainly one of mine does). Since we don't know if selecting content of spin controls by default was a deliberate decision on the WX Vidgets side it would be good to have a system test ensuring that this behaviour persists when we update wxPython. My preference would be for both removal of this class and eventual automated test to happen in a separate pr.
Good point. Thanks. When the remaining issue of this PR will be solved, I will:
- either add an additional note about deprecation in the change log if this PR can still be included in 2021.1
- or revert the commit that removed the auto-select component if this PR may not be merged in 2021.1 anymore
I'll need to check if this also occurs in the wx Vidgets itself and probably create a C++ sample demonstrating the problem;. I'll try to set some time aside for this in the coming days.
I've attempted to associate |
Thanks @lukaszgo1 for your comments, your help and your investigations.
Thanks a lot!
How do you get the first child of this window and how do you know it is the edit field? (just for my information) |
I now understand why the correct name is not returned even if the
I've just printed |
I've reported this against wx at: wxWidgets/wxWidgets#19222 |
@seanbudd, you have just added the blocked/needs-external-fix label. Rather than waiting for wx to find a solution to make
What do you and all think of these suggestions? |
I would think a selection list of quarter second values up to three seconds, and
then 5, 10, 15, 20, 25, and 30 seconds options, would be far more than
sufficient for this.
I would like to experience the (incorrect) wxSpinCtrlDouble behavior. Can you
prompt a try build for this PR? From the description alone, it is hard to
understand why the issue is so significant as to be blocking. If it is just the
absence of a label, could not a separate static text control be provided first
to explain the data entry? But I suspect I'm misunderstanding it, which is why
I'd like to observe it.
|
@XLTechie, I have pushed an empty commit to re-trigger an appVeyor build. |
@XLTechie, here is a second attempt to generate a new build. I have merged with updated master branch. Hope that the build can be generated now. |
@CyrilleB79 - Now that I have had a chance to write this issue up, I would consider this feature blocked by #13915 rather than wxWidgets/wxWidgets#19222. |
Upon later reflection, perhaps this shouldn't be blocked by #13915. Use-cases which require a separate option may not have been fully considered as there is a difference between this feature, and the general concept of "idle speech". I would still consider it a "nice to have" to get the option in #13915 first, so we can test if it is appropriate to use the same setting for this PR. |
source/gui/settingsDialogs.py
Outdated
@@ -1977,6 +1977,24 @@ def makeSettings(self, settingsSizer): | |||
self.bindHelpEvent("KeyboardSettingsHandleKeys", self.handleInjectedKeysCheckBox) | |||
self.handleInjectedKeysCheckBox.SetValue(config.conf["keyboard"]["handleInjectedKeys"]) | |||
|
|||
minDelay = int( | |||
config.conf.getConfigValidation(("keyboard", "maxRepeatedKeyPressDelay")).kwargs["min"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here (and in other places). Even if the rest of it stays the same, I would recommend "timeout" over "delay".
Co-authored-by: Luke Davis <8139760+XLTechie@users.noreply.github.com>
@XLTechie your review is totally relevant and very appreciated. Many thanks! For example regarding "delay" vs "timeout": the initial issue was mentioning "delay" and I have taken this word as is. In my native language (French), there is no single word for "timeout", and "delay" and "timeout" are translated more or less the same. Though, the meaning of these two words is clearly different and after your suggestion, it was clear for me that the most (or even only) suitable word was "timeout". |
See test results for failed build of commit 6ff923382b |
Thanks @CyrilleB79. I'll review again, if you're done making changes. |
Yes, you can review again, I'm done. |
Co-authored-by: Luke Davis <8139760+XLTechie@users.noreply.github.com>
source/scriptHandler.py
Outdated
] and scriptFunc == lastScriptRef: | ||
if ( | ||
(scriptTime - _lastScriptTime) * 1000 <= config.conf["keyboard"]["multiPressTimeout"] | ||
and scriptFunc == lastScriptRef |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CyrilleB79 you asked what I meant about "preferred linting" or some such phrase I used. I meant, NVDA's preferred coding style.
Specifically, we used to have a rule, that conditionals should start new and
/or
clauses on new lines.
However, I checked codingStandards.md
, and this rule is no longer extant.
Don't know why it was removed, unless it's in some other file, but it probably happened in the recent docs re-org. @seanbudd did I miss that we stopped caring about this, or is it somewhere else?
See test results for failed build of commit d009a72d1d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts on documentation and linting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts on documentation and linting
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
Also taking this suggestion (oversight). Co-authored-by: Sean Budd <seanbudd123@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs read well, this will be a good chance, thank you
Fix-up of #12049 Summary of the issue: When implementing multi keypress timeout in #12049, the timeout for double press of NVDA key (to execute native function) was not honoured. Description of user facing changes Multiple key press timeout will now be honoured also for double press of NVDA key. Description of development approach Replace the hard-coded value 0.5 with the config value.
Link to issue number:
Fixes #11929.
Summary of the issue:
Some NVDA keystrokes can perform various commands according to the number of times the keystrokes is executed. E.g. NVDA+Numpad2 reports the current character under the review cursor with one key press. But a double key press reports the character description. And a tripe key press reports the character code.
Currently, double or triple key press should executed quite quickly to be considered a multiple key press: a maximum of 0.5 s is required between two key presses.
This may be difficult or even impossible for some people having physical disabilities and/or using sticky keys.
Description of user facing changes
This PR adds an option in the keyboard settings panel to allow to configure the timeout for multiple keypress.
Description of development approach
Added a value in ms in the GUI and in the config spec.
In this PR, a first attempt was made with a value in seconds, but it was blocked by an external issue wxWidgets/wxWidgets#19222
Testing strategy:
Manual tests:
Known issues with pull request:
None
Code Review Checklist:
Summary by CodeRabbit
New Features
Documentation
Bug Fixes