Class: Wx::JoystickEvent

Inherits:
Event show all
Defined in:
lib/wx/doc/gen/events.rb

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:

Category: Events

See Also:

  • Joystick

Instance Method Summary collapse

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.

Parameters:

  • eventType (Wx::GenericCollapsiblePane::EventType) (defaults to: Wx::EVT_NULL)
  • state (Integer) (defaults to: 0)
  • joystick (Integer) (defaults to: wxJOYSTICK1)
  • change (Integer) (defaults to: 0)


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).

Parameters:

  • button (Integer) (defaults to: Wx::JOY_BUTTON_ANY)

    Can be Wx::JOY_BUTTONn where n is 1, 2, 3 or 4; or Wx::JOY_BUTTON_ANY to indicate any button down event.

Returns:

  • (Boolean)


1981
# File 'lib/wx/doc/gen/events.rb', line 1981

def button_down(button=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.

Parameters:

  • button (Integer) (defaults to: Wx::JOY_BUTTON_ANY)

    Can be Wx::JOY_BUTTONn where n is 1, 2, 3 or 4; or Wx::JOY_BUTTON_ANY to indicate any button down event.

Returns:

  • (Boolean)


1986
# File 'lib/wx/doc/gen/events.rb', line 1986

def button_is_down(button=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).

Parameters:

  • button (Integer) (defaults to: Wx::JOY_BUTTON_ANY)

    Can be Wx::JOY_BUTTONn where n is 1, 2, 3 or 4; or Wx::JOY_BUTTON_ANY to indicate any button down event.

Returns:

  • (Boolean)


1991
# File 'lib/wx/doc/gen/events.rb', line 1991

def button_up(button=Wx::JOY_BUTTON_ANY) end

#get_button_changeInteger Also known as: button_change

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.

Returns:

  • (Integer)


2002
# File 'lib/wx/doc/gen/events.rb', line 2002

def get_button_change; end

#get_button_ordinalInteger Also known as: button_ordinal

Returns the 0-indexed ordinal of the button changing state.

Returns:

  • (Integer)

See Also:



2010
# File 'lib/wx/doc/gen/events.rb', line 2010

def get_button_ordinal; end

#get_button_stateInteger Also known as: button_state

Returns the down state of the buttons.

This is a Wx::JOY_BUTTONn identifier, where n is one of 1, 2, 3, 4.

Returns:

  • (Integer)


2017
# File 'lib/wx/doc/gen/events.rb', line 2017

def get_button_state; end

#get_joystickInteger Also known as: joystick

Returns the identifier of the joystick generating the event - one of Wx::JOYSTICK1 and Wx::JOYSTICK2.

Returns:

  • (Integer)


2022
# File 'lib/wx/doc/gen/events.rb', line 2022

def get_joystick; end

#get_positionWx::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.

Returns:



2029
# File 'lib/wx/doc/gen/events.rb', line 2029

def get_position; end

#get_z_positionInteger Also known as: z_position

Returns the z position of the joystick event.

This method can only be used for EVT_JOY_ZMOVE events.

Returns:

  • (Integer)


2036
# File 'lib/wx/doc/gen/events.rb', line 2036

def get_z_position; end

#is_buttonBoolean Also known as: button?

Returns true if this was a button up or down event (not ‘is any button down?’).

Returns:

  • (Boolean)


2041
# File 'lib/wx/doc/gen/events.rb', line 2041

def is_button; end

#is_moveBoolean Also known as: move?

Returns true if this was an x, y move event.

Returns:

  • (Boolean)


2046
# File 'lib/wx/doc/gen/events.rb', line 2046

def is_move; end

#is_z_moveBoolean Also known as: z_move?

Returns true if this was a z move event.

Returns:

  • (Boolean)


2051
# File 'lib/wx/doc/gen/events.rb', line 2051

def is_z_move; end