DirectInput8 wrapper.
More...
#include <input.h>
DirectInput8 wrapper.
Definition at line 16 of file input.h.
Keyboard data: array[KEY_NUM] of bool.
Index is DIK_XXX in dinput.h.
Definition at line 28 of file input.h.
yappy::input::DInput::DInput |
( |
HINSTANCE |
hInst, |
|
|
HWND |
hWnd, |
|
|
bool |
foreground = true , |
|
|
bool |
exclusive = false |
|
) |
| |
Initialize DirectInput8.
- Parameters
-
[in] | hInst | Instance handle. |
[in] | hWnd | Window handle. |
[in] | foreground | Can obtain input data only when the window is active. |
[in] | exclusive | Obtain exclusive access to the device. |
Definition at line 15 of file input.cpp.
yappy::input::DInput::~DInput |
( |
| ) |
|
Finalize DirectInput8.
Definition at line 52 of file input.cpp.
Get keyboard input data.
- Returns
- Keyboard input data.
Definition at line 177 of file input.cpp.
int yappy::input::DInput::getPadCount |
( |
| ) |
const |
Get connected pad count.
Definition at line 182 of file input.cpp.
void yappy::input::DInput::getPadState |
( |
DIJOYSTATE * |
state, |
|
|
int |
index |
|
) |
| const |
Get pad input data.
- Parameters
-
[out] | state | Current input state. |
[in] | index | Pad index. |
- Precondition
- 0 <= index < getPadCount()
Definition at line 188 of file input.cpp.
void yappy::input::DInput::processFrame |
( |
| ) |
|
Must be called at every frame.
Update the key and pad input status.
Definition at line 134 of file input.cpp.
void yappy::input::DInput::updateControllers |
( |
HWND |
hwnd, |
|
|
bool |
foreground = true , |
|
|
bool |
exclusive = false |
|
) |
| |
Update pad list.
Also called in the constructor.
- Parameters
-
[in] | hInst | Instance handle. |
[in] | hWnd | Window handle. |
[in] | foreground | Can obtain input data only when the window is active. |
[in] | exclusive | Obtain exclusive access to the device. |
Definition at line 88 of file input.cpp.
const int yappy::input::DInput::AXIS_RANGE = 1000 |
|
static |
Pad analog value max.
Definition at line 21 of file input.h.
const int yappy::input::DInput::AXIS_THRESHOLD = AXIS_RANGE / 2 |
|
static |
Pad analog value threshold.
Definition at line 23 of file input.h.
const int yappy::input::DInput::KEY_NUM = 256 |
|
static |
Keyboard array count.
Definition at line 19 of file input.h.
The documentation for this class was generated from the following files: