Table of Contents

Class Touch

Namespace
Ranorex
Assembly
Ranorex.Core.dll

Provides touch input actions.

public class Touch
Inheritance
Touch
Inherited Members

Constructors

Touch()

public Touch()

Properties

HasActivePointers

Gets a value indicating whether the touch input state has active (in contact) pointers.

public static bool HasActivePointers { get; }

Property Value

bool

true if the touch input state has active pointers; otherwise, false.

IsSupported

Gets a value indicating whether touch input is supported on this system.

public static bool IsSupported { get; }

Property Value

bool

true if touch input is supported; otherwise, false.

Methods

DoubleTap(Element)

Performs a double tap action on the adapter.

public static void DoubleTap(Element element)

Parameters

element Element

The element to perform the Touch action on.

DoubleTap(Element, double, double)

Performs a double tap action on the adapter with the specified location.

public static void DoubleTap(Element element, double x, double y)

Parameters

element Element

The element to perform the Touch action on.

x double

X-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed outside the element.

y double

Y-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed the element.

DoubleTap(Element, int, Location)

Performs a double tap action on the adapter with the specified location.

public static void DoubleTap(Element element, int pointer, Location location)

Parameters

element Element

The element to perform the Double Tap action on.

pointer int

The pointer identifier to use, with zero being the default pointer.

location Location

The location to touch at.

DoubleTap(Element, int, int)

Performs a double tap action on the adapter with the specified location.

public static void DoubleTap(Element element, int x, int y)

Parameters

element Element

The element to perform the Double Tap action on.

x int

X-Coordinate to tap within the element rectangle in pixels. If the value is greater than the width of the element the touch will be performed outside the element.

y int

Y-Coordinate to tap within the element rectangle in pixels. If the value is greater than the height of the element the touch will be performed outside the element.

LongTouch(Element)

Performs a long touch action on the adapter.

public static void LongTouch(Element element)

Parameters

element Element

The element to perform the Touch action on.

LongTouch(Element, Duration)

Performs a long touch action on the adapter.

public static void LongTouch(Element element, Duration longTouchDuration)

Parameters

element Element

The element to perform the Touch action on.

longTouchDuration Duration

The timespan between the down and up event of the touch.

LongTouch(Element, double, double)

Performs a long touch action on the adapter with the specified location.

public static void LongTouch(Element element, double x, double y)

Parameters

element Element

The element to perform the Touch action on.

x double

X-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed outside the element.

y double

Y-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed the element.

LongTouch(Element, double, double, Duration)

Performs a long touch action on the adapter with the specified location.

public static void LongTouch(Element element, double x, double y, Duration longTouchDuration)

Parameters

element Element

The element to perform the Touch action on.

x double

X-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed outside the element.

y double

Y-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed the element.

longTouchDuration Duration

The timespan between the down and up event of the touch.

LongTouch(Element, int, Location)

Performs a long touch action on the adapter with the specified location.

public static void LongTouch(Element element, int pointer, Location location)

Parameters

element Element

The element to perform the Touch action on.

pointer int

The pointer identifier to use, with zero being the default pointer.

location Location

The location to touch at.

LongTouch(Element, int, Location, Duration)

Performs a long touch action on the adapter with the specified location.

public static void LongTouch(Element element, int pointer, Location location, Duration longTouchDuration)

Parameters

element Element

The element to perform the Touch action on.

pointer int

The pointer identifier to use, with zero being the default pointer.

location Location

The location to touch at.

longTouchDuration Duration

The timespan between the down and up event of the touch.

LongTouch(Element, int, int)

Performs a long touch action on the adapter with the specified location.

public static void LongTouch(Element element, int x, int y)

Parameters

element Element

The element to perform the Touch action on.

x int

X-Coordinate to click within the element rectangle in pixels. If the value is greater than the width of the element the touch will be performed outside the element.

y int

Y-Coordinate to click within the element rectangle in pixels. If the value is greater than the height of the element the touch will be performed outside the element.

LongTouch(Element, int, int, Duration)

Performs a long touch action on the adapter with the specified location.

public static void LongTouch(Element element, int x, int y, Duration longTouchDuration)

Parameters

element Element

The element to perform the Touch action on.

x int

X-Coordinate to click within the element rectangle in pixels. If the value is greater than the width of the element the touch will be performed outside the element.

y int

Y-Coordinate to click within the element rectangle in pixels. If the value is greater than the height of the element the touch will be performed outside the element.

longTouchDuration Duration

The timespan between the down and up event of the touch.

Reset()

Resets the current touch state, removing all active pointers.

public static void Reset()

Tap(Element)

Performs a touch action.

public static void Tap(Element element)

Parameters

element Element

The element to perform the Touch action on.

Tap(Element, Duration)

Performs a touch action.

public static void Tap(Element element, Duration touchDuration)

Parameters

element Element

The element to perform the Touch action on.

touchDuration Duration

The duration between the down and up phase of the touch.

Tap(Element, double, double)

Performs a touch action on the adapter with the specified location.

public static void Tap(Element element, double x, double y)

Parameters

element Element

The element to perform the Touch action on.

x double

X-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the touch will be performed outside the element.

y double

Y-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the touch will be performed the element.

Tap(Element, double, double, Duration)

Performs a touch action on the adapter with the specified location.

public static void Tap(Element element, double x, double y, Duration touchDuration)

Parameters

element Element

The element to perform the Touch action on.

x double

X-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the touch will be performed outside the element.

y double

Y-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the touch will be performed the element.

touchDuration Duration

The duration between the down and up phase of the touch.

Tap(Element, int, Location)

Performs a touch action on the adapter.

public static void Tap(Element element, int pointer, Location location)

Parameters

element Element

The element to perform the Touch action on.

pointer int

The pointer identifier to use, with zero being the default pointer.

location Location

The location to touch at.

Tap(Element, int, Location, Duration)

Performs a touch action on the adapter.

public static void Tap(Element element, int pointer, Location location, Duration touchDuration)

Parameters

element Element

The element to perform the Touch action on.

pointer int

The pointer identifier to use, with zero being the default pointer.

location Location

The location to touch at.

touchDuration Duration

The duration between the down and up phase of the touch.

Tap(Element, int, int)

Performs a touch action on the adapter with the specified location.

public static void Tap(Element element, int x, int y)

Parameters

element Element

The element to perform the Touch action on.

x int

X-Coordinate to touch within the element rectangle in pixels. If the value is greater than the width of the element the click will be performed outside the element.

y int

Y-Coordinate to touch within the element rectangle in pixels. If the value is greater than the height of the element the click will be performed outside the element.

Tap(Element, int, int, Duration)

Performs a touch action on the adapter with the specified location.

public static void Tap(Element element, int x, int y, Duration touchDuration)

Parameters

element Element

The element to perform the Touch action on.

x int

X-Coordinate to touch within the element rectangle in pixels. If the value is greater than the width of the element the click will be performed outside the element.

y int

Y-Coordinate to touch within the element rectangle in pixels. If the value is greater than the height of the element the click will be performed outside the element.

touchDuration Duration

The duration between the down and up phase of the touch.

TouchEnd(Element, Location, Duration)

Finishes a multi touch operation on the adapter. TouchStart(Element, int, int)

public static void TouchEnd(Element element, Location location, Duration moveTime)

Parameters

element Element

The element to perform the Touch action on.

location Location

The location to touch at.

moveTime Duration

The time it takes the pointer to move to the specified position.

TouchEnd(Element, double, double)

Finishes a multi touch operation on the adapter. TouchStart(Element, double, double)

public static void TouchEnd(Element element, double x, double y)

Parameters

element Element

The element to perform the Touch action on.

x double

X-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed outside the element.

y double

Y-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed the element.

TouchEnd(Element, int, Location)

Finishes a multi touch operation on the adapter. TouchStart(Element, int, Location)

public static void TouchEnd(Element element, int pointer, Location location)

Parameters

element Element

The element to perform the Touch action on.

pointer int

The pointer identifier to use, with zero being the default pointer.

location Location

The location to touch at.

TouchEnd(Element, int, Location, Duration)

Finishes a multi touch operation on the adapter. TouchStart(Element, int, Location)

public static void TouchEnd(Element element, int pointer, Location location, Duration moveTime)

Parameters

element Element

The element to perform the Touch action on.

pointer int

The pointer identifier to use, with zero being the default pointer.

location Location

The location to touch at.

moveTime Duration

The time it takes the pointer to move to the specified position.

TouchEnd(Element, int, double, double)

Finishes a multi touch operation on the adapter. TouchStart(Element, int, double, double)

public static void TouchEnd(Element element, int pointer, double x, double y)

Parameters

element Element

The element to perform the Touch action on.

pointer int

The pointer identifier to use, with zero being the default pointer.

x double

X-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed outside the element.

y double

Y-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed the element.

TouchEnd(Element, int, int)

Finishes a multi touch operation on the adapter. TouchStart(Element, int, int)

public static void TouchEnd(Element element, int x, int y)

Parameters

element Element

The element to perform the Touch action on.

x int

X-Coordinate to click within the element rectangle in pixels. If the value is greater than the width of the element the touch will be performed outside the element.

y int

Y-Coordinate to click within the element rectangle in pixels. If the value is greater than the height of the element the touch will be performed outside the element.

TouchEnd(Element, int, int, int)

Finishes a multi touch operation on the adapter. TouchStart(Element, int, int, int)

public static void TouchEnd(Element element, int pointer, int x, int y)

Parameters

element Element

The element to perform the Touch action on.

pointer int

The pointer identifier to use, with zero being the default pointer.

x int

X-Coordinate to click within the element rectangle in pixels. If the value is greater than the width of the element the touch will be performed outside the element.

y int

Y-Coordinate to click within the element rectangle in pixels. If the value is greater than the height of the element the touch will be performed outside the element.

TouchMove(Element, Location, Duration)

Performs a touch move action on the adapter. This adds a move to the specified location with cursor pressed. TouchStart(Element, int, int)

public static void TouchMove(Element element, Location location, Duration moveTime)

Parameters

element Element

The element to perform the Touch action on.

location Location

The location to touch at.

moveTime Duration

The time it takes the pointer to move to the specified position.

TouchMove(Element, double, double)

Performs a touch move action on the adapter. This adds a move to the specified location with cursor pressed. TouchStart(Element, double, double)

public static void TouchMove(Element element, double x, double y)

Parameters

element Element

The element to perform the Touch action on.

x double

X-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed outside the element.

y double

Y-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed the element.

TouchMove(Element, double, double, Duration)

Performs a touch move action on the adapter. This adds a move to the specified location with cursor pressed. TouchStart(Element, double, double)

public static void TouchMove(Element element, double x, double y, Duration moveTime)

Parameters

element Element

The element to perform the Touch action on.

x double

X-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed outside the element.

y double

Y-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed the element.

moveTime Duration

The timespan between the first and the second position update of the event.

TouchMove(Element, int, Location)

Performs a touch move action on the adapter. This adds a move to the specified location with cursor pressed. TouchStart(Element, int, Location)

public static void TouchMove(Element element, int pointer, Location location)

Parameters

element Element

The element to perform the Touch action on.

pointer int

The pointer identifier to use, with zero being the default pointer.

location Location

The location to touch at.

TouchMove(Element, int, Location, Duration)

Performs a touch move action on the adapter. This adds a move to the specified location with cursor pressed. TouchStart(Element, int, Location)

public static void TouchMove(Element element, int pointer, Location location, Duration moveTime)

Parameters

element Element

The element to perform the Touch action on.

pointer int

The pointer identifier to use, with zero being the default pointer.

location Location

The location to touch at.

moveTime Duration

The timespan between the first and the second position update of the event.

TouchMove(Element, int, double, double)

Performs a touch move action on the adapter. This adds a move to the specified location with cursor pressed. TouchStart(Element, int, double, double)

public static void TouchMove(Element element, int pointer, double x, double y)

Parameters

element Element

The element to perform the Touch action on.

pointer int

The pointer identifier to use, with zero being the default pointer.

x double

X-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed outside the element.

y double

Y-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed the element.

TouchMove(Element, int, double, double, Duration)

Performs a touch move action on the adapter. This adds a move to the specified location with cursor pressed. TouchStart(Element, int, double, double)

public static void TouchMove(Element element, int pointer, double x, double y, Duration moveTime)

Parameters

element Element

The element to perform the Touch action on.

pointer int

The pointer identifier to use, with zero being the default pointer.

x double

X-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed outside the element.

y double

Y-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed the element.

moveTime Duration

The timespan between the first and the second position update of the event.

TouchMove(Element, int, int)

Performs a touch move action on the adapter. This adds a move to the specified location with cursor pressed. TouchStart(Element, int, int)

public static void TouchMove(Element element, int x, int y)

Parameters

element Element

The element to perform the Touch action on.

x int

X-Coordinate to click within the element rectangle in pixels. If the value is greater than the width of the element the touch will be performed outside the element.

y int

Y-Coordinate to click within the element rectangle in pixels. If the value is greater than the height of the element the touch will be performed outside the element.

TouchMove(Element, int, int, Duration)

Performs a touch move action on the adapter. This adds a move to the specified location with cursor pressed. TouchStart(Element, int, int)

public static void TouchMove(Element element, int x, int y, Duration moveDuration)

Parameters

element Element

The element to perform the Touch action on.

x int

X-Coordinate to click within the element rectangle in pixels. If the value is greater than the width of the element the touch will be performed outside the element.

y int

Y-Coordinate to click within the element rectangle in pixels. If the value is greater than the height of the element the touch will be performed outside the element.

moveDuration Duration

The timespan between the first and the second position update of the event.

TouchMove(Element, int, int, int)

Performs a touch move action on the adapter. This adds a move to the specified location with cursor pressed. TouchStart(Element, int, int, int)

public static void TouchMove(Element element, int pointer, int x, int y)

Parameters

element Element

The element to perform the Touch action on.

pointer int

The pointer identifier to use, with zero being the default pointer.

x int

X-Coordinate to click within the element rectangle in pixels. If the value is greater than the width of the element the touch will be performed outside the element.

y int

Y-Coordinate to click within the element rectangle in pixels. If the value is greater than the height of the element the touch will be performed outside the element.

TouchMove(Element, int, int, int, Duration)

Performs a touch move action on the adapter. This adds a move to the specified location with cursor pressed. TouchStart(Element, int, int, int)

public static void TouchMove(Element element, int pointer, int x, int y, Duration moveTime)

Parameters

element Element

The element to perform the Touch action on.

pointer int

The pointer identifier to use, with zero being the default pointer.

x int

X-Coordinate to click within the element rectangle in pixels. If the value is greater than the width of the element the touch will be performed outside the element.

y int

Y-Coordinate to click within the element rectangle in pixels. If the value is greater than the height of the element the touch will be performed outside the element.

moveTime Duration

The timespan between the first and the second position update of the event.

TouchStart(Element, double, double)

Begins a multi touch operation on the adapter. Multi touch operations can be used to compose more complex touch gestures. E.g. a swipe from left to right could be composed in the following way:

adapter.TouchStart(Location.Left);
adapter.TouchEnd(Location.Right);

Useful multitouch operations always have the form

  • 1 TouchStart
  • 0-N TouchMove
  • 1 TouchEnd
public static void TouchStart(Element element, double x, double y)

Parameters

element Element

The element to perform the Touch action on.

x double

X-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed outside the element.

y double

Y-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed the element.

TouchStart(Element, int, Location)

Performs a touch start action on the adapter.

public static void TouchStart(Element element, int pointer, Location location)

Parameters

element Element

The element to perform the Touch action on.

pointer int

The pointer identifier to use, with zero being the default pointer.

location Location

The location to touch at.

TouchStart(Element, int, double, double)

Begins a multi touch operation on the adapter. Multi touch operations can be used to compose more complex touch gestures. E.g. a swipe from left to right could be composed in the following way:

adapter.TouchStart(Location.Left);
adapter.TouchEnd(Location.Right);

Useful multitouch operations always have the form

  • 1 TouchStart
  • 0-N TouchMove
  • 1 TouchEnd
public static void TouchStart(Element element, int pointer, double x, double y)

Parameters

element Element

The element to perform the Touch action on.

pointer int

The pointer identifier to use, with zero being the default pointer.

x double

X-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed outside the element.

y double

Y-Coordinate to click within the element rectangle as percentage (1.0 = 100%). If the value is greater than 1.0 the click will be performed the element.

TouchStart(Element, int, int)

Begins a multi touch operation on the adapter. Multi touch operations can be used to compose more complex touch gestures. E.g. a swipe from left to right could be composed in the following way:

adapter.TouchStart(Location.Left);
adapter.TouchEnd(Location.Right);

Useful multitouch operations always have the form

  • 1 TouchStart
  • 0-N TouchMove
  • 1 TouchEnd
public static void TouchStart(Element element, int x, int y)

Parameters

element Element

The element to perform the Touch action on.

x int

X-Coordinate to click within the element rectangle in pixels. If the value is greater than the width of the element the touch will be performed outside the element.

y int

Y-Coordinate to click within the element rectangle in pixels. If the value is greater than the height of the element the touch will be performed outside the element.

TouchStart(Element, int, int, int)

Begins a multi touch operation on the adapter. Multi touch operations can be used to compose more complex touch gestures. E.g. a swipe from left to right could be composed in the following way:

adapter.TouchStart(Location.Left);
adapter.TouchEnd(Location.Right);

Useful multitouch operations always have the form

  • 1 TouchStart
  • 0-N TouchMove
  • 1 TouchEnd
public static void TouchStart(Element element, int pointer, int x, int y)

Parameters

element Element

The element to perform the Touch action on.

pointer int

The pointer identifier to use, with zero being the default pointer.

x int

X-Coordinate to click within the element rectangle in pixels. If the value is greater than the width of the element the touch will be performed outside the element.

y int

Y-Coordinate to click within the element rectangle in pixels. If the value is greater than the height of the element the touch will be performed outside the element.