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

Method GetKeyState

common/src/handler/KeyScanner.cpp:22–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22bool KeyScanner::GetKeyState(int key) {
23#ifdef _WIN32
24 return GetAsyncKeyState(key) < 0;
25#endif
26#ifdef LINUX
27 std::lock_guard<std::mutex> lock(m_ScanMutex);
28 for(auto keyMap : m_KeyMaps) {
29 if(keyMap.count(key) && keyMap[key])
30 return true;
31 }
32 return false;
33#endif
34#ifdef APPLE
35 unsigned char keyMap[16];
36 GetKeys((BigEndianUInt32 *)&keyMap);
37 return (0 != ((keyMap[key >> 3] >> (key & 7)) & 1));
38#endif
39}
40
41std::map<int, bool> KeyScanner::GetAllKeys() {
42#ifdef _WIN32

Callers 1

RunServerMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected