discussions-and-proposals icon indicating copy to clipboard operation
discussions-and-proposals copied to clipboard

Support TouchTool in React Native touch events

Open rhalaly opened this issue 3 years ago • 0 comments

Introduction

All native platforms support "Touch Tool" info that indicates the pointer type. This should be included in React Native natively.

Details

All native platforms know to identify what is the pointer type that triggered a touch event:

  • Android: https://developer.android.com/reference/android/view/MotionEvent#getToolType(int)
  • IOS: https://developer.apple.com/documentation/uikit/uitouch/touchtype
  • Web: https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType
  • Windows: https://docs.microsoft.com/en-us/uwp/api/Windows.Devices.Input.PointerDevice?view=winrt-22621

Discussion points

My proposal is to add touchTool field to React Native touch events that will return one of:

  • finger
  • pen
  • eraser
  • unknown

That will be chosen per the native platform event info

rhalaly avatar Aug 06 '22 13:08 rhalaly