about news documentation discuss download add-ons credits
Windows Adapter Information
The Windows Cpw adapter has optional support for DirectInput. The precompiled DLL and lib available on the download page support Windows base services for joystick, mouse and keyboard input. The library has been tested with Direct Input 5.0, 7.0 and 8.1. Below are some specific notes on each of the DI Cpw interfaces and explanations on how to enable them.
Direct Joystick Input
For DirectInput joystick access a client machine must have DirectInput 5.0 or greater installed. DirectInput 3.0 does not support Joysticks. Cpw's DI joystick interface will 'fall through' to Windows base services for joystick access if the required DirectInput software is not available on the client machine. Cpw's joystick interface behavior does is the same regardless of which input method is used. (Although the DI interface may provide enhanced input and performance.)

To enable the DirectInput Joystick input interface in Cpw, un-comment the following win32 platform specific compile directive in cpw_config.h and compile the library:

        /* #define CPW_DIRECTINPUT_JOYSTICKACCESS */
        
You can also customize the version of DirectInput your application will make use of using the 'DIRECTINPUT_VERSION' define, also in cpw_config.h. The default value is set to 0x0500.
Direct Mouse Input
For DirectInput mouse access a client machine must have DirectInput 3.0 or greater installed. Cpw's DirectInput interface for mice will 'fall through' to Windows base services if the required DirectInput software is not available on the client machine.

Cpw's DirectInput mouse interface is intended for use with fullscreen single windowed games. DirectInput has some unique behavior which developers should be aware of:

No mouse cursors
The DirectInput mouse interface is a low level 'direct to driver' interface which bypasses standard Windows mouse input processing. As such, mouse cursors are not diplayed in a window which uses direct mouse input.

No mouse events
Mouse positional information is only available through the mouse polling interface. (cpwMouseState) Mouse callback events are not supported when DirectInput mouse access is enabled.

Relative mouse movement values only
The DirectInput mouse interface only supports relative mouse movement. There is no 'absolute cursor position' - mouse x, y, and z (wheel) positional values are negaitve or positive values which are relative to the last time the mouse's position was requested via cpwMouseState.

Window attachment
DirectInput requires that DirectInput mouse access be associated with a window. On the first call to cpwMouseState, Cpw will initialize the DI mouse interface and attach it to the current foreground window. You may create as many windows as you like, but only one window will be DirectInput enabled.

To enable the DirectInput for mouse access interface in Cpw, un-comment the following win32 specific compile directive in cpw_config.h and compile the library:

/* #define CPW_DIRECTINPUT_MOUSEACCESS */
Direct Keyboard Input
Currently not implemented. This should be available shortly.