diff options
Diffstat (limited to 'src/input_common/drivers/keyboard.h')
| -rw-r--r-- | src/input_common/drivers/keyboard.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/input_common/drivers/keyboard.h b/src/input_common/drivers/keyboard.h new file mode 100644 index 000000000..a3e0d8a61 --- /dev/null +++ b/src/input_common/drivers/keyboard.h | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "input_common/input_engine.h" | ||
| 8 | |||
| 9 | namespace InputCommon { | ||
| 10 | |||
| 11 | /** | ||
| 12 | * A button device factory representing a keyboard. It receives keyboard events and forward them | ||
| 13 | * to all button devices it created. | ||
| 14 | */ | ||
| 15 | class Keyboard final : public InputCommon::InputEngine { | ||
| 16 | public: | ||
| 17 | explicit Keyboard(const std::string& input_engine_); | ||
| 18 | |||
| 19 | /** | ||
| 20 | * Sets the status of all buttons bound with the key to pressed | ||
| 21 | * @param key_code the code of the key to press | ||
| 22 | */ | ||
| 23 | void PressKey(int key_code); | ||
| 24 | |||
| 25 | /** | ||
| 26 | * Sets the status of all buttons bound with the key to released | ||
| 27 | * @param key_code the code of the key to release | ||
| 28 | */ | ||
| 29 | void ReleaseKey(int key_code); | ||
| 30 | |||
| 31 | void ReleaseAllKeys(); | ||
| 32 | |||
| 33 | /// Used for automapping features | ||
| 34 | std::vector<Common::ParamPackage> GetInputDevices() const override; | ||
| 35 | |||
| 36 | private: | ||
| 37 | const PadIdentifier identifier = { | ||
| 38 | .guid = Common::UUID{""}, | ||
| 39 | .port = 0, | ||
| 40 | .pad = 0, | ||
| 41 | }; | ||
| 42 | }; | ||
| 43 | |||
| 44 | } // namespace InputCommon | ||