macOS: touch input fails to work on a Wacom Intuos Pro tablet #86223

Open
opened 2021-03-03 03:55:42 +01:00 by Corbin Dunn · 9 comments

System Information
Operating system: macOS 11.1 Big Sur build 20C69
Graphics card: n/a

Blender Version
Broken: Top of tree git pull from today
Worked: probably never since 2.8

Short description of error
Wacom Intuos Pro tablets support touch in addition to pen entry. When using touch, two fingers will scroll up and down. In Blender, two finger touch should work like an Apple touch pad or Apple magic mouse: two finger movement will orbit the view; holding down command zooms, holding down shift pans. Instead, it simply does nothing.

Exact steps for others to reproduce the error
Blender.app, default cube. Place two fingers down on a Wacom Intuos Pro tablet and move them around; it should orbit, but nothing happens. Well, the bottom status bar flickers back and forth as though command/shift or alt is pressed.

There are two reasons why this happens.

  1. Blender has incorrect Cocoa/AppKit code. I worked on AppKit for ~13 years at Apple. Below is a diff that addresses some of the issues. The code attempts to keep track of m_multiTouchScroll, but this isn't needed. It should key off of hasPreciseScrollingDeltas instead. I tested this diff with: Apple Magic Mouse, old school Apple scroll wheel mouse, Wacom tablet; all things work the same (except Wacom, which has the bug I'm reporting fixed). There is also a comment about intuos5, but that seems to be incorrect and outdated, but I don't have an Intuos 5 to test with.

0001-Fix-scrolling-with-wacom-tablets-using-them-as-a-tou.patch

  1. Wacom's tablet touch drivers do link-checked behavior based on the bundle identifier "org.blenderfoundation.blender". In other words: they change the touch behavior when they see the target application is Blender. Wacom needs to fix this, but I'm not sure how to log a bug report for them.

To prove this, I created the sample application:

TabletTest.zip

The sample application has the blender bundle identifier set, as seen in this screen shot:

Screen Shot 2021-03-02 at 6.48.31 PM.png

In ViewTest.m I log the flagsChanged:

{
NSLog(@"%@", event);
}

If you run the app and do a two finger scroll in the window you will see some flagsChanged logged, which is very strange because Shift/Alt/Cmd have not been pressed! Wacom is faking them for some reason, and changing the scrolling data, which messes up Blender.

Change the applications's bundle identifier to "org.blenderfoundationXX.blender" (you can simply edit the info.plist) and run it again; it will then behave correctly.

I don't know how to fix item 2 for Blender; I'm fixing it in my own build of Blender by changing the bundle identifier to org.blenderfoundation.bl3nder after it is built. I looked into identifying the events, and I can could identify the source as coming from the wacom driver but I can't fix them.

I'm trying to find a contact at Wacom to have them fix this, but once it is fixed we still need item 1 fixed.

**System Information** Operating system: macOS 11.1 Big Sur build 20C69 Graphics card: n/a **Blender Version** Broken: Top of tree git pull from today Worked: probably never since 2.8 **Short description of error** Wacom Intuos Pro tablets support touch in addition to pen entry. When using touch, two fingers will scroll up and down. In Blender, two finger touch should work like an Apple touch pad or Apple magic mouse: two finger movement will orbit the view; holding down command zooms, holding down shift pans. Instead, it simply does nothing. **Exact steps for others to reproduce the error** Blender.app, default cube. Place two fingers down on a Wacom Intuos Pro tablet and move them around; it should orbit, but nothing happens. Well, the bottom status bar flickers back and forth as though command/shift or alt is pressed. There are two reasons why this happens. 1. Blender has incorrect Cocoa/AppKit code. I worked on AppKit for ~13 years at Apple. Below is a diff that addresses some of the issues. The code attempts to keep track of m_multiTouchScroll, but this isn't needed. It should key off of hasPreciseScrollingDeltas instead. I tested this diff with: Apple Magic Mouse, old school Apple scroll wheel mouse, Wacom tablet; all things work the same (except Wacom, which has the bug I'm reporting fixed). There is also a comment about intuos5, but that seems to be incorrect and outdated, but I don't have an Intuos 5 to test with. [0001-Fix-scrolling-with-wacom-tablets-using-them-as-a-tou.patch](https://archive.blender.org/developer/F9861683/0001-Fix-scrolling-with-wacom-tablets-using-them-as-a-tou.patch) 2. Wacom's tablet touch drivers do link-checked behavior based on the bundle identifier "org.blenderfoundation.blender". In other words: they change the touch behavior when they see the target application is Blender. Wacom needs to fix this, but I'm not sure how to log a bug report for them. To prove this, I created the sample application: [TabletTest.zip](https://archive.blender.org/developer/F9861693/TabletTest.zip) The sample application has the blender bundle identifier set, as seen in this screen shot: ![Screen Shot 2021-03-02 at 6.48.31 PM.png](https://archive.blender.org/developer/F9861701/Screen_Shot_2021-03-02_at_6.48.31_PM.png) In ViewTest.m I log the flagsChanged: ``` - (void)flagsChanged:(NSEvent *)event ``` { NSLog(@"%@", event); } ``` ``` If you run the app and do a two finger scroll in the window you will see some flagsChanged logged, which is very strange because Shift/Alt/Cmd have not been pressed! Wacom is faking them for some reason, and changing the scrolling data, which messes up Blender. Change the applications's bundle identifier to "org.blenderfoundationXX.blender" (you can simply edit the info.plist) and run it again; it will then behave correctly. I don't know how to fix item 2 for Blender; I'm fixing it in my own build of Blender by changing the bundle identifier to org.blenderfoundation.bl3nder after it is built. I looked into identifying the events, and I can could identify the source as coming from the wacom driver but I can't fix them. I'm trying to find a contact at Wacom to have them fix this, but once it is fixed we still need item 1 fixed.
Author

Added subscriber: @corbindunn

Added subscriber: @corbindunn
Author

Sorry...learning how to format stuff.

Sorry...learning how to format stuff.

@corbindunn - One note, some of the regular computer mice have hasPreciseScrollingDeltas see D8797 for details.

@corbindunn - One note, some of the regular computer mice have `hasPreciseScrollingDeltas` see [D8797](https://archive.blender.org/developer/D8797) for details.
Author

In #86223#1123198, @jenkm wrote:
@corbindunn - One note, some of the regular computer mice have hasPreciseScrollingDeltas see D8797 for details.

Interesting! Is that really an issue? It seems strange to treat them differently, right? It looks like D8797 is very similar to what I was fixing.

Apple's intention with hasPreciseScrollingDeltas was for people to scrollDeltaX/Y, but multiply it by the line height or row height (ie: it was more discrete and not pixel based). I helped review this API back when it was introduced back in macOS 10.7.

> In #86223#1123198, @jenkm wrote: > @corbindunn - One note, some of the regular computer mice have `hasPreciseScrollingDeltas` see [D8797](https://archive.blender.org/developer/D8797) for details. Interesting! Is that really an issue? It seems strange to treat them differently, right? It looks like [D8797](https://archive.blender.org/developer/D8797) is very similar to what I was fixing. Apple's intention with hasPreciseScrollingDeltas was for people to scrollDeltaX/Y, but multiply it by the line height or row height (ie: it was more discrete and not pixel based). I helped review this API back when it was introduced back in macOS 10.7.

The hasPreciseScrollingDeltas has been used earlier and there was a issue that mouse scrolling is recognized as a touch event 6451c072ce.
There is a whole "History" of related changes in my D8797.

The `hasPreciseScrollingDeltas` has been used earlier and there was a issue that mouse scrolling is recognized as a touch event 6451c072ce. There is a whole "History" of related changes in my [D8797](https://archive.blender.org/developer/D8797).
Author

Thanks; I read the report and history. It looks like "Logitech Performance MX mouse" is sending hasPreciseScrollingDeltas too. There is no way to differentiate them and the touch input on a Wacom tablet as not enough information is packed into NSEvent or the underlying CGEvent. We could get the source process that generated the event via CGEventRef/kCGEventSourceUnixProcessID; and then identify the process by string...but this would likely be too slow to do on each mouse event.

Exposing a new UI flag for this doesn't seem ideal, as not many people would be affected. We could do a private user default for people who run into this issue (like me). Something like this:

    BOOL treatMouseInputAsTouchDevices = [NSUserDefaults.standardUserDefaults boolForKey:@"TreatMouseInputAsTouchDevices"];
      
    if (!event.hasPreciseScrollingDeltas && !treatMouseInputAsTouchDevices) {

I'd probably cache the result in a static. I could then set the default using 'defaults' on the command line.

Thanks; I read the report and history. It looks like "Logitech Performance MX mouse" is sending hasPreciseScrollingDeltas too. There is no way to differentiate them and the touch input on a Wacom tablet as not enough information is packed into NSEvent or the underlying CGEvent. We *could* get the source process that generated the event via CGEventRef/kCGEventSourceUnixProcessID; and then identify the process by string...but this would likely be too slow to do on each mouse event. Exposing a new UI flag for this doesn't seem ideal, as not many people would be affected. We could do a private user default for people who run into this issue (like me). Something like this: ``` BOOL treatMouseInputAsTouchDevices = [NSUserDefaults.standardUserDefaults boolForKey:@"TreatMouseInputAsTouchDevices"]; if (!event.hasPreciseScrollingDeltas && !treatMouseInputAsTouchDevices) { ``` I'd probably cache the result in a static. I could then set the default using 'defaults' on the command line.
Author

I quickly typed that code...it would have to be reworked to re-enable the old code as it was. I can easily do this change if people like it.

I quickly typed that code...it would have to be reworked to re-enable the old code as it was. I can easily do this change if people like it.

Added subscriber: @julianlema

Added subscriber: @julianlema

Hi Corbin, did you find a solution? Im facing the same problem with my Wacom in Windows Blender.

Hi Corbin, did you find a solution? Im facing the same problem with my Wacom in Windows Blender.
Philipp Oeser removed the
Interest
User Interface
label 2023-02-10 09:23:34 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#86223
No description provided.