summaryrefslogtreecommitdiff
path: root/core/input
diff options
context:
space:
mode:
authorTomasz Chabora <kobewi4e@gmail.com>2020-02-13 16:42:49 +0100
committerkobewi <kobewi4e@gmail.com>2021-05-20 23:07:57 +0200
commitb1859510ab0a3381e0a5bec3d896032fc5019147 (patch)
tree8f7d3e9b6d31b645db48de3d4e02cc3a485588da /core/input
parent78d85de13be383b24252a38e42bec5be81721ea7 (diff)
Change behavior of String.right
Diffstat (limited to 'core/input')
-rw-r--r--core/input/input.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/input/input.cpp b/core/input/input.cpp
index 2304c05bf8..6eafec087d 100644
--- a/core/input/input.cpp
+++ b/core/input/input.cpp
@@ -1262,16 +1262,16 @@ void Input::parse_mapping(String p_mapping) {
} else if (output[0] == '-') {
output_range = NEGATIVE_HALF_AXIS;
}
- output = output.right(1);
+ output = output.substr(1);
}
JoyAxisRange input_range = FULL_AXIS;
if (input[0] == '+') {
input_range = POSITIVE_HALF_AXIS;
- input = input.right(1);
+ input = input.substr(1);
} else if (input[0] == '-') {
input_range = NEGATIVE_HALF_AXIS;
- input = input.right(1);
+ input = input.substr(1);
}
bool invert_axis = false;
if (input[input.length() - 1] == '~') {
@@ -1299,11 +1299,11 @@ void Input::parse_mapping(String p_mapping) {
switch (input[0]) {
case 'b':
binding.inputType = TYPE_BUTTON;
- binding.input.button = input.right(1).to_int();
+ binding.input.button = input.substr(1).to_int();
break;
case 'a':
binding.inputType = TYPE_AXIS;
- binding.input.axis.axis = input.right(1).to_int();
+ binding.input.axis.axis = input.substr(1).to_int();
binding.input.axis.range = input_range;
binding.input.axis.invert = invert_axis;
break;
@@ -1312,7 +1312,7 @@ void Input::parse_mapping(String p_mapping) {
String(entry[idx] + "\nInvalid hat input: " + input));
binding.inputType = TYPE_HAT;
binding.input.hat.hat = input.substr(1, 1).to_int();
- binding.input.hat.hat_mask = static_cast<HatMask>(input.right(3).to_int());
+ binding.input.hat.hat_mask = static_cast<HatMask>(input.substr(3).to_int());
break;
default:
ERR_CONTINUE_MSG(true, String(entry[idx] + "\nUnrecognised input string: " + input));