Reading from Mouse and XBoxController

Mouse Input

You can use a mouse for position information or its button states. In the control system you create an instance of type Mouse Input.
It is also possible to check for mouse input in the safety system by means of critical inputs. Defining a Mouse Input the HAL will contain 3 registered mouse button inputs under the names of:

As an example you could define a critical input in the safety system as follows

  Input<bool>* in1 = HAL::instance().getLogicInput("leftMouseButton", false);
  criticalInputs = { in1 };

A more complete example is given in Reading from a Mouse / Keyboard / XBox Controller / Space Navigator
WARNING The HAL will contain the three inputs mentioned above only after the control system created its Mouse Input object.

XBox Input

You can use a XBox controller for position information or its button states. In the control system you create an instance of type XBox Input.
It is also possible to check for XBox input in the safety system by means of critical inputs. Defining a XBox Input the HAL will contain 8 registered XBox button inputs under the names of:

  1. XBoxButtonA
  2. XBoxButtonB
  3. XBoxButtonX
  4. XBoxButtonY
  5. XBoxButtonLB
  6. XBoxButtonRB
  7. XBoxButtonBack
  8. XBoxButtonStart

As an example you could define a critical input in the safety system as follows

  Input<bool>* in1 = HAL::instance().getLogicInput("XBoxButtonX", false);
  criticalInputs = { in1 };

A more complete example is given in Reading from a Mouse / Keyboard / XBox Controller / Space Navigator.
WARNING The HAL will contain the three inputs mentioned above only after the control system created its XBox Input object.