![]() |
A class implementing the communication with a keyboard. More...
#include <SurgSim/Devices/Keyboard/KeyboardDevice.h>
Public Member Functions | |
KeyboardDevice (const std::string &deviceName) | |
Constructor. More... | |
virtual | ~KeyboardDevice () |
Destructor. More... | |
virtual bool | initialize () override |
Initialize this device and register it with corresponding scaffold. More... | |
virtual bool | finalize () override |
"De"-initialize this device and unregister from the scaffold. More... | |
bool | isInitialized () const |
Check if the scaffold of this device is initialized. More... | |
OsgKeyboardHandler * | getKeyboardHandler () const |
Get keyboard handler. More... | |
![]() | |
CommonDevice (const std::string &name) | |
Constructor. More... | |
CommonDevice (const std::string &name, const SurgSim::DataStructures::DataGroup &inputData) | |
Constructor. More... | |
CommonDevice (const std::string &name, SurgSim::DataStructures::DataGroup &&inputData) | |
Constructor. More... | |
virtual | ~CommonDevice () |
Destructor. More... | |
virtual std::string | getName () const override |
Return a (hopefully unique) device name. More... | |
void | setNameForCallback (const std::string &name) |
Set the name used for calling the input consumers and output producer. More... | |
std::string | getNameForCallback () const |
Get the name used for calling the input consumers and output producer. More... | |
virtual bool | addInputConsumer (std::shared_ptr< InputConsumerInterface > inputConsumer) override |
Connect this device to an InputConsumerInterface, which will receive the data that comes from this device. More... | |
virtual bool | removeInputConsumer (std::shared_ptr< InputConsumerInterface > inputConsumer) override |
Disconnect this device from an InputConsumerInterface, which will no longer receive data from this device. More... | |
virtual bool | setOutputProducer (std::shared_ptr< OutputProducerInterface > outputProducer) override |
Connect this device to an OutputProducerInterface, which will send data to this device. More... | |
virtual bool | removeOutputProducer (std::shared_ptr< OutputProducerInterface > outputProducer) override |
Disconnect this device from an OutputProducerInterface, which will no longer send data to this device. More... | |
virtual bool | hasOutputProducer () override |
Getter for whether or not this device is connected with an OutputProducerInterface. More... | |
![]() | |
virtual | ~DeviceInterface () |
Virtual destructor (empty). More... | |
Private Attributes | |
std::shared_ptr< KeyboardScaffold > | m_scaffold |
Communication with hardware is handled by scaffold. More... | |
Friends | |
class | KeyboardScaffold |
class | KeyboardDeviceTest |
Additional Inherited Members | |
![]() | |
virtual void | pushInput () |
Push application input to consumers. More... | |
virtual bool | pullOutput () |
Pull application output from a producer. More... | |
SurgSim::DataStructures::DataGroup & | getInputData () |
Getter for the input data DataGroup. More... | |
const SurgSim::DataStructures::DataGroup & | getOutputData () const |
Getter for the output data DataGroup. More... | |
A class implementing the communication with a keyboard.
type | name | |
---|---|---|
int | "key" | Key code for the pressed key, if any. Default: -1 |
int | "modifierMask" | Mask for the pressed modifier, if any. Default: 0 |
|
explicit |
Constructor.
deviceName | Name for keyboard device |
|
virtual |
Destructor.
|
overridevirtual |
"De"-initialize this device and unregister from the scaffold.
Implements SurgSim::Input::DeviceInterface.
OsgKeyboardHandler * SurgSim::Device::KeyboardDevice::getKeyboardHandler | ( | ) | const |
Get keyboard handler.
|
overridevirtual |
Initialize this device and register it with corresponding scaffold.
Implements SurgSim::Input::DeviceInterface.
bool SurgSim::Device::KeyboardDevice::isInitialized | ( | ) | const |
Check if the scaffold of this device is initialized.
|
friend |
|
friend |
|
private |
Communication with hardware is handled by scaffold.