void MainWindow::keyPressEvent(QKeyEvent *e) { if(isFullScreen() && e->key() == Qt::Key_F11) { on_action_OptionsFullScreen_triggered(); return; } NativeKey(KeyInput(DEVICE_ID_KEYBOARD, KeyMapRawQttoNative.find(e->key())->second, KEY_DOWN)); }
void MainWindow::keyPressEvent(QKeyEvent *e) { if(isFullScreen() && e->key() == Qt::Key_F11) { on_action_OptionsFullScreen_triggered(); return; } pressedKeys.insert(e->key()); }
void MainWindow::keyPressEvent(QKeyEvent *e) { if(isFullScreen() && e->key() == Qt::Key_F12) { on_action_OptionsFullScreen_triggered(); return; } for (int b = 0; b < controllistCount; b++) { if (e->key() == controllist[b].key) { input_state.pad_buttons |= (controllist[b].emu_id); } } }
// TODO: Make this class thread-aware. Can't send events to a different thread. Currently only works on X11. // Needs to use QueuedConnection for signals/slots. MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), nextState(CORE_POWERDOWN), dialogDisasm(0), memoryWindow(0), memoryTexWindow(0), timer(this), displaylistWindow(0), lastUIState(UISTATE_MENU) { ui->setupUi(this); controls = new Controls(this); #if QT_HAS_SDL gamePadDlg = new GamePadDialog(&input_state, this); #endif host = new QtHost(this); emugl = ui->widget; emugl->init(&input_state); emugl->resize(pixel_xres, pixel_yres); emugl->setMinimumSize(pixel_xres, pixel_yres); emugl->setMaximumSize(pixel_xres, pixel_yres); QObject::connect( emugl, SIGNAL(doubleClick()), this, SLOT(on_action_OptionsFullScreen_triggered()) ); createLanguageMenu(); UpdateMenus(); int zoom = g_Config.iWindowZoom; if (zoom < 1) zoom = 1; if (zoom > 4) zoom = 4; SetZoom(zoom); SetGameTitle(fileToStart); connect(&timer, SIGNAL(timeout()), this, SLOT(Update())); timer.setInterval(0); timer.start(); // if (!fileToStart.isNull()) // { // UpdateMenus(); // if (stateToLoad != NULL) // SaveState::Load(stateToLoad); // } }
/* SLOTS */ void MainWindow::Boot() { dialogDisasm = new Debugger_Disasm(currentDebugMIPS, this, this); if(g_Config.bShowDebuggerOnLoad) dialogDisasm->show(); if(g_Config.bFullScreen != isFullScreen()) on_action_OptionsFullScreen_triggered(); memoryWindow = new Debugger_Memory(currentDebugMIPS, this, this); memoryTexWindow = new Debugger_MemoryTex(this); displaylistWindow = new Debugger_DisplayList(currentDebugMIPS, this, this); notifyMapsLoaded(); if (nextState == CORE_RUNNING) on_action_EmulationRun_triggered(); UpdateMenus(); }