1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
3 | #pragma once |
4 | |
5 | #include "BsCorePrerequisites.h" |
6 | |
7 | namespace bs |
8 | { |
9 | /** Represents a single hardware keyboard. Used by the Input to report raw keyboard input events. */ |
10 | class BS_CORE_EXPORT Keyboard |
11 | { |
12 | public: |
13 | struct Pimpl; |
14 | |
15 | Keyboard(const String& name, Input* owner); |
16 | ~Keyboard(); |
17 | |
18 | /** Returns the name of the device. */ |
19 | String getName() const { return mName; } |
20 | |
21 | /** Captures the input since the last call and triggers the events on the parent Input. */ |
22 | void capture(); |
23 | |
24 | private: |
25 | friend class Input; |
26 | |
27 | /** Changes the capture context. Should be called when focus is moved to a new window. */ |
28 | void changeCaptureContext(UINT64 windowHandle); |
29 | |
30 | String mName; |
31 | Input* mOwner; |
32 | |
33 | Pimpl* m; |
34 | }; |
35 | } |
36 | |