KeyboardImpl.cpp revision ad77e3ec3cde24263bc7537575f5cae442bee3b1
/** @file
*
* VBox frontends: Basic Frontend (BFE):
* Implementation of Keyboard class and related things
*/
/*
* Copyright (C) 2006-2007 Sun Microsystems, Inc.
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#ifdef VBOXBFE_WITHOUT_COM
# include "COMDefs.h"
#else
#endif
#include "KeyboardImpl.h"
// defines
////////////////////////////////////////////////////////////////////////////////
// globals
////////////////////////////////////////////////////////////////////////////////
/**
* Keyboard driver instance data.
*/
typedef struct DRVMAINKEYBOARD
{
/** Pointer to the keyboard object. */
/** Pointer to the driver instance structure. */
/** Our mouse connector interface. */
// constructor / destructor
////////////////////////////////////////////////////////////////////////////////
{
mfVMMDevInited = false;
}
{
if (mpDrv)
mfVMMDevInited = true;
}
// public methods
////////////////////////////////////////////////////////////////////////////////
/**
* Sends a scancode to the keyboard.
*
* @returns COM status code
* @param scancode The scancode to send
*/
{
if (!mpDrv)
return S_OK;
if (RT_FAILURE (rcVBox))
return E_FAIL;
return S_OK;
}
/**
* Sends a list of scancodes to the keyboard.
*
* @returns COM status code
* @param scancodes Safe array of scancodes
* @param codesStored Address of variable to store the number
* of scancodes that were sent to the keyboard.
This value can be NULL.
*/
{
return E_INVALIDARG;
if (!mpDrv)
return S_OK;
int rcVBox = VINF_SUCCESS;
{
}
if (RT_FAILURE (rcVBox))
return E_FAIL;
/// @todo is it actually possible that not all scancodes can be transmitted?
if (codesStored)
return S_OK;
}
/**
* Sends Control-Alt-Delete to the keyboard. This could be done otherwise
* but it's so common that we'll be nice and supply a convenience API.
*
* @returns COM status code
*
*/
{
}
//
// private methods
//
/**
* Queries an interface to the driver.
*
* @returns Pointer to interface.
* @returns NULL if the interface was not supported by the driver.
* @param pInterface Pointer to this interface structure.
* @param enmInterface The requested interface identification.
*/
{
switch (enmInterface)
{
case PDMINTERFACE_BASE:
default:
return NULL;
}
}
/**
* Destruct a keyboard driver instance.
*
* @returns VBox status.
* @param pDrvIns The driver instance data.
*/
{
{
}
}
/** @copydoc PDMIKEYBOARDCONNECTOR::pfnLedStatusChange */
{
/** @todo Implement me. */
}
/**
* Construct a keyboard driver instance.
*
* @copydoc FNPDMDRVCONSTRUCT
*/
{
/*
* Validate configuration.
*/
("Configuration error: Not possible to attach anything to this driver!\n"),
/*
* IBase.
*/
/*
*/
pData->pUpPort = (PPDMIKEYBOARDPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_KEYBOARD_PORT);
{
AssertMsgFailed(("Configuration error: No keyboard port interface above!\n"));
return VERR_PDM_MISSING_INTERFACE_ABOVE;
}
/*
* Get the Keyboard object pointer and update the mpDrv member.
*/
void *pv;
if (RT_FAILURE(rc))
{
return rc;
}
return VINF_SUCCESS;
}
/**
* Keyboard driver registration record.
*/
{
/* u32Version */
/* szDriverName */
"MainKeyboard",
/* szRCMod */
"",
/* szR0Mod */
"",
/* pszDescription */
"Main keyboard driver (Main as in the API).",
/* fFlags */
/* fClass. */
/* cMaxInstances */
~0,
/* cbInstance */
sizeof(DRVMAINKEYBOARD),
/* pfnConstruct */
/* pfnDestruct */
/* pfnRelocate */
NULL,
/* pfnIOCtl */
NULL,
/* pfnPowerOn */
NULL,
/* pfnReset */
NULL,
/* pfnSuspend */
NULL,
/* pfnResume */
NULL,
/* pfnAttach */
NULL,
/* pfnDetach */
NULL,
/* pfnPowerOff */
NULL,
/* pfnSoftReset */
NULL,
/* u32EndVersion */
};