summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2022-01-15 20:44:18 +0100
committergerman77 <juangerman-13@hotmail.com>2022-01-16 03:28:37 +0100
commitc8b3a1285653deb6156acd63f45179b13e07c549 (patch)
tree331a27bbd744608d01f99abd4d731685ff0cd170 /src
parentyuzu: Remove speed limit hotkeys (diff)
downloadyuzu-c8b3a1285653deb6156acd63f45179b13e07c549.tar
yuzu-c8b3a1285653deb6156acd63f45179b13e07c549.tar.gz
yuzu-c8b3a1285653deb6156acd63f45179b13e07c549.tar.bz2
yuzu-c8b3a1285653deb6156acd63f45179b13e07c549.tar.lz
yuzu-c8b3a1285653deb6156acd63f45179b13e07c549.tar.xz
yuzu-c8b3a1285653deb6156acd63f45179b13e07c549.tar.zst
yuzu-c8b3a1285653deb6156acd63f45179b13e07c549.zip
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/configuration/config.cpp6
-rw-r--r--src/yuzu/configuration/config.h2
-rw-r--r--src/yuzu/main.cpp12
3 files changed, 16 insertions, 4 deletions
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index 87a4b5c78..34329970e 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -65,7 +65,10 @@ const std::array<int, 2> Config::default_stick_mod = {
// This must be in alphabetical order according to action name as it must have the same order as
// UISetting::values.shortcuts, which is alphabetically ordered.
// clang-format off
-const std::array<UISettings::Shortcut, 18> Config::default_hotkeys{{
+const std::array<UISettings::Shortcut, 20> Config::default_hotkeys{{
+ {QStringLiteral("Audio Mute/Unmute"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+M"), QStringLiteral("Home+Dpad_Right"), Qt::WindowShortcut}},
+ {QStringLiteral("Audio Volume Down"), QStringLiteral("Main Window"), {QStringLiteral("-"), QStringLiteral("Home+Dpad_Down"), Qt::ApplicationShortcut}},
+ {QStringLiteral("Audio Volume Up"), QStringLiteral("Main Window"), {QStringLiteral("+"), QStringLiteral("Home+Dpad_Up"), Qt::ApplicationShortcut}},
{QStringLiteral("Capture Screenshot"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+P"), QStringLiteral("Screenshot"), Qt::WidgetWithChildrenShortcut}},
{QStringLiteral("Change Docked Mode"), QStringLiteral("Main Window"), {QStringLiteral("F10"), QStringLiteral("Home+X"), Qt::ApplicationShortcut}},
{QStringLiteral("Continue/Pause Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F4"), QStringLiteral("Home+Plus"), Qt::WindowShortcut}},
@@ -74,7 +77,6 @@ const std::array<UISettings::Shortcut, 18> Config::default_hotkeys{{
{QStringLiteral("Fullscreen"), QStringLiteral("Main Window"), {QStringLiteral("F11"), QStringLiteral("Home+B"), Qt::WindowShortcut}},
{QStringLiteral("Load Amiibo"), QStringLiteral("Main Window"), {QStringLiteral("F2"), QStringLiteral("Home+A"), Qt::WidgetWithChildrenShortcut}},
{QStringLiteral("Load File"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+O"), QStringLiteral(""), Qt::WidgetWithChildrenShortcut}},
- {QStringLiteral("Mute Audio"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+M"), QStringLiteral(""), Qt::WindowShortcut}},
{QStringLiteral("Restart Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F6"), QStringLiteral(""), Qt::WindowShortcut}},
{QStringLiteral("Stop Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F5"), QStringLiteral(""), Qt::WindowShortcut}},
{QStringLiteral("TAS Start/Stop"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F5"), QStringLiteral(""), Qt::ApplicationShortcut}},
diff --git a/src/yuzu/configuration/config.h b/src/yuzu/configuration/config.h
index 2e377d63b..22f27d80d 100644
--- a/src/yuzu/configuration/config.h
+++ b/src/yuzu/configuration/config.h
@@ -46,7 +46,7 @@ public:
default_mouse_buttons;
static const std::array<int, Settings::NativeKeyboard::NumKeyboardKeys> default_keyboard_keys;
static const std::array<int, Settings::NativeKeyboard::NumKeyboardMods> default_keyboard_mods;
- static const std::array<UISettings::Shortcut, 18> default_hotkeys;
+ static const std::array<UISettings::Shortcut, 20> default_hotkeys;
private:
void Initialize(const std::string& config_name);
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index b3ad89281..d9e689d14 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1014,8 +1014,18 @@ void GMainWindow::InitializeHotkeys() {
Settings::values.use_docked_mode.GetValue(), *system);
dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue());
});
- connect_shortcut(QStringLiteral("Mute Audio"),
+ connect_shortcut(QStringLiteral("Audio Mute/Unmute"),
[] { Settings::values.audio_muted = !Settings::values.audio_muted; });
+ connect_shortcut(QStringLiteral("Audio Volume Down"), [] {
+ const auto current_volume = static_cast<int>(Settings::values.volume.GetValue());
+ const auto new_volume = std::max(current_volume - 5, 0);
+ Settings::values.volume.SetValue(static_cast<u8>(new_volume));
+ });
+ connect_shortcut(QStringLiteral("Audio Volume Up"), [] {
+ const auto current_volume = static_cast<int>(Settings::values.volume.GetValue());
+ const auto new_volume = std::min(current_volume + 5, 100);
+ Settings::values.volume.SetValue(static_cast<u8>(new_volume));
+ });
connect_shortcut(QStringLiteral("Toggle Framerate Limit"), [] {
Settings::values.disable_fps_limit.SetValue(!Settings::values.disable_fps_limit.GetValue());
});