A class that implements the behavior of KeyboardDevice objects.
More...
#include <SurgSim/Devices/Keyboard/KeyboardScaffold.h>
A class that implements the behavior of KeyboardDevice objects.
- See also
- SurgSim::Device::KeyboardDevice
Constructor.
- Parameters
-
logger | (optional) The logger to be used by the scaffold object and the devices it manages. If unspecified or empty, a console logger will be created and used. |
SurgSim::Device::KeyboardScaffold::~KeyboardScaffold |
( |
| ) |
|
Builds the data layout for the application input (i.e. device output).
Get keyboard handler.
- Returns
- The keyboard handler associated with this device
Gets the logger used by this object and the devices it manages.
- Returns
- The logger.
std::shared_ptr< KeyboardScaffold > SurgSim::Device::KeyboardScaffold::getOrCreateSharedInstance |
( |
| ) |
|
|
static |
Gets or creates the scaffold shared by all KeyboardDevice instances.
The scaffold is managed using a SingleInstance object, so it will be destroyed when all devices are released.
- Returns
- the scaffold object.
bool SurgSim::Device::KeyboardScaffold::registerDevice |
( |
KeyboardDevice * |
device | ) |
|
|
private |
Registers the specified device object.
If successful, the device object will become connected to an hardware device.
- Parameters
-
device | The device object to be used, which should have a unique name. |
- Returns
- True if the initialization succeeds, false if it fails.
Sets the default log level.
Has no effect unless called before a scaffold is created (i.e. before the first device).
- Parameters
-
bool SurgSim::Device::KeyboardScaffold::unregisterDevice |
( |
| ) |
|
|
private |
Unregisters the specified device object.
The corresponding controller will become unused, and can be re-registered later.
- Returns
- True on success, false on failure.
bool SurgSim::Device::KeyboardScaffold::updateDevice |
( |
int |
key, |
|
|
int |
modifierMask |
|
) |
| |
|
private |
Updates the device information for a single device.
- Parameters
-
key | Unmodified OSG key code. |
modifierMask | Modifier mask. |
- Returns
- True on success.
friend class KeyboardDeviceTest |
|
friend |
The default logging level.
std::unique_ptr<DeviceData> SurgSim::Device::KeyboardScaffold::m_device |
|
private |
The keyboard device managed by this scaffold.
Logger used by the scaffold and all devices.
The documentation for this class was generated from the following files: