MCPcopy Create free account
hub / github.com/MeisApps/pcbu-desktop / GetAllKeys

Method GetAllKeys

common/src/handler/KeyScanner.cpp:41–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41std::map<int, bool> KeyScanner::GetAllKeys() {
42#ifdef _WIN32
43 auto map = std::map<int, bool>();
44 for(int i = 0; i < 0xA6; i++) {
45 map[i] = GetKeyState(i);
46 }
47 return map;
48#endif
49#ifdef LINUX
50 std::lock_guard<std::mutex> lock(m_ScanMutex);
51 if(m_KeyMaps.empty())
52 return {};
53 return m_KeyMaps[0]; // ToDo
54#endif
55#ifdef APPLE
56 auto map = std::map<int, bool>();
57 for(int i = 0; i < 0x7E; i++) {
58 map[i] = GetKeyState(i);
59 }
60 return map;
61#endif
62}
63
64void KeyScanner::Start() {
65#ifdef LINUX

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected