Equivalent of coalescedTouchesForTouch in AppKit?

This method on UIEvent gets you more touch positions, and I think it's useful for a drawing app, to respond with greater precision to the position of the Pencil stylus.

Is there a similar thing in macOS, for mouse or tablet events? I found this property mouseCoalescingEnabled, but the docs there don't describe how to get the extra events.

I may miss something in your question.

Can't you use the info in allTouches() ?

https://developer.apple.com/documentation/appkit/nsevent/alltouches()

I have the same question. If you upgrade to the latest version 26.2, you will find that the coalescing of mouse movement events has become more restrictive—they are downsampled to match the screen refresh rate. This has become similar to how the system handles touch events. Unfortunately, regarding this change, I haven’t been able to find any interface provided by Apple that allows access to the original data points before coalescing. It seems that on macOS, the only way for an application to obtain relatively precise and raw mouse movement events is to set isMouseCoalescingEnabled to false. I hope someone can help confirm whether this understanding is correct.

Same finding here, measured rather than guessed: on macOS 26 with a 120 Hz ProMotion panel, mouse-moved NSEvents reach a Cocoa app in bursts once per display refresh, 8.3 ms apart, no matter how fast the mouse reports — a 1000 Hz mouse gets merged into one event per frame. I haven't verified whether NSEvent.isMouseCoalescingEnabled = false restores the full rate on 26.2.

What does give you every report is reading the device directly with IOHIDManager on its own thread:

import Foundation
import IOKit.hid

let manager = IOHIDManagerCreate(kCFAllocatorDefault, IOOptionBits(kIOHIDOptionsTypeNone))
IOHIDManagerSetDeviceMatching(manager, [kIOHIDDeviceUsagePageKey: kHIDPage_GenericDesktop,
                                        kIOHIDDeviceUsageKey: kHIDUsage_GD_Mouse] as NSDictionary as CFDictionary)
IOHIDManagerRegisterInputValueCallback(manager, { _, _, _, value in
    let element = IOHIDValueGetElement(value)
    guard IOHIDElementGetUsagePage(element) == UInt32(kHIDPage_GenericDesktop),
          IOHIDElementIsRelative(element) else { return }
    let usage = IOHIDElementGetUsage(element)        // kHIDUsage_GD_X or kHIDUsage_GD_Y
    let delta = IOHIDValueGetIntegerValue(value)     // raw counts, no acceleration curve
    let stamp = IOHIDValueGetTimeStamp(value)        // mach time of the report
    // X and Y of one report share a timestamp: accumulate until it changes.
}, nil)
IOHIDManagerScheduleWithRunLoop(manager, CFRunLoopGetCurrent(), CFRunLoopMode.defaultMode.rawValue)
IOHIDManagerOpen(manager, IOOptionBits(kIOHIDOptionsTypeNone))

Things that bit us: it needs the Input Monitoring permission (IOHIDCheckAccess / IOHIDRequestAccess(kIOHIDRequestTypeListenEvent)); the values are raw device counts, so if you want the system's pointer feel you apply the curve yourself; and some mice expose two HID interfaces that report the same motion, so dedupe by device. For a pen tablet the Digitizer usage page (absolute coordinates) is the one to look at — I haven't tried that part.

Context: we ran into this in a game-input layer, where shooters need every one of those 1000 reports; reading HID like this is what fixed it.

Equivalent of coalescedTouchesForTouch in AppKit?
 
 
Q