檢視原始碼 wxJoystickEvent (wx v2.4.3)
此事件類別包含關於搖桿事件的資訊,特別是視窗接收到的事件。
此類別繼承自,且可以使用以下類別的函式:
wxWidgets 文件:wxJoystickEvent
事件
使用 wxEvtHandler:connect/3
和 wxJoystickEventType
來訂閱此類型的事件。
摘要
函式
如果事件是指定按鈕(或任何按鈕)的按下事件,則返回 true。
如果指定的按鈕(或任何按鈕)處於按下狀態,則返回 true。
如果事件是指定按鈕(或任何按鈕)的彈起事件,則返回 true。
返回正在改變狀態的按鈕的識別碼。
返回按鈕的按下狀態。
返回產生事件的搖桿的識別碼 - wxJOYSTICK1 和 wxJOYSTICK2 其中之一。
返回搖桿事件的 x, y 位置。
返回搖桿事件的 z 位置。
如果此事件是按鈕按下或彈起事件(不是
'是否有任何按鈕按下?'),則返回 true。
如果此事件是 x, y 移動事件,則返回 true。
如果此事件是 z 移動事件,則返回 true。
類型
-type wxJoystickEvent() :: wx:wx_object().
-type wxJoystickEventType() :: joy_button_down | joy_button_up | joy_move | joy_zmove.
函式
-spec buttonDown(This) -> boolean() when This :: wxJoystickEvent().
等同於 buttonDown(This, [])
。
-spec buttonDown(This, [Option]) -> boolean() when This :: wxJoystickEvent(), Option :: {but, integer()}.
如果事件是指定按鈕(或任何按鈕)的按下事件,則返回 true。
-spec buttonIsDown(This) -> boolean() when This :: wxJoystickEvent().
-spec buttonIsDown(This, [Option]) -> boolean() when This :: wxJoystickEvent(), Option :: {but, integer()}.
如果指定的按鈕(或任何按鈕)處於按下狀態,則返回 true。
-spec buttonUp(This) -> boolean() when This :: wxJoystickEvent().
等同於 buttonUp(This, [])
。
-spec buttonUp(This, [Option]) -> boolean() when This :: wxJoystickEvent(), Option :: {but, integer()}.
如果事件是指定按鈕(或任何按鈕)的彈起事件,則返回 true。
-spec getButtonChange(This) -> integer() when This :: wxJoystickEvent().
返回正在改變狀態的按鈕的識別碼。
返回值為 n
,其中 n
是正在改變狀態的按鈕的索引,也可以使用 GetButtonOrdinal()
擷取(在 wx 中未實作)。
請注意,對於 n
等於 1、2、3 或 4 的情況,有預先定義的 wxJOY_BUTTONn
常數可以使用,以提高清晰度,但是這些常數並未針對前四個按鈕以外的按鈕定義。
-spec getButtonState(This) -> integer() when This :: wxJoystickEvent().
返回按鈕的按下狀態。
這是一個 wxJOY_BUTTONn
識別碼,其中 n
是 1、2、3、4 其中之一。
-spec getJoystick(This) -> integer() when This :: wxJoystickEvent().
返回產生事件的搖桿的識別碼 - wxJOYSTICK1 和 wxJOYSTICK2 其中之一。
-spec getPosition(This) -> {X :: integer(), Y :: integer()} when This :: wxJoystickEvent().
返回搖桿事件的 x, y 位置。
這些座標對於除了 wxEVT_JOY_ZMOVE 之外的所有事件都有效。
-spec getZPosition(This) -> integer() when This :: wxJoystickEvent().
返回搖桿事件的 z 位置。
此方法只能用於 wxEVT_JOY_ZMOVE 事件。
-spec isButton(This) -> boolean() when This :: wxJoystickEvent().
如果此事件是按鈕按下或彈起事件(不是
'是否有任何按鈕按下?'),則返回 true。
-spec isMove(This) -> boolean() when This :: wxJoystickEvent().
如果此事件是 x, y 移動事件,則返回 true。
-spec isZMove(This) -> boolean() when This :: wxJoystickEvent().
如果此事件是 z 移動事件,則返回 true。