Add support for fullscreen hotkey (#748)
This commit is contained in:
parent
7d20988b78
commit
ea640398f9
|
@ -54,6 +54,7 @@ const int hk_general[] =
|
||||||
HK_Reset,
|
HK_Reset,
|
||||||
HK_FastForward,
|
HK_FastForward,
|
||||||
HK_FastForwardToggle,
|
HK_FastForwardToggle,
|
||||||
|
HK_FullscreenToggle,
|
||||||
HK_Lid,
|
HK_Lid,
|
||||||
HK_Mic,
|
HK_Mic,
|
||||||
};
|
};
|
||||||
|
@ -64,6 +65,7 @@ const char* hk_general_labels[] =
|
||||||
"Reset",
|
"Reset",
|
||||||
"Fast forward",
|
"Fast forward",
|
||||||
"Toggle FPS limit",
|
"Toggle FPS limit",
|
||||||
|
"Toggle Fullscreen",
|
||||||
"Close/open lid",
|
"Close/open lid",
|
||||||
"Microphone",
|
"Microphone",
|
||||||
};
|
};
|
||||||
|
@ -86,7 +88,7 @@ InputConfigDialog::InputConfigDialog(QWidget* parent) : QDialog(parent), ui(new
|
||||||
addonsJoyMap[i] = Config::HKJoyMapping[hk_addons[i]];
|
addonsJoyMap[i] = Config::HKJoyMapping[hk_addons[i]];
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 6; i++)
|
for (int i = 0; i < 7; i++)
|
||||||
{
|
{
|
||||||
hkGeneralKeyMap[i] = Config::HKKeyMapping[hk_general[i]];
|
hkGeneralKeyMap[i] = Config::HKKeyMapping[hk_general[i]];
|
||||||
hkGeneralJoyMap[i] = Config::HKJoyMapping[hk_general[i]];
|
hkGeneralJoyMap[i] = Config::HKJoyMapping[hk_general[i]];
|
||||||
|
@ -94,7 +96,7 @@ InputConfigDialog::InputConfigDialog(QWidget* parent) : QDialog(parent), ui(new
|
||||||
|
|
||||||
populatePage(ui->tabInput, 12, dskeylabels, keypadKeyMap, keypadJoyMap);
|
populatePage(ui->tabInput, 12, dskeylabels, keypadKeyMap, keypadJoyMap);
|
||||||
populatePage(ui->tabAddons, 2, hk_addons_labels, addonsKeyMap, addonsJoyMap);
|
populatePage(ui->tabAddons, 2, hk_addons_labels, addonsKeyMap, addonsJoyMap);
|
||||||
populatePage(ui->tabHotkeysGeneral, 6, hk_general_labels, hkGeneralKeyMap, hkGeneralJoyMap);
|
populatePage(ui->tabHotkeysGeneral, 7, hk_general_labels, hkGeneralKeyMap, hkGeneralJoyMap);
|
||||||
|
|
||||||
int njoy = SDL_NumJoysticks();
|
int njoy = SDL_NumJoysticks();
|
||||||
if (njoy > 0)
|
if (njoy > 0)
|
||||||
|
|
|
@ -64,7 +64,7 @@ private:
|
||||||
|
|
||||||
int keypadKeyMap[12], keypadJoyMap[12];
|
int keypadKeyMap[12], keypadJoyMap[12];
|
||||||
int addonsKeyMap[2], addonsJoyMap[2];
|
int addonsKeyMap[2], addonsJoyMap[2];
|
||||||
int hkGeneralKeyMap[6], hkGeneralJoyMap[6];
|
int hkGeneralKeyMap[7], hkGeneralJoyMap[7];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -110,6 +110,7 @@ ConfigEntry PlatformConfigFile[] =
|
||||||
{"HKKey_Reset", 0, &HKKeyMapping[HK_Reset], -1, NULL, 0},
|
{"HKKey_Reset", 0, &HKKeyMapping[HK_Reset], -1, NULL, 0},
|
||||||
{"HKKey_FastForward", 0, &HKKeyMapping[HK_FastForward], -1, NULL, 0},
|
{"HKKey_FastForward", 0, &HKKeyMapping[HK_FastForward], -1, NULL, 0},
|
||||||
{"HKKey_FastForwardToggle", 0, &HKKeyMapping[HK_FastForwardToggle], -1, NULL, 0},
|
{"HKKey_FastForwardToggle", 0, &HKKeyMapping[HK_FastForwardToggle], -1, NULL, 0},
|
||||||
|
{"HKKey_FullscreenToggle", 0, &HKKeyMapping[HK_FullscreenToggle], -1, NULL, 0},
|
||||||
{"HKKey_SolarSensorDecrease", 0, &HKKeyMapping[HK_SolarSensorDecrease], -1, NULL, 0},
|
{"HKKey_SolarSensorDecrease", 0, &HKKeyMapping[HK_SolarSensorDecrease], -1, NULL, 0},
|
||||||
{"HKKey_SolarSensorIncrease", 0, &HKKeyMapping[HK_SolarSensorIncrease], -1, NULL, 0},
|
{"HKKey_SolarSensorIncrease", 0, &HKKeyMapping[HK_SolarSensorIncrease], -1, NULL, 0},
|
||||||
|
|
||||||
|
@ -119,6 +120,7 @@ ConfigEntry PlatformConfigFile[] =
|
||||||
{"HKJoy_Reset", 0, &HKJoyMapping[HK_Reset], -1, NULL, 0},
|
{"HKJoy_Reset", 0, &HKJoyMapping[HK_Reset], -1, NULL, 0},
|
||||||
{"HKJoy_FastForward", 0, &HKJoyMapping[HK_FastForward], -1, NULL, 0},
|
{"HKJoy_FastForward", 0, &HKJoyMapping[HK_FastForward], -1, NULL, 0},
|
||||||
{"HKJoy_FastForwardToggle", 0, &HKJoyMapping[HK_FastForwardToggle], -1, NULL, 0},
|
{"HKJoy_FastForwardToggle", 0, &HKJoyMapping[HK_FastForwardToggle], -1, NULL, 0},
|
||||||
|
{"HKJoy_FastForwardToggle", 0, &HKJoyMapping[HK_FullscreenToggle], -1, NULL, 0},
|
||||||
{"HKJoy_SolarSensorDecrease", 0, &HKJoyMapping[HK_SolarSensorDecrease], -1, NULL, 0},
|
{"HKJoy_SolarSensorDecrease", 0, &HKJoyMapping[HK_SolarSensorDecrease], -1, NULL, 0},
|
||||||
{"HKJoy_SolarSensorIncrease", 0, &HKJoyMapping[HK_SolarSensorIncrease], -1, NULL, 0},
|
{"HKJoy_SolarSensorIncrease", 0, &HKJoyMapping[HK_SolarSensorIncrease], -1, NULL, 0},
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ enum
|
||||||
HK_Reset,
|
HK_Reset,
|
||||||
HK_FastForward,
|
HK_FastForward,
|
||||||
HK_FastForwardToggle,
|
HK_FastForwardToggle,
|
||||||
|
HK_FullscreenToggle,
|
||||||
HK_SolarSensorDecrease,
|
HK_SolarSensorDecrease,
|
||||||
HK_SolarSensorIncrease,
|
HK_SolarSensorIncrease,
|
||||||
HK_MAX
|
HK_MAX
|
||||||
|
|
|
@ -266,6 +266,7 @@ EmuThread::EmuThread(QObject* parent) : QThread(parent)
|
||||||
connect(this, SIGNAL(windowEmuPause()), mainWindow->actPause, SLOT(trigger()));
|
connect(this, SIGNAL(windowEmuPause()), mainWindow->actPause, SLOT(trigger()));
|
||||||
connect(this, SIGNAL(windowEmuReset()), mainWindow->actReset, SLOT(trigger()));
|
connect(this, SIGNAL(windowEmuReset()), mainWindow->actReset, SLOT(trigger()));
|
||||||
connect(this, SIGNAL(screenLayoutChange()), mainWindow->panel, SLOT(onScreenLayoutChanged()));
|
connect(this, SIGNAL(screenLayoutChange()), mainWindow->panel, SLOT(onScreenLayoutChanged()));
|
||||||
|
connect(this, SIGNAL(windowFullscreenToggle()), mainWindow, SLOT(onFullscreenToggled()));
|
||||||
|
|
||||||
if (mainWindow->hasOGL) initOpenGL();
|
if (mainWindow->hasOGL) initOpenGL();
|
||||||
}
|
}
|
||||||
|
@ -364,6 +365,8 @@ void EmuThread::run()
|
||||||
|
|
||||||
if (Input::HotkeyPressed(HK_Pause)) emit windowEmuPause();
|
if (Input::HotkeyPressed(HK_Pause)) emit windowEmuPause();
|
||||||
if (Input::HotkeyPressed(HK_Reset)) emit windowEmuReset();
|
if (Input::HotkeyPressed(HK_Reset)) emit windowEmuReset();
|
||||||
|
|
||||||
|
if (Input::HotkeyPressed(HK_FullscreenToggle)) emit windowFullscreenToggle();
|
||||||
|
|
||||||
if (GBACart::CartInserted && GBACart::HasSolarSensor)
|
if (GBACart::CartInserted && GBACart::HasSolarSensor)
|
||||||
{
|
{
|
||||||
|
@ -1878,6 +1881,20 @@ void MainWindow::onTitleUpdate(QString title)
|
||||||
setWindowTitle(title);
|
setWindowTitle(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::onFullscreenToggled()
|
||||||
|
{
|
||||||
|
if (!mainWindow->isFullScreen())
|
||||||
|
{
|
||||||
|
mainWindow->showFullScreen();
|
||||||
|
mainWindow->menuBar()->hide();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mainWindow->showNormal();
|
||||||
|
mainWindow->menuBar()->show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::onEmuStart()
|
void MainWindow::onEmuStart()
|
||||||
{
|
{
|
||||||
// TODO: make savestates work in DSi mode!!
|
// TODO: make savestates work in DSi mode!!
|
||||||
|
|
|
@ -69,6 +69,8 @@ signals:
|
||||||
void windowLimitFPSChange();
|
void windowLimitFPSChange();
|
||||||
|
|
||||||
void screenLayoutChange();
|
void screenLayoutChange();
|
||||||
|
|
||||||
|
void windowFullscreenToggle();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
volatile int EmuStatus;
|
volatile int EmuStatus;
|
||||||
|
@ -229,6 +231,8 @@ private slots:
|
||||||
void onEmuStop();
|
void onEmuStop();
|
||||||
|
|
||||||
void onUpdateVideoSettings(bool glchange);
|
void onUpdateVideoSettings(bool glchange);
|
||||||
|
|
||||||
|
void onFullscreenToggled();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void createScreenPanel();
|
void createScreenPanel();
|
||||||
|
|
Loading…
Reference in New Issue