2014-04-27 21:32:09 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Windows.Forms;
|
2015-02-08 22:51:52 +01:00
|
|
|
|
|
2014-11-18 22:23:41 +01:00
|
|
|
|
namespace DS4Windows
|
2014-04-27 21:32:09 +02:00
|
|
|
|
{
|
|
|
|
|
public partial class KBM360 : Form
|
|
|
|
|
{
|
|
|
|
|
private int device;
|
|
|
|
|
private Button button;
|
|
|
|
|
private Options ops;
|
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
|
|
|
|
private SpecActions sA;
|
2014-06-14 21:14:27 +02:00
|
|
|
|
public List<string> macros = new List<string>();
|
|
|
|
|
public List<int> macrostag = new List<int>();
|
2014-12-02 01:07:29 +01:00
|
|
|
|
public bool macrorepeat, newaction;
|
2014-11-14 20:44:50 +01:00
|
|
|
|
RecordBox rb;
|
2014-12-02 01:07:29 +01:00
|
|
|
|
object oldtag;
|
2014-12-17 19:29:22 +01:00
|
|
|
|
bool scanavail, toggleavil;
|
|
|
|
|
string keyname;
|
|
|
|
|
object keytag;
|
2014-12-13 21:12:03 +01:00
|
|
|
|
public KBM360(int deviceNum, Options ooo, Button buton)
|
2014-04-27 21:32:09 +02:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
device = deviceNum;
|
|
|
|
|
ops = ooo;
|
|
|
|
|
button = buton;
|
2014-12-17 19:29:22 +01:00
|
|
|
|
cBToggle.Checked = button.Font.Italic;
|
|
|
|
|
cBScanCode.Checked = button.Font.Bold;
|
2014-12-02 01:07:29 +01:00
|
|
|
|
if (button.Tag != null)
|
2014-11-14 20:44:50 +01:00
|
|
|
|
{
|
2014-12-02 01:07:29 +01:00
|
|
|
|
string[] extras;
|
|
|
|
|
if (button.Tag is KeyValuePair<int, string>)
|
|
|
|
|
{
|
|
|
|
|
KeyValuePair<int, string> tag = (KeyValuePair<int, string>)button.Tag;
|
|
|
|
|
oldtag = tag.Key;
|
2014-12-17 19:29:22 +01:00
|
|
|
|
keytag = tag.Key;
|
2014-12-02 01:07:29 +01:00
|
|
|
|
extras = tag.Value.Split(',');
|
|
|
|
|
}
|
|
|
|
|
else if (button.Tag is KeyValuePair<Int32[], string>)
|
|
|
|
|
{
|
|
|
|
|
KeyValuePair<Int32[], string> tag = (KeyValuePair<Int32[], string>)button.Tag;
|
|
|
|
|
oldtag = tag.Key;
|
2014-12-17 19:29:22 +01:00
|
|
|
|
keytag = tag.Key;
|
2014-12-02 01:07:29 +01:00
|
|
|
|
if (button.Font.Underline)
|
|
|
|
|
{
|
|
|
|
|
lBMacroOn.Visible = true;
|
|
|
|
|
foreach (int i in ((int[])tag.Key))
|
|
|
|
|
macrostag.Add(i);
|
|
|
|
|
}
|
|
|
|
|
if (button.Font.Strikeout)
|
|
|
|
|
macrorepeat = true;
|
|
|
|
|
extras = tag.Value.Split(',');
|
|
|
|
|
}
|
|
|
|
|
else if (button.Tag is KeyValuePair<string, string>)
|
|
|
|
|
{
|
|
|
|
|
KeyValuePair<string, string> tag = (KeyValuePair<string, string>)button.Tag;
|
|
|
|
|
oldtag = tag.Key;
|
2014-12-17 19:29:22 +01:00
|
|
|
|
keytag = tag.Key;
|
2014-12-02 01:07:29 +01:00
|
|
|
|
extras = tag.Value.Split(',');
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
KeyValuePair<object, string> tag = (KeyValuePair<object, string>)button.Tag;
|
|
|
|
|
extras = tag.Value.Split(',');
|
|
|
|
|
}
|
|
|
|
|
int b;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (int.TryParse(extras[0], out b)) nUDHeavy.Value = b;
|
|
|
|
|
if (int.TryParse(extras[1], out b)) nUDLight.Value = b;
|
|
|
|
|
if (int.TryParse(extras[2], out b))
|
|
|
|
|
if (b == 1)
|
|
|
|
|
{
|
|
|
|
|
cBLightbar.Checked = true;
|
|
|
|
|
if (int.TryParse(extras[3], out b)) tBRedBar.Value = b;
|
|
|
|
|
if (int.TryParse(extras[4], out b)) tBGreenBar.Value = b;
|
|
|
|
|
if (int.TryParse(extras[5], out b)) tBBlueBar.Value = b;
|
|
|
|
|
if (int.TryParse(extras[6], out b)) nUDLightFlash.Value = b;
|
|
|
|
|
}
|
|
|
|
|
if (int.TryParse(extras[7], out b))
|
|
|
|
|
if (b == 1)
|
|
|
|
|
{
|
|
|
|
|
cBMouse.Checked = true;
|
|
|
|
|
if (int.TryParse(extras[8], out b)) nUDMouse.Value = b;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch { }
|
2014-11-14 20:44:50 +01:00
|
|
|
|
}
|
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
|
|
|
|
if (button.Name.StartsWith("bnShift"))
|
2014-11-01 22:49:22 +01:00
|
|
|
|
{
|
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
|
|
|
|
Console.Write("shift");
|
2014-11-01 22:49:22 +01:00
|
|
|
|
Text = Properties.Resources.SelectActionTitle.Replace("*action*", button.Name.Substring(7));
|
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
|
|
|
|
btnDefault.Text = Properties.Resources.FallBack;
|
2014-11-04 04:44:55 +01:00
|
|
|
|
}
|
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
|
|
|
|
else if (button.Name.StartsWith("bn"))
|
|
|
|
|
Text = Properties.Resources.SelectActionTitle.Replace("*action*", button.Name.Substring(2));
|
2014-12-02 01:07:29 +01:00
|
|
|
|
foreach (System.Windows.Forms.Control control in Controls)
|
2014-04-27 21:32:09 +02:00
|
|
|
|
if (control is Button)
|
2014-06-14 21:14:27 +02:00
|
|
|
|
((Button)control).Click += anybtn_Click;
|
2014-11-18 22:23:41 +01:00
|
|
|
|
if (button.Name.Contains("Touch") || button.Name.Contains("Swipe"))
|
2014-04-29 23:56:58 +02:00
|
|
|
|
{
|
2014-11-04 04:44:55 +01:00
|
|
|
|
btnMOUSEDOWN.Visible = false;
|
|
|
|
|
btnMOUSELEFT.Visible = false;
|
|
|
|
|
btnMOUSERIGHT.Visible = false;
|
|
|
|
|
btnMOUSEUP.Visible = false;
|
2014-04-29 23:56:58 +02:00
|
|
|
|
}
|
2014-12-13 21:12:03 +01:00
|
|
|
|
ActiveControl = lBMacroOn;
|
2014-04-27 21:32:09 +02:00
|
|
|
|
}
|
2014-11-14 20:44:50 +01:00
|
|
|
|
|
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
|
|
|
|
public KBM360(SpecActions ooo, Button buton)
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
sA = ooo;
|
|
|
|
|
button = buton;
|
|
|
|
|
Size = new System.Drawing.Size(763, 244);
|
|
|
|
|
cBScanCode.Checked = button.Text.Contains("(SC)");
|
|
|
|
|
cBToggle.Checked = button.Text.Contains("(Toggle)");
|
|
|
|
|
gBExtras.Visible = false;
|
|
|
|
|
bnMacro.Visible = false;
|
|
|
|
|
Text = Properties.Resources.SelectActionTitle.Replace("*action*", "Trigger");
|
|
|
|
|
foreach (System.Windows.Forms.Control control in Controls)
|
|
|
|
|
if (control is Button)
|
|
|
|
|
((Button)control).Click += anybtn_Click;
|
|
|
|
|
btnMOUSEDOWN.Visible = false;
|
|
|
|
|
btnMOUSELEFT.Visible = false;
|
|
|
|
|
btnMOUSERIGHT.Visible = false;
|
|
|
|
|
btnMOUSEUP.Visible = false;
|
|
|
|
|
ActiveControl = lBMacroOn;
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-27 21:32:09 +02:00
|
|
|
|
public void anybtn_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2014-12-02 01:07:29 +01:00
|
|
|
|
if (rb == null && sender is Button && ((Button)sender).Name != "bnMacro" && ((Button)sender).Name != "bnTest")
|
2014-04-27 21:32:09 +02:00
|
|
|
|
{
|
2014-05-28 04:49:58 +02:00
|
|
|
|
Button bn = ((Button)sender);
|
2014-12-17 19:29:22 +01:00
|
|
|
|
macrostag.Clear();
|
2014-04-29 23:56:58 +02:00
|
|
|
|
if (((Button)sender).Text.Contains('↑') || ((Button)sender).Text.Contains('↓') || ((Button)sender).Text.Contains('→') || ((Button)sender).Text.Contains('←') || ((Button)sender).Text.Contains('Ø'))
|
2014-04-27 21:32:09 +02:00
|
|
|
|
keyname = ((Button)sender).Text.Substring(1);
|
|
|
|
|
else if (((Button)sender).Font.Name == "Webdings")
|
|
|
|
|
{
|
|
|
|
|
if (((Button)sender).Text == "9")
|
|
|
|
|
keyname = "Previous Track";
|
|
|
|
|
else if (((Button)sender).Text == "<")
|
|
|
|
|
keyname = "Stop Track";
|
|
|
|
|
else if (((Button)sender).Text == "4")
|
|
|
|
|
keyname = "Play/Pause";
|
|
|
|
|
else if (((Button)sender).Text == ":")
|
|
|
|
|
keyname = "Next Track";
|
|
|
|
|
else
|
|
|
|
|
keyname = "How did you get here?";
|
|
|
|
|
}
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
else if (((Button)sender).Tag == null)
|
2014-07-26 01:17:45 +02:00
|
|
|
|
keyname = ((Button)sender).Text;
|
2014-06-17 01:43:01 +02:00
|
|
|
|
else if (((Button)sender).Tag.ToString().Contains("X360"))
|
2014-12-17 19:29:22 +01:00
|
|
|
|
{
|
2014-06-17 01:43:01 +02:00
|
|
|
|
keyname = ((Button)sender).Tag.ToString().Substring(4);
|
2014-12-17 19:29:22 +01:00
|
|
|
|
}
|
2014-04-27 21:32:09 +02:00
|
|
|
|
else
|
|
|
|
|
keyname = ((Button)sender).Text;
|
2014-05-28 04:49:58 +02:00
|
|
|
|
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
if (((Button)sender).Tag != null && ((Button)sender).Tag.ToString().Contains("X360"))
|
2014-06-17 01:43:01 +02:00
|
|
|
|
keytag = ((Button)sender).Tag.ToString().Substring(4);
|
2014-05-12 07:48:50 +02:00
|
|
|
|
else
|
2014-06-14 21:14:27 +02:00
|
|
|
|
keytag = ((Button)sender).Tag;
|
2014-12-17 19:29:22 +01:00
|
|
|
|
|
2014-06-14 21:14:27 +02:00
|
|
|
|
lBMacroOn.Visible = false;
|
2014-12-02 01:07:29 +01:00
|
|
|
|
string extras = GetExtras();
|
|
|
|
|
KeyValuePair<object, string> tag = new KeyValuePair<object, string>(keytag, extras);
|
|
|
|
|
newaction = true;
|
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
|
|
|
|
if (ops != null)
|
|
|
|
|
ops.ChangeButtonText(keyname, tag);
|
|
|
|
|
else if (sA != null)
|
|
|
|
|
{
|
|
|
|
|
button.Text = keyname;
|
|
|
|
|
button.Tag = keytag;
|
|
|
|
|
button.ForeColor = Color.Black;
|
|
|
|
|
}
|
2014-06-14 21:14:27 +02:00
|
|
|
|
this.Close();
|
2014-04-27 21:32:09 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-02 01:07:29 +01:00
|
|
|
|
private string GetExtras()
|
|
|
|
|
{
|
|
|
|
|
string t =(byte)nUDHeavy.Value + "," + (byte)nUDLight.Value + "," +
|
|
|
|
|
(cBLightbar.Checked ? "1" + "," + tBRedBar.Value + "," + tBGreenBar.Value + "," + tBBlueBar.Value + "," + nUDLightFlash.Value: "0,0,0,0,0") + "," +
|
|
|
|
|
(cBMouse.Checked ? "1" + "," + (byte)nUDMouse.Value : "0,0");
|
|
|
|
|
return t;
|
|
|
|
|
}
|
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
|
|
|
|
|
2014-04-27 21:32:09 +02:00
|
|
|
|
private void finalMeasure(object sender, FormClosedEventArgs e)
|
|
|
|
|
{
|
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
|
|
|
|
if (ops != null)
|
2014-11-14 20:44:50 +01:00
|
|
|
|
{
|
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
|
|
|
|
if (rb != null) //if record macro is open
|
|
|
|
|
{
|
|
|
|
|
if (!rb.saved && rb.macros.Count > 0)
|
|
|
|
|
if (MessageBox.Show(Properties.Resources.SaveRecordedMacro, "DS4Windows", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
|
|
|
|
|
rb.btnSave_Click(this, null);
|
|
|
|
|
}
|
|
|
|
|
if (lBMacroOn.Visible)
|
|
|
|
|
{
|
|
|
|
|
string extras = GetExtras();
|
|
|
|
|
keytag = null;
|
|
|
|
|
KeyValuePair<object, string> tag = new KeyValuePair<object, string>(macrostag.ToArray(), extras);
|
|
|
|
|
ops.ChangeButtonText("Macro", tag);
|
|
|
|
|
//ops.ChangeButtonText("Macro", macrostag.ToArray());
|
|
|
|
|
}
|
|
|
|
|
else if (!newaction)
|
|
|
|
|
{
|
|
|
|
|
string extras = GetExtras();
|
|
|
|
|
KeyValuePair<object, string> tag = new KeyValuePair<object, string>(oldtag, extras);
|
|
|
|
|
ops.ChangeButtonText(button.Text, tag);
|
|
|
|
|
}
|
|
|
|
|
int value;
|
|
|
|
|
bool tagisint = keytag != null && Int32.TryParse(keytag.ToString(), out value);
|
|
|
|
|
scanavail = lBMacroOn.Visible || tagisint;
|
|
|
|
|
toggleavil = tagisint;
|
|
|
|
|
ops.Toggle_Bn((scanavail ? cBScanCode.Checked : false), (toggleavil ? cBToggle.Checked : false), lBMacroOn.Visible, macrorepeat);
|
|
|
|
|
ops.UpdateLists();
|
2014-12-02 01:07:29 +01:00
|
|
|
|
}
|
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
|
|
|
|
else if (sA != null)
|
2014-12-02 01:07:29 +01:00
|
|
|
|
{
|
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
|
|
|
|
if (button.Tag != null)
|
|
|
|
|
{
|
|
|
|
|
int key;
|
|
|
|
|
if (int.TryParse(button.Tag.ToString(), out key))
|
|
|
|
|
button.Text = ((Keys)key).ToString() +
|
|
|
|
|
(cBScanCode.Checked ? " (SC)" : "") +
|
|
|
|
|
(cBToggle.Checked ? " (Toggle)" : "");
|
|
|
|
|
}
|
|
|
|
|
//button.Font = new Font(button.Font, (cBScanCode.Checked ? FontStyle.Bold : FontStyle.Regular) | (cBToggle.Checked ? FontStyle.Italic : FontStyle.Regular));
|
2014-12-02 01:07:29 +01:00
|
|
|
|
}
|
2014-04-27 21:32:09 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Key_Down_Action(object sender, KeyEventArgs e)
|
|
|
|
|
{
|
2014-12-02 01:07:29 +01:00
|
|
|
|
if (rb == null && !(ActiveControl is NumericUpDown) && !(ActiveControl is TrackBar))
|
2014-11-14 20:44:50 +01:00
|
|
|
|
{
|
|
|
|
|
lBMacroOn.Visible = false;
|
2014-12-02 01:07:29 +01:00
|
|
|
|
string extras = GetExtras();
|
|
|
|
|
KeyValuePair<object, string> tag = new KeyValuePair<object, string>(e.KeyValue, extras);
|
|
|
|
|
newaction = true;
|
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
|
|
|
|
if (ops != null)
|
|
|
|
|
ops.ChangeButtonText(keyname, tag);
|
|
|
|
|
else if (sA != null)
|
|
|
|
|
{
|
|
|
|
|
button.Text = e.KeyCode.ToString();
|
|
|
|
|
button.Tag = e.KeyValue;
|
|
|
|
|
button.ForeColor = Color.Black;
|
|
|
|
|
}
|
2014-11-14 20:44:50 +01:00
|
|
|
|
this.Close();
|
|
|
|
|
}
|
2014-04-27 21:32:09 +02:00
|
|
|
|
}
|
|
|
|
|
|
2014-06-14 21:14:27 +02:00
|
|
|
|
private void Key_Press_Action(object sender, KeyEventArgs e)
|
|
|
|
|
{
|
2014-12-02 01:07:29 +01:00
|
|
|
|
if (rb == null && !(ActiveControl is NumericUpDown) && !(ActiveControl is TrackBar))
|
2014-11-14 20:44:50 +01:00
|
|
|
|
{
|
|
|
|
|
lBMacroOn.Visible = false;
|
2014-12-02 01:07:29 +01:00
|
|
|
|
string extras = GetExtras();
|
|
|
|
|
KeyValuePair<object, string> tag = new KeyValuePair<object, string>(e.KeyValue, extras);
|
|
|
|
|
newaction = true;
|
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
|
|
|
|
if (ops != null)
|
|
|
|
|
ops.ChangeButtonText(keyname, tag);
|
|
|
|
|
else if (sA != null)
|
|
|
|
|
{
|
|
|
|
|
button.Text = e.KeyCode.ToString();
|
|
|
|
|
button.Tag = e.KeyValue;
|
|
|
|
|
button.ForeColor = Color.Black;
|
|
|
|
|
}
|
2014-11-14 20:44:50 +01:00
|
|
|
|
this.Close();
|
|
|
|
|
}
|
2014-05-28 04:49:58 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void cbToggle_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
2014-12-17 19:29:22 +01:00
|
|
|
|
|
2014-05-28 04:49:58 +02:00
|
|
|
|
}
|
|
|
|
|
|
2014-06-14 21:14:27 +02:00
|
|
|
|
private void btnMacro_Click(object sender, EventArgs e)
|
2014-11-14 20:44:50 +01:00
|
|
|
|
{
|
2014-12-17 19:29:22 +01:00
|
|
|
|
gBExtras.Controls.Add(cBScanCode);
|
|
|
|
|
cBScanCode.Location = new Point(20, 320);
|
2014-12-13 21:12:03 +01:00
|
|
|
|
rb = new RecordBox(this);
|
2014-11-14 20:44:50 +01:00
|
|
|
|
rb.TopLevel = false;
|
|
|
|
|
rb.Dock = DockStyle.Fill;
|
|
|
|
|
rb.Visible = true;
|
|
|
|
|
Controls.Add(rb);
|
|
|
|
|
rb.BringToFront();
|
2014-12-17 19:29:22 +01:00
|
|
|
|
rb.FormClosed += delegate { Controls.Add(cBScanCode); cBScanCode.Location = new Point(663, 8); ActiveControl = lBMacroOn; };
|
2014-06-14 21:14:27 +02:00
|
|
|
|
}
|
Rest of DS4Windows has been upped to .NET 4.5 (If you have .net 4/already can run DS4Windows, this won't affect you), thanks to this update, you can now...
Add delay to macros from one millisecond to 60 seconds, macros with delays only run once until pressed again. Without delays, the macro can be repeated while held down.
Profiles and settings are now back inside the application folder to help portability. It will remain in appdata as previous versions if DS4Windows is in a admin folder, I may try to add a setting for location saving.
Import profile option will automatically go to the appdata profile folder, auto profiles and settings will automatically copy over.
Option to delete the appdata folder if not in use in the settings tab, this way it helps with cleanup.
Another fix for auto profiles startup bug
Better reading of autoprofile program path names
Now only one instance of DS4Windows is possible, if another DS4Tool or DS4Windows that is not this version is started, this DS4Windows comes back into focus.
UI fixes
2014-06-10 21:45:09 +02:00
|
|
|
|
|
2014-06-14 21:14:27 +02:00
|
|
|
|
protected override bool IsInputKey(Keys keyData)
|
|
|
|
|
{
|
|
|
|
|
switch (keyData)
|
|
|
|
|
{
|
|
|
|
|
case Keys.Right:
|
|
|
|
|
case Keys.Left:
|
|
|
|
|
case Keys.Up:
|
|
|
|
|
case Keys.Down:
|
|
|
|
|
return true;
|
|
|
|
|
case Keys.Shift | Keys.Right:
|
|
|
|
|
case Keys.Shift | Keys.Left:
|
|
|
|
|
case Keys.Shift | Keys.Up:
|
|
|
|
|
case Keys.Shift | Keys.Down:
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return base.IsInputKey(keyData);
|
Rest of DS4Windows has been upped to .NET 4.5 (If you have .net 4/already can run DS4Windows, this won't affect you), thanks to this update, you can now...
Add delay to macros from one millisecond to 60 seconds, macros with delays only run once until pressed again. Without delays, the macro can be repeated while held down.
Profiles and settings are now back inside the application folder to help portability. It will remain in appdata as previous versions if DS4Windows is in a admin folder, I may try to add a setting for location saving.
Import profile option will automatically go to the appdata profile folder, auto profiles and settings will automatically copy over.
Option to delete the appdata folder if not in use in the settings tab, this way it helps with cleanup.
Another fix for auto profiles startup bug
Better reading of autoprofile program path names
Now only one instance of DS4Windows is possible, if another DS4Tool or DS4Windows that is not this version is started, this DS4Windows comes back into focus.
UI fixes
2014-06-10 21:45:09 +02:00
|
|
|
|
}
|
2014-06-14 21:14:27 +02:00
|
|
|
|
protected override void OnKeyDown(KeyEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
base.OnKeyDown(e);
|
|
|
|
|
switch (e.KeyCode)
|
|
|
|
|
{
|
|
|
|
|
case Keys.Left:
|
|
|
|
|
case Keys.Right:
|
|
|
|
|
case Keys.Up:
|
|
|
|
|
case Keys.Down:
|
|
|
|
|
if (e.Shift)
|
|
|
|
|
{
|
Rest of DS4Windows has been upped to .NET 4.5 (If you have .net 4/already can run DS4Windows, this won't affect you), thanks to this update, you can now...
Add delay to macros from one millisecond to 60 seconds, macros with delays only run once until pressed again. Without delays, the macro can be repeated while held down.
Profiles and settings are now back inside the application folder to help portability. It will remain in appdata as previous versions if DS4Windows is in a admin folder, I may try to add a setting for location saving.
Import profile option will automatically go to the appdata profile folder, auto profiles and settings will automatically copy over.
Option to delete the appdata folder if not in use in the settings tab, this way it helps with cleanup.
Another fix for auto profiles startup bug
Better reading of autoprofile program path names
Now only one instance of DS4Windows is possible, if another DS4Tool or DS4Windows that is not this version is started, this DS4Windows comes back into focus.
UI fixes
2014-06-10 21:45:09 +02:00
|
|
|
|
|
2014-06-14 21:14:27 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-12-02 01:07:29 +01:00
|
|
|
|
|
|
|
|
|
private int alphacolor;
|
|
|
|
|
private Color reg, full;
|
|
|
|
|
int bgc = 240; //Color of the form background, If greyscale color
|
|
|
|
|
private void redBar_ValueChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
cBLightbar.Checked = true;
|
|
|
|
|
int value = ((TrackBar)sender).Value;
|
|
|
|
|
int sat = bgc - (value < bgc ? value : bgc);
|
|
|
|
|
int som = bgc + 11 * (int)(value * 0.0039215);
|
|
|
|
|
((TrackBar)sender).BackColor = Color.FromArgb(som, sat, sat);
|
|
|
|
|
alphacolor = Math.Max(tBRedBar.Value, Math.Max(tBGreenBar.Value, tBBlueBar.Value));
|
|
|
|
|
reg = Color.FromArgb(tBRedBar.Value, tBGreenBar.Value, tBBlueBar.Value);
|
|
|
|
|
full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg);
|
|
|
|
|
bnColor.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full);
|
2015-02-08 22:51:52 +01:00
|
|
|
|
Global.ShiftColor[device] = new DS4Color((byte)tBRedBar.Value, (byte)tBGreenBar.Value, (byte)tBBlueBar.Value);
|
2014-12-02 01:07:29 +01:00
|
|
|
|
lbRedV.Text = ((TrackBar)sender).Value.ToString();
|
|
|
|
|
}
|
|
|
|
|
private void greenBar_ValueChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
cBLightbar.Checked = true;
|
|
|
|
|
int value = ((TrackBar)sender).Value;
|
|
|
|
|
int sat = bgc - (value < bgc ? value : bgc);
|
|
|
|
|
int som = bgc + 11 * (int)(value * 0.0039215);
|
|
|
|
|
((TrackBar)sender).BackColor = Color.FromArgb(sat, som, sat);
|
|
|
|
|
alphacolor = Math.Max(tBRedBar.Value, Math.Max(tBGreenBar.Value, tBBlueBar.Value));
|
|
|
|
|
reg = Color.FromArgb(tBRedBar.Value, tBGreenBar.Value, tBBlueBar.Value);
|
|
|
|
|
full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg);
|
|
|
|
|
bnColor.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full);
|
2015-02-08 22:51:52 +01:00
|
|
|
|
Global.ShiftColor[device] = new DS4Color((byte)tBRedBar.Value, (byte)tBGreenBar.Value, (byte)tBBlueBar.Value);
|
2014-12-02 01:07:29 +01:00
|
|
|
|
lbGreenV.Text = ((TrackBar)sender).Value.ToString();
|
|
|
|
|
}
|
|
|
|
|
private void blueBar_ValueChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
cBLightbar.Checked = true;
|
|
|
|
|
int value = ((TrackBar)sender).Value;
|
|
|
|
|
int sat = bgc - (value < bgc ? value : bgc);
|
|
|
|
|
int som = bgc + 11 * (int)(value * 0.0039215);
|
|
|
|
|
((TrackBar)sender).BackColor = Color.FromArgb(sat, sat, som);
|
|
|
|
|
alphacolor = Math.Max(tBRedBar.Value, Math.Max(tBGreenBar.Value, tBBlueBar.Value));
|
|
|
|
|
reg = Color.FromArgb(tBRedBar.Value, tBGreenBar.Value, tBBlueBar.Value);
|
|
|
|
|
full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg);
|
|
|
|
|
bnColor.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full);
|
2015-02-08 22:51:52 +01:00
|
|
|
|
Global.ShiftColor[device] = new DS4Color((byte)tBRedBar.Value, (byte)tBGreenBar.Value, (byte)tBBlueBar.Value);
|
2014-12-02 01:07:29 +01:00
|
|
|
|
lbBlueV.Text = ((TrackBar)sender).Value.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Color HuetoRGB(float hue, float light, Color rgb)
|
|
|
|
|
{
|
|
|
|
|
float L = (float)Math.Max(.5, light);
|
|
|
|
|
float C = (1 - Math.Abs(2 * L - 1));
|
|
|
|
|
float X = (C * (1 - Math.Abs((hue / 60) % 2 - 1)));
|
|
|
|
|
float m = L - C / 2;
|
|
|
|
|
float R = 0, G = 0, B = 0;
|
|
|
|
|
if (light == 1) return Color.FromName("White");
|
|
|
|
|
else if (rgb.R == rgb.G && rgb.G == rgb.B) return Color.FromName("White");
|
|
|
|
|
else if (0 <= hue && hue < 60) { R = C; G = X; }
|
|
|
|
|
else if (60 <= hue && hue < 120) { R = X; G = C; }
|
|
|
|
|
else if (120 <= hue && hue < 180) { G = C; B = X; }
|
|
|
|
|
else if (180 <= hue && hue < 240) { G = X; B = C; }
|
|
|
|
|
else if (240 <= hue && hue < 300) { R = X; B = C; }
|
|
|
|
|
else if (300 <= hue && hue < 360) { R = C; B = X; }
|
|
|
|
|
return Color.FromArgb((int)((R + m) * 255), (int)((G + m) * 255), (int)((B + m) * 255));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void bnColor_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
advColorDialog.Color = bnColor.BackColor;
|
|
|
|
|
if (advColorDialog.ShowDialog() == DialogResult.OK)
|
|
|
|
|
{
|
|
|
|
|
cBLightbar.Checked = true;
|
|
|
|
|
bnColor.BackColor = advColorDialog.Color;
|
|
|
|
|
tBRedBar.Value = advColorDialog.Color.R;
|
|
|
|
|
tBGreenBar.Value = advColorDialog.Color.G;
|
|
|
|
|
tBBlueBar.Value = advColorDialog.Color.B;
|
|
|
|
|
}
|
|
|
|
|
if (device < 4)
|
2015-02-08 22:51:52 +01:00
|
|
|
|
DS4LightBar.forcelight[device] = false;
|
2014-12-02 01:07:29 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void advColorDialog_OnUpdateColor(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (sender is Color && device < 4)
|
|
|
|
|
{
|
|
|
|
|
Color color = (Color)sender;
|
2015-02-08 22:51:52 +01:00
|
|
|
|
DS4Color dcolor = new DS4Color { red = color.R, green = color.G, blue = color.B };
|
|
|
|
|
DS4LightBar.forcedColor[device] = dcolor;
|
|
|
|
|
DS4LightBar.forcedFlash[device] = 0;
|
|
|
|
|
DS4LightBar.forcelight[device] = true;
|
2014-12-02 01:07:29 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void bnTest_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (device < 4)
|
|
|
|
|
if (((Button)sender).Text == Properties.Resources.TestText)
|
|
|
|
|
{
|
2014-12-13 21:12:03 +01:00
|
|
|
|
Program.rootHub.setRumble((byte)nUDHeavy.Value, (byte)nUDLight.Value, device);
|
2014-12-02 01:07:29 +01:00
|
|
|
|
((Button)sender).Text = Properties.Resources.StopText;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-12-13 21:12:03 +01:00
|
|
|
|
Program.rootHub.setRumble(0, 0, device);
|
2014-12-02 01:07:29 +01:00
|
|
|
|
((Button)sender).Text = Properties.Resources.TestText;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (((Button)sender).Text == Properties.Resources.TestText)
|
|
|
|
|
{
|
2014-12-13 21:12:03 +01:00
|
|
|
|
Program.rootHub.setRumble((byte)nUDHeavy.Value, (byte)nUDLight.Value, 0);
|
2014-12-02 01:07:29 +01:00
|
|
|
|
((Button)sender).Text = Properties.Resources.StopText;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-12-13 21:12:03 +01:00
|
|
|
|
Program.rootHub.setRumble(0, 0, 0);
|
2014-12-02 01:07:29 +01:00
|
|
|
|
((Button)sender).Text = Properties.Resources.TestText;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void nUD_ValueChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (bnTest.Text != Properties.Resources.TestText)
|
|
|
|
|
{
|
|
|
|
|
if (device < 4)
|
2014-12-13 21:12:03 +01:00
|
|
|
|
Program.rootHub.setRumble((byte)nUDHeavy.Value, (byte)nUDLight.Value, device);
|
2014-12-02 01:07:29 +01:00
|
|
|
|
else
|
2014-12-13 21:12:03 +01:00
|
|
|
|
Program.rootHub.setRumble((byte)nUDHeavy.Value, (byte)nUDLight.Value, 0);
|
2014-12-02 01:07:29 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void nUDMouse_ValueChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
cBMouse.Checked = true;
|
|
|
|
|
}
|
2014-04-27 21:32:09 +02:00
|
|
|
|
}
|
|
|
|
|
}
|