What is the framerJS method to know if a finger is being held down anywhere on the screen? Like a scroll event, but just for the finger touching the screen.
# Detect a long press layer.on Events.LongPress, (event) -> print "Long press"
docs here: https://framer.com/docs/under "LongPress Events"
can you do this to the whole screen, instead of a layer?
basically, if the finger is held down in the top 3rd I want to trigger one thing, and in the bottom third, another
Joshua Miller I was hoping it could be done with Canvas: ```Canvas.backgroundColor = "#28affa"Canvas.onLongPress -> print 'pressing'```but doesn't appear to work
Also, i'm looking for an event that continuously triggers, while the finger is down, not just a one time trigger.
Layer.on Events.touchStart(Events, Layer)Layer.on Events.touchMoved(Events, Layer)Layer.on Events.touchEnd(Events, Layer)I think there are what you are looking for. touchStart fires when you put your finger down. touchMoved fires when you move your finger. touchEnd fires when you lift your finger.
You can create an invisible layer that covers the screen to act as a handler for touches
My current solution is to start an interval during "layerA.onMouseDown ->" but then how would i cancel it?
If you assign your interval to a variable you can the interval.invalidate()
myInterval = utils.interval 60 -> //Do Stuff
layerA.onMouseUp -> myInterval.invalidate()