Skip to content
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

UPDDMultitouch: Implement multi-touch in macOS using the UPDD API #1382

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

brian-kendall-tb
Copy link

This pull request implements multi-touch support for macOS applications and plug-ins using the UPDD, a third party macOS touch driver from Touch-Base, which supports a wide array of different touch screen models.

I'm a developer for Touch-Base, and we've received many requests from macOS users who want to get multi-touch support working in various third party apps and plug-ins that were developed with JUCE. The difficulty is that macOS doesn't have a native representation of touch events from a touch screen, unlike for example Windows or iOS, so JUCE doesn't currently support multi-touch on macOS at all. This pull request implements multi-touch support using the UPDD API, the driver's low level programming interface, allowing full multi-touch support in JUCE applications and plug-ins on macOS systems that have the UPDD installed.

A few technical details about this PR:

  • The UPDD API functions are loaded dynamically at runtime with dlopen / dlsym, since it's not possible to know whether the UPDD is installed until runtime. In the case it's not installed, there's no change in behavior, and JUCE will report that multi-touch is not supported as before.

  • When the UPDD is installed, this implementation connects to the driver and listens for touch events from it, and then translates those into JUCE touch events and delivers them to the appropriate Component via the ComponentPeer API.

  • Because this requires loading a dynamic library that will not be signed by the same developer as the host application, any standalone macOS application that is notarized or otherwise has hardened runtime enabled will need to include a runtime exception disabling library validation if it wants to have multi-touch support. (This will already be the case in any application that loads plug-ins, such as a DAW that loads VSTs.)

I've tested this PR both in a standalone JUCE application as well as a VST and AU plug-in running in various DAWs on macOS. Hopefully the way I included my changes is acceptable, since I had to make a few guesses about how to best integrate it into JUCE. I'm happy to make any changes required for it be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant