7 #include "imstkKeyboardControl.h" 8 #include "imstkKeyboardDeviceClient.h" 13 KeyboardControl::setDevice(std::shared_ptr<DeviceClient> device)
16 if (m_deviceClient !=
nullptr)
18 disconnect(m_deviceClient, shared_from_this(), &KeyboardDeviceClient::keyPress);
19 disconnect(m_deviceClient, shared_from_this(), &KeyboardDeviceClient::keyRelease);
23 DeviceControl::setDevice(device);
26 connect(device, &KeyboardDeviceClient::keyPress,
28 connect(device, &KeyboardDeviceClient::keyRelease,
35 OnKeyPress(keyPressEvent->m_key);
41 OnKeyRelease(keyPressEvent->m_key);
friend void disconnect(std::shared_ptr< EventObject >, std::shared_ptr< EventObject >, std::string(*)())
Remove an observer from the sender.
virtual void keyReleaseEvent(KeyEvent *e)
Recieves key release event.
Provides the information of a key event (press, release, & which key)
virtual void keyPressEvent(KeyEvent *e)
Recieves key press event.