# VrButton #

This Component is a helper for managing the interaction state machine for a gaze button. By default, a VrButton has no appearance and will only act as a wrapper to capture events, but it can be styled in the same ways as a View.

<VrButton style={{width: 0.7}} onClick={()=>this._onViewClicked()}> <Image style={{width:1, height:1}} source={{uri:'../../Assets/Images/gaze_cursor_cross_hi.png'}} inset={[0.2,0.2,0.2,0.2]} insetSize={[0.05,0.45,0.55,0.15]} > </Image> </VrButton>

The State Machine for button state.

+-------------+ | FOCUS_OUT | <---------------------------------------------------------+ +-------------+ <--------------------+ | + ^ | | | ENTER | EXIT | EXIT EXIT| v + + + +-----------+ KEY_PRESSED +----------------+ LONG DELAY+---------------------+ | FOCUS_IN | +-----------> | FOCUS_IN_PRESS | +-------> | FOCUS_IN_LONG_PRESS | +-----------+ +----------------+ +---------------------+ ^ ^ + + | | KEY_RELEASED | | | +-------------------------+ KEY_RELEASED | +-----------------------------------------------------------------------+ Standard component dipatching click events These input event will be considered as primary key and handled by VrButton - Button A on XBOX Gamepad - Space button on keyboard - Left click on Mouse - Touch on screen

### Props #

#### View props... #

#### disabled PropTypes.bool #

If `true`, this component can't be interacted with.

#### longClickDelayMS PropTypes.number #

Custom delay time for long click

#### onClick PropTypes.func #

Invoked on short click event or if no long click handler

#### onEnter PropTypes.func #

Invoked when button hit enters

#### onExit PropTypes.func #

Invoked when button hit exits

#### onLongClick PropTypes.func #

Invoked on long click event

#### style style #

###### Layout Props...

###### Shadow Props...

###### Transforms...

###### backgroundColor color

###### borderColor color

###### borderRadius number

###### borderWidth number

###### opacity number

You can edit the content above on GitHub and send us a pull request!

← Prev Next →