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:
- leftMouseButton
- middleMouseButton
- 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 Using the HAL with a Watchdog Timer
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:
- leftMouseButton
- middleMouseButton
- 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 Using the HAL with a Watchdog Timer