User Tools

Site Tools


eeros_architecture:hal:input_devices

This is an old revision of the document!


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 critival inputs. Defining a Mouse Input the HAL will contain 3 registered mouse button inputs under the names of:

  1. leftMouseButton
  2. middleMouseButton
  3. rightMouseButton

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 hal2 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 mouse input in the safety system by means of critival inputs. Defining a Mouse Input the HAL will contain 3 registered mouse button inputs under the names of:

  1. leftMouseButton
  2. middleMouseButton
  3. rightMouseButton

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 hal2

eeros_architecture/hal/input_devices.1493790976.txt.gz · Last modified: 2017/05/03 07:56 by graf