JoystickSensor(Sensor)

base classes — bpy_struct, Sensor

class bpy.types.JoystickSensor(Sensor)

Sensor to detect joystick events

axis_direction

The direction of the stick (default 'RIGHTAXIS')

Type:

Literal[‘RIGHTAXIS’, ‘UPAXIS’, ‘LEFTAXIS’, ‘DOWNAXIS’]

axis_number

Which Stick to use (default 'LEFT_STICK')

Type:

Literal[‘LEFT_STICK’, ‘RIGHT_STICK’]

axis_threshold

Threshold minimum to detect the stick/trigger (in [0, 32768], default 0)

Type:

int

axis_trigger_number

Which trigger to detect (default 'LEFT_SHOULDER_TRIGGER')

Type:

Literal[‘LEFT_SHOULDER_TRIGGER’, ‘RIGHT_SHOULDER_TRIGGER’]

button_number

Which button to use (default 'BUTTON_A')

Type:

Literal[‘BUTTON_A’, ‘BUTTON_B’, ‘BUTTON_X’, ‘BUTTON_Y’, ‘BUTTON_BACK’, ‘BUTTON_GUIDE’, ‘BUTTON_START’, ‘BUTTON_STICK_LEFT’, ‘BUTTON_STICK_RIGHT’, ‘BUTTON_SHOULDER_LEFT’, ‘BUTTON_SHOULDER_RIGHT’, ‘BUTTON_DPAD_UP’, ‘BUTTON_DPAD_DOWN’, ‘BUTTON_DPAD_LEFT’, ‘BUTTON_DPAD_RIGHT’]

event_type

The type of event this joystick sensor is triggered on (default 'BUTTONS')

Type:

Literal[‘STICK_DIRECTIONS’, ‘STICK_AXIS’, ‘SHOULDER_TRIGGERS’, ‘BUTTONS’]

joystick_index

Which joystick to use (in [0, 7], default 0)

Type:

int

single_axis_number

Which stick single axis (vertical/horizontal/other) to detect (default 'LEFT_STICK_HORIZONTAL')

Type:

Literal[‘LEFT_STICK_HORIZONTAL’, ‘LEFT_STICK_VERTICAL’, ‘RIGHT_STICK_HORIZONTAL’, ‘RIGHT_STICK_VERTICAL’]

use_all_events

Triggered by all events on this joystick’s current type (axis/button) (default False)

Type:

bool

classmethod bl_rna_get_subclass(id, default=None, /)
Parameters:
  • id (str) – The RNA type identifier.

  • default (bpy.types.Struct | None) – The value to return when not found.

Returns:

The RNA type or default when not found.

Return type:

bpy.types.Struct

classmethod bl_rna_get_subclass_py(id, default=None, /)
Parameters:
  • id (str) – The RNA type identifier.

  • default (type | None) – The value to return when not found.

Returns:

The class or default when not found.

Return type:

type

Inherited Properties

Inherited Functions