| 39 | } |
| 40 | |
| 41 | std::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 | |
| 64 | void KeyScanner::Start() { |
| 65 | #ifdef LINUX |
nothing calls this directly
no outgoing calls
no test coverage detected