github kenesu-h/sys-hidplus-client-rs 1.1.0-alpha.2
More bug fixes, restructuring, and deadzones. (1.1.0-alpha.2)

latest releases: 1.1.0-alpha.5, 1.1.0-alpha.4, 1.1.0-alpha.3...
pre-release3 years ago

Released: 8/23/2021

Save for code cleanups, documentation, and bug fixes, this might be one of the last few pre-releases, or releases in general. A GUI is also in-development, but I might keep that on-hold until after I optimize all the other code and have more motivation. I want to reiterate that I'm not completely done with this project and intend to do more with it, but my motivation is at a bit of a low right now due to personal issues. There may be circumstances in the next few months that will likely prevent me from contributing to this anywhere nearly as much as before. I will still continue to work on small, easily-fixable bugs and the sort, but I might not implement huge, sweeping features for a while. I don't have any estimate for how long this'll take.

That said, this release has a lot of things. Hope I don't miss anything.

Bug Fixes

  • On Xbox, PS4, and potentially other controllers, the north face button used to be mapped to west and vice-versa.
    • This should no longer be the case and both buttons should be correctly mapped to the corresponding face buttons.
  • A and B on Switch Pro Controllers were switched around.
    • Both buttons should be correctly mapped.
  • The analog stick buttons were not bound to anything.
    • They now emulate the Switch's stick buttons, as they originally should have.
  • "restart" wasn't acknowledged as a command.
    • This should no longer be the case.

QOL Change for Exiting

  • Exiting will no longer attempt to disconnect controllers from the Switch if there are none plugged in.
    • This makes exiting pretty much instant as long as the above condition is satisfied.

New Feature: Deadzones

  • Users can now manually set controller deadzones, or the area in which analog input isn't accepted.
    • This can be set through the new set_left_deadzone and set_right_deadzone commands, or by directly editing config.toml.
      • The values must be a decimal number equal to 0.0, 1.0, or somewhere in between.
    • Why: There are two reasons for implementing this:
      • Some controllers may have drifting analog sticks, which can allow for misinputs. While this isn't inherently fixable due to hardware, deadzones give users a way to circumvent the drift.
      • Not sure why this happens or if this is fixable, but it's harder for stick flicks to be registered through client-rs rather than when directly connected to the Switch. Deadzones can help controllers recognize stick flicks, but at the cost of being unable to "tilt" the stick within their area.

For testers and potential future developers:

Code Restructuring

  • The code has been restructured to better support future GUI development.
    • Namely, there used to be a ClientView interface/trait, where the controller pulled input from and wrote text to the view. However, this strongly conflicted with the Rust GUI libraries I had access to since they didn't allow you to run the GUIs on a separate thread. The way I was taught the MVC design pattern conflicts with this, and I didn't see any conceivable way to effectively write to the view with this in mind. There's now a ClientApp interface/trait, where the application makes calls to the controller and retrieves results returned by those calls; this is much more different from the controller doing all the hard work. The application can write those results to stdout, the GUI, or whatever your output is.
    • A more strict adherence to the MVC design pattern still exists via the model and controller. Consider the application layer a bit loose in terms of the role of a view.
    • Because of this, command line behavior will be a little different than past releases, but the changes shouldn't be major.
  • Data types have also been changed in an attempt to optimize memory usage a tad bit, though this probably wasn't that effective.
    • I know for sure one bug was introduced because of this, though it's been fixed. I don't know if there are any other bugs, but be wary.
    • If you crash, do your best to note the exact things you were doing at the time of the crash - this includes button inputs.

Lack of Documentation and Not-so-great Organization

  • A lot of frustration was put into restructuring the code, and as a result much of the new code will probably be undocumented and disorganized. It's possible that this will change in the coming month since I'm still motivated enough to at least document and clean up more code, but no promises.

To existing users:

You will have to either delete or edit your existing config.toml for this release. Deleting is preferred so we can eliminate potential mistakes, but if you want to edit, add the following (on a new line):

left_deadzones = [
    0.0,
    0.0,
    0.0,
    0.0,
    0.0,
    0.0,
    0.0,
    0.0,
]
right_deadzones = [
    0.0,
    0.0,
    0.0,
    0.0,
    0.0,
    0.0,
    0.0,
    0.0,
]

Don't miss a new sys-hidplus-client-rs release

NewReleases is sending notifications on new releases.