Version 3 (modified by rgrieder, 16 years ago) (diff) |
---|
InputHandler
TracNav(TracNav/TOC_Development)?
Down the hierarchy of input distribution, this is the second last or last stage. An InputHandler can do anything with an input event. It simply receives it in almost exactly the same manner as the InputManager does from OIS. The difference is that the target is selectively chosen. You can also derive from it yourself and do some crazy stuff. But you are probably more interested in the 'built-in' classes.
How to write one
In order to create a new InputHandler class, you will have to derive from orxonox::KeyHandler, MouseHandler and/or JoyStickHandler. For the joysticks, the device id gets sent with the event, so you can distinguish between them. The rest is up to you..
Derived classes
- EmptyHandler: Discards input. Use this to 'absorb' input in a state even if it doesn't process it
- InputBuffer: Only accepts keyboard input. Stores it in a buffer to act like a stream.
- KeyBinder: Executes commands bound to a certain key.
- CalibratorCallback: Use internally to finish calibration on key press.