New option to calibrate controllers in BetterJoy (#522)

* Inital fix for #521

* Update App.config

* Update App.config

Co-authored-by: Shuken <shukenmg@iuvenisstudios.ga>
This commit is contained in:
shukenmg 2020-11-02 22:52:57 +08:00 committed by GitHub
parent f9f1ea4081
commit e0e2499f04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 6 deletions

View file

@ -44,6 +44,12 @@
<!--On is "true"; off is "false". Default: false -->
<add key="SwapXY" value="false" />
<!--Allows for calibration of the controller's gyro. Adds a "Calibrate" button.-->
<!--When "true", click the "Calibrate" button once to get gyro calibrate data.-->
<!--When enabled, can only calibrate one controller at a time.-->
<!--Default: true -->
<add key="AllowCalibration" value="true" />
<!--Allows use of gyroscope tilting to get full control of the slider values (big triggers)-->
<!--Works on pro controller and joined joycons (pro controller case - triggers combined, joycons case - separate tilt)-->
<!--Default: false -->
@ -65,9 +71,7 @@
<!-- Default: false -->
<add key="UseHIDG" value="false" />
<!-- Determines whether or not to enable (experimental - currently default controller to pro) support for 3rd-party controllers. Adds a "Calibrate" button. -->
<!-- When "true", click "Calibrate" button once to get gyro calibrate data. -->
<!-- When enabled, can only calibrate one controller at a time. -->
<!-- Determines whether or not to enable (experimental - currently default controller to pro) support for 3rd-party controllers. -->
<!-- Default: false -->
<add key="NonOriginalController" value="false" />
<!-- The program will keep the HOME button LED ring light on at all times. -->

View file

@ -944,7 +944,7 @@ namespace BetterJoyForCemu {
acc_r[1] = (Int16)(report_buf[15 + n * 12] | ((report_buf[16 + n * 12] << 8) & 0xff00));
acc_r[2] = (Int16)(report_buf[17 + n * 12] | ((report_buf[18 + n * 12] << 8) & 0xff00));
if (form.nonOriginal) {
if (form.allowCalibration) {
for (int i = 0; i < 3; ++i) {
switch (i) {
case 0:

View file

@ -16,6 +16,7 @@ using System.Xml.Linq;
namespace BetterJoyForCemu {
public partial class MainForm : Form {
public bool nonOriginal = Boolean.Parse(ConfigurationManager.AppSettings["NonOriginalController"]);
public bool allowCalibration = Boolean.Parse(ConfigurationManager.AppSettings["AllowCalibration"]);
public List<Button> con, loc;
public bool calibrate;
public List<KeyValuePair<string, float[]>> caliData;
@ -35,7 +36,7 @@ namespace BetterJoyForCemu {
InitializeComponent();
if (!nonOriginal)
if (!allowCalibration)
AutoCalibrate.Hide();
con = new List<Button> { con1, con2, con3, con4 };

View file

@ -318,7 +318,7 @@ namespace BetterJoyForCemu {
}
jc.Begin();
if (form.nonOriginal) {
if (form.allowCalibration) {
jc.getActiveData();
}