Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSEventMBS class.

NSEventMBS.allTouches as NSTouchMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 23.5 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Returns all touch objects associated with the event.
Example
Dim e As NSEventMBS = NSApplicationMBS.sharedApplication.currentEvent
Dim touches() As NSTouchMBS = e.allTouches

Break

If the touches originate in different views or windows, each NSTouchMBS object may have a different responder object.

NSEventMBS.coalescedTouchesForTouch(touch as NSTouchMBS) as NSTouchMBS()   New in 24.2

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 24.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Returns all of the touch objects associated with the specified main touch.

touch: A touch that occurred in the Touch Bar. The method uses this object to determine which additional touch objects to return.

Returns an array that contains the NSTouch objects AppKit generated since the last event, but didn’t deliver. This method returns nil if the object in the touch parameter isn’t associated with the current event.

Use this method to obtain additional touch objects that the system received but didn’t deliver to your app. You might use these extra touch objects to create a more precise path for the touch sequence.
AppKit coalesces touches only when they occur in the Touch Bar; it doesn’t coalesce touch events on the track pad. This method returns the complete sequence of touches since the last event, and it returns them in the same order the system reported them. The last object in the array is a copy of the same object you provided in the touch parameter.

NSEventMBS.Constructor   Private

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 13.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The private constructor.

NSEventMBS.predictedTouchesForTouch(touch as NSTouchMBS) as NSTouchMBS()   New in 24.2

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 24.2 ✅ Yes ❌ No ❌ No ✅ Yes iOS only
Returns an array of touches that are predicted to occur for the specified touch.

touch: A main touch object that was reported with the event. The touch object you specify is used to determine which sequence of additional touches is returned.

Returns an array of NSTouchMBS objects representing the set of touches that the system predicts will occur next. The order of the objects in the array matches the order in which the touches are expected to be delivered to your app. This array does not include the original touch you specified in the touch parameter. The return value is nil if the object in the touch parameter is not associated with the current event.

Use this method to minimize the apparent latency between the user's touch input and the rendering of your onscreen content. Processing touch input from the user and translating that information into drawing commands takes time, and turning those drawing commands into rendered content takes additional time. If the user's finger or Apple Pencil is moving fast enough, these delays can result in a noticeable gap between the current touch location and the rendered content. To minimize the perceived lag, use the predicted touches of this method as additional, temporary input to your content.
The touches returned by this method represent the system's estimation of where the user's touch input will be, based on the user's past input. Append these touches only temporarily to the structures you use for drawing or updating your content, and discard them as soon as you receive a new event with fresh touches. When used in conjunction with coalesced touches and efficient drawing code, you can create the perception that the user's input is being handled immediately, with little or no lag. That perception improves the user experience of drawing apps or of any app that let users manipulate objects directly onscreen.

NSEventMBS.touchesForView(view as NSViewMBS) as NSTouchMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 23.5 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Returns the touch objects from the event that belong to the specified view.

NSEventMBS.touchesForWindow(win as NSWindowMBS) as NSTouchMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 23.5 ✅ Yes ❌ No ❌ No ✅ Yes iOS only
Returns the touch objects from the event that belong to the specified window.

NSEventMBS.touchesMatchingPhase(Phase as Integer, view as NSViewMBS = nil) as NSTouchMBS()   New in 24.2

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 24.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the touch objects associated with the specified phase.

phase: The touch phase for which you want touches.
view: The view for which touches are wanted. Touches that target this view, or any of the view’s descendants will be returned. Passing nil as the view gets all touches regardless of their targeted view.

Returns an array of applicable NSTouchMBS objects.
This method is only valid for gesture events (gesture, magnify, swipe, rotate, etc.).

The items on this page are in the following plugins: MBS MacBase Plugin.


The biggest plugin in space...