This package provides touchscreen event handling and gesture capability.
This package exposes the events listed below as part of Atom Services.
- Touch-based scrolling (horizontal and vertical) for Text Editors
- Touch-based zooming (font size adjustment) for Text Editors
- Tap sets cursor position without bringing up keyboard
- AtomTouchEvents.onDidTouchSwipeUp
- AtomTouchEvents.onDidTouchSwipeDown
- AtomTouchEvents.onDidTouchSwipeLeft
- AtomTouchEvents.onDidTouchSwipeRight
- AtomTouchEvents.onDidTouchPinchIn
- AtomTouchEvents.onDidTouchPinchOut
- AtomTouchEvents.onDidTouchTap
- Add more behaviours (more granular pinch to zoom)
- Fix TreeView touch-related issues
The Atom Service Provider API is used to provide versioned services of these events.
For more information about consuming these services in your package, read here: https://atom.io/docs/latest/behind-atom-interacting-with-packages-via-services.
To consume these events, add the following to your package.json (or the services you need):
"consumedServices": {
"touch-events": {
"versions": {
"^0.21.0": "consumeTouchEvents"
}
}
}
Then in your main package, implement your consumer function to use the service function:
consumeTouchEvents: (touchEvents) ->
# Subscribe to touch swipe left event
touchEvents.onDidTouchSwipeLeft (event) ->
console.log "Swiped left!"