Touch interaction: allow users to disable touch support completely#10557
Conversation
|
Hi, This will be considered "draft" while NVDA 2019.3 is under development; once stable version is released, draft status will be removed. IN the meantime, comments (including design comments) are appreciated. Thanks. |
LeonarddeR
left a comment
There was a problem hiding this comment.
Could you please change the touch panel to guiHelper while at it?
|
|
||
| def touchSupported(): | ||
|
|
||
| def touchSupported(debugLog=False): |
There was a problem hiding this comment.
| def touchSupported(debugLog=False): | |
| def touchSupported(debugLog: bool = False): |
|
|
||
| def initialize(): | ||
|
|
||
| def setTouchSupport(enable): |
There was a problem hiding this comment.
| def setTouchSupport(enable): | |
| def setTouchSupport(enable: bool): |
|
Hi, I don’t think we execute profile switch handlers when settings are saved – I borrowed this logic from Speech category/audio ducking. Thanks.
|
| ==== Enable touch interaction support ====[TouchSupportEnable] | ||
| This checkbox enables NVDA's touch interaction support. | ||
| If enabled, you can use your fingers to navigate and interact with items on screen using a touchscreen device. | ||
| If disabled, touchscreen support from NVDA will be disabled. |
There was a problem hiding this comment.
What does this mean?
| If disabled, touchscreen support from NVDA will be disabled. | |
| If disabled, touchscreen support from NVDA will be disabled, making the touch screen behave as normal. |
|
Hi, I had difficulty when writing that sentence, and the suggestion above confirms my thought that we need to clarify a bit. Thanks for pointing this out.
|
|
Hi, Now that 2019.3 is under translatable string freeze, and with 2020.1 changelog showing, I'd like to get this PR reviewed again. Thanks. |
Foundation: allow users to disable touch handler overlay by adding 'touch enabled' key to NVDA settings.
…rt should be used. Re nvaccess#9682
…. re nvaccess#9682. Enable touch support if configured to do so via settings. Also, change log text on touchscreen detection to just announce how many touch points are available before proceeding to enable/disable touch support.
Allow users to enable/disable touch support via Touch Interaction settings panel.
…be seen unless requested. Re nvaccess#9682.
…touch mode setter function. Re nvaccess#9682. Similar to audio ducking support: use a dedicated 'set touch support' function to enable/disable touch handler thread based on whether touch support should be anbeld or not. This function in turn will be called when configuration profile changes to support scenarios such as manually turning off touch support or using profiles for apps where NVDA's own touch support should be turned off.
… switching support. Re nvaccess#9682. Touch handler's initialize function will set appropriate touch support mode based on current config value. Also, both initialize and termiante methods support profile switching by calling register/unregister function, respectively.
…nction to toggle touch handler thread. Re nvaccess#9682.
…9682. Reviewed by Leonard de Ruijter: add type annotations, along with docstring for touch supported function.
Comment from Leonard de Ruijter: convert touch interaction panel to use GUI helper code just like other panels.
4df35f1 to
ec3061b
Compare
|
Hi, Suspended until further notice in light of #11006. Thanks. |
Please continue to work on this PR. #11006 requests no new PR's. This PR already exists and is thus in the backlog of PR's that we want to address before accepting new ones. We are trying to stop PR's from going stale, and then becoming hard to merge. Forgive me for replying to you multiple times, I want to avoid the community being mislead. |
|
I’ll take a look at this PR as early as Thursday.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@josephsl, thanks for taking care of this. The lack of this feature has been annoying me quite a lot lately. My few grains of salt on this topic...
|
|
Hi, Suspending touch support for passthrough command: not easy. In order to do so, NVDA must be able to detect that touch interaction has occurred after it is suspended. This isn't quite possible because once an assistive technology registers for touch interaction, it won't let go unless it voluntarily gives up, and manual work is involved to bring touch support back online. Also, if multiple assistive technologies wants to work with touch interaction, only one will get a chance to do it (when it starts, Narrator presents a dialog about this when NVDA is running on a touchscreen computer). Command to toggle touch support: although it makes sense, it isn't consistent. One can assign a keyboard or a braille command to toggle touch interaction. One can turn off touch interaction using touch gestures, but you can't bring it back with touch gestures as NVDA doesn't know if a gesture has occurred (same problem as above). UIA/IA2 and touch support: probably not unless I read the documentation wrong. As for Windows Magnifier window: one way to enhance this in the future is letting app modules or overlay classes define if touch interaction should be turned off. This is already possible with this PR through app-specific profiles, which users must specify manually. Thanks. |
|
@josephsl wrote:
Letting other ATs aside, do you mean there is no such mechanism as sending a touch gesture we received back to the control that would have received it if NVDA did not register?
Idem, I feel that inconsistency here is better than inability, especially if we cannot achieve a "next touch gesture pass through" command.
Glad to read this. We for sure can take the time once this PR is merged to experiment with such a profile before deciding if it's worth being promoted as a default. |
|
Hi, Once an AT unregisters itself from getting touch gestures, it isn't possible to listen to touch gestures. This is because an invisible iwndow is used by the AT to listen to touch interaction signals, and suspending touch means destroying that window. As for toggle command: I imagine a scenario where people would prefer to use touchscreen alone rather than using a keyboard along with the device (Surface Pro without type cover, for example). Thanks. |
Sure, but again, do you mean we cannot send back what we don't want to keep (as keyboard handler does)?
While this scenario makes sense, it's no reason IMHO to disallow altogether binding a keyboard gesture to do the toggling. |
|
Hi, no, we can’t do that with touchscreen gestures at this time, as the window itself isn’t going to be used. In short, Windows will forget that an AT is active. As for toggle command bindings, it might be possible to do that at least for keyboards – it is something we should think about for a future iteration of this PR. Thanks.
|
…onfigurableTouchOverlay
|
@JulienCochuyt You bring up all good points, but these should be all handled in one or more separate PRs. Not only are they a little complex and will be somewhat technically unrelated to how this is currently implemented. By itself this current PR still has a clear use case. There are certainly low vision users who use NVDA to read text along with a magnifier, but have enough vision to interact with their touch screen independently and do not want NVDA ever intercepting touch. So @josephsl assuming this passes review, I want to take this as soon as we can. |
|
@josephsl just confirming that you have tested config profile switches where one profile has touch enabled and one does not? I.e. touch successfully gets re-enabled after being disabled by a previous profile? |
|
Hi, glad to contribute another feature from Enhanced Touch Gestures to NVDA Core – thanks.
|
|
Hi, yes, tested via Enhanced Touch Gestures add-on, which has identical construction. Thanks.
|
|
Hi, forgot to say that profile switching does work. Thanks.
|
|
@LeonarddeR Are there any pending changes you are waiting for on this pr? |
LeonarddeR
left a comment
There was a problem hiding this comment.
If a sighted person can confirm that the gui looks good (though I don't have reason to think it wouldn't), I'm ok with this. Just one small thing.
| return False | ||
| if (winVersion.winVersion.major*10+winVersion.winVersion.minor)<62: | ||
| log.debugWarning("Touch only supported on Windows 8 and higher") | ||
| if winVersion.winVersion.platform_version < (6, 2, 9200): |
There was a problem hiding this comment.
Is it really necessary to take the platform into account here?
| if winVersion.winVersion.platform_version < (6, 2, 9200): | |
| if (winVersion.winVersion.major, winVersion.winVersion.minor) < (6, 2): |
|
Hi, the platform attribute gives us all the info we need in one function call, and it is also used for app module version lookup. Thanks.
|
Follow-up of #10557 Default binding: NVDA+control+alt+t
Link to issue number:
Fixes #9682
Summary of the issue:
Allow users to turn off touch support completely.
Description of how this pull request fixes the issue:
Added a checkbox (and a corresponding flag in NVDA configuration database) that disables touch support completely. If disabled, touchscreen will behave as though NVDA is not running. Also, added support for touch being disabled on per-profile basis i.e. touch can be disabled if an app comes with its own touch interaction model.
Testing performed:
Tested via try builds on a laptop with touch capabilities.
Known issues with pull request:
None so far.
Change log entry:
Changes (although this can go as a new feature):
You can now enable or disable NVDA's touchscreen support. This is done by checking a new checkbox in Touch Interaction panel of NVDA settings. (#9682)
Thanks.