void SystemTrayIcon::createSystrayActions() { openDashboardAct = new QAction("Open Online Dashboard", this); connect(openDashboardAct, SIGNAL(triggered()), this, SLOT(openDashboard())); cptFullScreenAct = new QAction("Capture Full Screen", this); cptFullScreenAct->setShortcut(keySqFullScreen); connect(cptFullScreenAct, SIGNAL(triggered()), this, SLOT(captureFullScreen())); cptSelectionAct = new QAction("Capture Selection", this); cptSelectionAct->setShortcut(keySqSelection); connect(cptSelectionAct, SIGNAL(triggered()), this, SLOT(captureSelection())); cptWindowAct = new QAction("Capture Window", this); cptWindowAct->setShortcut(keySqWindow); connect(cptWindowAct, SIGNAL(triggered()), this, SLOT(captureWindow())); preferencesAct = new QAction("Preferences...", this); connect(preferencesAct, SIGNAL(triggered()), this, SLOT(openPreferencesWindow())); quitAct = new QAction("Quit", this); connect(quitAct, SIGNAL(triggered()), this, SLOT(quitApplication())); //Sub menu askMeAct = new QAction("Ask me..", this); askMeAct->setCheckable(true); connect(askMeAct, SIGNAL(triggered(bool)), this, SLOT(uploaderMenuItemChecked(bool))); submenuActions.insert("askme", askMeAct); if(activeUploaderIndex <= -1) { askMeAct->setChecked(true); } }
void SystemTrayIcon::createGlobalShortcuts() { hotkeyFullScreen = new QxtGlobalShortcut(keySqFullScreen, this); connect(hotkeyFullScreen, SIGNAL(activated()), this, SLOT(captureFullScreen())); hotkeySelection = new QxtGlobalShortcut(keySqSelection, this); connect(hotkeySelection, SIGNAL(activated()), this, SLOT(captureSelection())); hotkeyWindow = new QxtGlobalShortcut(keySqWindow, this); connect(hotkeyWindow, SIGNAL(activated()), this, SLOT(captureWindow())); }
void WindowManager::update(std::array<bool,11>& sensors_info, std::array<bool,8>& actuators_info) { std::vector<HWND> hwnd_list; getHwndsByProcessName(this->PROCESS_NAME_.c_str(), hwnd_list, false); if (hwnd_list.size() > 0) { HWND hwnd = hwnd_list.at(0); { std::lock_guard<std::mutex> lock(frameCopyMutex_); try { // TODO: Capture frame is capturing the ENTIRE window. ROI will be problaby faster captureWindow(hwnd, lastFrame_, false); this->ipsystem_.processImage(lastFrame_, sensors_info, actuators_info); } catch (std::exception& e) { } } } }