VirtualBox

source: vbox/trunk/src/VBox/Main/include/KeyboardImpl.h@ 1830

Last change on this file since 1830 was 1, checked in by vboxsync, 55 years ago

import

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1/** @file
2 *
3 * VirtualBox COM class implementation
4 */
5
6/*
7 * Copyright (C) 2006 InnoTek Systemberatung GmbH
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License as published by the Free Software Foundation,
13 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14 * distribution. VirtualBox OSE is distributed in the hope that it will
15 * be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * If you received this file as part of a commercial VirtualBox
18 * distribution, then only the terms of your commercial VirtualBox
19 * license agreement apply instead of the previous paragraph.
20 */
21
22#ifndef ____H_KEYBOARDIMPL
23#define ____H_KEYBOARDIMPL
24
25#include "VirtualBoxBase.h"
26#include "ConsoleEvents.h"
27#include <VBox/pdm.h>
28
29/** Simple keyboard event class. */
30class KeyboardEvent
31{
32public:
33 KeyboardEvent() : scan(-1) {}
34 KeyboardEvent(int _scan) : scan(_scan) {}
35 bool isValid()
36 {
37 return (scan & ~0x80) && !(scan & ~0xFF);
38 }
39 int scan;
40};
41// template instantiation
42typedef ConsoleEventBuffer<KeyboardEvent> KeyboardEventBuffer;
43
44class Console;
45
46class ATL_NO_VTABLE Keyboard :
47 public VirtualBoxSupportErrorInfoImpl <Keyboard, IKeyboard>,
48 public VirtualBoxSupportTranslation <Keyboard>,
49 public VirtualBoxBase,
50 public IKeyboard
51{
52
53public:
54
55 DECLARE_NOT_AGGREGATABLE(Keyboard)
56
57 DECLARE_PROTECT_FINAL_CONSTRUCT()
58
59 BEGIN_COM_MAP(Keyboard)
60 COM_INTERFACE_ENTRY(ISupportErrorInfo)
61 COM_INTERFACE_ENTRY(IKeyboard)
62 END_COM_MAP()
63
64 NS_DECL_ISUPPORTS
65
66 HRESULT FinalConstruct();
67 void FinalRelease();
68
69 // public methods only for internal purposes
70 HRESULT init (Console *parent);
71 void uninit();
72
73 STDMETHOD(PutScancode)(LONG scancode);
74 STDMETHOD(PutScancodes)(LONG *scancodes,
75 ULONG count,
76 ULONG *codesStored);
77 STDMETHOD(PutCAD)();
78
79 // for VirtualBoxSupportErrorInfoImpl
80 static const wchar_t *getComponentName() { return L"Keyboard"; }
81
82 static const PDMDRVREG DrvReg;
83
84 Console *getParent()
85 {
86 return mParent;
87 }
88
89private:
90
91 static DECLCALLBACK(void *) drvQueryInterface(PPDMIBASE pInterface, PDMINTERFACE enmInterface);
92 static DECLCALLBACK(int) drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle);
93 static DECLCALLBACK(void) drvDestruct(PPDMDRVINS pDrvIns);
94
95 ComObjPtr <Console, ComWeakRef> mParent;
96 /** Pointer to the associated keyboard driver. */
97 struct DRVMAINKEYBOARD *mpDrv;
98 /** Pointer to the device instance for the VMM Device. */
99 PPDMDEVINS mpVMMDev;
100 /** Set after the first attempt to find the VMM Device. */
101 bool mfVMMDevInited;
102};
103
104#endif // ____H_KEYBOARDIMPL
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette