iMSTK
Interactive Medical Simulation Toolkit
imstkConsoleModule.cpp
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #include "imstkConsoleModule.h"
8 #include "imstkKeyboardDeviceClient.h"
9 
10 namespace imstk
11 {
12 ConsoleModule::ConsoleModule(std::string name) :
13  m_keyboardDeviceClient(KeyboardDeviceClient::New())
14 {
15 }
16 
17 void
19 {
20  const char c = static_cast<char>(getchar());
21 
22  // Simulate key press/release
23  m_keyboardDeviceClient->emitKeyDown(c);
24  m_keyboardDeviceClient->emitKeyUp(c);
25 }
26 } // namespace imstk
void updateModule() override
Awaits input.
Compound Geometry.