'How to disable Force Click Lookup programmatically?

I need to disable Force Click Lookup in my application that uses CEF.

Already tried to override quickLookWithEvent in NSApplication, NSWindow and NSTextView without any affect (the method doesn't get called during the event).

Actually I need to achieve the same affect as when unchecking "Force Click and haptic feedback" checkbox in the Preferences, but to do it programmatically. Is there a way to prevent the lookup window from showing on force clicks?



Solution 1:[1]

This code did the trick:

[NSUserDefaults.standardUserDefaults
    setInteger:0
        forKey:@"com.apple.trackpad.forceClick"];

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ababo