All Projects → thefunbots → react-native-pointer-interactions

thefunbots / react-native-pointer-interactions

Licence: Apache-2.0 License
Expose iPad mouse & trackpads interactions to React Native

Programming Languages

javascript
184084 projects - #8 most used programming language
objective c
16641 projects - #2 most used programming language
swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to react-native-pointer-interactions

mousecase
A JavaScript utility enabling horizontal dragging on mousedown events 🖱
Stars: ✭ 35 (+75%)
Mutual labels:  trackpad, mouse
Pointerkit
A proof of concept framework to use a pointing device on iOS
Stars: ✭ 166 (+730%)
Mutual labels:  ipad, mouse
spark-sdk-ios
DEPRECATED Particle iOS Cloud SDK. Use -->
Stars: ✭ 52 (+160%)
Mutual labels:  ipad
creviceapp
Multi purpose utility which supports gestures with mouse and keyboard.
Stars: ✭ 22 (+10%)
Mutual labels:  mouse
PointerScript
Scripting language with pointers and native library access.
Stars: ✭ 26 (+30%)
Mutual labels:  pointer
KeyLy
A powerfull and awesome Keylogger(Your keyboard and your mouse) realy helpfull for hackers! :-P (C/C++)
Stars: ✭ 17 (-15%)
Mutual labels:  mouse
ios code sign
iOS 签名简介
Stars: ✭ 23 (+15%)
Mutual labels:  ipad
hotscript
HotScript - Revolutionizing how Windows works.
Stars: ✭ 29 (+45%)
Mutual labels:  mouse
blobile
Blases Loaded - Unofficial Live Blaseball Game Viewer for iOS, Android, and Web
Stars: ✭ 16 (-20%)
Mutual labels:  ipad
x86-Assembly-Reverse-Engineering
🛠 Knowledge about the topic of x86 assembly & disassembly 🛠
Stars: ✭ 27 (+35%)
Mutual labels:  pointer
trail
An image with a mouse trail in pure JS.
Stars: ✭ 14 (-30%)
Mutual labels:  mouse
tacklebox
🎣React UX components for handling common interactions
Stars: ✭ 15 (-25%)
Mutual labels:  interactions
nativesapp
Simple WhatsApp clone just for training purposes - Course Angular Native at www.udemy.com/angular-native
Stars: ✭ 19 (-5%)
Mutual labels:  ipad
xclicker
XClicker - Fast gui autoclicker for x11 linux desktops
Stars: ✭ 179 (+795%)
Mutual labels:  mouse
Hostess.swift
A Swift implementation of NSHost that works on iOS, OS X and tvOS. Hostess.swift is safe to use in a framework because it does not require a bridging header. Hostess is Swift 4.0 (or newer) only and replaces the Swift 2.x only Host.swift.
Stars: ✭ 27 (+35%)
Mutual labels:  ipad
iOS interviews
iOS Interviews - 史上最贴心 iOS 面试知识点分享!不只是 iOS !只为技术的执拗 !👍 全网火速更新中 🔥 期待你的讨论,期待你的 issue ! 🌟
Stars: ✭ 25 (+25%)
Mutual labels:  ipad
DartBible-Flutter
cross-platform mobile bible app [Android & iOS / iPhone / iPad]; written in Dart programming language
Stars: ✭ 26 (+30%)
Mutual labels:  ipad
Nightscouter
An Native iOS app for displaying Nightscout website data.
Stars: ✭ 18 (-10%)
Mutual labels:  ipad
hammerspoon-vimouse
Control the mouse with Hammerspoon in a Vim-ish way
Stars: ✭ 19 (-5%)
Mutual labels:  mouse
openinput
Open source firmware for input devices
Stars: ✭ 43 (+115%)
Mutual labels:  mouse

React Native Pointer Interactions

Expose iPad mouse & track pads interactions to React Native.

npm version npm downloads Codacy Badge Follow @thefunbots


Expose iPad mouse & track pads interactions to React Native

Ref: https://developer.apple.com/design/human-interface-guidelines/ios/user-interaction/pointers/

demo

Getting started

Mostly automatic installation

1. Install the library

npm install @thefunbots/react-native-pointer-interactions --save

2. (Optional) Install react-native-swift

If you are not already using any other swift based modules in your app, install and run react-native-swift to configure your iOS project to support swift.

Install react-native-swift

npm install --save react-native-swift

After installing it, you will need to link it. Requires project to use Swift 5.0 and iOS SDK 13.4+

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-pointer-interactions and add RNPointerInteractions.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNPointerInteractions.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Setup

Add this to the Info plists

<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>

Usage

Basic usage

Wrap the views you want to be interactable in PointerInteractionView

import { PointerInteractionView } from '@thefunbots/react-native-pointer-interactions';

<PointerInteractionView pointerMode="lift">
  <Text>Hi</Text>
</PointerInteractionView>

Using the High Order Component

Soon

Props

The component extends the regular View, so you can use the common properties too.

Prop Description
pointerMode [automatic, lift, highlight, hover, verticalBeam, horizontalBeam]
beamLength Sets the cursor size for Beam modes only

Examples

If you want to play with the API but don't feel like trying it on a real app, you can run the example project. Clone the repo, go to the example/ folder and run:

npm install

If you are running on ios, run pod install in the ios folder

Run react-native start to start the metro bundler

Run react-native run-ios (depending on which platform you want to run the example app on).

You will need to have an iOS device or emulator connected as well as react-native-cli package installed globally.

Troubleshooting

  • It doesn't work when wrapping react-native-gesture-handler buttons
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].