Home

Alberto Salguero
What’s “OIS Input Control System (ICS)”? ICS is a little library that allows you, as a programmer, to separate the logic of an OIS-based application from how the user interacts with that application. It can be seen as a key/mouse/joystick binding system but it has a lot more features.

From the programmer point of view, ICS can be seen as a set of ordered channels which vary between 0 and 1. Each of those channels can be assigned to any of the action the application should perform. Channel 3 can be assigned to the walking action, for instance. In that case, the speed of the player is determined by the value of the channel:

Speed = (channelValue – 0.5) * speedFactor;

According to the formula given above, the player won’t move when the channel value is equal to 0.5, it will be moved forward when the value is greater than 0.5 and it will be moved backward when its value is smaller than 0.5.

From the user point of view, there is a set of controls that he or she can act on by using any of the input devices available (keyboard, mouse and joystick, basically). Each of the control has a starting value and it can be moved in two directions in order to increase or decrease its value. When keys or buttons are used to increase or decrease the value of a control, it can automatically return to its initial value, allowing the implementations of push-like and on/off-like buttons very easily.

Each control affects one or many channels in a specific percentage. We can, for instance, set the WALKING control to modify channel 3 (see above) in a 50% percentage and bind it to UPARROW key, so while that key is pressed (push-like button) the channel 3 is set to 0.75. We can attach another control to the same channel to make the player run instead of walk (increasing channel 3 to its maximum value).

It is possible to have multiple input control systems working at the same time, so it is possible to use one for the application actions (pause, exit...) and another one for player movements.

ICS currently supports key, X and Y mouse axis, joystick and mouse/joystick buttons bindings.
Following are described some other interesting features of ICS:

  • Time dependent. Keys/Buttons bindings modify controls at the same speed in every system.
  • Auto binding function. ICS has a built-in function that allows the user to bind any key/axis/button to any of the defined control.
  • XML based configuration. ICS has built-in methods for loading/ saving configuration files from/to disk.

Planned features:

  • Exponential controls. added
  • Joysticks POV support. added
  • Multiple joystick support. added
  • Mouse wheel support.
  • Joystick slider support. added
  • Cyclic controls.

MongoDB Logo MongoDB