VControl Library

A simple digital input abstraction for the Simple Direct-Media Layer

Graphical applications on modern machines provide an event loop to model the actions of the user. While this is the most direct way of handling general GUI events, it is inconvenient to program many game applications with this model. VControl provides a much simpler interface for the game developer that provides a great deal of keyboard and joystick configurability for the end user.

To use the Virtual Controller, the developer names a number of "buttons." For example, a simple Space-Invaders style game would have buttons named "left," "right," and "fire." The library reads a configuration file that maps keyboard or joystick actions to these names. This configuration can be very general - multiple game actions may be mapped to a single user action, and any game action may have any number of user actions that signify that game action. As far as the game logic is concerned, "left," "right," and "fire" are the only reality; the VControl routines filter the event stream to update the values appropriately.

VControl is built on top of the Simple Direct-Media Layer version 1.2, and is intended to provide configurable digital input for programs that use SDL as their primary user-interface library. It is distributed under the modified BSD license.

A somewhat modified version of the VControl code is being used to power the input system of the Ur-Quan Masters project; note that that code is protected by the stronger GNU GPL.

Why Use VControl?

VControl offers a number of advantages to the game programmer.

Why NOT Use VControl?

VControl is a nice library. However, there are tasks that it is bad at, or which it has no intention of being able to deal with.

How can I use VControl?

You can download the VControl sources here: vcontrol-0.1.zip

Documentation and build instructions are included for Unix (likely including OS X, but this is not tested) and Windows. You can also browse the documentation online.