joy_1 ...  joy_12

joy2_1 ...  joy2_12

State of the 12 buttons of the first and second joystick, 3D navigation device, or Bluetooth input device.

Range:

0 = not pressed
nonzero = pressed

Type:

var, read-only

Example

action fire_rocket()
{	
  while(1)
 	{
 	  if(joy_1) // first joystick button pressed?
 	  {
 	    ent_create("rocket.mdl" , my.x, rocket);
    }
    wait(1);
 	}
}

See also:

joy_raw, joy2_raw, joy_rot , joy2_rot, joy_force, num_joysticks, joy_button

► latest version online