forked from mia/Aegisub
Uninvert hotkey::Scan's return value
Originally committed to SVN as r5506.
This commit is contained in:
parent
ffe8c7a5d6
commit
dabcdb2e8b
2 changed files with 5 additions and 5 deletions
|
@ -137,7 +137,7 @@ bool Hotkey::Scan(const std::string &context, const std::string &str, bool alway
|
||||||
if (always && ctext == "Always") {
|
if (always && ctext == "Always") {
|
||||||
cmd = index->second.CmdName();
|
cmd = index->second.CmdName();
|
||||||
LOG_D("agi/hotkey/found") << "Found: " << str << " Context (req/found): " << context << "/Always Command: " << cmd;
|
LOG_D("agi/hotkey/found") << "Found: " << str << " Context (req/found): " << context << "/Always Command: " << cmd;
|
||||||
return 0;
|
return true;
|
||||||
}
|
}
|
||||||
if (ctext == "Default") {
|
if (ctext == "Default") {
|
||||||
dfault = index->second.CmdName();
|
dfault = index->second.CmdName();
|
||||||
|
@ -150,15 +150,15 @@ bool Hotkey::Scan(const std::string &context, const std::string &str, bool alway
|
||||||
if (!local.empty()) {
|
if (!local.empty()) {
|
||||||
cmd = local;
|
cmd = local;
|
||||||
LOG_D("agi/hotkey/found") << "Found: " << str << " Context: " << context << " Command: " << local;
|
LOG_D("agi/hotkey/found") << "Found: " << str << " Context: " << context << " Command: " << local;
|
||||||
return 0;
|
return true;
|
||||||
}
|
}
|
||||||
if (!dfault.empty()) {
|
if (!dfault.empty()) {
|
||||||
cmd = dfault;
|
cmd = dfault;
|
||||||
LOG_D("agi/hotkey/found") << "Found: " << str << " Context (req/found): " << context << "/Default Command: " << dfault;
|
LOG_D("agi/hotkey/found") << "Found: " << str << " Context (req/found): " << context << "/Default Command: " << dfault;
|
||||||
return 0;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> Hotkey::GetHotkeys(const std::string &context, const std::string &command) const {
|
std::vector<std::string> Hotkey::GetHotkeys(const std::string &context, const std::string &command) const {
|
||||||
|
|
|
@ -69,7 +69,7 @@ bool check(std::string const& context, int key_code, wchar_t key_char, int modif
|
||||||
if (combo.empty()) return false;
|
if (combo.empty()) return false;
|
||||||
|
|
||||||
std::string command;
|
std::string command;
|
||||||
if (agi::hotkey::hotkey->Scan(context, combo, OPT_GET("Audio/Medusa Timing Hotkeys")->GetBool(), command) == 0) {
|
if (agi::hotkey::hotkey->Scan(context, combo, OPT_GET("Audio/Medusa Timing Hotkeys")->GetBool(), command)) {
|
||||||
/// The bottom line should be removed after all the hotkey commands are fixed.
|
/// The bottom line should be removed after all the hotkey commands are fixed.
|
||||||
/// This is to avoid pointless exceptions.
|
/// This is to avoid pointless exceptions.
|
||||||
if (command.find("/") != std::string::npos) {
|
if (command.find("/") != std::string::npos) {
|
||||||
|
|
Loading…
Reference in a new issue