7 #include "imstkOpenVRDeviceClient.h" 11 std::shared_ptr<OpenVRDeviceClient>
20 const int prevButtonState = m_buttons[buttonId];
21 m_buttons[buttonId] = BUTTON_TOUCHED;
22 if (prevButtonState != BUTTON_TOUCHED)
24 this->
postEvent(
ButtonEvent(OpenVRDeviceClient::buttonStateChanged(), buttonId, BUTTON_TOUCHED));
29 OpenVRDeviceClient::emitButtonUntouched(
const int buttonId)
31 const int prevButtonState = m_buttons[buttonId];
32 m_buttons[buttonId] = BUTTON_UNTOUCHED;
33 if (prevButtonState != BUTTON_UNTOUCHED)
35 this->
postEvent(
ButtonEvent(OpenVRDeviceClient::buttonStateChanged(), buttonId, BUTTON_UNTOUCHED));
40 OpenVRDeviceClient::emitButtonPress(
const int buttonId)
42 const int prevButtonState = m_buttons[buttonId];
43 m_buttons[buttonId] = BUTTON_PRESSED;
44 if (prevButtonState != BUTTON_PRESSED)
46 this->
postEvent(
ButtonEvent(OpenVRDeviceClient::buttonStateChanged(), buttonId, BUTTON_PRESSED));
51 OpenVRDeviceClient::emitButtonRelease(
const int buttonId)
53 const int prevButtonState = m_buttons[buttonId];
54 m_buttons[buttonId] = BUTTON_RELEASED;
55 if (prevButtonState != BUTTON_RELEASED)
57 this->
postEvent(
ButtonEvent(OpenVRDeviceClient::buttonStateChanged(), buttonId, BUTTON_RELEASED));
void emitButtonTouched(const int buttonId)
Emit various button events.
OpenVRDeviceClient(DeviceType deviceType)
static std::shared_ptr< OpenVRDeviceClient > New(DeviceType deviceType)
void postEvent(const T &e)
Emits the event Direct observers will be immediately called, in sync Queued observers will receive th...