androidx.compose.ui.input.pointer
Interfaces
AwaitPointerEventScope |
Receiver scope for awaiting pointer events in a call to |
Cmn
|
PointerIcon |
Represents a pointer icon to use in |
Cmn
|
PointerInputEventHandler |
Cmn
|
|
PointerInputModifier |
A |
Cmn
|
PointerInputScope |
Receiver scope for |
Cmn
|
SuspendingPointerInputModifierNode |
Extends |
Cmn
|
Classes
ConsumedData |
This class is deprecated. Use PointerInputChange.isConsumed and PointerInputChange.consume() instead |
Cmn
|
HistoricalChange |
Data structure for "historical" pointer moves. |
Cmn
|
NativePointerButtons |
Cmn
|
|
NativePointerKeyboardModifiers |
Cmn
|
|
PointerButtons |
Contains the state of pointer buttons (e.g. mouse and stylus buttons). |
Cmn
|
PointerEvent |
Describes a pointer input change event that has occurred at a particular point in time. |
Cmn
android
|
PointerEventType |
Indicates the primary reason that the |
Cmn
|
PointerId |
An ID for a given pointer. |
Cmn
|
PointerInputChange |
Describes a change that has occurred for a particular pointer, as well as how much of the change has been consumed (meaning, used by a node in the UI). |
Cmn
|
PointerInputFilter |
A PointerInputFilter represents a single entity that receives |
Cmn
|
PointerKeyboardModifiers |
Contains the state of modifier keys, such as Shift, Control, and Alt, as well as the state of the lock keys, such as Caps Lock and Num Lock. |
Cmn
|
PointerType |
The device type that produces a |
Cmn
|
RequestDisallowInterceptTouchEvent |
Function that can be passed to |
android
|
Exceptions
PointerEventTimeoutCancellationException |
An exception thrown from |
Cmn
android
|
Enums
PointerEventPass |
The enumeration of passes where |
Cmn
|
Modifiers
motionEventSpy |
Calls |
android
|
pointerHoverIcon |
Modifier that lets a developer define a pointer icon to display when the cursor is hovered over the element. |
Cmn
|
pointerInput |
Create a modifier for processing pointer input within the region of the modified element. |
Cmn
|
pointerInteropFilter |
A special PointerInputModifier that provides access to the underlying |
android
|
stylusHoverIcon |
Modifier that lets a developer define a pointer icon to display when a stylus is hovered over the element. |
Cmn
|
Top-level functions summary
PointerIcon |
PointerIcon(pointerIcon: PointerIcon)Creates |
android
|
PointerIcon |
PointerIcon(pointerIconType: Int)Creates |
android
|
SuspendingPointerInputModifierNode |
SuspendingPointerInputModifierNode(Supports suspending pointer event handling. |
Cmn
|
Extension functions summary
Boolean |
This function is deprecated. Partial consumption has been deprecated. |
Cmn
|
Boolean |
True if this |
Cmn
|
Boolean |
True if this |
Cmn
|
Boolean |
True if this |
Cmn
|
Boolean |
True if this |
Cmn
|
Unit |
This function is deprecated. Use consume() instead |
Cmn
|
Unit |
This function is deprecated. Partial consumption has been deprecated. |
Cmn
|
Unit |
This function is deprecated. Partial consumption has been deprecated. |
Cmn
|
Int |
Returns the index of first button pressed as used in |
Cmn
android
|
Int |
Returns the index of last button pressed as used in |
Cmn
android
|
Boolean |
This function is deprecated. Use isOutOfBounds() that supports minimum touch target |
Cmn
|
Boolean |
PointerInputChange.isOutOfBounds(Returns |
Cmn
|
Boolean |
PointerButtons.isPressed(buttonIndex: Int)Returns |
Cmn
android
|
Offset |
The distance that the pointer has moved on the screen minus any distance that has been consumed. |
Cmn
|
Boolean |
This function is deprecated. Partial consumption has been deprecated. |
Cmn
|
Offset |
The distance that the pointer has moved on the screen, ignoring the fact that it might have been consumed. |
Cmn
|
Boolean |
True if this |
Cmn
|
Boolean |
True if this |
Cmn
|
Extension properties summary
Boolean |
Returns |
Cmn
android
|
Boolean |
|
Cmn
android
|
Boolean |
|
Cmn
android
|
Boolean |
|
Cmn
android
|
Boolean |
|
Cmn
android
|
Boolean |
|
Cmn
android
|
Boolean |
|
Cmn
android
|
Boolean |
|
Cmn
android
|
Boolean |
|
Cmn
android
|
Boolean |
|
Cmn
android
|
Boolean |
|
Cmn
android
|
Boolean |
|
Cmn
android
|
Boolean |
|
Cmn
android
|
Boolean |
|
Cmn
android
|
Boolean |
|
Cmn
android
|
Boolean |
|
Cmn
android
|
Top-level functions
PointerIcon
fun PointerIcon(pointerIcon: PointerIcon): PointerIcon
Creates PointerIcon from android.view.PointerIcon
PointerIcon
fun PointerIcon(pointerIconType: Int): PointerIcon
Creates PointerIcon from pointer icon type (see android.view.PointerIcon.getSystemIcon
SuspendingPointerInputModifierNode
fun SuspendingPointerInputModifierNode(
pointerInputEventHandler: PointerInputEventHandler
): SuspendingPointerInputModifierNode
Supports suspending pointer event handling. This is used by pointerInput, so in most cases you should just use pointerInput for suspending pointer input. Creating a SuspendingPointerInputModifierNode should only be needed when you want to delegate to suspending pointer input as part of the implementation of a complex Modifier.Node.
Extension functions
PointerInputChange.anyChangeConsumed
fun PointerInputChange.anyChangeConsumed(): Boolean
True if any aspect of this PointerInputChange has been consumed.
PointerInputChange.changedToDown
fun PointerInputChange.changedToDown(): Boolean
True if this PointerInputChange represents a pointer coming in contact with the screen and that change has not been consumed.
PointerInputChange.changedToDownIgnoreConsumed
fun PointerInputChange.changedToDownIgnoreConsumed(): Boolean
True if this PointerInputChange represents a pointer coming in contact with the screen, whether or not that change has been consumed.
PointerInputChange.changedToUp
fun PointerInputChange.changedToUp(): Boolean
True if this PointerInputChange represents a pointer breaking contact with the screen and that change has not been consumed.
PointerInputChange.changedToUpIgnoreConsumed
fun PointerInputChange.changedToUpIgnoreConsumed(): Boolean
True if this PointerInputChange represents a pointer breaking contact with the screen, whether or not that change has been consumed.
PointerInputChange.consumeAllChanges
fun PointerInputChange.consumeAllChanges(): Unit
Consumes all changes associated with the PointerInputChange
PointerInputChange.consumeDownChange
fun PointerInputChange.consumeDownChange(): Unit
Consume the up or down change of this PointerInputChange if there is an up or down change to consume.
PointerInputChange.consumePositionChange
fun PointerInputChange.consumePositionChange(): Unit
Consume position change if there is any
PointerButtons.indexOfFirstPressed
fun PointerButtons.indexOfFirstPressed(): Int
Returns the index of first button pressed as used in isPressed or -1 if no button is pressed.
PointerButtons.indexOfLastPressed
fun PointerButtons.indexOfLastPressed(): Int
Returns the index of last button pressed as used in isPressed or -1 if no button is pressed.
PointerInputChange.isOutOfBounds
fun PointerInputChange.isOutOfBounds(size: IntSize): Boolean
Returns true if the pointer has moved outside of the region of (0, 0, size.width, size.height) or false if the current pointer is up or it is inside the given bounds.
PointerInputChange.isOutOfBounds
fun PointerInputChange.isOutOfBounds(
size: IntSize,
extendedTouchPadding: Size
): Boolean
Returns true if the pointer has moved outside of the pointer region. For Touch events, this is (-extendedTouchPadding.width, -extendedTouchPadding.height, size.width + extendedTouchPadding.width, size.height + extendedTouchPadding.height) and for other events, this is (0, 0, size.width, size.height). Returnsfalse if the current pointer is up or it is inside the pointer region.
PointerButtons.isPressed
fun PointerButtons.isPressed(buttonIndex: Int): Boolean
Returns true when the button at buttonIndex is pressed and false when it isn't pressed. This method can handle buttons that haven't been assigned a designated purpose like isPrimaryPressed and isSecondaryPressed.
PointerInputChange.positionChange
fun PointerInputChange.positionChange(): Offset
The distance that the pointer has moved on the screen minus any distance that has been consumed.
PointerInputChange.positionChangeConsumed
fun PointerInputChange.positionChangeConsumed(): Boolean
True if this PointerInputChange's movement has been consumed.
PointerInputChange.positionChangeIgnoreConsumed
fun PointerInputChange.positionChangeIgnoreConsumed(): Offset
The distance that the pointer has moved on the screen, ignoring the fact that it might have been consumed.
PointerInputChange.positionChanged
fun PointerInputChange.positionChanged(): Boolean
True if this PointerInputChange represents a pointer moving on the screen and some of that movement has not been consumed.
PointerInputChange.positionChangedIgnoreConsumed
fun PointerInputChange.positionChangedIgnoreConsumed(): Boolean
True if this PointerInputChange represents a pointer moving on the screen ignoring how much of that movement may have been consumed.
Extension properties
PointerButtons.areAnyPressed
val PointerButtons.areAnyPressed: Boolean
Returns true if any button is pressed or false if all buttons are released.
PointerKeyboardModifiers.isAltGraphPressed
val PointerKeyboardModifiers.isAltGraphPressed: Boolean
true when the AltGraph key is pressed.
PointerKeyboardModifiers.isAltPressed
val PointerKeyboardModifiers.isAltPressed: Boolean
true when the Alt key is pressed. This is commonly associated with the Option key on some keyboards.
PointerButtons.isBackPressed
val PointerButtons.isBackPressed: Boolean
true when the back button (mouse back button) is pressed or false when it isn't pressed or there is no mouse button assigned to "back."
PointerKeyboardModifiers.isCapsLockOn
val PointerKeyboardModifiers.isCapsLockOn: Boolean
true when the keyboard's Caps Lock is on.
PointerKeyboardModifiers.isCtrlPressed
val PointerKeyboardModifiers.isCtrlPressed: Boolean
true when the Control key is pressed.
PointerButtons.isForwardPressed
val PointerButtons.isForwardPressed: Boolean
true when the forward button (mouse forward button) is pressed or false when it isn't pressed or there is no button assigned to "forward."
PointerKeyboardModifiers.isFunctionPressed
val PointerKeyboardModifiers.isFunctionPressed: Boolean
true when the Function key is pressed.
PointerKeyboardModifiers.isMetaPressed
val PointerKeyboardModifiers.isMetaPressed: Boolean
true when the Meta key is pressed. This is commonly associated with the Windows or Command key on some keyboards.
PointerKeyboardModifiers.isNumLockOn
val PointerKeyboardModifiers.isNumLockOn: Boolean
true when the keyboard's Num Lock is on.
PointerButtons.isPrimaryPressed
val PointerButtons.isPrimaryPressed: Boolean
true when the primary button (left mouse button) is pressed or false when it isn't pressed.
PointerKeyboardModifiers.isScrollLockOn
val PointerKeyboardModifiers.isScrollLockOn: Boolean
true when the keyboard's Scroll Lock is on.
PointerButtons.isSecondaryPressed
val PointerButtons.isSecondaryPressed: Boolean
true when the secondary button (right mouse button) is pressed or false when it isn't pressed.
PointerKeyboardModifiers.isShiftPressed
val PointerKeyboardModifiers.isShiftPressed: Boolean
true when the Shift key is pressed.
PointerKeyboardModifiers.isSymPressed
val PointerKeyboardModifiers.isSymPressed: Boolean
true when the Sym key is pressed.
PointerButtons.isTertiaryPressed
val PointerButtons.isTertiaryPressed: Boolean
true when the tertiary button (middle mouse button) is pressed or false when it isn't pressed.