- Renamed BetterJoyForCemu to BetterJoy
- Fixed joy-to-joy bug (hopefully last) - Added drag toggle
This commit is contained in:
parent
77913a8562
commit
146a712c06
5 changed files with 28 additions and 8 deletions
|
@ -1,9 +1,9 @@
|
||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 16
|
# Visual Studio 15
|
||||||
VisualStudioVersion = 16.0.29418.71
|
VisualStudioVersion = 15.0.28307.852
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BetterJoyForCemu", "BetterJoyForCemu\BetterJoyForCemu.csproj", "{1BF709E9-C133-41DF-933A-C9FF3F664C7B}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BetterJoy", "BetterJoyForCemu\BetterJoy.csproj", "{1BF709E9-C133-41DF-933A-C9FF3F664C7B}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
@ -65,5 +65,9 @@
|
||||||
<!-- When two joycons are connected, it would take the gyro movement of the right joycon for mouse movement. This swaps that -->
|
<!-- When two joycons are connected, it would take the gyro movement of the right joycon for mouse movement. This swaps that -->
|
||||||
<!-- Default: false -->
|
<!-- Default: false -->
|
||||||
<add key="GyroMouseLeftHanded" value="false"/>
|
<add key="GyroMouseLeftHanded" value="false"/>
|
||||||
|
<!-- Changes drag behaviour. -->
|
||||||
|
<!-- Will only apply to mouse buttons being mapped -->
|
||||||
|
<!-- Default: false -->
|
||||||
|
<add key="DragToggle" value="true"/>
|
||||||
</appSettings>
|
</appSettings>
|
||||||
</configuration>
|
</configuration>
|
|
@ -522,6 +522,8 @@ namespace BetterJoyForCemu {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool dragToggle = Boolean.Parse(ConfigurationManager.AppSettings["DragToggle"]);
|
||||||
|
Dictionary<int, bool> mouse_toggle_btn = new Dictionary<int, bool>();
|
||||||
private void Simulate(string s, bool click=true, bool up=false) {
|
private void Simulate(string s, bool click=true, bool up=false) {
|
||||||
if (s.StartsWith("key_")) {
|
if (s.StartsWith("key_")) {
|
||||||
WindowsInput.Events.KeyCode key = (WindowsInput.Events.KeyCode)Int32.Parse(s.Substring(4));
|
WindowsInput.Events.KeyCode key = (WindowsInput.Events.KeyCode)Int32.Parse(s.Substring(4));
|
||||||
|
@ -539,10 +541,22 @@ namespace BetterJoyForCemu {
|
||||||
if (click) {
|
if (click) {
|
||||||
WindowsInput.Simulate.Events().Click(button).Invoke();
|
WindowsInput.Simulate.Events().Click(button).Invoke();
|
||||||
} else {
|
} else {
|
||||||
if (up) {
|
if (dragToggle) {
|
||||||
WindowsInput.Simulate.Events().Release(button).Invoke();
|
if (!up) {
|
||||||
|
bool release;
|
||||||
|
mouse_toggle_btn.TryGetValue((int)button, out release);
|
||||||
|
if (release)
|
||||||
|
WindowsInput.Simulate.Events().Release(button).Invoke();
|
||||||
|
else
|
||||||
|
WindowsInput.Simulate.Events().Hold(button).Invoke();
|
||||||
|
mouse_toggle_btn[(int)button] = !release;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
WindowsInput.Simulate.Events().Hold(button).Invoke();
|
if (up) {
|
||||||
|
WindowsInput.Simulate.Events().Release(button).Invoke();
|
||||||
|
} else {
|
||||||
|
WindowsInput.Simulate.Events().Hold(button).Invoke();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -552,7 +566,7 @@ namespace BetterJoyForCemu {
|
||||||
private void SimulateContinous(int origin, string s) {
|
private void SimulateContinous(int origin, string s) {
|
||||||
if (s.StartsWith("joy_")) {
|
if (s.StartsWith("joy_")) {
|
||||||
int button = Int32.Parse(s.Substring(4));
|
int button = Int32.Parse(s.Substring(4));
|
||||||
buttons[button] = buttons[origin];
|
buttons[button] |= buttons[origin];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -720,6 +734,8 @@ namespace BetterJoyForCemu {
|
||||||
down_[i] = buttons[i];
|
down_[i] = buttons[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
buttons = new bool[20];
|
||||||
|
|
||||||
buttons[(int)Button.DPAD_DOWN] = (report_buf[3 + (isLeft ? 2 : 0)] & (isLeft ? 0x01 : 0x04)) != 0;
|
buttons[(int)Button.DPAD_DOWN] = (report_buf[3 + (isLeft ? 2 : 0)] & (isLeft ? 0x01 : 0x04)) != 0;
|
||||||
buttons[(int)Button.DPAD_RIGHT] = (report_buf[3 + (isLeft ? 2 : 0)] & (isLeft ? 0x04 : 0x08)) != 0;
|
buttons[(int)Button.DPAD_RIGHT] = (report_buf[3 + (isLeft ? 2 : 0)] & (isLeft ? 0x04 : 0x08)) != 0;
|
||||||
buttons[(int)Button.DPAD_UP] = (report_buf[3 + (isLeft ? 2 : 0)] & (isLeft ? 0x02 : 0x02)) != 0;
|
buttons[(int)Button.DPAD_UP] = (report_buf[3 + (isLeft ? 2 : 0)] & (isLeft ? 0x02 : 0x02)) != 0;
|
||||||
|
|
2
BetterJoyForCemu/MainForm.Designer.cs
generated
2
BetterJoyForCemu/MainForm.Designer.cs
generated
|
@ -367,7 +367,7 @@
|
||||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||||
this.MaximizeBox = false;
|
this.MaximizeBox = false;
|
||||||
this.Name = "MainForm";
|
this.Name = "MainForm";
|
||||||
this.Text = "BetterJoyForCemu";
|
this.Text = "BetterJoy";
|
||||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
|
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
|
||||||
this.Load += new System.EventHandler(this.MainForm_Load);
|
this.Load += new System.EventHandler(this.MainForm_Load);
|
||||||
this.Resize += new System.EventHandler(this.MainForm_Resize);
|
this.Resize += new System.EventHandler(this.MainForm_Resize);
|
||||||
|
|
Loading…
Add table
Reference in a new issue