Returns right analog stick vertical axis value with direction parameter.
Takes controller (controller handle from inpCreateController, positive integer), direction (0=up, 1=down, controls return value sign/interpretation).
Returns integer axis value (-32768 to +32767 range, sign depends on direction parameter).
Input
Parameters & Returns
Parameters
controllerInt
directionInt
Returns
Int
Quick Summary
Returns right analog stick vertical axis value with direction parameter.
Takes controller (controller handle from inpCreateController, positive integer), direction (0=up, 1=down, controls return value sign/interpretation).
Returns integer axis value (-32768 to +32767 range, sign depends on direction parameter).
Technical Exegesis...
Returns right analog stick vertical axis value with direction parameter. Takes controller (controller handle from inpCreateController, positive integer), direction (0=up, 1=down, controls return value sign/interpretation). Returns integer axis value (-32768 to +32767 range, sign depends on direction parameter). Queries right stick Y-axis for analog camera/aiming input.
Returns right analog stick vertical axis value with direction parameter. Takes controller (controller handle from inpCreateController, positive integer), direction (0=up, 1=down, controls return value sign/interpretation). Returns integer axis value (-32768 to +32767 range, sign depends on direction parameter). Queries right stick Y-axis for analog camera/aiming input.
Axis value: returns analog stick position on Y-axis, -32768=full up, 0=centered/neutral, +32767=full down, magnitude indicates how far stick pushed (32767=maximum displacement, 16384=half displacement), includes deadzone filtering (small movements near center ignored to prevent drift).
Direction parameter: 0=up (returns positive value when stick pushed up, negative when down), 1=down (returns positive value when stick pushed down, negative when up), allows checking specific direction (If inpRightStickHitY(ctrl%, 0)>threshold Then rotating up), different from reading raw axis (raw would require sign checking).
Use cases: (1) Camera pitch control (vertical camera rotation in FPS/TPS games), (2) Aiming (vertical aim adjustment in shooters), (3) Aircraft control (pitch control for flying vehicles), (4) Turret elevation (vertical turret/weapon angle), (5) Cursor control (analog vertical cursor movement).
Common patterns: camera pitch = cameraPitch#=cameraPitch#-inpRightStickHitY(controller%, 0)/32767.0*rotSpeed# (normalize and apply rotation, note negative for standard controls); sensitivity = stickY#=inpRightStickHitY(ctrl%, 0)/32767.0*sensitivity#: cameraPitch#=cameraPitch#-stickY# (adjustable sensitivity); pitch clamp = pitch#=pitch#-stickY#: If pitch#<-89.0 Then pitch#=-89.0: If pitch#>89.0 Then pitch#=89.0 (prevent gimbal lock).
Normalization: convert to -1.0 to +1.0 float range (value# = axis% / 32767.0), useful for rotation calculations (rotation# = normalizedAxis# * rotSpeed#), preserves analog precision (full range of stick movement), typical multiplier 0.05-0.2 for camera rotation.
Deadzone: built-in deadzone filtering applied (small values near center returned as 0), prevents stick drift (worn controllers report non-zero when centered), typical deadzone ~8000-10000 (about 25% of full range), larger deadzone improves aiming precision (reduces unintentional movement).
Y-axis direction: Y-axis increases downward (standard gamepad convention, +Y=down), opposite of mathematical Y-axis (mathematical +Y=up), consistent with screen coordinates, direction parameter allows inverting (0=up positive for standard FPS controls).
Camera pitch control: right stick typically controls camera in console games (standard FPS/TPS layout), vertical axis controls pitch (up/down rotation), pattern: pitch#=pitch#-inpRightStickHitY(ctrl%, 0)/32767.0*pitchSpeed# (negative for non-inverted controls), clamp pitch to -89 degrees to +89 degrees (prevent flipping upside-down/gimbal lock).
Inverted Y-axis: many players prefer inverted Y controls (push up to look down, like flight stick), user option strongly recommended (allow Y-axis inversion toggle), pattern: If invertY Then dir=1: multiplier=-1.0 Else dir=0: multiplier=1.0: pitch#=pitch#+inpRightStickHitY(ctrl%, dir)/32767.0*rotSpeed#*multiplier.
Pitch clamping: critical for FPS games (prevent camera flipping upside-down), clamp to -89 degrees to +89 degrees (just before vertical to avoid gimbal lock), pattern: pitch#=pitch#-stickY#*sensitivity#: If pitch#<-89.0 Then pitch#=-89.0: If pitch#>89.0 Then pitch#=89.0, prevents disorientation and mathematical issues.
Controller requirements: requires inpUpdateController called each frame (updates stick state from hardware), returns 0 if controller disconnected (check inpIsControllerConnected first), right stick typically used for camera (left stick for movement in FPS games).
Performance: fast query (~0.001ms, simple state lookup), safe for per-frame calls (intended usage pattern), no controller update required (reads cached state from last inpUpdateController).
Axis range: -32768 to +32767 (16-bit signed integer, standard XInput range), 0=neutral/centered (stick not pushed), positive/negative depends on direction parameter (0=up positive, 1=down positive), magnitude indicates displacement (larger absolute value=farther from center).
Return values: -32768 to +32767 analog axis value (sign depends on direction), 0 if stick centered or disconnected, 0 on error (invalid controller handle).