Etterna 0.74.4
Loading...
Searching...
No Matches
InputHandler_DirectInputHelper.h
1#ifndef INPUTHANDLER_DIRECTINPUT_HELPER_H
2#define INPUTHANDLER_DIRECTINPUT_HELPER_H
3
4#include "Etterna/Singletons/InputFilter.h"
5
6#define DIRECTINPUT_VERSION 0x0800
7#include <dinput.h>
8extern LPDIRECTINPUT8 g_dinput;
9
10#define INPUT_QSIZE 32
11
12struct input_t
13{
14 // DirectInput offset for this input type:
15 DWORD ofs;
16
17 // Button, axis or hat:
18 enum Type
19 {
20 KEY,
21 BUTTON,
22 AXIS,
23 HAT
24 } type;
25
26 int num;
27
28 // Comparitor for finding the input_t with the matching ofs member in std
29 // containers.
30 class Compare
31 {
32 public:
33 Compare(DWORD _ofs)
34 : ofs(_ofs)
35 {
36 }
37
38 bool operator()(const input_t& input) const { return input.ofs == ofs; }
39
40 private:
41 DWORD ofs;
42 };
43};
44
46{
47 DIDEVICEINSTANCE JoystickInst;
48 LPDIRECTINPUTDEVICE8 Device;
49 std::string m_sName;
50
51 enum
52 {
53 KEYBOARD,
54 JOYSTICK,
55 MOUSE
56 } type;
57
58 bool buffered;
59 int buttons, axes, hats;
60 std::vector<input_t> Inputs;
61 InputDevice dev;
62
63 DIDevice();
64
65 bool Open(bool checkPreference);
66 void Close();
67};
68
69#endif
Definition InputHandler_DirectInputHelper.h:31
Definition InputHandler_DirectInputHelper.h:46
Definition InputHandler_DirectInputHelper.h:13