Skip to content

Latest commit

 

History

History
49 lines (28 loc) · 2.23 KB

pressinterpreter.md

File metadata and controls

49 lines (28 loc) · 2.23 KB

Class: PressInterpreter

If you are using Space then you don't need to use or interact directly with this class. It is used internally by Space along with Pressable to interpret and respond to press interactions.

On the other hand if you are using ViewPort without Space you may want to use this to make handling interactions easier.

It works by calling a DecidePressHandlingCallback callback whenever a press starts, and the callback decides how the press should be handled.

After you construct the PressInterpreter pass the pressHandlers to the ViewPort's constructors (as part of the options parameter).

Hierarchy

  • PressInterpreter

Index

Constructors

Properties

Constructors

constructor

+ new PressInterpreter(onDecideHowToHandlePress: DecidePressHandlingCallback): PressInterpreter

Parameters:

Name Type Description
onDecideHowToHandlePress DecidePressHandlingCallback This callback decides how to handle presses. See DecidePressHandlingCallback for more info.

Returns: PressInterpreter

Properties

pressHandlers

pressHandlers: Pick‹ViewPortOptions, "onPressStart" | "onPressMove" | "onPressEnd" | "onPressCancel"›

Pass this to the ViewPort as part of its ViewPortOptions.