Difference between revisions of "Key.axis"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "<c>key.axis</c> returns the numeric value (from -1 to 1) of an input axis. See also: key.pressed === Arguments === {| class="wikitable" |- ! Parameter Name !! Type !! D...")
 
Line 13: Line 13:
  
 
=== Usage Notes ===
 
=== Usage Notes ===
Available axis names are "Horizontal" and "Vertical", which can be activated
+
Available axis names are:
by both WASD and arrow keys as well as any joystick or gamepad;
+
* "Horizontal" and "Vertical", which can be activated
"JoyAxis1" through "JoyAxis29" which detect axis inputs from any joystick or gamepad, and "Joy1Axis1" through "Joy8Axis29" which detect
+
by both WASD and arrow keys as well as any joystick or gamepad
axis inputs from specific joystick/gamepad 1 through 8.
+
* "JoyAxis1" through "JoyAxis29" which detect axis inputs from any joystick or gamepad
 +
* "Joy1Axis1" through "Joy8Axis29" which detect axis inputs from specific joystick/gamepad 1 through 8.
  
 
== Example ==
 
== Example ==

Revision as of 19:48, 24 March 2020

key.axis returns the numeric value (from -1 to 1) of an input axis.

See also: key.pressed

Arguments

Parameter Name Type Default Value Meaning
axisName string Horizontal name of axis to get

Usage Notes

Available axis names are:

  • "Horizontal" and "Vertical", which can be activated

by both WASD and arrow keys as well as any joystick or gamepad

  • "JoyAxis1" through "JoyAxis29" which detect axis inputs from any joystick or gamepad
  • "Joy1Axis1" through "Joy8Axis29" which detect axis inputs from specific joystick/gamepad 1 through 8.

Example

print key.axis("Vertical")