Class vCast.Input
The lowest level functions in IO system, to handle all types of device input and output.
輸入輸出系統中的第二級別的功能,用作處理所有類型的裝置輸入輸出。
Inheritance
Namespace: Votanic.vXR.vCast
Assembly: Votanic.vXR.dll
Syntax
public class Input
Properties
OpenVR
The handler of OpenVR device type in IO System.
輸入輸出系統中的 OpenVR 裝置類型處理器。
Declaration
public static OpenVRHandler OpenVR { get; }
Property Value
Type | Description |
---|---|
OpenVRHandler |
VInput
The handler of VInput device type in IO System.
輸入輸出系統中的 VInput 裝置類型處理器。
Declaration
public static VInputHandler VInput { get; }
Property Value
Type | Description |
---|---|
VInputHandler |
VRPN
The handler of VRPN device type in IO System.
輸入輸出系統中的 VRPN 裝置類型處理器。
Declaration
public static VRPNHandler VRPN { get; }
Property Value
Type | Description |
---|---|
VRPNHandler |
Methods
AxisDown(Int32, AxisDirection, Int32, Boolean, AssistButtons)
Return true if an axis in target axes is pressed (Absolute axis value >= Press detect value).
當目標軸群的軸按下時傳回 true(軸絕對值 >= 按下偵測值)。
AxisDown(0, AxisDirection.Positive, 0)
Declaration
public static bool AxisDown(int index, AxisDirection direction = AxisDirection.Any, int deviceIndex = 0, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Axis index |
AxisDirection | direction | Axis press direction |
System.Int32 | deviceIndex | Axes index |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Boolean |
AxisDown(Int32, AxisDirection, String, Boolean, AssistButtons)
Return true if an axis in target axes is pressed (Absolute axis value >= Press detect value).
當目標軸群的軸按下時傳回 true(軸絕對值 >= 按下偵測值)。
AxisDown(0, AxisDirection.Positive, "Controller (XBOX 360 For Windows).Axes")
Declaration
public static bool AxisDown(int index, AxisDirection direction, string deviceName, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Axis index |
AxisDirection | direction | Axis press direction |
System.String | deviceName | Axes name |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Boolean |
AxisDown(String, AxisDirection, Int32, Boolean, AssistButtons)
Return true if an axis in target axes is pressed (Absolute axis value >= Press detect value).
當目標軸群的軸按下時傳回 true(軸絕對值 >= 按下偵測值)。
AxisDown("LT", AxisDirection.Positive, 0)
Declaration
public static bool AxisDown(string name, AxisDirection direction = AxisDirection.Any, int deviceIndex = 0, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Axis name |
AxisDirection | direction | Axis press direction |
System.Int32 | deviceIndex | Axes index |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Boolean |
AxisDown(String, AxisDirection, String, Boolean, AssistButtons)
Return true if an axis in target axes is pressed (Absolute axis value >= Press detect value).
當目標軸群的軸按下時傳回 true(軸絕對值 >= 按下偵測值)。
AxisDown("LT", AxisDirection.Positive, "Controller (XBOX 360 For Windows).Axes")
Declaration
public static bool AxisDown(string name, AxisDirection direction, string deviceName, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Axis name |
AxisDirection | direction | Axis press direction |
System.String | deviceName | Axes name |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Boolean |
AxisHold(Int32, AxisDirection, Int32, Boolean, AssistButtons)
Return true if an axis in target axes is held for a while (Absolute axis value >= Press detect value).
當目標軸群的軸長按一段時間時傳回 true(軸絕對值 >= 按下偵測值)。
AxisHold(0, AxisDirection.Positive, 0)
Declaration
public static bool AxisHold(int index, AxisDirection direction = AxisDirection.Any, int deviceIndex = 0, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Axis index |
AxisDirection | direction | Axis press direction |
System.Int32 | deviceIndex | Axes index |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Boolean |
AxisHold(Int32, AxisDirection, String, Boolean, AssistButtons)
Return true if an axis in target axes is held for a while (Absolute axis value >= Press detect value).
當目標軸群的軸長按一段時間時傳回 true(軸絕對值 >= 按下偵測值)。
AxisHold(0, AxisDirection.Positive, "Controller (XBOX 360 For Windows).Axes")
Declaration
public static bool AxisHold(int index, AxisDirection direction, string deviceName, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Axis index |
AxisDirection | direction | Axis press direction |
System.String | deviceName | Axes name |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Boolean |
AxisHold(String, AxisDirection, Int32, Boolean, AssistButtons)
Return true if an axis in target axes is held for a while (Absolute axis value >= Press detect value).
當目標軸群的軸長按一段時間時傳回 true(軸絕對值 >= 按下偵測值)。
AxisHold("LT", AxisDirection.Positive, 0)
Declaration
public static bool AxisHold(string name, AxisDirection direction = AxisDirection.Any, int deviceIndex = 0, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Axis name |
AxisDirection | direction | Axis press direction |
System.Int32 | deviceIndex | Axes index |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Boolean |
AxisHold(String, AxisDirection, String, Boolean, AssistButtons)
Return true if an axis in target axes is held for a while (Absolute axis value >= Press detect value).
當目標軸群的軸長按一段時間時傳回 true(軸絕對值 >= 按下偵測值)。
AxisHold("LT", AxisDirection.Positive, "Controller (XBOX 360 For Windows).Axes")
Declaration
public static bool AxisHold(string name, AxisDirection direction, string deviceName, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Axis name |
AxisDirection | direction | Axis press direction |
System.String | deviceName | Axes name |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Boolean |
AxisPress(Int32, AxisDirection, Int32, Boolean, AssistButtons)
Return true if an axis in target axes is pressing (Absolute axis value >= Press detect value).
當目標軸群的軸正在按住時傳回 true(軸絕對值 >= 按下偵測值)。
AxisPress(0, AxisDirection.Positive, 0)
Declaration
public static bool AxisPress(int index, AxisDirection direction = AxisDirection.Any, int deviceIndex = 0, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Axis index |
AxisDirection | direction | Axis press direction |
System.Int32 | deviceIndex | Axes index |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Boolean |
AxisPress(Int32, AxisDirection, String, Boolean, AssistButtons)
Return true if an axis in target axes is pressing (Absolute axis value >= Press detect value).
當目標軸群的軸正在按住時傳回 true(軸絕對值 >= 按下偵測值)。
AxisPress(0, AxisDirection.Positive, "Controller (XBOX 360 For Windows).Axes")
Declaration
public static bool AxisPress(int index, AxisDirection direction, string deviceName, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Axis index |
AxisDirection | direction | Axis press direction |
System.String | deviceName | Axes name |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Boolean |
AxisPress(String, AxisDirection, Int32, Boolean, AssistButtons)
Return true if an axis in target axes is pressing (Absolute axis value >= Press detect value).
當目標軸群的軸正在按住時傳回 true(軸絕對值 >= 按下偵測值)。
AxisPress("LT", AxisDirection.Positive, 0)
Declaration
public static bool AxisPress(string name, AxisDirection direction = AxisDirection.Any, int deviceIndex = 0, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Axis name |
AxisDirection | direction | Axis press direction |
System.Int32 | deviceIndex | Axes index |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Boolean |
AxisPress(String, AxisDirection, String, Boolean, AssistButtons)
Return true if an axis in target axes is pressing (Absolute axis value >= Press detect value).
當目標軸群的軸正在按住時傳回 true(軸絕對值 >= 按下偵測值)。
AxisPress("LT", AxisDirection.Positive, "Controller (XBOX 360 For Windows).Axes")
Declaration
public static bool AxisPress(string name, AxisDirection direction, string deviceName, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Axis name |
AxisDirection | direction | Axis press direction |
System.String | deviceName | Axes name |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Boolean |
AxisUp(Int32, AxisDirection, Int32, Boolean, AssistButtons)
Return true if an axis in target axes is released (Absolute release value >= Press detect value).
當目標軸群的軸放開時傳回 true(釋放絕對值 >= 按下偵測值)。
AxisUp(0, AxisDirection.Positive, 0)
Declaration
public static bool AxisUp(int index, AxisDirection direction = AxisDirection.Any, int deviceIndex = 0, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Axis index |
AxisDirection | direction | Axis press direction |
System.Int32 | deviceIndex | Axes index |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Boolean |
AxisUp(Int32, AxisDirection, String, Boolean, AssistButtons)
Return true if an axis in target axes is released (Absolute release value >= Press detect value).
當目標軸群的軸放開時傳回 true(釋放絕對值 >= 按下偵測值)。
AxisUp(0, AxisDirection.Positive, "Controller (XBOX 360 For Windows).Axes")
Declaration
public static bool AxisUp(int index, AxisDirection direction, string deviceName, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Axis index |
AxisDirection | direction | Axis press direction |
System.String | deviceName | Axes name |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Boolean |
AxisUp(String, AxisDirection, Int32, Boolean, AssistButtons)
Return true if an axis in target axes is released (Absolute release value >= Press detect value).
當目標軸群的軸放開時傳回 true(釋放絕對值 >= 按下偵測值)。
AxisUp("LT", AxisDirection.Positive, 0)
Declaration
public static bool AxisUp(string name, AxisDirection direction = AxisDirection.Any, int deviceIndex = 0, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Axis name |
AxisDirection | direction | Axis press direction |
System.Int32 | deviceIndex | Axes index |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Boolean |
AxisUp(String, AxisDirection, String, Boolean, AssistButtons)
Return true if an axis in target axes is released (Absolute release value >= Press detect value).
當目標軸群的軸放開時傳回 true(釋放絕對值 >= 按下偵測值)。
AxisUp("LT", AxisDirection.Positive, "Controller (XBOX 360 For Windows).Axes")
Declaration
public static bool AxisUp(string name, AxisDirection direction, string deviceName, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Axis name |
AxisDirection | direction | Axis press direction |
System.String | deviceName | Axes name |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Boolean |
AxisValue(Int32, Int32, Boolean, AssistButtons)
Return the floating value of an axis in target axes.
傳回目標軸群的軸浮點值。
AxisValue(0, 0)
Declaration
public static float AxisValue(int index, int deviceIndex = 0, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Axis index |
System.Int32 | deviceIndex | Axes index |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Single |
AxisValue(Int32, String, Boolean, AssistButtons)
Return the floating value of an axis in target axes.
傳回目標軸群的軸浮點值。
AxisValue(0, "Controller (XBOX 360 For Windows).Axes")
Declaration
public static float AxisValue(int index, string deviceName, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Axis index |
System.String | deviceName | Axes name |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Single |
AxisValue(String, Int32, Boolean, AssistButtons)
Return the floating value of an axis in target axes.
傳回目標軸群的軸浮點值。
AxisValue("LT", 0)
Declaration
public static float AxisValue(string name, int deviceIndex = 0, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Axis name |
System.Int32 | deviceIndex | Axes index |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Single |
AxisValue(String, String, Boolean, AssistButtons)
Return the floating value of an axis in target axes.
傳回目標軸群的軸浮點值。
AxisValue("LT", AxisDirection.Positive, "Controller (XBOX 360 For Windows).Axes")
Declaration
public static float AxisValue(string name, string deviceName, bool reversed = false, AssistButtons assistButtons = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Axis name |
System.String | deviceName | Axes name |
System.Boolean | reversed | Reverse the result if true |
AssistButtons | assistButtons | Assist buttons |
Returns
Type | Description |
---|---|
System.Single |
ButtonDown(Int32, Int32, Boolean)
Return true if a button in target buttons is pressed.
當目標按鈕群的按鈕按下時傳回 true。
ButtonDown(0, 0)
Declaration
public static bool ButtonDown(int index, int deviceIndex = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Button index |
System.Int32 | deviceIndex | Buttons index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonDown(Int32, String, Boolean)
Return true if a button in target buttons is pressed.
當目標按鈕群的按鈕按下時傳回 true。
ButtonDown(0, "Controller (XBOX 360 For Windows).Buttons")
Declaration
public static bool ButtonDown(int index, string deviceName, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Button index |
System.String | deviceName | Buttons name |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonDown(String, Int32, Boolean)
Return true if a button in target buttons is pressed.
當目標按鈕群的按鈕按下時傳回 true。
ButtonDown("A", 0)
Declaration
public static bool ButtonDown(string name, int deviceIndex = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Button name |
System.Int32 | deviceIndex | Buttons index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonDown(String, String, Boolean)
Return true if a button in target buttons is pressed.
當目標按鈕群的按鈕按下時傳回 true。
ButtonDown("A", "Controller (XBOX 360 For Windows).Buttons")
Declaration
public static bool ButtonDown(string name, string deviceName, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Button name |
System.String | deviceName | Buttons name |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonHold(Int32, Int32, Boolean)
Return true if a button in target buttons is held for a while.
當目標按鈕群的按鈕長按一段時間時傳回 true。
ButtonHold(0, 0)
Declaration
public static bool ButtonHold(int index, int deviceIndex = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Button index |
System.Int32 | deviceIndex | Buttons index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonHold(Int32, String, Boolean)
Return true if a button in target buttons is held for a while.
當目標按鈕群的按鈕長按一段時間時傳回 true。
ButtonHold(0, "Controller (XBOX 360 For Windows).Buttons")
Declaration
public static bool ButtonHold(int index, string deviceName, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Button index |
System.String | deviceName | Buttons name |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonHold(String, Int32, Boolean)
Return true if a button in target buttons is held for a while.
當目標按鈕群的按鈕長按一段時間時傳回 true。
ButtonHold("A", 0)
Declaration
public static bool ButtonHold(string name, int deviceIndex = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Button name |
System.Int32 | deviceIndex | Buttons index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonHold(String, String, Boolean)
Return true if a button in target buttons is held for a while.
當目標按鈕群的按鈕長按一段時間時傳回 true。
ButtonHold("A", "Controller (XBOX 360 For Windows).Buttons")
Declaration
public static bool ButtonHold(string name, string deviceName, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Button name |
System.String | deviceName | Buttons name |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonPress(Int32, Int32, Boolean)
Return true if a button in target buttons is pressing.
當目標按鈕群的按鈕正在按住時傳回 true。
ButtonPress(0, 0)
Declaration
public static bool ButtonPress(int index, int deviceIndex = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Button index |
System.Int32 | deviceIndex | Buttons index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonPress(Int32, String, Boolean)
Return true if a button in target buttons is pressing.
當目標按鈕群的按鈕正在按住時傳回 true。
ButtonPress(0, "Controller (XBOX 360 For Windows).Buttons")
Declaration
public static bool ButtonPress(int index, string deviceName, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Button index |
System.String | deviceName | Buttons name |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonPress(String, Int32, Boolean)
Return true if a button in target buttons is pressing.
當目標按鈕群的按鈕正在按住時傳回 true。
ButtonPress("A", 0)
Declaration
public static bool ButtonPress(string name, int deviceIndex = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Button name |
System.Int32 | deviceIndex | Buttons index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonPress(String, String, Boolean)
Return true if a button in target buttons is pressing.
當目標按鈕群的按鈕正在按住時傳回 true。
ButtonPress("A", "Controller (XBOX 360 For Windows).Buttons")
Declaration
public static bool ButtonPress(string name, string deviceName, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Button name |
System.String | deviceName | Buttons name |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonTouch(Int32, Int32, Boolean)
Return true if a button in target buttons is touched.
當目標按鈕群的按鈕被觸碰時傳回 true。
ButtonTouch(0, 0)
Declaration
public static bool ButtonTouch(int index, int deviceIndex = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Button index |
System.Int32 | deviceIndex | Buttons index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonTouch(Int32, String, Boolean)
Return true if a button in target buttons is touched.
當目標按鈕群的按鈕被觸碰時傳回 true。
ButtonTouch(0, "Controller (XBOX 360 For Windows).Buttons")
Declaration
public static bool ButtonTouch(int index, string deviceName, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Button index |
System.String | deviceName | Buttons name |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonTouch(String, Int32, Boolean)
Return true if a button in target buttons is touched.
當目標按鈕群的按鈕被觸碰時傳回 true。
ButtonTouch("A", 0)
Declaration
public static bool ButtonTouch(string name, int deviceIndex = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Button name |
System.Int32 | deviceIndex | Buttons index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonTouch(String, String, Boolean)
Return true if a button in target buttons is touched.
當目標按鈕群的按鈕被觸碰時傳回 true。
ButtonTouch("A", "Controller (XBOX 360 For Windows).Buttons")
Declaration
public static bool ButtonTouch(string name, string deviceName, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Button name |
System.String | deviceName | Buttons name |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonUp(Int32, Int32, Boolean)
Return true if a button in target buttons is released.
當目標按鈕群的按鈕放開時傳回 true。
ButtonUp(0, 0)
Declaration
public static bool ButtonUp(int index, int deviceIndex = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Button index |
System.Int32 | deviceIndex | Buttons index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonUp(Int32, String, Boolean)
Return true if a button in target buttons is released.
當目標按鈕群的按鈕放開時傳回 true。
ButtonUp(0, "Controller (XBOX 360 For Windows).Buttons")
Declaration
public static bool ButtonUp(int index, string deviceName, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Button index |
System.String | deviceName | Buttons name |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonUp(String, Int32, Boolean)
Return true if a button in target buttons is released.
當目標按鈕群的按鈕放開時傳回 true。
ButtonUp("A", 0)
Declaration
public static bool ButtonUp(string name, int deviceIndex = 0, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Button name |
System.Int32 | deviceIndex | Buttons index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
ButtonUp(String, String, Boolean)
Return true if a button in target buttons is released.
當目標按鈕群的按鈕放開時傳回 true。
ButtonUp("A", "Controller (XBOX 360 For Windows).Buttons")
Declaration
public static bool ButtonUp(string name, string deviceName, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Button name |
System.String | deviceName | Buttons name |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
DeviceIndex(String)
Return the index of a buttons or an axes.
傳回一個按鈕群或軸群的編號。
DeviceIndex("Controller (XBOX 360 For Windows).Buttons")
Declaration
public static int DeviceIndex(string device)
Parameters
Type | Name | Description |
---|---|---|
System.String | device | Buttons name or Axes name |
Returns
Type | Description |
---|---|
System.Int32 |
GetAxisIndex(Int32, String)
Return the axis index by axis name.
根據軸名稱傳回軸編號。
GetAxisIndex(0, "LT")
Declaration
public static int GetAxisIndex(int axes, string axisName)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | axes | Axes name |
System.String | axisName | Axis name |
Returns
Type | Description |
---|---|
System.Int32 |
GetButtonIndex(Int32, String)
Return the button index by button name.
根據按鈕名稱傳回按鈕編號。
GetButtonIndex(0, "A")
Declaration
public static int GetButtonIndex(int buttons, string buttonName)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | buttons | Buttons name |
System.String | buttonName | Button name |
Returns
Type | Description |
---|---|
System.Int32 |
GetKeyIndex(String)
Return the key index of keyboard by key name.
根據鍵盤的按鍵名稱傳回按鍵編號。
GetKeyIndex("Space")
Declaration
public static int GetKeyIndex(string keyName)
Parameters
Type | Name | Description |
---|---|---|
System.String | keyName | Key name |
Returns
Type | Description |
---|---|
System.Int32 |
KeyboardDown(Int32, Boolean)
Return true if a key on keyboard is pressed.
當鍵盤上的按鍵按下時傳回 true。
KeyboardDown(57)
Declaration
public static bool KeyboardDown(int index, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Key index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
KeyboardDown(KeyCode, Boolean)
Return true if a key on keyboard is pressed.
當鍵盤上的按鍵按下時傳回 true。
KeyboardDown(KeyCode.Space)
Declaration
public static bool KeyboardDown(KeyCode key, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.KeyCode | key | KeyCode |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
KeyboardHold(Int32, Boolean)
Return true if a key on keyboard is held for a while.
當鍵盤上的按鍵長按一段時間時傳回 true。
KeyboardHold(57)
Declaration
public static bool KeyboardHold(int index, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Key index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
KeyboardHold(KeyCode, Boolean)
Return true if a key on keyboard is held for a while.
當鍵盤上的按鍵長按一段時間時傳回 true。
KeyboardHold(KeyCode.Space)
Declaration
public static bool KeyboardHold(KeyCode key, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.KeyCode | key | KeyCode |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
KeyboardPress(Int32, Boolean)
Return true if a key on keyboard is pressing.
當鍵盤上的按鍵正在按住時傳回 true。
KeyboardPress(57)
Declaration
public static bool KeyboardPress(int index, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Key index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
KeyboardPress(KeyCode, Boolean)
Return true if a key on keyboard is pressing.
當鍵盤上的按鍵按住時傳回 true。
KeyboardPress(KeyCode.Space)
Declaration
public static bool KeyboardPress(KeyCode key, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.KeyCode | key | KeyCode |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
KeyboardUp(Int32, Boolean)
Return true if a key on keyboard is released.
當鍵盤上的按鍵放開時傳回 true。
KeyboardUp(57)
Declaration
public static bool KeyboardUp(int index, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Key index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
KeyboardUp(KeyCode, Boolean)
Return true if a key on keyboard is released.
當鍵盤上的按鍵放開時傳回 true。
KeyboardUp(KeyCode.Space)
Declaration
public static bool KeyboardUp(KeyCode key, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.KeyCode | key | KeyCode |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
MouseAxis(Int32, Boolean)
Return the floatng value of a mouse axis.
傳回滑鼠軸的浮點值。
MouseAxis(0)
Declaration
public static float MouseAxis(int index, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Axis index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Single |
MouseDown(Int32, Boolean)
Return true if a key on mouse is pressed.
當滑鼠上的按鍵按下時傳回 true。
MouseDown(0)
Declaration
public static bool MouseDown(int index, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Key index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
MouseHold(Int32, Boolean)
Return true if a key on mouse is held for a while.
當滑鼠上的按鍵長按一段時間時傳回 true。
MouseHold(0)
Declaration
public static bool MouseHold(int index, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Key index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
MousePress(Int32, Boolean)
Return true if a key on mouse is pressing.
當滑鼠上的按鍵正在按住時傳回 true。
MousePress(0)
Declaration
public static bool MousePress(int index, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Key index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
MouseUp(Int32, Boolean)
Return true if a key on mouse is released.
當滑鼠上的按鍵放開時傳回 true。
MouseUp(0)
Declaration
public static bool MouseUp(int index, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Key index |
System.Boolean | reversed | Reverse the result if true |
Returns
Type | Description |
---|---|
System.Boolean |
Scan()
Search the existing VInput devices and auto set controller buttons and axes if avaliable.
搜索存在的 VInput 裝置並在可行情況下自動為控制器設定按鈕群及軸群。
Declaration
public static void Scan()
SetScanOrder(DeviceClass[])
Set the order of device classes for scanning and auto set controller buttons and axes.
設定掃瞄及自動為控制器設定按鈕群及軸群的裝置類別順序。
SetScanOrder(DeviceClass.OpenVR, DeviceClass.VInput, DeviceClass.VRPN)
Declaration
public static void SetScanOrder(params DeviceClass[] deviceClasses)
Parameters
Type | Name | Description |
---|---|---|
DeviceClass[] | deviceClasses | Sorted list of device classes |