I've trying to programatically generate a force click in a Cocoa application. Is there anyway to do this? I've been investigating whether or not it's possible to post one to the system using CGEventPost, but so far no luck. It seems Apple hasn't updated their API for creating events in a long time. The docs make no mention of trackpad events, momentum scrolling, or any kind of pressure-sensitive event. CGEventTypes.h does have constants for momentum scroll related event fields, but that's it.
I've tried recording all events passing through the system using an event tap and replaying them, changing only the events' timestamps as appropriate. Replaying mouse clicks works, and replaying multitouch gestures like a three finger swipe left or right works and does indeed cause the space to change, meaning it is possible to reproduce event types that don't have a formal API for creating them. In fact replaying any sort of event works... except for force clicks. Replaying that only causes a regular click. However I have a hard time believing Apple broke their own system-level event model just for force clicks.
Any ideas?