~ubuntu-branches/debian/experimental/mednafen/experimental

« back to all changes in this revision

Viewing changes to src/drivers/Keyboard.h

  • Committer: Package Import Robot
  • Author(s): Stephen Kitt
  • Date: 2012-11-19 07:00:37 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20121119070037-jvknrm13zvim88oc
Tags: 0.9.26-1
* New upstream WIP version.
* Change priority to "extra" to match libvorbisidec1's.
* Drop "DM-Upload-Allowed" since it is no longer appropriate.
* Refresh patches, replacing MPC_STATUS_FAIL constant from older mpcdec
  versions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// TODO WIP EXPERIMENTAL
 
2
 
 
3
enum
 
4
{
 
5
 MDFNKEY_ESCAPE,
 
6
 MDFNKEY_F1,
 
7
 MDFNKEY_F2,
 
8
 MDFNKEY_F3,
 
9
 MDFNKEY_F4,
 
10
 MDFNKEY_F5,
 
11
 MDFNKEY_F6,
 
12
 MDFNKEY_F7,
 
13
 MDFNKEY_F8,
 
14
 MDFNKEY_F9,
 
15
 MDFNKEY_F10,
 
16
 MDFNKEY_F11,
 
17
 MDFNKEY_F12,
 
18
 
 
19
 MDFNKEY_PRINTSCREEN,
 
20
 MDFNKEY_SCROLLLOCK,
 
21
 MDFNKEY_PAUSE,
 
22
 
 
23
 MDFNKEY_GRAVE,
 
24
 MDFNKEY_0,
 
25
 MDFNKEY_1,
 
26
 MDFNKEY_2,
 
27
 MDFNKEY_3,
 
28
 MDFNKEY_4,
 
29
 MDFNKEY_5,
 
30
 MDFNKEY_6,
 
31
 MDFNKEY_7,
 
32
 MDFNKEY_8,
 
33
 MDFNKEY_9,
 
34
 MDFNKEY_MINUS,
 
35
 MDFNKEY_EQUAL,
 
36
 MDFNKEY_BACKSPACE
 
37
 
 
38
 
 
39
 MDFNKEY_INSERT,
 
40
 MDFNKEY_HOME,
 
41
 MDFNKEY_PAGEUP,
 
42
 MDFNKEY_PAGEDOWN,
 
43
 MDFNKEY_DELETE,
 
44
 MDFNKEY_END,
 
45
 
 
46
 MDFNKEY_UP,
 
47
 MDFNKEY_DOWN,
 
48
 MDFNKEY_LEFT,
 
49
 MDFNKEY_RIGHT
 
50
};
 
51
 
 
52
#define MDFNKEYMOD_LSHIFT       0x0001
 
53
#define MDFNKEYMOD_RSHIFT       0x0002
 
54
#define MDFNKEYMOD_LCTRL        0x0004
 
55
#define MDFNKEYMOD_RCTRL        0x0008
 
56
#define MDFNKEYMOD_LALT         0x0010
 
57
#define MDFNKEYMOD_RALT         0x0020
 
58
 
 
59
struct MDFN_KeyEvent
 
60
{
 
61
 enum { PressEvent = 1, ReleaseEvent = 2 };
 
62
 uint8 type;
 
63
 uint8 device;
 
64
 uint8 keycode;         // MDFNKEY_* (a select few scancodes translated into common key codes for default hotkey/input configuration)
 
65
 uint16 modifier;       // MDFNKEYMOD_*
 
66
 uint16 scancode;       // Rawish keyboard scancode.  Used for custom input configurations.
 
67
 uint32 unicode;        // Unicode glyph(0 if not applicable), based on scancode, modifier, and MAYBE DRAGONS.  For text entry.
 
68
};
 
69
 
 
70
class KeyboardManager
 
71
{
 
72
 public:
 
73
 
 
74
 KeyboardManager();
 
75
 ~KeyboardManager();
 
76
 
 
77
 void Reset_BC_ChangeCheck(void);
 
78
 bool Do_BC_ChangeCheck(ButtConfig *bc);
 
79
 
 
80
 void UpdateKeyboards(std::vector<MDFN_KeyEvent> *event_queue = NULL);  // Maybe use a fixed-size queue/FIFO instead to eliminate memory allocs?
 
81
 
 
82
 //unsigned GetIndexByUniqueID(uint64 unique_id);       // Returns ~0U if joystick was not found.
 
83
 //unsigned GetUniqueIDByIndex(unsigned index);
 
84
 
 
85
 private:
 
86
 std::vector<JoystickDriver *> JoystickDrivers;
 
87
 std::vector<JoystickManager_Cache> JoystickCache;
 
88
 ButtConfig BCPending;
 
89
};