PointerButtons


Contains the state of pointer buttons (e.g. mouse and stylus buttons).

Summary

Public constructors

Cmn

Extension functions

Int

Returns the index of first button pressed as used in isPressed or -1 if no button is pressed.

Cmn
android
Int

Returns the index of last button pressed as used in isPressed or -1 if no button is pressed.

Cmn
android
Boolean

Returns true when the button at buttonIndex is pressed and false when it isn't pressed.

Cmn
android

Extension properties

Boolean

Returns true if any button is pressed or false if all buttons are released.

Cmn
android
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."

Cmn
android
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."

Cmn
android
Boolean

true when the primary button (left mouse button) is pressed or false when it isn't pressed.

Cmn
android
Boolean

true when the secondary button (right mouse button) is pressed or false when it isn't pressed.

Cmn
android
Boolean

true when the tertiary button (middle mouse button) is pressed or false when it isn't pressed.

Cmn
android

Public constructors

PointerButtons

PointerButtons(packedValue: NativePointerButtons)

Extension functions

indexOfFirstPressed

fun PointerButtons.indexOfFirstPressed(): Int

Returns the index of first button pressed as used in isPressed or -1 if no button is pressed.

indexOfLastPressed

fun PointerButtons.indexOfLastPressed(): Int

Returns the index of last button pressed as used in isPressed or -1 if no button is pressed.

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.

Extension properties

areAnyPressed

val PointerButtons.areAnyPressedBoolean

Returns true if any button is pressed or false if all buttons are released.

isBackPressed

val PointerButtons.isBackPressedBoolean

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."

isForwardPressed

val PointerButtons.isForwardPressedBoolean

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."

isPrimaryPressed

val PointerButtons.isPrimaryPressedBoolean

true when the primary button (left mouse button) is pressed or false when it isn't pressed.

isSecondaryPressed

val PointerButtons.isSecondaryPressedBoolean

true when the secondary button (right mouse button) is pressed or false when it isn't pressed.

isTertiaryPressed

val PointerButtons.isTertiaryPressedBoolean

true when the tertiary button (middle mouse button) is pressed or false when it isn't pressed.