Files
react-native/ReactCommon/react/renderer/components/view/PointerEvent.h
T
Vincent Riemer c25c4abe4a Add detail property to the PointerEvent object
Summary: Changelog: [iOS][Internal] Add detail property to the PointerEvent interface

Reviewed By: necolas

Differential Revision: D37117932

fbshipit-source-id: a5f1c6386d2521e22651453efeffe2005e4a8b6e
2022-06-21 14:05:44 -07:00

76 lines
2.0 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <react/renderer/core/ReactPrimitives.h>
#include <react/renderer/debug/DebugStringConvertible.h>
#include <react/renderer/graphics/Geometry.h>
namespace facebook {
namespace react {
struct PointerEvent {
/*
* A unique identifier for the pointer causing the event.
*/
int pointerId;
/*
* The normalized pressure of the pointer input in the range 0 to 1, where 0
* and 1 represent the minimum and maximum pressure the hardware is capable of
* detecting, respectively.
*/
Float pressure;
/*
* Indicates the device type that caused the event (mouse, pen, touch, etc.)
*/
std::string pointerType;
/*
* Point within the application's viewport at which the event occurred (as
* opposed to the coordinate within the page).
*/
Point clientPoint;
/*
* The width (magnitude on the X axis), in CSS pixels, of the contact geometry
* of the pointer
*/
Float width;
/*
* The height (magnitude on the y axis), in CSS pixels, of the contact
* geometry of the pointer
*/
Float height;
/*
* The plane angle (in degrees, in the range of -90 to 90) between the YZ
* plane and the plane containing both the pointer (e.g. pen stylus) axis and
* the Y axis.
*/
int tiltX;
/*
* The plane angle (in degrees, in the range of -90 to 90) between the XZ
* plane and the plane containing both the pointer (e.g. pen stylus) axis and
* the X axis.
*/
int tiltY;
/**
* Returns a long with details about the event, depending on the event type.
*/
int detail;
};
#if RN_DEBUG_STRING_CONVERTIBLE
std::string getDebugName(PointerEvent const &pointerEvent);
std::vector<DebugStringConvertibleObject> getDebugProps(
PointerEvent const &pointerEvent,
DebugStringConvertibleOptions options);
#endif
} // namespace react
} // namespace facebook