🧪 Version 0.2.2 is our alpha release candidate. Please send us bug reports and suggestions!

Sketchingpy

Creative coding and interactive science everywhere for everyone: web, desktop, mobile, Jupyter, and more. Open source!

Reference for get_input_axis

Get the input on a single axis for a joystick-like device. This is part of the reference section.

Purpose

Get the current input as a number describing input on a single axis on a joy-stick like device. For trackballs, this is change since last call to get_axis for that input. For displacement input, this is the current level of displacement.

Snippet

Get the change in x input on the first ball of the first joystick found.
joysticks = sketch.get_joysticks()()
first_joystick = joysticks[0]
x_input = first_joystick.get_input_axis('ball0.x')

Parameters

  • axis_name: The name of the axis to look up and for which a value should be returned.

Availability

Not yet available. Planned for future release.

See also