diff --git a/src/apps/SettingsWindow/src/View/DevicesGamePadSettingsView.swift b/src/apps/SettingsWindow/src/View/DevicesGamePadSettingsView.swift index 0a9725395..fcfb73c3c 100644 --- a/src/apps/SettingsWindow/src/View/DevicesGamePadSettingsView.swift +++ b/src/apps/SettingsWindow/src/View/DevicesGamePadSettingsView.swift @@ -76,12 +76,6 @@ struct DevicesGamePadSettingsView: View { .gamePadXYStickContinuedMovementIntervalMilliseconds, continuedMovementIntervalMillisecondsDefaultValue: Int( libkrbn_core_configuration_game_pad_xy_stick_continued_movement_interval_milliseconds_default_value() - ), - - flickingInputWindowMilliseconds: $connectedDeviceSetting - .gamePadXYStickFlickingInputWindowMilliseconds, - flickingInputWindowMillisecondsDefaultValue: Int( - libkrbn_core_configuration_game_pad_xy_stick_flicking_input_window_milliseconds_default_value() ) ) @@ -124,12 +118,6 @@ struct DevicesGamePadSettingsView: View { .gamePadWheelsStickContinuedMovementIntervalMilliseconds, continuedMovementIntervalMillisecondsDefaultValue: Int( libkrbn_core_configuration_game_pad_wheels_stick_continued_movement_interval_milliseconds_default_value() - ), - - flickingInputWindowMilliseconds: $connectedDeviceSetting - .gamePadWheelsStickFlickingInputWindowMilliseconds, - flickingInputWindowMillisecondsDefaultValue: Int( - libkrbn_core_configuration_game_pad_wheels_stick_flicking_input_window_milliseconds_default_value() ) ) @@ -183,9 +171,6 @@ struct DevicesGamePadSettingsView: View { @Binding var continuedMovementIntervalMilliseconds: Int let continuedMovementIntervalMillisecondsDefaultValue: Int - @Binding var flickingInputWindowMilliseconds: Int - let flickingInputWindowMillisecondsDefaultValue: Int - var body: some View { Grid(alignment: .leadingFirstTextBaseline) { GridRow { @@ -215,18 +200,6 @@ struct DevicesGamePadSettingsView: View { Text("(Default: \(continuedMovementIntervalMillisecondsDefaultValue))") } - - GridRow { - Text("Flicking input window milliseconds:") - - IntTextField( - value: $flickingInputWindowMilliseconds, - range: 0...1000, - step: 1, - width: 60) - - Text("(Default: \(flickingInputWindowMillisecondsDefaultValue))") - } } } } diff --git a/src/apps/share/swift/LibKrbn/Models/ConnectedDeviceSetting.swift b/src/apps/share/swift/LibKrbn/Models/ConnectedDeviceSetting.swift index b17ea5e83..a0807c6b6 100644 --- a/src/apps/share/swift/LibKrbn/Models/ConnectedDeviceSetting.swift +++ b/src/apps/share/swift/LibKrbn/Models/ConnectedDeviceSetting.swift @@ -68,10 +68,6 @@ extension LibKrbn { libkrbn_core_configuration_get_selected_profile_device_game_pad_xy_stick_continued_movement_interval_milliseconds( connectedDevice.libkrbnDeviceIdentifiers)) - gamePadXYStickFlickingInputWindowMilliseconds = Int( - libkrbn_core_configuration_get_selected_profile_device_game_pad_xy_stick_flicking_input_window_milliseconds( - connectedDevice.libkrbnDeviceIdentifiers)) - gamePadWheelsStickContinuedMovementAbsoluteMagnitudeThreshold = libkrbn_core_configuration_get_selected_profile_device_game_pad_wheels_stick_continued_movement_absolute_magnitude_threshold( connectedDevice.libkrbnDeviceIdentifiers) @@ -80,10 +76,6 @@ extension LibKrbn { libkrbn_core_configuration_get_selected_profile_device_game_pad_wheels_stick_continued_movement_interval_milliseconds( connectedDevice.libkrbnDeviceIdentifiers)) - gamePadWheelsStickFlickingInputWindowMilliseconds = Int( - libkrbn_core_configuration_get_selected_profile_device_game_pad_wheels_stick_flicking_input_window_milliseconds( - connectedDevice.libkrbnDeviceIdentifiers)) - var buffer = [Int8](repeating: 0, count: 16384) if libkrbn_core_configuration_get_selected_profile_device_game_pad_stick_x_formula( @@ -264,18 +256,6 @@ extension LibKrbn { } } - @Published var gamePadXYStickFlickingInputWindowMilliseconds: Int = 0 { - didSet { - if didSetEnabled { - libkrbn_core_configuration_set_selected_profile_device_game_pad_xy_stick_flicking_input_window_milliseconds( - connectedDevice.libkrbnDeviceIdentifiers, - Int32(gamePadXYStickFlickingInputWindowMilliseconds)) - - Settings.shared.save() - } - } - } - @Published var gamePadWheelsStickContinuedMovementAbsoluteMagnitudeThreshold: Double = 0.0 { didSet { if didSetEnabled { @@ -300,18 +280,6 @@ extension LibKrbn { } } - @Published var gamePadWheelsStickFlickingInputWindowMilliseconds: Int = 0 { - didSet { - if didSetEnabled { - libkrbn_core_configuration_set_selected_profile_device_game_pad_wheels_stick_flicking_input_window_milliseconds( - connectedDevice.libkrbnDeviceIdentifiers, - Int32(gamePadWheelsStickFlickingInputWindowMilliseconds)) - - Settings.shared.save() - } - } - } - @Published var gamePadStickXFormula = "" { didSet { if didSetEnabled { diff --git a/src/core/grabber/include/grabber/device_grabber_details/game_pad_stick_converter.hpp b/src/core/grabber/include/grabber/device_grabber_details/game_pad_stick_converter.hpp index 7cc2c11e7..fa4efe412 100644 --- a/src/core/grabber/include/grabber/device_grabber_details/game_pad_stick_converter.hpp +++ b/src/core/grabber/include/grabber/device_grabber_details/game_pad_stick_converter.hpp @@ -77,38 +77,6 @@ class game_pad_stick_converter final : public pqrs::dispatcher::extra::dispatche nod::signal values_updated; - // - // Classes - // - - class stick_history_entry final { - public: - stick_history_entry(absolute_time_point time, - double horizontal_stick_sensor_value, - double vertical_stick_sensor_value) - : time_(time), - horizontal_stick_sensor_value_(horizontal_stick_sensor_value), - vertical_stick_sensor_value_(vertical_stick_sensor_value) { - } - - absolute_time_point get_time(void) const { - return time_; - } - - double get_horizontal_stick_sensor_value(void) const { - return horizontal_stick_sensor_value_; - } - - double get_vertical_stick_sensor_value(void) const { - return vertical_stick_sensor_value_; - } - - private: - absolute_time_point time_; - double horizontal_stick_sensor_value_; - double vertical_stick_sensor_value_; - }; - // // Methods // @@ -118,10 +86,9 @@ class game_pad_stick_converter final : public pqrs::dispatcher::extra::dispatche radian_(0.0), absolute_magnitude_(0.0), delta_magnitude_(0.0), - continued_movement_magnitude_(0.0), previous_absolute_magnitude_(0.0), continued_movement_absolute_magnitude_threshold_(1.0), - flicking_input_window_milliseconds_(0) { + continued_movement_interval_milliseconds_(0) { } ~stick(void) { @@ -148,10 +115,6 @@ class game_pad_stick_converter final : public pqrs::dispatcher::extra::dispatche continued_movement_interval_milliseconds_ = value; } - void set_flicking_input_window_milliseconds(int value) { - flicking_input_window_milliseconds_ = value; - } - // This method should be called in the shared dispatcher thread. void update_horizontal_stick_sensor_value(CFIndex logical_max, CFIndex logical_min, @@ -175,18 +138,16 @@ class game_pad_stick_converter final : public pqrs::dispatcher::extra::dispatche } std::chrono::milliseconds get_continued_movement_interval_milliseconds(void) const { - if (continued_movement_magnitude_ == 0.0) { - return std::chrono::milliseconds(0); + if (continued_movement()) { + return std::chrono::milliseconds(continued_movement_interval_milliseconds_); } - return std::chrono::milliseconds(continued_movement_interval_milliseconds_); + return std::chrono::milliseconds(0); } private: // This method is executed in the shared dispatcher thread. void update_values(void) { - auto now = pqrs::osx::chrono::mach_absolute_time_point(); - radian_ = std::atan2(vertical_stick_sensor_.get_value(), horizontal_stick_sensor_.get_value()); // When the stick is tilted diagonally, the distance from the centre may exceed 1.0 (e.g. 1.2). @@ -197,44 +158,14 @@ class game_pad_stick_converter final : public pqrs::dispatcher::extra::dispatche auto dm = std::max(0.0, absolute_magnitude_ - previous_absolute_magnitude_); - // - // Update stick_history_ - // - - stick_history_.push_back(stick_history_entry(now, - horizontal_stick_sensor_.get_value(), - vertical_stick_sensor_.get_value())); - stick_history_.erase(std::remove_if(std::begin(stick_history_), - std::end(stick_history_), - [this, now](auto&& e) { - return pqrs::osx::chrono::make_milliseconds(now - e.get_time()) > std::chrono::milliseconds(flicking_input_window_milliseconds_); - }), - std::end(stick_history_)); - // // Update delta_magnitude_ // - if (absolute_magnitude_ >= continued_movement_absolute_magnitude_threshold_) { - if (continued_movement_magnitude_ == 0.0) { - double max = 0; - for (int i = 0; i < stick_history_.size(); ++i) { - for (int j = i + 1; j < stick_history_.size(); ++j) { - auto h = stick_history_[i].get_horizontal_stick_sensor_value() - stick_history_[j].get_horizontal_stick_sensor_value(); - auto v = stick_history_[i].get_vertical_stick_sensor_value() - stick_history_[j].get_vertical_stick_sensor_value(); - auto d = std::sqrt(h * h + v * v); - if (max < d) { - max = d; - } - } - } - continued_movement_magnitude_ = std::min(max, 1.0); - } + if (continued_movement()) { + delta_magnitude_ = absolute_magnitude_; - delta_magnitude_ = continued_movement_magnitude_; } else { - continued_movement_magnitude_ = 0.0; - // Ignore minor magnitude changes until a sufficient amount of change accumulates. auto delta_magnitude_threshold = 0.01; if (0 < delta_magnitude_ && delta_magnitude_ < delta_magnitude_threshold) { @@ -252,15 +183,17 @@ class game_pad_stick_converter final : public pqrs::dispatcher::extra::dispatche values_updated(); } + bool continued_movement(void) const { + return absolute_magnitude_ >= continued_movement_absolute_magnitude_threshold_; + } + stick_sensor horizontal_stick_sensor_; stick_sensor vertical_stick_sensor_; double radian_; double absolute_magnitude_; double delta_magnitude_; - double continued_movement_magnitude_; double previous_absolute_magnitude_; - std::deque stick_history_; // // configurations @@ -268,7 +201,6 @@ class game_pad_stick_converter final : public pqrs::dispatcher::extra::dispatche double continued_movement_absolute_magnitude_threshold_; int continued_movement_interval_milliseconds_; - int flicking_input_window_milliseconds_; }; class event_value final { @@ -461,11 +393,9 @@ class game_pad_stick_converter final : public pqrs::dispatcher::extra::dispatche xy_.set_continued_movement_absolute_magnitude_threshold(d->get_game_pad_xy_stick_continued_movement_absolute_magnitude_threshold()); xy_.set_continued_movement_interval_milliseconds(d->get_game_pad_xy_stick_continued_movement_interval_milliseconds()); - xy_.set_flicking_input_window_milliseconds(d->get_game_pad_xy_stick_flicking_input_window_milliseconds()); wheels_.set_continued_movement_absolute_magnitude_threshold(d->get_game_pad_wheels_stick_continued_movement_absolute_magnitude_threshold()); wheels_.set_continued_movement_interval_milliseconds(d->get_game_pad_wheels_stick_continued_movement_interval_milliseconds()); - wheels_.set_flicking_input_window_milliseconds(d->get_game_pad_wheels_stick_flicking_input_window_milliseconds()); x_formula_string_ = d->get_game_pad_stick_x_formula(); y_formula_string_ = d->get_game_pad_stick_y_formula(); @@ -537,21 +467,22 @@ class game_pad_stick_converter final : public pqrs::dispatcher::extra::dispatche void update_continued_movement_timer(continued_movement_mode mode, std::chrono::milliseconds interval) { xy_radian_ = xy_.get_radian(); - if (wheels_.get_delta_magnitude() == 0.0) { - xy_delta_magnitude_ = xy_.get_delta_magnitude(); - xy_absolute_magnitude_ = xy_.get_absolute_magnitude(); - } else { - xy_delta_magnitude_ = xy_.get_delta_magnitude() + wheels_.get_delta_magnitude(); - xy_absolute_magnitude_ = xy_.get_absolute_magnitude() + wheels_.get_absolute_magnitude(); + xy_delta_magnitude_ = xy_.get_delta_magnitude(); + xy_absolute_magnitude_ = xy_.get_absolute_magnitude(); + if (continued_movement_mode_ == continued_movement_mode::xy) { + // Add secondary stick absolute magnitude to magnitudes; + auto m = wheels_.get_absolute_magnitude(); + xy_delta_magnitude_ += m; + xy_absolute_magnitude_ += m; } wheels_radian_ = wheels_.get_radian(); - if (xy_.get_delta_magnitude() == 0.0) { - wheels_delta_magnitude_ = wheels_.get_delta_magnitude(); - wheels_absolute_magnitude_ = wheels_.get_absolute_magnitude(); - } else { - wheels_delta_magnitude_ = wheels_.get_delta_magnitude() + xy_.get_delta_magnitude(); - wheels_absolute_magnitude_ = wheels_.get_absolute_magnitude() + xy_.get_absolute_magnitude(); + wheels_delta_magnitude_ = wheels_.get_delta_magnitude(); + wheels_absolute_magnitude_ = wheels_.get_absolute_magnitude(); + if (continued_movement_mode_ == continued_movement_mode::wheels) { + auto m = xy_.get_absolute_magnitude(); + wheels_delta_magnitude_ += m; + wheels_absolute_magnitude_ += m; } auto [x, y] = xy_hid_values(); @@ -559,7 +490,6 @@ class game_pad_stick_converter final : public pqrs::dispatcher::extra::dispatche y_value_.set_value(y); auto [h, v] = wheels_hid_values(); - horizontal_wheel_value_.set_value(h); vertical_wheel_value_.set_value(v); diff --git a/src/lib/libkrbn/include/libkrbn/libkrbn.h b/src/lib/libkrbn/include/libkrbn/libkrbn.h index 001880b2a..b49d4f02d 100644 --- a/src/lib/libkrbn/include/libkrbn/libkrbn.h +++ b/src/lib/libkrbn/include/libkrbn/libkrbn.h @@ -253,13 +253,6 @@ void libkrbn_core_configuration_set_selected_profile_device_game_pad_xy_stick_co int value); int libkrbn_core_configuration_game_pad_xy_stick_continued_movement_interval_milliseconds_default_value(void); -// game_pad_xy_stick_flicking_input_window_milliseconds - -int libkrbn_core_configuration_get_selected_profile_device_game_pad_xy_stick_flicking_input_window_milliseconds(const libkrbn_device_identifiers* device_identifiers); -void libkrbn_core_configuration_set_selected_profile_device_game_pad_xy_stick_flicking_input_window_milliseconds(const libkrbn_device_identifiers* device_identifiers, - int value); -int libkrbn_core_configuration_game_pad_xy_stick_flicking_input_window_milliseconds_default_value(void); - // game_pad_wheels_stick_continued_movement_absolute_magnitude_threshold double libkrbn_core_configuration_get_selected_profile_device_game_pad_wheels_stick_continued_movement_absolute_magnitude_threshold(const libkrbn_device_identifiers* device_identifiers); @@ -274,13 +267,6 @@ void libkrbn_core_configuration_set_selected_profile_device_game_pad_wheels_stic int value); int libkrbn_core_configuration_game_pad_wheels_stick_continued_movement_interval_milliseconds_default_value(void); -// game_pad_wheels_stick_flicking_input_window_milliseconds - -int libkrbn_core_configuration_get_selected_profile_device_game_pad_wheels_stick_flicking_input_window_milliseconds(const libkrbn_device_identifiers* device_identifiers); -void libkrbn_core_configuration_set_selected_profile_device_game_pad_wheels_stick_flicking_input_window_milliseconds(const libkrbn_device_identifiers* device_identifiers, - int value); -int libkrbn_core_configuration_game_pad_wheels_stick_flicking_input_window_milliseconds_default_value(void); - // game_pad_stick_x_formula bool libkrbn_core_configuration_get_selected_profile_device_game_pad_stick_x_formula(const libkrbn_device_identifiers* device_identifiers, diff --git a/src/lib/libkrbn/src/libkrbn_configuration.cpp b/src/lib/libkrbn/src/libkrbn_configuration.cpp index 9dbed2a07..7a5ed995e 100644 --- a/src/lib/libkrbn/src/libkrbn_configuration.cpp +++ b/src/lib/libkrbn/src/libkrbn_configuration.cpp @@ -792,26 +792,6 @@ int libkrbn_core_configuration_game_pad_xy_stick_continued_movement_interval_mil empty_device->get_game_pad_xy_stick_continued_movement_interval_milliseconds()); } -// game_pad_xy_stick_flicking_input_window_milliseconds - -int libkrbn_core_configuration_get_selected_profile_device_game_pad_xy_stick_flicking_input_window_milliseconds(const libkrbn_device_identifiers* device_identifiers) { - auto c = get_current_core_configuration(); - auto d = c->get_selected_profile().get_device(libkrbn_cpp::make_device_identifiers(device_identifiers)); - return d->get_game_pad_xy_stick_flicking_input_window_milliseconds(); -} - -void libkrbn_core_configuration_set_selected_profile_device_game_pad_xy_stick_flicking_input_window_milliseconds(const libkrbn_device_identifiers* device_identifiers, - int value) { - auto c = get_current_core_configuration(); - auto d = c->get_selected_profile().get_device(libkrbn_cpp::make_device_identifiers(device_identifiers)); - d->set_game_pad_xy_stick_flicking_input_window_milliseconds(value); -} - -int libkrbn_core_configuration_game_pad_xy_stick_flicking_input_window_milliseconds_default_value(void) { - return empty_device->find_default_value( - empty_device->get_game_pad_xy_stick_flicking_input_window_milliseconds()); -} - // game_pad_wheels_stick_continued_movement_absolute_magnitude_threshold double libkrbn_core_configuration_get_selected_profile_device_game_pad_wheels_stick_continued_movement_absolute_magnitude_threshold(const libkrbn_device_identifiers* device_identifiers) { @@ -852,26 +832,6 @@ int libkrbn_core_configuration_game_pad_wheels_stick_continued_movement_interval empty_device->get_game_pad_wheels_stick_continued_movement_interval_milliseconds()); } -// game_pad_wheels_stick_flicking_input_window_milliseconds - -int libkrbn_core_configuration_get_selected_profile_device_game_pad_wheels_stick_flicking_input_window_milliseconds(const libkrbn_device_identifiers* device_identifiers) { - auto c = get_current_core_configuration(); - auto d = c->get_selected_profile().get_device(libkrbn_cpp::make_device_identifiers(device_identifiers)); - return d->get_game_pad_wheels_stick_flicking_input_window_milliseconds(); -} - -void libkrbn_core_configuration_set_selected_profile_device_game_pad_wheels_stick_flicking_input_window_milliseconds(const libkrbn_device_identifiers* device_identifiers, - int value) { - auto c = get_current_core_configuration(); - auto d = c->get_selected_profile().get_device(libkrbn_cpp::make_device_identifiers(device_identifiers)); - d->set_game_pad_wheels_stick_flicking_input_window_milliseconds(value); -} - -int libkrbn_core_configuration_game_pad_wheels_stick_flicking_input_window_milliseconds_default_value(void) { - return empty_device->find_default_value( - empty_device->get_game_pad_wheels_stick_flicking_input_window_milliseconds()); -} - // game_pad_stick_x_formula bool libkrbn_core_configuration_get_selected_profile_device_game_pad_stick_x_formula(const libkrbn_device_identifiers* device_identifiers, diff --git a/src/share/core_configuration/details/profile/device.hpp b/src/share/core_configuration/details/profile/device.hpp index dc3708e05..47d902621 100644 --- a/src/share/core_configuration/details/profile/device.hpp +++ b/src/share/core_configuration/details/profile/device.hpp @@ -92,10 +92,6 @@ class device final { game_pad_xy_stick_continued_movement_interval_milliseconds_, 20); - helper_values_.push_back_value("game_pad_xy_stick_flicking_input_window_milliseconds", - game_pad_xy_stick_flicking_input_window_milliseconds_, - 50); - helper_values_.push_back_value("game_pad_wheels_stick_continued_movement_absolute_magnitude_threshold", game_pad_wheels_stick_continued_movement_absolute_magnitude_threshold_, 1.0); @@ -104,10 +100,6 @@ class device final { game_pad_wheels_stick_continued_movement_interval_milliseconds_, 10); - helper_values_.push_back_value("game_pad_wheels_stick_flicking_input_window_milliseconds", - game_pad_wheels_stick_flicking_input_window_milliseconds_, - 50); - helper_values_.push_back_value("game_pad_stick_x_formula", game_pad_stick_x_formula_, // The logical value range of Karabiner-DriverKit-VirtualHIDPointing is -127 ... 127. @@ -435,15 +427,6 @@ if (abs(cos(radian)) <= abs(sin(radian))) { coordinate_between_properties(); } - const int& get_game_pad_xy_stick_flicking_input_window_milliseconds(void) const { - return game_pad_xy_stick_flicking_input_window_milliseconds_; - } - void set_game_pad_xy_stick_flicking_input_window_milliseconds(int value) { - game_pad_xy_stick_flicking_input_window_milliseconds_ = value; - - coordinate_between_properties(); - } - const double& get_game_pad_wheels_stick_continued_movement_absolute_magnitude_threshold(void) const { return game_pad_wheels_stick_continued_movement_absolute_magnitude_threshold_; } @@ -462,15 +445,6 @@ if (abs(cos(radian)) <= abs(sin(radian))) { coordinate_between_properties(); } - const int& get_game_pad_wheels_stick_flicking_input_window_milliseconds(void) const { - return game_pad_wheels_stick_flicking_input_window_milliseconds_; - } - void set_game_pad_wheels_stick_flicking_input_window_milliseconds(int value) { - game_pad_wheels_stick_flicking_input_window_milliseconds_ = value; - - coordinate_between_properties(); - } - const std::string& get_game_pad_stick_x_formula(void) const { return game_pad_stick_x_formula_; } @@ -559,10 +533,8 @@ if (abs(cos(radian)) <= abs(sin(radian))) { bool game_pad_swap_sticks_; double game_pad_xy_stick_continued_movement_absolute_magnitude_threshold_; int game_pad_xy_stick_continued_movement_interval_milliseconds_; - int game_pad_xy_stick_flicking_input_window_milliseconds_; double game_pad_wheels_stick_continued_movement_absolute_magnitude_threshold_; int game_pad_wheels_stick_continued_movement_interval_milliseconds_; - int game_pad_wheels_stick_flicking_input_window_milliseconds_; std::string game_pad_stick_x_formula_; std::string game_pad_stick_y_formula_; std::string game_pad_stick_vertical_wheel_formula_; diff --git a/tests/src/core_configuration/json/errors/profile_device_errors.jsonc b/tests/src/core_configuration/json/errors/profile_device_errors.jsonc index 09a7b9afc..71f5e5384 100644 --- a/tests/src/core_configuration/json/errors/profile_device_errors.jsonc +++ b/tests/src/core_configuration/json/errors/profile_device_errors.jsonc @@ -185,16 +185,6 @@ "error": "`game_pad_xy_stick_continued_movement_interval_milliseconds` must be number, but is `null`" }, - // game_pad_xy_stick_flicking_input_window_milliseconds - - { - "class": "devices", - "input": { - "game_pad_xy_stick_flicking_input_window_milliseconds": null - }, - "error": "`game_pad_xy_stick_flicking_input_window_milliseconds` must be number, but is `null`" - }, - // game_pad_wheels_stick_continued_movement_absolute_magnitude_threshold { @@ -215,16 +205,6 @@ "error": "`game_pad_wheels_stick_continued_movement_interval_milliseconds` must be number, but is `null`" }, - // game_pad_wheels_stick_flicking_input_window_milliseconds - - { - "class": "devices", - "input": { - "game_pad_wheels_stick_flicking_input_window_milliseconds": null - }, - "error": "`game_pad_wheels_stick_flicking_input_window_milliseconds` must be number, but is `null`" - }, - // game_pad_stick_x_formula { diff --git a/tests/src/core_configuration/src/device_test.hpp b/tests/src/core_configuration/src/device_test.hpp index a05721dbf..42f865a31 100644 --- a/tests/src/core_configuration/src/device_test.hpp +++ b/tests/src/core_configuration/src/device_test.hpp @@ -108,14 +108,10 @@ void run_device_test(void) { device.get_game_pad_xy_stick_continued_movement_absolute_magnitude_threshold())); expect(20_i == device.find_default_value( device.get_game_pad_xy_stick_continued_movement_interval_milliseconds())); - expect(50_i == device.find_default_value( - device.get_game_pad_xy_stick_flicking_input_window_milliseconds())); expect(1.0_d == device.find_default_value( device.get_game_pad_wheels_stick_continued_movement_absolute_magnitude_threshold())); expect(10_i == device.find_default_value( device.get_game_pad_wheels_stick_continued_movement_interval_milliseconds())); - expect(50_i == device.find_default_value( - device.get_game_pad_wheels_stick_flicking_input_window_milliseconds())); }; "device"_test = [] { @@ -141,10 +137,6 @@ void run_device_test(void) { auto& v = device.get_game_pad_xy_stick_continued_movement_interval_milliseconds(); expect(device.find_default_value(v) == v); } - { - auto& v = device.get_game_pad_xy_stick_flicking_input_window_milliseconds(); - expect(device.find_default_value(v) == v); - } { auto& v = device.get_game_pad_wheels_stick_continued_movement_absolute_magnitude_threshold(); expect(device.find_default_value(v) == v); @@ -153,10 +145,6 @@ void run_device_test(void) { auto& v = device.get_game_pad_wheels_stick_continued_movement_interval_milliseconds(); expect(device.find_default_value(v) == v); } - { - auto& v = device.get_game_pad_wheels_stick_flicking_input_window_milliseconds(); - expect(device.find_default_value(v) == v); - } { auto& v = device.get_game_pad_stick_x_formula(); expect(device.find_default_value(v) == v); @@ -191,7 +179,6 @@ void run_device_test(void) { {"treat_as_built_in_keyboard", false}, {"game_pad_xy_stick_continued_movement_absolute_magnitude_threshold", 0.5}, {"game_pad_xy_stick_continued_movement_interval_milliseconds", 15}, - {"game_pad_xy_stick_flicking_input_window_milliseconds", 123}, // string {"game_pad_stick_x_formula", "cos(radian) * acceleration * 127"}, // array of string @@ -215,7 +202,6 @@ void run_device_test(void) { expect(device.get_disable_built_in_keyboard_if_exists() == true); expect(device.get_game_pad_xy_stick_continued_movement_absolute_magnitude_threshold() == 0.5); expect(device.get_game_pad_xy_stick_continued_movement_interval_milliseconds() == 15); - expect(device.get_game_pad_xy_stick_flicking_input_window_milliseconds() == 123); expect(device.get_game_pad_stick_x_formula() == "cos(radian) * acceleration * 127"); expect(device.get_game_pad_stick_y_formula() == "if (acceleration < 0.5,\n" " cos(radian) * acceleration * 127 * 0.5,\n" @@ -369,10 +355,8 @@ void run_device_test(void) { {"game_pad_swap_sticks", true}, {"game_pad_xy_stick_continued_movement_absolute_magnitude_threshold", 0.5}, {"game_pad_xy_stick_continued_movement_interval_milliseconds", 10}, - {"game_pad_xy_stick_flicking_input_window_milliseconds", 123}, {"game_pad_wheels_stick_continued_movement_absolute_magnitude_threshold", 0.08}, {"game_pad_wheels_stick_continued_movement_interval_milliseconds", 40}, - {"game_pad_wheels_stick_flicking_input_window_milliseconds", 124}, {"game_pad_stick_x_formula", "cos(radian) * acceleration * 127"}, {"game_pad_stick_y_formula", nlohmann::json::array({ "var a := acceleration ^ 2;", @@ -399,10 +383,8 @@ void run_device_test(void) { {"game_pad_swap_sticks", true}, {"game_pad_xy_stick_continued_movement_absolute_magnitude_threshold", 0.5}, {"game_pad_xy_stick_continued_movement_interval_milliseconds", 10}, - {"game_pad_xy_stick_flicking_input_window_milliseconds", 123}, {"game_pad_wheels_stick_continued_movement_absolute_magnitude_threshold", 0.08}, {"game_pad_wheels_stick_continued_movement_interval_milliseconds", 40}, - {"game_pad_wheels_stick_flicking_input_window_milliseconds", 124}, {"game_pad_stick_x_formula", "cos(radian) * acceleration * 127"}, {"game_pad_stick_y_formula", nlohmann::json::array({ "var a := acceleration ^ 2;",