diff --git a/aegisub/src/command/app.cpp b/aegisub/src/command/app.cpp index 3ad8d792c..bfd333bca 100644 --- a/aegisub/src/command/app.cpp +++ b/aegisub/src/command/app.cpp @@ -227,11 +227,28 @@ struct app_options : public Command { } }; +/// Toggle global override hotkeys (aka medusa mode). +struct app_toggle_global_hotkeys : public Command { + CMD_NAME("app/toggle/global_hotkeys") + STR_MENU("Toggle global hotkey overrides") + STR_DISP("Toggle global hotkey overrides") + STR_HELP("Toggle global hotkey overrides.") + CMD_TYPE(COMMAND_TOGGLE) + + bool IsActive(const agi::Context *c) { + return OPT_GET("Audio/Medusa Timing Hotkeys")->GetBool(); + } + + void operator()(agi::Context *c) { + agi::OptionValue *opt = OPT_SET("Audio/Medusa Timing Hotkeys"); + opt->SetBool(!opt->GetBool()); + } +}; /// Check to see if there is a new version of Aegisub available. struct app_updates : public Command { CMD_NAME("app/updates") - STR_MENU("&Check for Updates..") + STR_MENU("&Check for Updates...") STR_DISP("Check for Updates") STR_HELP("Check to see if there is a new version of Aegisub available.") @@ -255,6 +272,7 @@ namespace cmd { reg(new app_log); reg(new app_new_window); reg(new app_options); + reg(new app_toggle_global_hotkeys); reg(new app_updates); } } diff --git a/aegisub/src/command/command.cpp b/aegisub/src/command/command.cpp index 910d666d3..875d265a5 100644 --- a/aegisub/src/command/command.cpp +++ b/aegisub/src/command/command.cpp @@ -85,7 +85,6 @@ namespace cmd { void init_grid(); void init_help(); void init_keyframe(); - void init_medusa(); void init_menu(); void init_recent(); void init_subtitle(); diff --git a/aegisub/src/libresrc/default_hotkey.json b/aegisub/src/libresrc/default_hotkey.json index 2edba24b1..ae2373834 100644 --- a/aegisub/src/libresrc/default_hotkey.json +++ b/aegisub/src/libresrc/default_hotkey.json @@ -1,12 +1,12 @@ { "Always" : { - "audio play" : [ + "audio/play/selection" : [ { "modifiers" : [], "key" : "KP_5" } ], - "audio stop" : [ + "audio/stop" : [ { "modifiers" : [], "key" : "KP_8" @@ -36,31 +36,31 @@ "key" : "KP_9" } ], - "audio play before selection begin" : [ + "audio/play/selection/before" : [ { "modifiers" : [], "key" : "KP_1" } ], - "audio play after selection end" : [ + "audio/play/selection/after" : [ { "modifiers" : [], "key" : "KP_3" } ], - "timing move to prev item" : [ + "time/prev" : [ { "modifiers" : [], "key" : "KP_0" } ], - "timing move to next item" : [ + "time/next" : [ { "modifiers" : [], "key" : "KP_2" } ], - "timing commit" : [ + "audio/commit" : [ { "modifiers" : [], "key" : "KP_Enter" @@ -417,7 +417,7 @@ "key" : "Left" } ], - "toggle global timing mode" : [ + "app/toggle/global_hotkeys" : [ { "modifiers" : [ "Ctrl" ], "key" : "KP_Multiply"