diff options
| author | 2014-09-03 18:12:58 -0700 | |
|---|---|---|
| committer | 2014-09-11 22:43:42 -0700 | |
| commit | 4a94ec934ab1a2216f94e3fcc46f5dde1d6e2f02 (patch) | |
| tree | 2588f0c6051c9a5e3f23057d2953c35a854dbc43 /src/common/key_map.h | |
| parent | Created structure for PAD. (diff) | |
| download | yuzu-4a94ec934ab1a2216f94e3fcc46f5dde1d6e2f02.tar.gz yuzu-4a94ec934ab1a2216f94e3fcc46f5dde1d6e2f02.tar.xz yuzu-4a94ec934ab1a2216f94e3fcc46f5dde1d6e2f02.zip | |
Initial HID PAD work, with GLFW only.
Diffstat (limited to 'src/common/key_map.h')
| -rw-r--r-- | src/common/key_map.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/common/key_map.h b/src/common/key_map.h new file mode 100644 index 000000000..7e94df618 --- /dev/null +++ b/src/common/key_map.h | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | // Copyright 2013 Dolphin Emulator Project | ||
| 2 | // Licensed under GPLv2 | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/service/hid.h" | ||
| 8 | |||
| 9 | namespace KeyMap { | ||
| 10 | |||
| 11 | class CitraKey { | ||
| 12 | public: | ||
| 13 | CitraKey() : keyCode(0) {} | ||
| 14 | CitraKey(int code) : keyCode(code) {} | ||
| 15 | |||
| 16 | int keyCode; | ||
| 17 | |||
| 18 | bool operator < (const CitraKey &other) const { | ||
| 19 | return keyCode < other.keyCode; | ||
| 20 | } | ||
| 21 | |||
| 22 | bool operator == (const CitraKey &other) const { | ||
| 23 | return keyCode == other.keyCode; | ||
| 24 | } | ||
| 25 | }; | ||
| 26 | |||
| 27 | struct DefaultKeyMapping { | ||
| 28 | KeyMap::CitraKey key; | ||
| 29 | HID_User::PADState state; | ||
| 30 | }; | ||
| 31 | |||
| 32 | void SetKeyMapping(CitraKey key, HID_User::PADState padState); | ||
| 33 | HID_User::PADState Get3DSKey(CitraKey key); | ||
| 34 | |||
| 35 | } | ||