# JoystickSensor(Sensor)

base classes — `bpy_struct`, `Sensor`

class `bpy.types.``JoystickSensor`(Sensor)

  Sensor to detect joystick events

  `axis_direction`

    The direction of the axis

    Type: | enum in [‘RIGHTAXIS’, ‘UPAXIS’, ‘LEFTAXIS’, ‘DOWNAXIS’], default ‘RIGHTAXIS’

  `axis_number`

    Which axis pair to use, 1 is usually the main direction input

    Type: | int in [1, 8], default 0

  `axis_threshold`

    Precision of the axis

    Type: | int in [0, 32768], default 0

  `button_number`

    Which button to use

    Type: | int in [0, 18], default 0

  `event_type`

    The type of event this joystick sensor is triggered on

    Type: | enum in [‘BUTTON’, ‘AXIS’, ‘HAT’, ‘AXIS_SINGLE’], default ‘BUTTON’

  `hat_direction`

    Hat direction

    Type: | enum in [‘UP’, ‘DOWN’, ‘LEFT’, ‘RIGHT’, ‘UPRIGHT’, ‘DOWNLEFT’, ‘UPLEFT’, ‘DOWNRIGHT’], default ‘UP’

  `hat_number`

    Which hat to use

    Type: | int in [1, 2], default 0

  `joystick_index`

    Which joystick to use

    Type: | int in [0, 7], default 0

  `single_axis_number`

    Single axis (vertical/horizontal/other) to detect

    Type: | int in [1, 16], default 0

  `use_all_events`

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

    Type: | boolean, default False

Inherited Properties

`bpy_struct.id_data` `Sensor.name` `Sensor.type` `Sensor.pin` `Sensor.active` `Sensor.show_expanded` `Sensor.invert` | `Sensor.use_level` `Sensor.use_pulse_true_level` `Sensor.use_pulse_false_level` `Sensor.tick_skip` `Sensor.use_tap` `Sensor.controllers`

Inherited Functions

`bpy_struct.as_pointer` `bpy_struct.driver_add` `bpy_struct.driver_remove` `bpy_struct.get` `bpy_struct.is_property_hidden` `bpy_struct.is_property_readonly` `bpy_struct.is_property_set` `bpy_struct.items` `bpy_struct.keyframe_delete` | `bpy_struct.keyframe_insert` `bpy_struct.keys` `bpy_struct.path_from_id` `bpy_struct.path_resolve` `bpy_struct.property_unset` `bpy_struct.type_recast` `bpy_struct.values` `Sensor.link` `Sensor.unlink`