enhanced global keys handling for fullscreen mode

reordered events for Event Mappings dialog
This commit is contained in:
Thomas Jentzsch 2021-11-21 11:02:11 +01:00
parent f3e82e91d8
commit f619b4e5cb
3 changed files with 89 additions and 70 deletions

View File

@ -2776,7 +2776,15 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { {
{ Event::ToggleContSnapshots, "Save continuous snapsh. (as defined)", "" },
{ Event::ToggleContSnapshotsFrame,"Save continuous snapsh. (every frame)", "" },
#endif
// Global keys:
{ Event::PreviousSettingGroup, "Select previous setting group", "" },
{ Event::NextSettingGroup, "Select next setting group", "" },
{ Event::PreviousSetting, "Select previous setting", "" },
{ Event::NextSetting, "Select next setting", "" },
{ Event::SettingDecrease, "Decrease current setting", "" },
{ Event::SettingIncrease, "Increase current setting", "" },
// Controllers:
{ Event::LeftJoystickUp, "Left Joystick Up", "" },
{ Event::LeftJoystickDown, "Left Joystick Down", "" },
{ Event::LeftJoystickLeft, "Left Joystick Left", "" },
@ -2855,22 +2863,24 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { {
{ Event::RightKeyboardStar, "Right Keyboard *", "" },
{ Event::RightKeyboard0, "Right Keyboard 0", "" },
{ Event::RightKeyboardPound, "Right Keyboard #", "" },
// Video
{ Event::ToggleInter, "Toggle display interpolation", "" },
{ Event::VidmodeDecrease, "Previous zoom level", "" },
{ Event::VidmodeIncrease, "Next zoom level", "" },
{ Event::ToggleFullScreen, "Toggle fullscreen", "" },
#ifdef ADAPTABLE_REFRESH_SUPPORT
{ Event::ToggleAdaptRefresh, "Toggle fullscreen refresh rate adapt", "" },
#endif
{ Event::OverscanDecrease, "Decrease overscan in fullscreen mode", "" },
{ Event::OverscanIncrease, "Increase overscan in fullscreen mode", "" },
{ Event::VidmodeDecrease, "Previous zoom level", "" },
{ Event::VidmodeIncrease, "Next zoom level", "" },
{ Event::ToggleCorrectAspectRatio,"Toggle aspect ratio correct scaling", "" },
{ Event::VSizeAdjustDecrease, "Decrease vertical display size", "" },
{ Event::VSizeAdjustIncrease, "Increase vertical display size", "" },
{ Event::VCenterDecrease, "Move display up", "" },
{ Event::VCenterIncrease, "Move display down", "" },
{ Event::FormatDecrease, "Decrease display format", "" },
{ Event::FormatIncrease, "Increase display format", "" },
{ Event::FormatDecrease, "Decrease TV format", "" },
{ Event::FormatIncrease, "Increase TV format", "" },
// Palette settings
{ Event::PaletteDecrease, "Switch to previous palette", "" },
{ Event::PaletteIncrease, "Switch to next palette", "" },
@ -2878,7 +2888,6 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { {
{ Event::NextPaletteAttribute, "Select next palette attribute", "" },
{ Event::PaletteAttributeDecrease,"Decrease selected palette attribute", "" },
{ Event::PaletteAttributeIncrease,"Increase selected palette attribute", "" },
{ Event::ToggleInter, "Toggle display interpolation", "" },
// Blargg TV effects:
{ Event::VidmodeStd, "Disable TV effects", "" },
{ Event::VidmodeRGB, "Select 'RGB' preset", "" },
@ -2900,15 +2909,71 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { {
{ Event::ScanlinesIncrease, "Increase scanlines", "" },
{ Event::PreviousScanlineMask, "Switch to previous scanline mask", "" },
{ Event::NextScanlineMask, "Switch to next scanline mask", "" },
// Audio
{ Event::SoundToggle, "Toggle sound", "" },
{ Event::VolumeDecrease, "Decrease volume", "" },
{ Event::VolumeIncrease, "Increase volume", "" },
{ Event::PreviousSettingGroup, "Select previous setting group", "" },
{ Event::NextSettingGroup, "Select next setting group", "" },
{ Event::PreviousSetting, "Select previous setting", "" },
{ Event::NextSetting, "Select next setting", "" },
{ Event::SettingDecrease, "Decrease current setting", "" },
{ Event::SettingIncrease, "Increase current setting", "" },
// Devices & Ports:
{ Event::DecreaseDeadzone, "Decrease digital dead zone", "" },
{ Event::IncreaseDeadzone, "Increase digital dead zone", "" },
{ Event::DecAnalogDeadzone, "Decrease analog dead zone", "" },
{ Event::IncAnalogDeadzone, "Increase analog dead zone", "" },
{ Event::DecAnalogSense, "Decrease analog paddle sensitivity", "" },
{ Event::IncAnalogSense, "Increase analog paddle sensitivity", "" },
{ Event::DecAnalogLinear, "Decrease analog paddle linearity", "" },
{ Event::IncAnalogLinear, "Increase analog paddle linearity", "" },
{ Event::DecDejtterAveraging, "Decrease paddle dejitter averaging", "" },
{ Event::IncDejtterAveraging, "Increase paddle dejitter averaging", "" },
{ Event::DecDejtterReaction, "Decrease paddle dejitter reaction", "" },
{ Event::IncDejtterReaction, "Increase paddle dejitter reaction", "" },
{ Event::DecDigitalSense, "Decrease digital paddle sensitivity", "" },
{ Event::IncDigitalSense, "Increase digital paddle sensitivity", "" },
{ Event::DecreaseAutoFire, "Decrease auto fire speed", "" },
{ Event::IncreaseAutoFire, "Increase auto fire speed", "" },
{ Event::ToggleFourDirections, "Toggle allow four joystick directions", "" },
{ Event::ToggleKeyCombos, "Toggle use of modifier key combos", "" },
{ Event::ToggleSAPortOrder, "Swap Stelladaptor port ordering", "" },
// Devices & Ports related properties
{ Event::PreviousLeftPort, "Select previous left controller", "" },
{ Event::NextLeftPort, "Select next left controller", "" },
{ Event::PreviousRightPort, "Select previous right controller", "" },
{ Event::NextRightPort, "Select next right controller", "" },
{ Event::ToggleSwapPorts, "Toggle swap ports", "" },
{ Event::ToggleSwapPaddles, "Toggle swap paddles", "" },
// Developer keys:
// Mouse
{ Event::PrevMouseAsController, "Select previous mouse controls", "" },
{ Event::NextMouseAsController, "Select next mouse controls", "" },
{ Event::DecMousePaddleSense, "Decrease mouse paddle sensitivity", "" },
{ Event::IncMousePaddleSense, "Increase mouse paddle sensitivity", "" },
{ Event::DecMouseTrackballSense, "Decrease mouse trackball sensitivity", "" },
{ Event::IncMouseTrackballSense, "Increase mouse trackball sensitivity", "" },
{ Event::DecreaseDrivingSense, "Decrease driving sensitivity", "" },
{ Event::IncreaseDrivingSense, "Increase driving sensitivity", "" },
{ Event::PreviousCursorVisbility, "Select prev. cursor visibility mode", "" },
{ Event::NextCursorVisbility, "Select next cursor visibility mode", "" },
{ Event::ToggleGrabMouse, "Toggle grab mouse", "" },
// Mouse related properties
{ Event::PreviousMouseControl, "Select previous mouse emulation mode", "" },
{ Event::NextMouseControl, "Select next mouse emulation mode", "" },
{ Event::DecreaseMouseAxesRange, "Decrease mouse axes range", "" },
{ Event::IncreaseMouseAxesRange, "Increase mouse axes range", "" },
// Time Machine
{ Event::ToggleTimeMachine, "Toggle 'Time Machine' mode", "" },
{ Event::TimeMachineMode, "Toggle 'Time Machine' UI", "" },
{ Event::RewindPause, "Rewind one state & enter Pause mode", "" },
{ Event::Rewind1Menu, "Rewind one state & enter TM UI", "" },
{ Event::Rewind10Menu, "Rewind 10 states & enter TM UI", "" },
{ Event::RewindAllMenu, "Rewind all states & enter TM UI", "" },
{ Event::UnwindPause, "Unwind one state & enter Pause mode", "" },
{ Event::Unwind1Menu, "Unwind one state & enter TM UI", "" },
{ Event::Unwind10Menu, "Unwind 10 states & enter TM UI", "" },
{ Event::UnwindAllMenu, "Unwind all states & enter TM UI", "" },
{ Event::TogglePlayBackMode, "Toggle 'Time Machine' playback mode", "" },
// Developer:
{ Event::ToggleDeveloperSet, "Toggle developer settings sets", "" },
{ Event::ToggleFrameStats, "Toggle frame stats", "" },
{ Event::ToggleP0Bit, "Toggle TIA Player0 object", "" },
@ -2930,64 +2995,8 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { {
{ Event::ToggleJitter, "Toggle TV scanline 'Jitter' effect", "" },
{ Event::JitterDecrease, "Decrease TV 'Jitter' roll", "" },
{ Event::JitterIncrease, "Increase TV 'Jitter' roll", "" },
// Other keys:
{ Event::SoundToggle, "Toggle sound", "" },
{ Event::VolumeDecrease, "Decrease volume", "" },
{ Event::VolumeIncrease, "Increase volume", "" },
{ Event::DecreaseDeadzone, "Decrease digital dead zone", "" },
{ Event::IncreaseDeadzone, "Increase digital dead zone", "" },
{ Event::DecAnalogDeadzone, "Decrease analog dead zone", "" },
{ Event::IncAnalogDeadzone, "Increase analog dead zone", "" },
{ Event::DecAnalogSense, "Decrease analog paddle sensitivity", "" },
{ Event::IncAnalogSense, "Increase analog paddle sensitivity", "" },
{ Event::DecAnalogLinear, "Decrease analog paddle linearity", "" },
{ Event::IncAnalogLinear, "Increase analog paddle linearity", "" },
{ Event::DecDejtterAveraging, "Decrease paddle dejitter averaging", "" },
{ Event::IncDejtterAveraging, "Increase paddle dejitter averaging", "" },
{ Event::DecDejtterReaction, "Decrease paddle dejitter reaction", "" },
{ Event::IncDejtterReaction, "Increase paddle dejitter reaction", "" },
{ Event::DecDigitalSense, "Decrease digital paddle sensitivity", "" },
{ Event::IncDigitalSense, "Increase digital paddle sensitivity", "" },
{ Event::DecreaseAutoFire, "Decrease auto fire speed", "" },
{ Event::IncreaseAutoFire, "Increase auto fire speed", "" },
{ Event::ToggleFourDirections, "Toggle allow four joystick directions", "" },
{ Event::ToggleKeyCombos, "Toggle use of modifier key combos", "" },
{ Event::ToggleSAPortOrder, "Swap Stelladaptor port ordering", "" },
{ Event::PrevMouseAsController, "Select previous mouse controls", "" },
{ Event::NextMouseAsController, "Select next mouse controls", "" },
{ Event::DecMousePaddleSense, "Decrease mouse paddle sensitivity", "" },
{ Event::IncMousePaddleSense, "Increase mouse paddle sensitivity", "" },
{ Event::DecMouseTrackballSense, "Decrease mouse trackball sensitivity", "" },
{ Event::IncMouseTrackballSense, "Increase mouse trackball sensitivity", "" },
{ Event::DecreaseDrivingSense, "Decrease driving sensitivity", "" },
{ Event::IncreaseDrivingSense, "Increase driving sensitivity", "" },
{ Event::PreviousCursorVisbility, "Select prev. cursor visibility mode", "" },
{ Event::NextCursorVisbility, "Select next cursor visibility mode", "" },
{ Event::ToggleGrabMouse, "Toggle grab mouse", "" },
{ Event::PreviousLeftPort, "Select previous left controller", "" },
{ Event::NextLeftPort, "Select next left controller", "" },
{ Event::PreviousRightPort, "Select previous right controller", "" },
{ Event::NextRightPort, "Select next right controller", "" },
{ Event::ToggleSwapPorts, "Toggle swap ports", "" },
{ Event::ToggleSwapPaddles, "Toggle swap paddles", "" },
{ Event::PreviousMouseControl, "Select previous mouse emulation mode", "" },
{ Event::NextMouseControl, "Select next mouse emulation mode", "" },
{ Event::DecreaseMouseAxesRange, "Decrease mouse axes range", "" },
{ Event::IncreaseMouseAxesRange, "Increase mouse axes range", "" },
{ Event::ToggleTimeMachine, "Toggle 'Time Machine' mode", "" },
{ Event::TimeMachineMode, "Toggle 'Time Machine' UI", "" },
{ Event::RewindPause, "Rewind one state & enter Pause mode", "" },
{ Event::Rewind1Menu, "Rewind one state & enter TM UI", "" },
{ Event::Rewind10Menu, "Rewind 10 states & enter TM UI", "" },
{ Event::RewindAllMenu, "Rewind all states & enter TM UI", "" },
{ Event::UnwindPause, "Unwind one state & enter Pause mode", "" },
{ Event::Unwind1Menu, "Unwind one state & enter TM UI", "" },
{ Event::Unwind10Menu, "Unwind 10 states & enter TM UI", "" },
{ Event::UnwindAllMenu, "Unwind all states & enter TM UI", "" },
{ Event::TogglePlayBackMode, "Toggle 'Time Machine' playback mode", "" },
// Combo
{ Event::Combo1, "Combo 1", "" },
{ Event::Combo2, "Combo 2", "" },
{ Event::Combo3, "Combo 3", "" },

View File

@ -137,7 +137,10 @@ bool GlobalKeyHandler::handleEvent(const Event::Type event, bool pressed, bool r
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void GlobalKeyHandler::setSetting(const Setting setting)
{
mySetting = setting;
if(setting == Setting::ZOOM && myOSystem.frameBuffer().fullScreen())
mySetting = Setting::FS_ASPECT;
else
mySetting = setting;
mySettingActive = true;
}
@ -193,6 +196,8 @@ bool GlobalKeyHandler::isTrackball(const Controller& controller) const
bool GlobalKeyHandler::skipAVSetting() const
{
const bool isFullScreen = myOSystem.frameBuffer().fullScreen();
const bool isFsStretch = isFullScreen &&
myOSystem.settings().getBool("tia.fs_stretch");
const bool isCustomPalette =
myOSystem.settings().getString("palette") == PaletteHandler::SETTING_CUSTOM;
const bool isCustomFilter =
@ -203,9 +208,12 @@ bool GlobalKeyHandler::skipAVSetting() const
myOSystem.settings().getString("video") == "software";
return (mySetting == Setting::OVERSCAN && !isFullScreen)
|| (mySetting == Setting::ZOOM && isFullScreen)
#ifdef ADAPTABLE_REFRESH_SUPPORT
|| (mySetting == Setting::ADAPT_REFRESH && !isFullScreen)
#endif
|| (mySetting == Setting::FS_ASPECT && !isFullScreen)
|| (mySetting == Setting::ASPECT_RATIO && isFsStretch)
|| (mySetting >= Setting::PALETTE_PHASE
&& mySetting <= Setting::PALETTE_BLUE_SHIFT
&& !isCustomPalette)
@ -328,6 +336,7 @@ GlobalKeyHandler::SettingData GlobalKeyHandler::getSettingData(const Setting set
{Setting::VOLUME, {true, std::bind(&Sound::adjustVolume, &myOSystem.sound(), _1)}},
{Setting::ZOOM, {false, std::bind(&FrameBuffer::switchVideoMode, &myOSystem.frameBuffer(), _1)}}, // always repeating
{Setting::FULLSCREEN, {false, std::bind(&FrameBuffer::toggleFullscreen, &myOSystem.frameBuffer(), _1)}}, // always repeating
{Setting::FS_ASPECT, {false, std::bind(&FrameBuffer::switchVideoMode, &myOSystem.frameBuffer(), _1)}}, // always repeating
#ifdef ADAPTABLE_REFRESH_SUPPORT
{Setting::ADAPT_REFRESH, {false, std::bind(&FrameBuffer::toggleAdaptRefresh, &myOSystem.frameBuffer(), _1)}}, // always repeating
#endif

View File

@ -38,6 +38,7 @@ class GlobalKeyHandler
VOLUME,
ZOOM,
FULLSCREEN,
FS_ASPECT,
#ifdef ADAPTABLE_REFRESH_SUPPORT
ADAPT_REFRESH,
#endif