bool checkKeys(KeyPress key, Display display, Notification notification, vector<int> keyCodeArray, bool isMenu) { display.updateDisplay(key); system("CLS"); cout << display.toString(); while (true) { for (int i = 0; i < keyCodeArray.size(); i++) { if (key.isPressed(keyCodeArray.at(i))) { display.updateDisplay(key); system("CLS"); cout << display.toString(); }; } //extra logic for if the display is not a menu: if (!isMenu) { if (key.timedUpdate(1)) { display.updateDisplay(key); system("CLS"); cout << display.toString(); } key.isHeld(VK_SPACE); notification.lockedScreen(stoi(key.getLockedScreenPercent()), key.getSecondsLocked()); key.incrementLoopCount(); } //reset counter and key presses if (key.checkIfRequiresReset()) break; Sleep(10); } return 0; }