Show / Hide Table of Contents

Class Buttons

The buttons class. Device type that contains group of buttons.
按鈕群類別。包含一組按鈕的裝置類型。

Inheritance
System.Object
Element
Device
Buttons
MobileButtons
OpenVRButtons
VInputButtons
VInputKeyboard
VInputMouse
VRPNButtons
Inherited Members
Device.address
Device.channel
Device.index
Device.holdingDuration
Device.ButtonIndex(String, String)
Device.AxisIndex(String, String)
Device.KeyboardIndex(String)
Element.name
Element.Equals(String, Boolean)
Element.Contains(String, Boolean, Boolean)
Namespace: Votanic.vIO
Assembly: Votanic.vIO.dll
Syntax
public abstract class Buttons : Device

Constructors

Buttons()

Declare a buttons.
宣告一個按鈕群。

Declaration
public Buttons()

Buttons(Int32, String, String, Int32, Int32, Single)

Declare a buttons.
宣告一個按鈕群。

Declaration
public Buttons(int index, string name, string address, int channel, int numberOfButton, float holdingDuration = 1F)
Parameters
Type Name Description
System.Int32 index

Index of buttons
按鈕群編號

System.String name

Name of buttons
按鈕群名稱

System.String address

Address of buttons
按鈕群位置

System.Int32 channel

Channel of buttons
按鈕群頻道

System.Int32 numberOfButton

Number of button in buttons
按鈕群的按鈕數量

System.Single holdingDuration

Holding seconds of hold input type
長按輸入類型的長按秒數

Fields

numberOfButton

Number of button in buttons.
按鈕群的按鈕數量。

Declaration
[Tooltip("Number of button in buttons.\n按鈕群的按鈕數量。")]
public int numberOfButton
Field Value
Type Description
System.Int32

Methods

ButtonDown(Int32, Boolean)

Return true if the button is pressed.
當按鈕按下時傳回 true。

ButtonDown(0)

Declaration
public virtual bool ButtonDown(int index, bool reversed = false)
Parameters
Type Name Description
System.Int32 index

Button index
按鈕編號

System.Boolean reversed

Reverse the result if true
當 true 時反轉結果

Returns
Type Description
System.Boolean

ButtonHold(Int32, Boolean)

Return true if the button is held for a while.
當按鈕長按一段時間時傳回 true。

ButtonHold(0)

Declaration
public virtual bool ButtonHold(int index, bool reversed = false)
Parameters
Type Name Description
System.Int32 index

Button index
按鈕編號

System.Boolean reversed

Reverse the result if true
當 true 時反轉結果

Returns
Type Description
System.Boolean

ButtonPress(Int32, Boolean)

Return true if the button is pressing.
當按鈕按住時傳回 true。

ButtonPress(0)

Declaration
public abstract bool ButtonPress(int index, bool reversed = false)
Parameters
Type Name Description
System.Int32 index

Button index
按鈕編號

System.Boolean reversed

Reverse the result if true
當 true 時反轉結果

Returns
Type Description
System.Boolean

ButtonTouch(Int32, Boolean)

Return true if the button is touched.
當按鈕被觸碰時傳回 true。

ButtonTouch(0)

Declaration
public virtual bool ButtonTouch(int index, bool reversed = false)
Parameters
Type Name Description
System.Int32 index

Button index
按鈕編號

System.Boolean reversed

Reverse the result if true
當 true 時反轉結果

Returns
Type Description
System.Boolean

ButtonUp(Int32, Boolean)

Return true if the button is released.
當按鈕放開時傳回 true。

ButtonUp(0)

Declaration
public virtual bool ButtonUp(int index, bool reversed = false)
Parameters
Type Name Description
System.Int32 index

Button index
按鈕編號

System.Boolean reversed

Reverse the result if true
當 true 時反轉結果

Returns
Type Description
System.Boolean

SetHoldingDuration(Int32, Single)

Set the holding type target seconds of a button.
設定一個按鈕的長按時間。

SetHoldingDuration(0, 1)

Declaration
public virtual void SetHoldingDuration(int index, float holdingDuration = 1F)
Parameters
Type Name Description
System.Int32 index

Target index
目標編號

System.Single holdingDuration

Target seconds
目標秒數

SetHoldingDuration(Single, Boolean)

Set the holding type target seconds of buttons.
設定按鈕群長按輸入類型所需的目標秒數。

SetHoldingDuration(1, true)

Declaration
public virtual void SetHoldingDuration(float holdingDuration = 1F, bool setToAll = false)
Parameters
Type Name Description
System.Single holdingDuration

Target seconds
目標秒數

System.Boolean setToAll

Set to all input indices if true, else only set to the index using global value
當 true 時設定到所有輸入編號,否則只設定到使用公用值的編號

In This Article
Back to top Generated by DocFX