Skip to content

Touch interaction: allow users to disable touch support completely#10557

Merged
michaelDCurran merged 16 commits into
nvaccess:masterfrom
josephsl:i9682configurableTouchOverlay
Jun 23, 2020
Merged

Touch interaction: allow users to disable touch support completely#10557
michaelDCurran merged 16 commits into
nvaccess:masterfrom
josephsl:i9682configurableTouchOverlay

Conversation

@josephsl

Copy link
Copy Markdown
Contributor

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.

@josephsl josephsl self-assigned this Nov 28, 2019
@josephsl

Copy link
Copy Markdown
Contributor Author

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 LeonarddeR left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please change the touch panel to guiHelper while at it?

Comment thread source/touchHandler.py Outdated

def touchSupported():

def touchSupported(debugLog=False):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def touchSupported(debugLog=False):
def touchSupported(debugLog: bool = False):

Comment thread source/touchHandler.py
Comment thread source/touchHandler.py
Comment thread source/touchHandler.py Outdated

def initialize():

def setTouchSupport(enable):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def setTouchSupport(enable):
def setTouchSupport(enable: bool):

@josephsl

josephsl commented Nov 28, 2019 via email

Copy link
Copy Markdown
Contributor Author

Comment thread user_docs/en/userGuide.t2t Outdated
==== 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean?

Suggested change
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.

@josephsl

josephsl commented Nov 29, 2019 via email

Copy link
Copy Markdown
Contributor Author

@josephsl

Copy link
Copy Markdown
Contributor Author

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.

@josephsl josephsl marked this pull request as ready for review January 21, 2020 04:30
Foundation: allow users to disable touch handler overlay by adding 'touch enabled' key to NVDA settings.
…. 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.
…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.
…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.
@josephsl josephsl force-pushed the i9682configurableTouchOverlay branch from 4df35f1 to ec3061b Compare February 13, 2020 06:19
@josephsl

Copy link
Copy Markdown
Contributor Author

Hi,

Suspended until further notice in light of #11006.

Thanks.

@feerrenrut

Copy link
Copy Markdown
Contributor

Suspended until further notice in light of #11006.

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.

@josephsl

josephsl commented Apr 15, 2020 via email

Copy link
Copy Markdown
Contributor Author

@dpy013

This comment has been minimized.

@josephsl

This comment has been minimized.

@JulienCochuyt

Copy link
Copy Markdown
Contributor

@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...

  • Would you please consider allowing to bind a gesture on toggling touch screen support on and off?
  • Shouldn't we consider to temporarily disable touch screen support when pressing NVDA+F2? If not, any suitable mean of letting a touch gesture through would be really handy.
  • Does UIA or IA2 expose the fact that a given control should have touch gestures not intercepted by AT? (such as found on touch musical instruments in IOS) If so, we should most likely plan on honoring it.
  • Should we consider shipping a default profile for Windows Touch Magnifier window to disable touch support when interacting with it?

@josephsl

josephsl commented May 2, 2020

Copy link
Copy Markdown
Contributor Author

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.

@JulienCochuyt

Copy link
Copy Markdown
Contributor

@josephsl wrote:

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.

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?
If so, I think my behavior of choice would be to (at least optionally) suspend touch handling until the next keystroke, to allow for keyboard+touch usages.

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).

Idem, I feel that inconsistency here is better than inability, especially if we cannot achieve a "next touch gesture pass through" command.

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.

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.

@josephsl

josephsl commented May 2, 2020

Copy link
Copy Markdown
Contributor Author

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.

@JulienCochuyt

Copy link
Copy Markdown
Contributor

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.

Sure, but again, do you mean we cannot send back what we don't want to keep (as keyboard handler does)?

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).

While this scenario makes sense, it's no reason IMHO to disallow altogether binding a keyboard gesture to do the toggling.

@josephsl

josephsl commented May 2, 2020 via email

Copy link
Copy Markdown
Contributor Author

@michaelDCurran

Copy link
Copy Markdown
Member

@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.

@michaelDCurran

Copy link
Copy Markdown
Member

@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?

@josephsl

josephsl commented Jun 23, 2020 via email

Copy link
Copy Markdown
Contributor Author

@josephsl

josephsl commented Jun 23, 2020 via email

Copy link
Copy Markdown
Contributor Author

@josephsl

josephsl commented Jun 23, 2020 via email

Copy link
Copy Markdown
Contributor Author

@michaelDCurran

Copy link
Copy Markdown
Member

@LeonarddeR Are there any pending changes you are waiting for on this pr?

@LeonarddeR LeonarddeR left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread source/touchHandler.py
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):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really necessary to take the platform into account here?

Suggested change
if winVersion.winVersion.platform_version < (6, 2, 9200):
if (winVersion.winVersion.major, winVersion.winVersion.minor) < (6, 2):

@josephsl

josephsl commented Jun 23, 2020 via email

Copy link
Copy Markdown
Contributor Author

@michaelDCurran michaelDCurran merged commit 38743ad into nvaccess:master Jun 23, 2020
@nvaccessAuto nvaccessAuto added this to the 2020.2 milestone Jun 23, 2020
michaelDCurran added a commit that referenced this pull request Jun 23, 2020
@michaelDCurran michaelDCurran modified the milestones: 2020.2, 2020.3 Jun 23, 2020
@josephsl josephsl deleted the i9682configurableTouchOverlay branch June 24, 2020 06:39
feerrenrut pushed a commit that referenced this pull request Jun 30, 2020
Follow-up of #10557

Default binding: NVDA+control+alt+t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to prevent NVDA to overwrite touchscreen configurations on Windows

7 participants