summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControlReference
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/InputCommon/ControlReference')
-rw-r--r--Source/Core/InputCommon/ControlReference/ExpressionParser.cpp5
-rw-r--r--Source/Core/InputCommon/ControlReference/ExpressionParser.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp b/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp
index c96ea0599c..5e69cc42d9 100644
--- a/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp
+++ b/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp
@@ -371,6 +371,7 @@ public:
}
case TOK_ASSIGN:
{
+ // Use this carefully as it's extremely powerful and can end up in unforeseen situations
lhs->SetValue(rhs->GetValue());
return lhs->GetValue();
}
@@ -565,6 +566,9 @@ private:
// This class proxies all methods to its either left-hand child if it has bound controls, or its
// right-hand child. Its intended use is for supporting old-style barewords expressions.
+// Note that if you have a keyboard device as default device and the expression is a single digit
+// number, this will usually resolve in a numerical key instead of a numerical value.
+// Though if this expression belongs to NumericSetting, it will likely be simplifed back to a value.
class CoalesceExpression : public Expression
{
public:
@@ -945,6 +949,7 @@ static std::unique_ptr<Expression> ParseBarewordExpression(const std::string& st
qualifier.control_name = str;
qualifier.has_device = false;
+ // This control expression will only work (find the specified control) with the default device.
return std::make_unique<ControlExpression>(qualifier);
}
diff --git a/Source/Core/InputCommon/ControlReference/ExpressionParser.h b/Source/Core/InputCommon/ControlReference/ExpressionParser.h
index 9789e9afe0..14670848ae 100644
--- a/Source/Core/InputCommon/ControlReference/ExpressionParser.h
+++ b/Source/Core/InputCommon/ControlReference/ExpressionParser.h
@@ -63,7 +63,9 @@ public:
enum class ParseStatus
{
Successful,
+ // Note that the expression could still work in this case (be valid and return a value)
SyntaxError,
+ // Will return the default value
EmptyExpression,
};
@@ -107,6 +109,7 @@ class ControlQualifier
public:
bool has_device;
Core::DeviceQualifier device_qualifier;
+ // Makes no distinction between input and output
std::string control_name;
ControlQualifier() : has_device(false) {}