Replies: 3 comments
|
I've discovered how changes to touchpad gestures can be applied immediately. The explorer has an internal cache for some settings, possibly to avoid reading from the registry every time. When the user changes a setting via the Settings UI, Settings will inform the explorer about this change, via an undocumented COM interface The problem is that this interface is internal and undocumented, so it could be changed in future Windows versions. However, since its introduction in the first version of Windows 10 (Windows 10 1511), this interface hasn't been changed until today's Windows 11 25H2, so it's still somewhat stable. Here's the C++ definition for the undocumented interface: MIDL_INTERFACE("4214f6fa-eb36-4e2f-9ca2-23fdc1832df7")
IImmersiveSettingsCache : public IUnknown
{
STDMETHOD(OnSettingChanged)(SETTING_IDENTIFIER) = 0;
STDMETHOD(GetBOOL)(SETTING_IDENTIFIER, LPBOOL) = 0;
STDMETHOD(GetDWORD)(SETTING_IDENTIFIER, LPDWORD) = 0;
STDMETHOD(RegisterForSettingChange)(/* IImmersiveSettingsCacheNotification* */ LPUNKNOWN, LPDWORD) = 0;
STDMETHOD(UnregisterForSettingChange)(DWORD) = 0;
};In order to get a
Although the interface itself is quite stable across those versions, the setting identifiers are not. Since it's an internal enum, Microsoft is free to reassign the IDs once new settings are introduced, and the IDs of touchpad gesture settings may change. Following is a table of the ID of some touchpad gesture settings across different Windows versions.
So in order to be somewhat futureproof, we might need to broadcast change notifications on a larger range of setting IDs. Although a lot of IDs are for unrelated settings, since this only triggers cache reload from registry, it shouldn't have serious side effects. Unfortunately, we can't know whether the explorer actually recognizes a specific setting ID, from the return value of I know that using undocumented APIs should be avoided, but as for now, this is the only way that can disable the built-in touchpad gestures immediately, without requiring an explorer restart. What's your thought on this, and on the other questions above? @seanbudd @SaschaCowley |
|
Hello, I would be very grateful if NV Access could respond to my questions below. |
|
We're not yet happy with the implementations suggested. We will work with Microsoft to establish a stable API. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
It's from the comment here: #3358 (comment)
To make it easier to track, I opened a discussion here. It's about my touchpad gesture implementation in PR #19823.
Touchpad exploring area
Touchpads are much smaller than the screen, so the exploring area needs to be smaller, too. So what should the touchpad area be mapped to?
We can also include all of them and provide a way to switch between them, but then we'll still need to decide which one is the default, and for users there's one more status to keep track of.
Touchpad gesture conflicts
Windows will enable built-in touchpad gestures by default when there is a precision touchpad present. NVDA can receive the raw interaction data from touchpad devices to recognize touchpad gestures, but this won't prevent the gestures from sending to the system, and the same gesture may be recognized by both NVDA and the system, causing gesture conflicts.
Unfortunately, due to system API limitation, NVDA can neither intercept touchpad gestures completely, nor change the system touchpad gesture settings on user's behalf, due to system API limitation.
There is a registry key
HKLM\Software\Microsoft\Windows\CurrentVersion\PrecisionTouchpad, and changing the touchpad settings will affect the registry values, but changing the registry values won't affect the touchpad settings until explorer restarts.On Windows 11 24H2 or later, you can call
SystemParametersInfoWwithSPI_SETTOUCHPADPARAMETERSto change some of the touchpad gestures programmatically, but three-finger and four-finger gesture settings are still out of reach.So to change all the system gesture settings, we have the following options:
IImmersiveSettingsCache. See comment.Additionally, there are still some cases to be considered.
More advanced touchpad gestures
Currently, only taps and simple swipes are supported by the NVDA touch tracker.
The author of #19414 planned to implement more gestures, such as pinching/spreading, rotation, edge gestures, and multi-part gestures, which is great, and can benefit touchpad gestures as well, since they share the same touch tracker. Maybe we can consider merging some touchpad and touchscreen infrastructures into one base class/module later.
Compared to touchscreens, touchpads are near the keyboard, so it's also convenient to combine modifier keys with touchpad gestures, since users can press the key with one hand and perform gestures with the other hand, and this can add more layers to simple touchpad gestures.
So my question: Is it possible, or how difficult it would be, to implement modifier keys plus touchpad gestures, in the current NVDA architecture?
Also, touchpads can be pressed or clicked, which is treated as a mouse button, and this can be used as additional available gestures as well. But since many touchpads on Windows PCs are not easy to press, or can only be pressed at the bottom, I'm not sure whether it's worthy to implement this.
Default touchpad gestures
As for now, I copied the default touchscreen gestures to be the default touchpad gestures, which is not necessarily the most suitable for touchpads. But there aren't many gesture solutions I can study from, especially for touchpad gestures.
Should I keep the default touchpad gestures aligned with the NVDA touchscreen gestures, or should I learn from VoiceOver and use a set of gestures more similar to VoiceOver's gestures?
How to enable touchpad gestures
macOS VoiceOver allows enabling touchpad gestures with the VoiceOver modifier key plus a specific touchpad gesture. In order to use touchpad gestures to enable touchpad gestures, gesture recognition must be run when touchpad gestures are disabled.
Should we try this?
Or we can also use a traditional keyboard gesture to enable touchpad gestures. I've currently set it to
NVDA+Ctrl+Alt+P.All reactions