Skip to main content

Function: assignGesture()

assignGesture(gestures, action, gesture): GestureSettings

Defined in: src/lib/utils/gestures/index.ts:76

Give an action a gesture. If another action had it, that action takes this action's old gesture instead (the two swap).

Parameters​

gestures​

GestureSettings

action​

"undo" | "redo" | "copy" | "paste"

gesture​

"tap2" | "tap3" | "swipeLeft3" | "swipeRight3" | "swipeUp3" | "swipeDown3" | "swipeOut3" | "swipeIn3" | "off"

Returns​

GestureSettings

Example​

assignGesture(DEFAULT_GESTURES, "undo", "tap3"); // undo: "tap3", redo: "tap2"