1 | /* $Id: Keyboard.h 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox frontends: Basic Frontend (BFE):
|
---|
4 | * Declaration of Keyboard class
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2023-2024 Oracle and/or its affiliates.
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox base platform packages, as
|
---|
11 | * available from https://www.virtualbox.org.
|
---|
12 | *
|
---|
13 | * This program is free software; you can redistribute it and/or
|
---|
14 | * modify it under the terms of the GNU General Public License
|
---|
15 | * as published by the Free Software Foundation, in version 3 of the
|
---|
16 | * License.
|
---|
17 | *
|
---|
18 | * This program is distributed in the hope that it will be useful, but
|
---|
19 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
21 | * General Public License for more details.
|
---|
22 | *
|
---|
23 | * You should have received a copy of the GNU General Public License
|
---|
24 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
25 | *
|
---|
26 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
27 | */
|
---|
28 |
|
---|
29 | #ifndef VBOX_INCLUDED_SRC_VBoxBFE_Keyboard_h
|
---|
30 | #define VBOX_INCLUDED_SRC_VBoxBFE_Keyboard_h
|
---|
31 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
32 | # pragma once
|
---|
33 | #endif
|
---|
34 |
|
---|
35 | #include <iprt/semaphore.h>
|
---|
36 | #include <VBox/vmm/pdm.h>
|
---|
37 |
|
---|
38 | #include <VBox/com/defs.h>
|
---|
39 |
|
---|
40 | class Keyboard
|
---|
41 | {
|
---|
42 |
|
---|
43 | public:
|
---|
44 |
|
---|
45 | Keyboard();
|
---|
46 | ~Keyboard();
|
---|
47 |
|
---|
48 | // public methods only for internal purposes
|
---|
49 | static const PDMDRVREG DrvReg;
|
---|
50 |
|
---|
51 | int PutScancode(long aScancode);
|
---|
52 | int PutScancodes(const long *paScancodes,
|
---|
53 | uint32_t cScancodes,
|
---|
54 | unsigned long *aCodesStored);
|
---|
55 | int PutUsageCode(long aUsageCode, long aUsagePage, bool fKeyRelease);
|
---|
56 |
|
---|
57 | private:
|
---|
58 |
|
---|
59 | int releaseKeys();
|
---|
60 |
|
---|
61 | static DECLCALLBACK(void) i_keyboardLedStatusChange(PPDMIKEYBOARDCONNECTOR pInterface, PDMKEYBLEDS enmLeds);
|
---|
62 | static DECLCALLBACK(void) i_keyboardSetActive(PPDMIKEYBOARDCONNECTOR pInterface, bool fActive);
|
---|
63 |
|
---|
64 | static DECLCALLBACK(void*) i_drvQueryInterface(PPDMIBASE pInterface, const char *pszIID);
|
---|
65 | static DECLCALLBACK(int) i_drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
|
---|
66 | static DECLCALLBACK(void) i_drvDestruct(PPDMDRVINS pDrvIns);
|
---|
67 |
|
---|
68 | /** Pointer to the associated display driver. */
|
---|
69 | struct DRVMAINKEYBOARD *mpDrv;
|
---|
70 |
|
---|
71 | bool mfMachineRunning;
|
---|
72 | };
|
---|
73 |
|
---|
74 | #define KEYBOARD_OID "d0cfbc0f-67ae-49db-ac4b-e8dc314f5a5c"
|
---|
75 |
|
---|
76 | #endif /* !VBOX_INCLUDED_SRC_VBoxBFE_Keyboard_h */
|
---|