cInput Reference Manual
  • Introduction
  • Using cInput
    • Initial Setup
    • A Brief Explanation of cInput
    • Setting Up the Default Inputs
      • The Keys Class
      • A Note About Xbox Controllers
      • Using Modifier Keys
    • Using cInput to Control Your Game
    • Changing Inputs from the Defaults
      • The OnKeyChanged Event
    • General Tips and Tricks
  • Script Reference
    • Variables and Properties
      • allowDuplicates
      • anyKey
      • anyKeyDown
      • deadzone
      • externalInputs
      • gravity
      • length
      • scanning
      • sensitivity
      • usePlayerPrefs
    • Methods
      • AddModifier
      • AxisInverted
      • Calibrate
      • ChangeKey
      • Clear
      • ForbidAxis
      • ForbidKey
      • GetAxis
      • GetAxisDeadzone
      • GetAxisGravity
      • GetAxisRaw
      • GetAxisSensitivity
      • GetButton
      • GetButtonDown
      • GetButtonUp
      • GetKey
      • GetKeyDown
      • GetKeyUp
      • GetText
      • Init
      • IsAxisDefined
      • IsKeyDefined
      • LoadExternal
      • RemoveModifier
      • ResetInputs
      • SetAxis
      • SetAxisDeadzone
      • SetAxisGravity
      • SetAxisSensitivity
      • SetKey
    • Valid Inputs
  • Changelog
Powered by GitBook
On this page

Was this helpful?

  1. Using cInput

Using cInput to Control Your Game

Once your inputs are defined in your setup script, you'll probably want to use those inputs to control your game. This is very simple to do using cInput's GetKey(), GetKeyDown(), GetKeyUp(), and GetAxis() functions, which all work in the same way as Unity's Input class functions of the same name.

For example:

If the above code seems familiar, it should! One of the main tenets of cInput was to make its syntax as similar to Unity's Input class as possible.

PreviousUsing Modifier KeysNextChanging Inputs from the Defaults

Last updated 6 years ago

Was this helpful?