API Reference › Input › Input.axis_i
method

Input.axis_i

Input.axis_i(neg, pos) -> int

Returns a directional intent as a plain int: +1 when the positive key is held, -1 when the negative one is, 0 for neither or both. It reads the multi-key device set, so it replaces the ki(key_down('d')) - ki(key_down('a')) boolean-to-int boilerplate and feeds an int mover directly — dx = Input.axis_i('a', 'd'), dy = Input.axis_i('w', 's'). For an analog / normalized value use Input.axis (fixed) or Input.vector.

Example

program Demo {
  entry {
    Input.press('d')
    Input.poll()
    print(Input.axis_i('a', 'd'))     # 1
  }
}
← All symbols