Class: Wx::JoystickEvent
Overview
This event class contains information about joystick events, particularly events received by windows.
Events using this class
The following event-handler methods redirect the events to member method or handler blocks for JoystickEvent events. Event handler methods:
-
EvtHandler#evt_joy_button_down(meth = nil, &block): Process a EVT_JOY_BUTTON_DOWN event.
-
EvtHandler#evt_joy_button_up(meth = nil, &block): Process a EVT_JOY_BUTTON_UP event.
-
EvtHandler#evt_joy_move(meth = nil, &block): Process a EVT_JOY_MOVE event.
-
EvtHandler#evt_joy_zmove(meth = nil, &block): Process a EVT_JOY_ZMOVE event.
-
EvtHandler#evt_joystick_events(meth = nil, &block): Processes all joystick events.
Category: Events
Instance Method Summary collapse
-
#button_down(button = Wx::JOY_BUTTON_ANY) ⇒ Boolean
Returns true if the event was a down event from the specified button (or any button).
-
#button_is_down(button = Wx::JOY_BUTTON_ANY) ⇒ Boolean
Returns true if the specified button (or any button) was in a down state.
-
#button_up(button = Wx::JOY_BUTTON_ANY) ⇒ Boolean
Returns true if the event was an up event from the specified button (or any button).
-
#get_button_change ⇒ Integer
(also: #button_change)
Returns the identifier of the button changing state.
-
#get_button_ordinal ⇒ Integer
(also: #button_ordinal)
Returns the 0-indexed ordinal of the button changing state.
-
#get_button_state ⇒ Integer
(also: #button_state)
Returns the down state of the buttons.
- #get_joystick ⇒ Integer (also: #joystick)
-
#get_position ⇒ Wx::Point
(also: #position)
Returns the x, y position of the joystick event.
-
#get_z_position ⇒ Integer
(also: #z_position)
Returns the z position of the joystick event.
-
#initialize(eventType = Wx::EVT_NULL, state = 0, joystick = wxJOYSTICK1, change = 0) ⇒ Wx::JoystickEvent
constructor
Constructor.
-
#is_button ⇒ Boolean
(also: #button?)
Returns true if this was a button up or down event (not ‘is any button down?’).
-
#is_move ⇒ Boolean
(also: #move?)
Returns true if this was an x, y move event.
-
#is_z_move ⇒ Boolean
(also: #z_move?)
Returns true if this was a z move event.
Methods inherited from Event
#clone, #get_event_category, #get_event_object, #get_event_type, #get_id, #get_skipped, #get_timestamp, #is_command_event, #resume_propagation, #set_event_object, #set_event_type, #set_id, #set_timestamp, #should_propagate, #skip, #stop_propagation
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize(eventType = Wx::EVT_NULL, state = 0, joystick = wxJOYSTICK1, change = 0) ⇒ Wx::JoystickEvent
Constructor.
1976 |
# File 'lib/wx/doc/gen/events.rb', line 1976 def initialize(eventType=Wx::EVT_NULL, state=0, joystick=wxJOYSTICK1, change=0) end |
Instance Method Details
#button_down(button = Wx::JOY_BUTTON_ANY) ⇒ Boolean
Returns true if the event was a down event from the specified button (or any button).
1981 |
# File 'lib/wx/doc/gen/events.rb', line 1981 def (=Wx::JOY_BUTTON_ANY) end |
#button_is_down(button = Wx::JOY_BUTTON_ANY) ⇒ Boolean
Returns true if the specified button (or any button) was in a down state.
1986 |
# File 'lib/wx/doc/gen/events.rb', line 1986 def (=Wx::JOY_BUTTON_ANY) end |
#button_up(button = Wx::JOY_BUTTON_ANY) ⇒ Boolean
Returns true if the event was an up event from the specified button (or any button).
1991 |
# File 'lib/wx/doc/gen/events.rb', line 1991 def (=Wx::JOY_BUTTON_ANY) end |
#get_button_change ⇒ Integer Also known as:
Returns the identifier of the button changing state.
The return value is
1 << n
where n is the index of the button changing state, which can also be retrieved using #get_button_ordinal. Note that for n equal to 1, 2, 3 or 4 there are predefined Wx::JOY_BUTTONn constants which can be used for more clarity, however these constants are not defined for the buttons beyond the first four.
2002 |
# File 'lib/wx/doc/gen/events.rb', line 2002 def ; end |
#get_button_ordinal ⇒ Integer Also known as:
Returns the 0-indexed ordinal of the button changing state.
2010 |
# File 'lib/wx/doc/gen/events.rb', line 2010 def ; end |
#get_button_state ⇒ Integer Also known as:
Returns the down state of the buttons.
This is a Wx::JOY_BUTTONn identifier, where n is one of 1, 2, 3, 4.
2017 |
# File 'lib/wx/doc/gen/events.rb', line 2017 def ; end |
#get_joystick ⇒ Integer Also known as: joystick
Returns the identifier of the joystick generating the event - one of Wx::JOYSTICK1 and Wx::JOYSTICK2.
2022 |
# File 'lib/wx/doc/gen/events.rb', line 2022 def get_joystick; end |
#get_position ⇒ Wx::Point Also known as: position
Returns the x, y position of the joystick event.
These coordinates are valid for all the events except EVT_JOY_ZMOVE.
2029 |
# File 'lib/wx/doc/gen/events.rb', line 2029 def get_position; end |
#get_z_position ⇒ Integer Also known as: z_position
Returns the z position of the joystick event.
This method can only be used for EVT_JOY_ZMOVE events.
2036 |
# File 'lib/wx/doc/gen/events.rb', line 2036 def get_z_position; end |
#is_button ⇒ Boolean Also known as:
Returns true if this was a button up or down event (not ‘is any button down?’).
2041 |
# File 'lib/wx/doc/gen/events.rb', line 2041 def ; end |
#is_move ⇒ Boolean Also known as: move?
Returns true if this was an x, y move event.
2046 |
# File 'lib/wx/doc/gen/events.rb', line 2046 def is_move; end |
#is_z_move ⇒ Boolean Also known as: z_move?
Returns true if this was a z move event.
2051 |
# File 'lib/wx/doc/gen/events.rb', line 2051 def is_z_move; end |