First Alpha for Keyboard and Gamepad support (ex Tuning)

New DSsharp dlls V2.6.3 via NuGet
pull/104/head
bm98 10 years ago
parent a0f3e3e9dd
commit 7dc4b37164

@ -92,12 +92,20 @@ namespace SCJMapper_V2
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "False" )] // false
public Boolean BlendUnmapped
public Boolean BlendUnmapped // Joystick (back compatibility)
{
get { return ( Boolean )this["BlendUnmapped"]; }
set { this["BlendUnmapped"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "False" )] // false
public Boolean BlendUnmappedGP
{
get { return ( Boolean )this["BlendUnmappedGP"]; }
set { this["BlendUnmappedGP"] = value; }
}
// Seetings Window
@ -199,6 +207,15 @@ namespace SCJMapper_V2
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "False" )] // false
public Boolean DetectGamepad
{
get { return ( Boolean )this["DetectGamepad"]; }
set { this["DetectGamepad"] = value; }
}
#endregion

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SCJMapper_V2
{
/// <summary>
/// Basic device as DXInput device
/// </summary>
public abstract class DeviceCls
{
public const String DeviceName ="UNDEF";
public const String BlendedInput = " ";
static public Boolean IsDevice( String device ) { return false; }
public enum InputKind
{
Other,
Kbd,
Joystick,
Gamepad,
}
public abstract String DevName { get; }
public abstract System.Drawing.Color MapColor { get; }
public abstract Boolean Activated { get; set; }
public virtual void FinishDX( ) {}
public virtual void ApplySettings( ){}
public abstract String GetLastChange( );
public abstract void GetData( );
}
}

225
Form1.Designer.cs generated

@ -47,20 +47,22 @@
this.btGrab = new System.Windows.Forms.Button();
this.btDump = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel();
this.btJsKbd = new System.Windows.Forms.Button();
this.IL = new System.Windows.Forms.ImageList(this.components);
this.btBlend = new System.Windows.Forms.Button();
this.lblLastJ = new System.Windows.Forms.TextBox();
this.cbxThrottle = new System.Windows.Forms.CheckBox();
this.btFind = new System.Windows.Forms.Button();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.btClear = new System.Windows.Forms.Button();
this.lblLastJ = new System.Windows.Forms.Label();
this.lblAction = new System.Windows.Forms.Label();
this.btAssign = new System.Windows.Forms.Button();
this.treeView1 = new System.Windows.Forms.TreeView();
this.IL = new System.Windows.Forms.ImageList(this.components);
this.tc1 = new System.Windows.Forms.TabControl();
this.tabJS1 = new System.Windows.Forms.TabPage();
this.UC_JoyPanel = new SCJMapper_V2.UC_JoyPanel();
this.panel1 = new System.Windows.Forms.Panel();
this.btClip = new System.Windows.Forms.Button();
this.txRebind = new System.Windows.Forms.TextBox();
this.linkLblReleases = new System.Windows.Forms.LinkLabel();
this.label8 = new System.Windows.Forms.Label();
@ -73,10 +75,9 @@
this.tlpanel = new System.Windows.Forms.TableLayoutPanel();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.button1 = new System.Windows.Forms.Button();
this.cbxBlendUnmapped = new System.Windows.Forms.CheckBox();
this.txFilter = new System.Windows.Forms.TextBox();
this.btClearFilter = new System.Windows.Forms.Button();
this.btJSTuning = new System.Windows.Forms.Button();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.btSettings = new System.Windows.Forms.Button();
this.btJsReassign = new System.Windows.Forms.Button();
@ -100,6 +101,7 @@
this.loadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.UC_JoyPanel = new SCJMapper_V2.UC_JoyPanel();
this.cmCopyPaste.SuspendLayout();
this.panel2.SuspendLayout();
this.tc1.SuspendLayout();
@ -130,10 +132,10 @@
this.rtb.DetectUrls = false;
this.rtb.Dock = System.Windows.Forms.DockStyle.Fill;
this.rtb.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rtb.Location = new System.Drawing.Point(606, 81);
this.rtb.Location = new System.Drawing.Point(676, 81);
this.rtb.Name = "rtb";
this.tlpanel.SetRowSpan(this.rtb, 2);
this.rtb.Size = new System.Drawing.Size(372, 653);
this.rtb.Size = new System.Drawing.Size(372, 666);
this.rtb.TabIndex = 21;
this.rtb.Text = "";
this.rtb.WordWrap = false;
@ -222,23 +224,72 @@
// panel2
//
this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel2.Controls.Add(this.btJsKbd);
this.panel2.Controls.Add(this.btBlend);
this.panel2.Controls.Add(this.lblLastJ);
this.panel2.Controls.Add(this.cbxThrottle);
this.panel2.Controls.Add(this.btFind);
this.panel2.Controls.Add(this.label7);
this.panel2.Controls.Add(this.label6);
this.panel2.Controls.Add(this.btClear);
this.panel2.Controls.Add(this.lblLastJ);
this.panel2.Controls.Add(this.lblAction);
this.panel2.Controls.Add(this.btAssign);
this.panel2.Location = new System.Drawing.Point(3, 358);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(289, 103);
this.panel2.Size = new System.Drawing.Size(289, 133);
this.panel2.TabIndex = 17;
//
// btJsKbd
//
this.btJsKbd.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btJsKbd.ImageKey = "J";
this.btJsKbd.ImageList = this.IL;
this.btJsKbd.Location = new System.Drawing.Point(104, 98);
this.btJsKbd.Name = "btJsKbd";
this.btJsKbd.Size = new System.Drawing.Size(79, 25);
this.btJsKbd.TabIndex = 16;
this.btJsKbd.Text = "JS / Kbd";
this.btJsKbd.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.btJsKbd.UseVisualStyleBackColor = true;
this.btJsKbd.Click += new System.EventHandler(this.btJsKbd_Click);
//
// IL
//
this.IL.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("IL.ImageStream")));
this.IL.TransparentColor = System.Drawing.Color.Transparent;
this.IL.Images.SetKeyName(0, "Map");
this.IL.Images.SetKeyName(1, "Selected");
this.IL.Images.SetKeyName(2, "J");
this.IL.Images.SetKeyName(3, "K");
this.IL.Images.SetKeyName(4, "X");
this.IL.Images.SetKeyName(5, "P");
this.IL.Images.SetKeyName(6, "Z");
//
// btBlend
//
this.btBlend.Location = new System.Drawing.Point(10, 98);
this.btBlend.Name = "btBlend";
this.btBlend.Size = new System.Drawing.Size(73, 25);
this.btBlend.TabIndex = 15;
this.btBlend.Text = "Blend";
this.btBlend.UseVisualStyleBackColor = true;
this.btBlend.Click += new System.EventHandler(this.btBlend_Click);
//
// lblLastJ
//
this.lblLastJ.Location = new System.Drawing.Point(52, 38);
this.lblLastJ.Name = "lblLastJ";
this.lblLastJ.Size = new System.Drawing.Size(222, 22);
this.lblLastJ.TabIndex = 14;
this.lblLastJ.Text = "...";
this.lblLastJ.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lblLastJ_MouseClick);
this.lblLastJ.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lblLastJ_KeyDown);
this.lblLastJ.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lblLastJ_MouseDoubleClick);
//
// cbxThrottle
//
this.cbxThrottle.AutoSize = true;
this.cbxThrottle.Location = new System.Drawing.Point(110, 72);
this.cbxThrottle.Location = new System.Drawing.Point(90, 72);
this.cbxThrottle.Name = "cbxThrottle";
this.cbxThrottle.Size = new System.Drawing.Size(66, 17);
this.cbxThrottle.TabIndex = 13;
@ -247,9 +298,9 @@
//
// btFind
//
this.btFind.Location = new System.Drawing.Point(190, 37);
this.btFind.Location = new System.Drawing.Point(201, 67);
this.btFind.Name = "btFind";
this.btFind.Size = new System.Drawing.Size(84, 20);
this.btFind.Size = new System.Drawing.Size(73, 25);
this.btFind.TabIndex = 12;
this.btFind.Text = "Find 1st.";
this.btFind.UseVisualStyleBackColor = true;
@ -258,7 +309,7 @@
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(7, 37);
this.label7.Location = new System.Drawing.Point(7, 41);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(28, 13);
this.label7.TabIndex = 3;
@ -275,24 +326,14 @@
//
// btClear
//
this.btClear.Location = new System.Drawing.Point(190, 67);
this.btClear.Location = new System.Drawing.Point(201, 98);
this.btClear.Name = "btClear";
this.btClear.Size = new System.Drawing.Size(94, 25);
this.btClear.Size = new System.Drawing.Size(73, 25);
this.btClear.TabIndex = 2;
this.btClear.Text = "Clear";
this.btClear.UseVisualStyleBackColor = true;
this.btClear.Click += new System.EventHandler(this.btClear_Click);
//
// lblLastJ
//
this.lblLastJ.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.lblLastJ.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblLastJ.Location = new System.Drawing.Point(52, 37);
this.lblLastJ.Name = "lblLastJ";
this.lblLastJ.Size = new System.Drawing.Size(135, 20);
this.lblLastJ.TabIndex = 1;
this.lblLastJ.Text = "...";
//
// lblAction
//
this.lblAction.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
@ -307,7 +348,7 @@
//
this.btAssign.Location = new System.Drawing.Point(10, 67);
this.btAssign.Name = "btAssign";
this.btAssign.Size = new System.Drawing.Size(94, 25);
this.btAssign.Size = new System.Drawing.Size(73, 25);
this.btAssign.TabIndex = 0;
this.btAssign.Text = "Assign";
this.btAssign.UseVisualStyleBackColor = true;
@ -323,22 +364,10 @@
this.treeView1.Name = "treeView1";
this.tlpanel.SetRowSpan(this.treeView1, 3);
this.treeView1.SelectedImageKey = "Selected";
this.treeView1.Size = new System.Drawing.Size(294, 739);
this.treeView1.Size = new System.Drawing.Size(364, 739);
this.treeView1.TabIndex = 16;
this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
//
// IL
//
this.IL.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("IL.ImageStream")));
this.IL.TransparentColor = System.Drawing.Color.Transparent;
this.IL.Images.SetKeyName(0, "Map");
this.IL.Images.SetKeyName(1, "Selected");
this.IL.Images.SetKeyName(2, "J");
this.IL.Images.SetKeyName(3, "K");
this.IL.Images.SetKeyName(4, "X");
this.IL.Images.SetKeyName(5, "P");
this.IL.Images.SetKeyName(6, "Z");
//
// tc1
//
this.tc1.Controls.Add(this.tabJS1);
@ -364,18 +393,10 @@
this.tabJS1.TabIndex = 0;
this.tabJS1.Text = "Joystick 1";
//
// UC_JoyPanel
//
this.UC_JoyPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.UC_JoyPanel.JsAssignment = 0;
this.UC_JoyPanel.Location = new System.Drawing.Point(3, 3);
this.UC_JoyPanel.Name = "UC_JoyPanel";
this.UC_JoyPanel.Size = new System.Drawing.Size(275, 315);
this.UC_JoyPanel.TabIndex = 0;
//
// panel1
//
this.tlpanel.SetColumnSpan(this.panel1, 3);
this.panel1.Controls.Add(this.btClip);
this.panel1.Controls.Add(this.txRebind);
this.panel1.Controls.Add(this.linkLblReleases);
this.panel1.Controls.Add(this.label8);
@ -384,9 +405,19 @@
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(6, 6);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(972, 66);
this.panel1.Size = new System.Drawing.Size(1042, 66);
this.panel1.TabIndex = 14;
//
// btClip
//
this.btClip.Image = global::SCJMapper_V2.Properties.Resources.Notes;
this.btClip.Location = new System.Drawing.Point(984, 8);
this.btClip.Name = "btClip";
this.btClip.Size = new System.Drawing.Size(52, 55);
this.btClip.TabIndex = 55;
this.btClip.UseVisualStyleBackColor = true;
this.btClip.Click += new System.EventHandler(this.btClip_Click);
//
// txRebind
//
this.txRebind.Location = new System.Drawing.Point(603, 39);
@ -437,7 +468,7 @@
// buttonExit
//
this.buttonExit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonExit.Location = new System.Drawing.Point(171, 53);
this.buttonExit.Location = new System.Drawing.Point(171, 40);
this.buttonExit.Name = "buttonExit";
this.buttonExit.Size = new System.Drawing.Size(120, 24);
this.buttonExit.TabIndex = 13;
@ -465,7 +496,7 @@
// tlpanel
//
this.tlpanel.ColumnCount = 3;
this.tlpanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 300F));
this.tlpanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 370F));
this.tlpanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 300F));
this.tlpanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tlpanel.Controls.Add(this.rtb, 2, 1);
@ -482,11 +513,11 @@
this.tlpanel.Padding = new System.Windows.Forms.Padding(3);
this.tlpanel.RowCount = 5;
this.tlpanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 75F));
this.tlpanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 500F));
this.tlpanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 535F));
this.tlpanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 65F));
this.tlpanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 35F));
this.tlpanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F));
this.tlpanel.Size = new System.Drawing.Size(984, 862);
this.tlpanel.Size = new System.Drawing.Size(1054, 862);
this.tlpanel.TabIndex = 25;
//
// flowLayoutPanel1
@ -495,9 +526,9 @@
this.flowLayoutPanel1.Controls.Add(this.panel2);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowLayoutPanel1.Location = new System.Drawing.Point(306, 81);
this.flowLayoutPanel1.Location = new System.Drawing.Point(376, 81);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(294, 494);
this.flowLayoutPanel1.Size = new System.Drawing.Size(294, 529);
this.flowLayoutPanel1.TabIndex = 22;
//
// tableLayoutPanel1
@ -508,44 +539,21 @@
this.tableLayoutPanel1.Controls.Add(this.btDump, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.btGrab, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.btDumpList, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.button1, 1, 4);
this.tableLayoutPanel1.Controls.Add(this.cbxBlendUnmapped, 0, 4);
this.tableLayoutPanel1.Controls.Add(this.txFilter, 0, 2);
this.tableLayoutPanel1.Controls.Add(this.btClearFilter, 0, 3);
this.tableLayoutPanel1.Controls.Add(this.btJSTuning, 1, 3);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
this.tableLayoutPanel1.Location = new System.Drawing.Point(306, 581);
this.tableLayoutPanel1.Location = new System.Drawing.Point(376, 616);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 5;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.tableLayoutPanel1.RowCount = 4;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(294, 153);
this.tableLayoutPanel1.Size = new System.Drawing.Size(294, 131);
this.tableLayoutPanel1.TabIndex = 23;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button1.Location = new System.Drawing.Point(171, 123);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(120, 24);
this.button1.TabIndex = 17;
this.button1.Text = "Joystick Tuning";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// cbxBlendUnmapped
//
this.cbxBlendUnmapped.AutoSize = true;
this.cbxBlendUnmapped.Location = new System.Drawing.Point(3, 123);
this.cbxBlendUnmapped.Name = "cbxBlendUnmapped";
this.cbxBlendUnmapped.Size = new System.Drawing.Size(115, 17);
this.cbxBlendUnmapped.TabIndex = 15;
this.cbxBlendUnmapped.Text = "Blend unmapped";
this.cbxBlendUnmapped.UseVisualStyleBackColor = true;
this.cbxBlendUnmapped.CheckedChanged += new System.EventHandler(this.cbxBlendUnmapped_CheckedChanged);
//
// txFilter
//
this.txFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
@ -566,6 +574,16 @@
this.btClearFilter.UseVisualStyleBackColor = true;
this.btClearFilter.Click += new System.EventHandler(this.btClearFilter_Click);
//
// btJSTuning
//
this.btJSTuning.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btJSTuning.Location = new System.Drawing.Point(171, 93);
this.btJSTuning.Name = "btJSTuning";
this.btJSTuning.Size = new System.Drawing.Size(120, 24);
this.btJSTuning.TabIndex = 17;
this.btJSTuning.Text = "Joystick Tuning";
this.btJSTuning.Click += new System.EventHandler(this.btJSTuning_Click);
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.ColumnCount = 2;
@ -576,18 +594,18 @@
this.tableLayoutPanel2.Controls.Add(this.btJsReassign, 0, 0);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
this.tableLayoutPanel2.Location = new System.Drawing.Point(306, 740);
this.tableLayoutPanel2.Location = new System.Drawing.Point(376, 753);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 2;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(294, 80);
this.tableLayoutPanel2.Size = new System.Drawing.Size(294, 67);
this.tableLayoutPanel2.TabIndex = 24;
//
// btSettings
//
this.btSettings.Location = new System.Drawing.Point(3, 53);
this.btSettings.Location = new System.Drawing.Point(3, 40);
this.btSettings.Name = "btSettings";
this.btSettings.Size = new System.Drawing.Size(120, 24);
this.btSettings.TabIndex = 14;
@ -597,7 +615,7 @@
// btJsReassign
//
this.btJsReassign.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btJsReassign.Location = new System.Drawing.Point(3, 23);
this.btJsReassign.Location = new System.Drawing.Point(3, 10);
this.btJsReassign.Name = "btJsReassign";
this.btJsReassign.Size = new System.Drawing.Size(120, 24);
this.btJsReassign.TabIndex = 16;
@ -615,19 +633,19 @@
this.tableLayoutPanel3.Controls.Add(this.label1, 0, 0);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel3.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
this.tableLayoutPanel3.Location = new System.Drawing.Point(606, 740);
this.tableLayoutPanel3.Location = new System.Drawing.Point(676, 753);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 2;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(372, 80);
this.tableLayoutPanel3.Size = new System.Drawing.Size(372, 67);
this.tableLayoutPanel3.TabIndex = 25;
//
// btSaveMyMapping
//
this.btSaveMyMapping.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btSaveMyMapping.Image = ((System.Drawing.Image)(resources.GetObject("btSaveMyMapping.Image")));
this.btSaveMyMapping.Location = new System.Drawing.Point(164, 53);
this.btSaveMyMapping.Location = new System.Drawing.Point(164, 40);
this.btSaveMyMapping.Name = "btSaveMyMapping";
this.btSaveMyMapping.Size = new System.Drawing.Size(205, 24);
this.btSaveMyMapping.TabIndex = 15;
@ -638,7 +656,7 @@
//
// btLoadMyMapping
//
this.btLoadMyMapping.Location = new System.Drawing.Point(3, 53);
this.btLoadMyMapping.Location = new System.Drawing.Point(3, 40);
this.btLoadMyMapping.Name = "btLoadMyMapping";
this.btLoadMyMapping.Size = new System.Drawing.Size(120, 24);
this.btLoadMyMapping.TabIndex = 14;
@ -650,7 +668,7 @@
//
this.txMappingName.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.txMappingName.CharacterCasing = System.Windows.Forms.CharacterCasing.Lower;
this.txMappingName.Location = new System.Drawing.Point(135, 14);
this.txMappingName.Location = new System.Drawing.Point(135, 7);
this.txMappingName.Name = "txMappingName";
this.txMappingName.Size = new System.Drawing.Size(234, 22);
this.txMappingName.TabIndex = 0;
@ -661,7 +679,7 @@
//
this.label1.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(41, 18);
this.label1.Location = new System.Drawing.Point(41, 12);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(88, 13);
this.label1.TabIndex = 16;
@ -808,20 +826,29 @@
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
this.statusStrip1.ShowItemToolTips = true;
this.statusStrip1.Size = new System.Drawing.Size(984, 30);
this.statusStrip1.Size = new System.Drawing.Size(1054, 30);
this.statusStrip1.TabIndex = 26;
this.statusStrip1.Text = "statusStrip1";
//
// UC_JoyPanel
//
this.UC_JoyPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.UC_JoyPanel.JsAssignment = 0;
this.UC_JoyPanel.Location = new System.Drawing.Point(3, 3);
this.UC_JoyPanel.Name = "UC_JoyPanel";
this.UC_JoyPanel.Size = new System.Drawing.Size(275, 315);
this.UC_JoyPanel.TabIndex = 0;
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(984, 862);
this.ClientSize = new System.Drawing.Size(1054, 862);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.tlpanel);
this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MinimumSize = new System.Drawing.Size(1000, 900);
this.MinimumSize = new System.Drawing.Size(1070, 900);
this.Name = "MainForm";
this.Text = "SC Joystick Mapper";
this.Activated += new System.EventHandler(this.MainForm_Activated);
@ -860,7 +887,6 @@
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Button btClear;
private System.Windows.Forms.Label lblLastJ;
private System.Windows.Forms.Label lblAction;
private System.Windows.Forms.Button btAssign;
private System.Windows.Forms.TreeView treeView1;
@ -913,10 +939,13 @@
private System.Windows.Forms.CheckBox cbxThrottle;
private System.Windows.Forms.TextBox txRebind;
private System.Windows.Forms.Button btSettings;
private System.Windows.Forms.CheckBox cbxBlendUnmapped;
private System.Windows.Forms.Button btJsReassign;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button btJSTuning;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.TextBox lblLastJ;
private System.Windows.Forms.Button btJsKbd;
private System.Windows.Forms.Button btBlend;
private System.Windows.Forms.Button btClip;
}
}

@ -26,6 +26,17 @@ namespace SCJMapper_V2
///</remarks>
private JoystickList m_Joystick = new JoystickList( );
///<remarks>
/// Holds the DXInput keyboard
///</remarks>
private GamepadCls m_Gamepad = null;
///<remarks>
/// Holds the DXInput keyboard
///</remarks>
private KeyboardCls m_Keyboard = null;
///<remarks>
/// Holds the ActionTree that manages the TreeView and the action lists
///</remarks>
@ -34,6 +45,70 @@ namespace SCJMapper_V2
private FormJSCalCurve JSCAL = null;
#region Tools section
// Means to identify the Gamepad TabPage
// (the TAG is used as Int for JS as well - so don't change the ID type used)
private const int ID_GAMEPAD_TAB = -99;
/// <summary>
/// Identify the Tab as Gamepad tab
/// </summary>
/// <param name="page">The tab page</param>
private void SetGamepadTab( TabPage page )
{
page.Tag = ID_GAMEPAD_TAB;
}
/// <summary>
/// Returns true if the tabPage is the Gamepad Page
/// </summary>
/// <param name="page">The tab page</param>
/// <returns>True if it is the Gamepad Tab</returns>
private Boolean IsGamepadTab( TabPage page )
{
// catch if the Tag is not an int...
try {
return ( ( int )page.Tag == ID_GAMEPAD_TAB );
}
catch {
return false;
}
}
/// <summary>
/// Detects and returns the current Input device
/// </summary>
private DeviceCls.InputKind InputMode
{
get
{
if ( m_keyIn ) {
return DeviceCls.InputKind.Kbd;
}
else {
if ( IsGamepadTab( tc1.SelectedTab) ) {
return DeviceCls.InputKind.Gamepad;
}
else {
return DeviceCls.InputKind.Joystick;
}
}
}
}
/// <summary>
/// Get the current JsN String for the active device tab
/// </summary>
/// <returns>The jsN string - can be jsx, js1..jsN</returns>
private String JSStr( )
{
UC_JoyPanel jp = ( UC_JoyPanel )( tc1.SelectedTab.Controls["UC_JoyPanel"] );
return jp.JsName;
}
#endregion
#region Main Form Handling
@ -53,6 +128,21 @@ namespace SCJMapper_V2
}
private void MainForm_Deactivate( object sender, EventArgs e )
{
timer1.Enabled = false;
m_Joystick.Deactivate( );
m_Keyboard.Deactivate( );
}
private void MainForm_Activated( object sender, EventArgs e )
{
timer1.Enabled = true;
m_Joystick.Activate( );
m_Keyboard.Activate( );
}
private void LoadProfileDD( )
{
tsDDbtProfiles.DropDownItems.Clear( );
@ -128,7 +218,6 @@ namespace SCJMapper_V2
log.Debug( "Loading Other" );
txMappingName.Text = m_AppSettings.MyMappingName;
SetRebindField( txMappingName.Text );
cbxBlendUnmapped.Checked = m_AppSettings.BlendUnmapped;
// Init X things
log.Debug( "Loading DirectX" );
@ -176,7 +265,7 @@ namespace SCJMapper_V2
//This line of code will help you to change the apperance like size,name,style.
Font f;
//For background color
Brush backBrush = new System.Drawing.SolidBrush( MyColors.JColor[e.Index] );
Brush backBrush = new System.Drawing.SolidBrush( MyColors.TabColor[e.Index] );
//For forground color
Brush foreBrush = new SolidBrush( System.Drawing.Color.Black );
@ -233,6 +322,8 @@ namespace SCJMapper_V2
#endregion
#region Initializations
/// <summary>
/// Resets the Action Tree
/// </summary>
@ -241,20 +332,27 @@ namespace SCJMapper_V2
log.Debug( "InitActionTree - Entry" );
// build TreeView and the ActionMaps
m_AT = new ActionTree( cbxBlendUnmapped.Checked, m_Joystick );
m_AT = new ActionTree( m_AppSettings.BlendUnmapped, m_AppSettings.BlendUnmappedGP, m_Joystick );
m_AT.Ctrl = treeView1; // the ActionTree owns the TreeView control
m_AT.IgnoreMaps = m_AppSettings.IgnoreActionmaps;
m_AT.LoadTree( m_AppSettings.DefProfileName, addDefaultBinding ); // Init with default profile filepath
// default JS to Joystick mapping - can be changed and reloaded from XML
if ( m_Joystick.Count > 0 ) { m_Joystick[0].JSAssignment = 1; m_AT.ActionMaps.jsN[0] = m_Joystick[0].DevName; m_AT.ActionMaps.jsNGUID[0] = m_Joystick[0].DevInstanceGUID; }
if ( m_Joystick.Count > 1 ) { m_Joystick[1].JSAssignment = 2; m_AT.ActionMaps.jsN[1] = m_Joystick[1].DevName; m_AT.ActionMaps.jsNGUID[1] = m_Joystick[1].DevInstanceGUID; }
// default JS to Joystick mapping - can be changed and reloaded from XML mappings
int jsTab = 0;
if ( IsGamepadTab( tc1.TabPages[jsTab] ) ) jsTab++;
if ( m_Joystick.Count > 0 ) { m_Joystick[0].JSAssignment = jsTab + 1; m_AT.ActionMaps.jsN[0] = m_Joystick[0].DevName; m_AT.ActionMaps.jsNGUID[0] = m_Joystick[0].DevInstanceGUID; }
jsTab++; if ( IsGamepadTab( tc1.TabPages[jsTab] ) ) jsTab++;
if ( m_Joystick.Count > 1 ) { m_Joystick[1].JSAssignment = jsTab + 1; m_AT.ActionMaps.jsN[1] = m_Joystick[1].DevName; m_AT.ActionMaps.jsNGUID[1] = m_Joystick[1].DevInstanceGUID; }
if ( m_Joystick.Count > 2 ) { m_Joystick[2].JSAssignment = 0; } // unmapped ones go with default 0
if ( m_Joystick.Count > 3 ) { m_Joystick[3].JSAssignment = 0; }
if ( m_Joystick.Count > 4 ) { m_Joystick[4].JSAssignment = 0; }
if ( m_Joystick.Count > 5 ) { m_Joystick[5].JSAssignment = 0; }
if ( m_Joystick.Count > 6 ) { m_Joystick[6].JSAssignment = 0; }
if ( m_Joystick.Count > 7 ) { m_Joystick[7].JSAssignment = 0; }
}
@ -268,43 +366,92 @@ namespace SCJMapper_V2
// Enumerate joysticks in the system.
int tabs = 0;
SharpDX.XInput.UserIndex gpDeviceIndex = SharpDX.XInput.UserIndex.Any;
try {
// Initialize DirectInput
log.Debug( "Instantiate DirectInput" );
var directInput = new DirectInput( );
log.Debug( "Get Keyboard device" );
m_Keyboard = new KeyboardCls( new Keyboard( directInput ), this );
// scan the Input for attached devices
log.Debug( "Scan GameControl devices" );
foreach ( DeviceInstance instance in directInput.GetDevices( DeviceClass.GameControl, DeviceEnumerationFlags.AttachedOnly ) ) {
log.InfoFormat( "GameControl: #{0} Type:{1} Device:{2}", tabs, instance.Type.ToString( ), instance.ProductName );
// Create the device interface
log.Debug( "Create the device interface" );
SharpDX.DirectInput.Joystick jsDevice = new Joystick( directInput, instance.InstanceGuid );
JoystickCls js = null;
log.DebugFormat( "Create the device interface for: {0}", jsDevice.Information.ProductName );
SharpDX.DirectInput.Joystick jsDevice = null;
SharpDX.XInput.Controller gpDevice = null;
JoystickCls js = null; GamepadCls gs = null;
if ( m_AppSettings.DetectGamepad && ( instance.Usage == SharpDX.Multimedia.UsageId.GenericGamepad ) ) {
// detect Gamepad only if the user wishes to do so
for ( SharpDX.XInput.UserIndex i = SharpDX.XInput.UserIndex.One; i < SharpDX.XInput.UserIndex.Four; i++ ) {
gpDevice = new SharpDX.XInput.Controller( i );
if ( gpDevice.IsConnected ) {
log.InfoFormat( "Scan Input {0} for gamepad - {1}", i, gpDevice.GetCapabilities( SharpDX.XInput.DeviceQueryType.Gamepad ).ToString( ) );
gpDeviceIndex = i;
break;
}
}
}
else {
jsDevice = new Joystick( directInput, instance.InstanceGuid );
log.DebugFormat( "Create the device interface for: {0}", jsDevice.Information.ProductName );
}
// we have the first tab made as reference so TabPage[0] already exists
if ( tabs == 0 ) {
// first panel - The Tab content exists already
log.Debug( "Add first Joystick panel" );
js = new JoystickCls( jsDevice, this, tabs + 1, UC_JoyPanel, tc1.TabPages[0] ); // does all device related activities for that particular item
if ( gpDevice != null ) {
log.Debug( "Add first Gamepad panel" );
tc1.TabPages[0].Text = "Gamepad ";
UC_GpadPanel uUC_GpadPanelNew = new UC_GpadPanel( ); tc1.TabPages[0].Controls.Add( uUC_GpadPanelNew );
uUC_GpadPanelNew.Size = UC_JoyPanel.Size; uUC_GpadPanelNew.Location = UC_JoyPanel.Location;
UC_JoyPanel.Enabled = false; UC_JoyPanel.Visible = false; // don't use this one
log.Debug( "Create Gamepad instance" );
gs = new GamepadCls( gpDevice, uUC_GpadPanelNew, 0 ); // does all device related activities for that particular item
}
else {
log.Debug( "Add first Joystick panel" );
log.Debug( "Create Joystick instance" );
js = new JoystickCls( jsDevice, this, tabs + 1, UC_JoyPanel, 0 ); // does all device related activities for that particular item
}
}
else {
log.Debug( "Add next Joystick panel" );
// setup the further tab contents along the reference one in TabPage[0] (the control named UC_JoyPanel)
tc1.TabPages.Add( "Joystick " + ( tabs + 1 ).ToString( ) );
UC_JoyPanel uUC_JoyPanelNew = new UC_JoyPanel( );
tc1.TabPages[tabs].Controls.Add( uUC_JoyPanelNew );
uUC_JoyPanelNew.Size = UC_JoyPanel.Size;
uUC_JoyPanelNew.Location = UC_JoyPanel.Location;
log.Debug( "Create Joystick instance" );
js = new JoystickCls( jsDevice, this, tabs + 1, uUC_JoyPanelNew, tc1.TabPages[tabs] ); // does all device related activities for that particular item
if ( gpDevice != null ) {
log.Debug( "Add next Gamepad panel" );
tc1.TabPages.Add( "Gamepad " );
UC_GpadPanel uUC_GpadPanelNew = new UC_GpadPanel( ); tc1.TabPages[tabs].Controls.Add( uUC_GpadPanelNew );
uUC_GpadPanelNew.Size = UC_JoyPanel.Size; uUC_GpadPanelNew.Location = UC_JoyPanel.Location;
UC_JoyPanel.Enabled = false; UC_JoyPanel.Visible = false; // don't use this one
log.Debug( "Create Gamepad instance" );
gs = new GamepadCls( gpDevice, uUC_GpadPanelNew, tabs ); // does all device related activities for that particular item
}
else {
log.Debug( "Add next Joystick panel" );
// setup the further tab contents along the reference one in TabPage[0] (the control named UC_JoyPanel)
tc1.TabPages.Add( "Joystick " + ( tabs + 1 ).ToString( ) );
UC_JoyPanel uUC_JoyPanelNew = new UC_JoyPanel( ); tc1.TabPages[tabs].Controls.Add( uUC_JoyPanelNew );
uUC_JoyPanelNew.Size = UC_JoyPanel.Size; uUC_JoyPanelNew.Location = UC_JoyPanel.Location;
log.Debug( "Create Joystick instance" );
js = new JoystickCls( jsDevice, this, tabs + 1, uUC_JoyPanelNew, tabs ); // does all device related activities for that particular item
}
}
m_Joystick.Add( js ); // add to joystick list
tc1.TabPages[tabs].Tag = js.DevName; // used to find the tab via JS mapping
tc1.TabPages[tabs].BackColor = MyColors.JColor[tabs]; // each tab has its own color
if ( gpDevice != null ) {
m_Gamepad = gs;
SetGamepadTab( tc1.TabPages[tabs] ); // indicates the gamepad tab (murks..)
MyColors.GamepadColor = MyColors.TabColor[tabs]; // save it for future use
}
else if ( js != null ) {
m_Joystick.Add( js ); // add to joystick list
tc1.TabPages[tabs].Tag = ( m_Joystick.Count - 1 ); // used to find the tab for polling
}
tc1.TabPages[tabs].BackColor = MyColors.TabColor[tabs]; // each tab has its own color
// next tab
tabs++;
@ -338,17 +485,9 @@ namespace SCJMapper_V2
return true;
}
#endregion
/// <summary>
/// Get the current JsTag for the active device tab
/// </summary>
/// <returns></returns>
private String JSStr( )
{
UC_JoyPanel jp = ( UC_JoyPanel )( tc1.SelectedTab.Controls["UC_JoyPanel"] );
return jp.JsName;
}
/// <summary>
@ -365,30 +504,34 @@ namespace SCJMapper_V2
// This is includes similar procedures as reassigning of the jsN items
JoystickCls j = null;
m_Joystick.ClearJsNAssignment( );
// for all supported jsN
for ( int i=0; i < JoystickCls.JSnum_MAX; i++ ) {
j = null;
if ( !String.IsNullOrEmpty( m_AT.ActionMaps.jsNGUID[i] ) ) {
j = m_Joystick.Find_jsInstance( m_AT.ActionMaps.jsNGUID[i] );
}
else if ( !String.IsNullOrEmpty( m_AT.ActionMaps.jsN[i] ) ) {
j = m_Joystick.Find_jsDev( m_AT.ActionMaps.jsN[i] );
}
if ( !String.IsNullOrEmpty( m_AT.ActionMaps.jsNGUID[i] ) ) j = m_Joystick.Find_jsInstance( m_AT.ActionMaps.jsNGUID[i] );
else if ( !String.IsNullOrEmpty( m_AT.ActionMaps.jsN[i] ) ) j = m_Joystick.Find_jsDev( m_AT.ActionMaps.jsN[i] );
if ( j != null ) {
m_AT.ActionMaps.jsNGUID[i] = j.DevInstanceGUID; // subst for missing one (version up etc.)
j.JSAssignment = i+1;
j.JSAssignment = i + 1; // i is 0 based ; jsN is 1 based
}
else {
// a valid but unknown GUID
m_AT.ActionMaps.Clear_jsEntry( i );
}
}
// maintain the new JsN assignment and update the colorlist
List<int> newL = new List<int>( );
foreach ( JoystickCls jj in m_Joystick ) {
newL.Add(jj.JSAssignment);
foreach ( TabPage tp in tc1.TabPages ) {
if ( IsGamepadTab( tp ) ) newL.Add( 0 );
else newL.Add( m_Joystick[(int)tp.Tag].JSAssignment );
}
JoystickCls.ReassignJsColor( newL );
m_AT.ReloadCtrl( ); // finally reload things into the tree
m_AT.ReloadTreeView( ); // finally reload things into the tree
btDump.BackColor = btClear.BackColor; btDump.UseVisualStyleBackColor = btClear.UseVisualStyleBackColor; // neutral again
btGrab.BackColor = btClear.BackColor; btGrab.UseVisualStyleBackColor = btClear.UseVisualStyleBackColor; // neutral again
@ -431,8 +574,21 @@ namespace SCJMapper_V2
private void timer1_Tick( object sender, System.EventArgs e )
{
foreach ( JoystickCls jsc in m_Joystick ) { jsc.GetData( ); } // poll the devices
String ctrl = JSStr( ) + m_Joystick[tc1.SelectedIndex].GetLastChange( ); // show last handled JS control
if ( m_keyIn ) return; // allow keyboard / mouse input
String ctrl = "";
int jsIndex = ( int )tc1.SelectedTab.Tag; // gets the index into the JS list
if ( jsIndex < 0 ) {
m_Gamepad.GetData( );
ctrl = m_Gamepad.GetLastChange( );
timer1.Interval = 750; // allow more time to release buttons
}
else {
m_Joystick[jsIndex].GetData( ); // poll the device
ctrl = JSStr( ) + m_Joystick[jsIndex].GetLastChange( ); // show last handled JS control
timer1.Interval = 100; // standard polling
}
lblLastJ.Text = ctrl;
if ( JoystickCls.CanThrottle( ctrl ) ) {
cbxThrottle.Enabled = true;
@ -468,7 +624,7 @@ namespace SCJMapper_V2
private void btAssign_Click( object sender, EventArgs e )
{
m_AT.UpdateSelectedItem( JoystickCls.MakeThrottle( lblLastJ.Text, cbxThrottle.Checked ) );
m_AT.UpdateSelectedItem( JoystickCls.MakeThrottle( lblLastJ.Text, cbxThrottle.Checked ), InputMode );
if ( m_AT.Dirty ) btDump.BackColor = MyColors.DirtyColor;
}
@ -478,7 +634,7 @@ namespace SCJMapper_V2
private void btClear_Click( object sender, EventArgs e )
{
m_AT.UpdateSelectedItem( "" );
m_AT.UpdateSelectedItem( "", InputMode );
if ( m_AT.Dirty ) btDump.BackColor = MyColors.DirtyColor;
}
@ -731,6 +887,11 @@ namespace SCJMapper_V2
System.Diagnostics.Process.Start( c_GithubLink );
}
private void btClip_Click( object sender, EventArgs e )
{
System.Windows.Forms.Clipboard.SetText( txRebind.Text );
}
// Settings
@ -762,12 +923,12 @@ namespace SCJMapper_V2
if ( m_Joystick.ShowReassign( ) != System.Windows.Forms.DialogResult.Cancel ) {
// copy the action tree while reassigning the jsN mappings from OLD to NEW
ActionTree newTree = m_AT.ReassignJsN( m_Joystick.JsReassingList );
// we have still the old assignment in the ActionMap - change it here (map does not know about the devices)
JoystickCls j = null;
// for all supported jsN devices
for ( int i=0; i < JoystickCls.JSnum_MAX; i++ ) {
j = m_Joystick.Find_jsN( i+1 );
j = m_Joystick.Find_jsN( i + 1 );
if ( j != null ) {
newTree.ActionMaps.jsN[i] = j.DevName; newTree.ActionMaps.jsNGUID[i] = j.DevInstanceGUID;
}
@ -777,7 +938,7 @@ namespace SCJMapper_V2
}
m_AT = newTree; // make it the valid one
m_AT.ReloadCtrl( );
m_AT.ReloadTreeView( );
if ( m_AT.Dirty ) btDump.BackColor = MyColors.DirtyColor;
}
@ -785,22 +946,17 @@ namespace SCJMapper_V2
}
// Blend Unmapped
// Blend
private void cbxBlendUnmapped_CheckedChanged( object sender, EventArgs e )
private void btBlend_Click( object sender, EventArgs e )
{
if ( m_AT != null ) {
m_AT.BlendUnmapped = cbxBlendUnmapped.Checked;
m_AT.ReloadCtrl( );
}
m_AppSettings.BlendUnmapped = cbxBlendUnmapped.Checked;
m_AT.UpdateSelectedItem( DeviceCls.BlendedInput, InputMode );
if ( m_AT.Dirty ) btDump.BackColor = MyColors.DirtyColor;
}
// Joystick Tuning
#endregion
private void button1_Click( object sender, EventArgs e )
private void btJSTuning_Click( object sender, EventArgs e )
{
timer1.Enabled = false; // must be off while a modal window is shown, else DX gets crazy
@ -861,21 +1017,83 @@ namespace SCJMapper_V2
JSCAL = null; // get rid and create a new one next time..
if ( m_AT.Dirty ) btDump.BackColor = MyColors.DirtyColor;
timer1.Enabled = true;
timer1.Enabled = true;
}
private void MainForm_Deactivate( object sender, EventArgs e )
// Keyboard Input
Boolean m_keyIn = false;
// Right no a double click triggers the switch between JS and Mouse+Kbd
private void lblLastJ_MouseDoubleClick( object sender, MouseEventArgs e )
{
timer1.Enabled = false;
m_Joystick.Deactivate( );
m_keyIn = ( !m_keyIn );
if ( m_keyIn ) {
if ( m_Keyboard == null ) {
m_keyIn = false;
return;
} // bail out ..
lblLastJ.BackColor = MyColors.KeyboardColor;
m_Keyboard.Activate( );
m_Keyboard.GetData( ); // poll to aquire once
}
else {
lblLastJ.BackColor = MyColors.ValidColor;
m_Keyboard.Deactivate( );
}
}
private void MainForm_Activated( object sender, EventArgs e )
private void btJsKbd_Click( object sender, EventArgs e )
{
timer1.Enabled =true;
m_Joystick.Activate( );
m_keyIn = ( !m_keyIn );
if ( m_keyIn ) {
if ( m_Keyboard == null ) {
m_keyIn = false;
btJsKbd.ImageKey = "J";
return;
} // bail out ..
lblLastJ.BackColor = MyColors.KeyboardColor;
btJsKbd.ImageKey = "K";
lblLastJ.Focus( );
m_Keyboard.Activate( );
m_Keyboard.GetData( ); // poll to aquire once
}
else {
lblLastJ.BackColor = MyColors.ValidColor;
btJsKbd.ImageKey = "J";
m_Keyboard.Deactivate( );
}
}
// read mouse commands (TODO only buttons no movement so far)
private void lblLastJ_MouseClick( object sender, MouseEventArgs e )
{
if ( !m_keyIn ) return;
// capture mouse things
lblLastJ.Text = MouseCls.MouseCmd( e );
}
// Key down triggers the readout via DX Input
private void lblLastJ_KeyDown( object sender, KeyEventArgs e )
{
if ( m_keyIn ) {
m_Keyboard.GetData( );
lblLastJ.Text = m_Keyboard.GetLastChange( );
}
// don't spill the field with regular input
e.SuppressKeyPress = true;
e.Handled = true;
}
#endregion

@ -392,7 +392,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAQ
DgAAAk1TRnQBSQFMAgEBBwEAARgBCgEYAQoBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
DgAAAk1TRnQBSQFMAgEBBwEAAbgBCgG4AQoBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

@ -56,7 +56,10 @@
this.btCancel = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.cbxDetectGamepad = new System.Windows.Forms.CheckBox();
this.cbxForceIgnoreversion = new System.Windows.Forms.CheckBox();
this.cbxBlendJS = new System.Windows.Forms.CheckBox();
this.cbxBlendGP = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
@ -333,6 +336,9 @@
//
// groupBox4
//
this.groupBox4.Controls.Add(this.cbxBlendGP);
this.groupBox4.Controls.Add(this.cbxBlendJS);
this.groupBox4.Controls.Add(this.cbxDetectGamepad);
this.groupBox4.Controls.Add(this.cbxForceIgnoreversion);
this.groupBox4.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.groupBox4.Location = new System.Drawing.Point(12, 340);
@ -342,6 +348,16 @@
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Advanced Options ...";
//
// cbxDetectGamepad
//
this.cbxDetectGamepad.AutoSize = true;
this.cbxDetectGamepad.Location = new System.Drawing.Point(145, 27);
this.cbxDetectGamepad.Name = "cbxDetectGamepad";
this.cbxDetectGamepad.Size = new System.Drawing.Size(98, 17);
this.cbxDetectGamepad.TabIndex = 6;
this.cbxDetectGamepad.Text = "Use Gamepad";
this.cbxDetectGamepad.UseVisualStyleBackColor = true;
//
// cbxForceIgnoreversion
//
this.cbxForceIgnoreversion.AutoSize = true;
@ -352,6 +368,26 @@
this.cbxForceIgnoreversion.Text = "force \'ignoreversion\'";
this.cbxForceIgnoreversion.UseVisualStyleBackColor = true;
//
// cbxBlendJS
//
this.cbxBlendJS.AutoSize = true;
this.cbxBlendJS.Location = new System.Drawing.Point(439, 13);
this.cbxBlendJS.Name = "cbxBlendJS";
this.cbxBlendJS.Size = new System.Drawing.Size(100, 17);
this.cbxBlendJS.TabIndex = 16;
this.cbxBlendJS.Text = "Blend Joystick";
this.cbxBlendJS.UseVisualStyleBackColor = true;
//
// cbxBlendGP
//
this.cbxBlendGP.AutoSize = true;
this.cbxBlendGP.Location = new System.Drawing.Point(439, 36);
this.cbxBlendGP.Name = "cbxBlendGP";
this.cbxBlendGP.Size = new System.Drawing.Size(109, 17);
this.cbxBlendGP.TabIndex = 16;
this.cbxBlendGP.Text = "Blend Gamepad";
this.cbxBlendGP.UseVisualStyleBackColor = true;
//
// FormSettings
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -415,5 +451,8 @@
private System.Windows.Forms.Label label1;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.CheckBox cbxForceIgnoreversion;
private System.Windows.Forms.CheckBox cbxDetectGamepad;
private System.Windows.Forms.CheckBox cbxBlendGP;
private System.Windows.Forms.CheckBox cbxBlendJS;
}
}

@ -60,8 +60,15 @@ namespace SCJMapper_V2
}
}
// Blend options
cbxBlendJS.Checked = m_owner.BlendUnmapped;
cbxBlendGP.Checked = m_owner.BlendUnmappedGP;
// ForceIgnoreversion
cbxForceIgnoreversion.Checked = m_owner.ForceIgnoreversion;
// DetectGamepad
cbxDetectGamepad.Checked = m_owner.DetectGamepad;
}
@ -90,9 +97,19 @@ namespace SCJMapper_V2
}
m_owner.IgnoreActionmaps = ignore;
// Blend options
m_owner.BlendUnmapped = cbxBlendJS.Checked;
m_owner.BlendUnmappedGP = cbxBlendGP.Checked;
// ForceIgnoreversion
m_owner.ForceIgnoreversion = cbxForceIgnoreversion.Checked;
// DetectGamepad
if ( m_owner.DetectGamepad != cbxDetectGamepad.Checked ) {
MessageBox.Show( "Changing the Gamepad option needs a restart of the application !!", "Settings Notification", MessageBoxButtons.OK, MessageBoxIcon.Information );
}
m_owner.DetectGamepad = cbxDetectGamepad.Checked;
m_owner.Save( );
}

@ -0,0 +1,380 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SharpDX;
using SharpDX.XInput;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using System.Collections.Specialized;
namespace SCJMapper_V2
{
/// <summary>
/// Handles one JS device as DXInput device
/// In addition provide some static tools to handle JS props here in one place
/// Also owns the GUI i.e. the user control that shows all values
/// </summary>
public class GamepadCls : DeviceCls
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
private static readonly AppSettings appSettings = new AppSettings( );
#region Static Items
public new const String DeviceName = "xboxpad"; // the device name used throughout this app
public const String JsUnknown = "xi_";
public new const String BlendedInput = "xi_reserved";
/// <summary>
/// Returns the currently valid color
/// </summary>
/// <returns>A color</returns>
static public System.Drawing.Color XiColor()
{
return MyColors.GamepadColor;
}
/// <summary>
/// Returns true if the devicename is a gamepad
/// </summary>
/// <param name="device"></param>
/// <returns></returns>
static public new Boolean IsDevice( String device )
{
return ( device == DeviceName );
}
/// <summary>
/// Returns true if the input is an xi_ but not xi_reserved
/// </summary>
/// <param name="device"></param>
/// <returns></returns>
static public Boolean IsXiValid( String input )
{
return (IsXi(input) && (String.Compare(input, BlendedInput)!= 0));
}
const string xi_pattern = @"^xi_*";
static Regex rgx_xi = new Regex( xi_pattern, RegexOptions.IgnoreCase );
/// <summary>
/// Returns true if the input starts with a valid xi_ formatting
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
static public Boolean IsXi( String input )
{
return rgx_xi.IsMatch( input );
}
#endregion
private Controller m_device;
private Capabilities m_gpCaps = new Capabilities( );
private State m_state = new State( );
private State m_prevState = new State( );
private String m_lastItem = "";
private int m_senseLimit = 500; // axis jitter avoidance...
private bool m_activated = false;
private UC_GpadPanel m_gPanel = null; // the GUI panel
internal int MyTabPageIndex = -1;
/// <summary>
/// The JS ProductName property
/// </summary>
public override String DevName { get { return "Generic Gamepad"; } }
/// <summary>
/// <summary>
/// Returns the mapping color for this device
/// </summary>
public override System.Drawing.Color MapColor
{
get { return MyColors.GamepadColor; }
}
public override Boolean Activated
{
get { return m_activated; }
set
{
m_activated = value;
}
}
private Boolean Bit( GamepadButtonFlags set, GamepadButtonFlags check )
{
Int32 s = ( Int32 )set; Int32 c = ( Int32 )check;
return ( ( s & c ) == c );
}
/// <summary>
/// ctor and init
/// </summary>
/// <param name="device">A DXInput device</param>
/// <param name="hwnd">The WinHandle of the main window</param>
/// <param name="panel">The respective JS panel to show the properties</param>
public GamepadCls( SharpDX.XInput.Controller device, UC_GpadPanel panel, int tabIndex )
{
log.DebugFormat( "GamepadCls ctor - Entry with index {0}", device.ToString( ) );
m_device = device;
m_gPanel = panel;
MyTabPageIndex = tabIndex;
Activated = false;
m_senseLimit = AppConfiguration.AppConfig.gpSenseLimit; // can be changed in the app.config file if it is still too little
// Set BufferSize in order to use buffered data.
log.Debug( "Get GP Objects" );
try {
m_gpCaps = m_device.GetCapabilities( DeviceQueryType.Gamepad );
}
catch ( Exception ex ) {
log.Error( "Get GamepadCapabilities failed", ex );
}
m_gPanel.Caption = DevName;
int n = 0;
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.DPadDown ) ) n++;
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.DPadLeft ) ) n++;
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.DPadRight ) ) n++;
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.DPadUp ) ) n++;
m_gPanel.nDPads = n.ToString( );
m_gPanel.DPadE = ( n > 0 );
n = 0;
if ( ( m_gpCaps.Gamepad.LeftThumbX != 0 ) || ( m_gpCaps.Gamepad.LeftThumbY != 0 ) || Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.LeftThumb ) ) { n++; m_gPanel.TStickLE = true; }
if ( ( m_gpCaps.Gamepad.RightThumbX != 0 ) || ( m_gpCaps.Gamepad.RightThumbY != 0 ) || Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.RightThumb ) ) { n++; m_gPanel.TStickRE = true; }
m_gPanel.nTSticks = n.ToString( );
n = 0;
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.A ) ) n++;
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.B ) ) n++;
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.X ) ) n++;
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.Y ) ) n++;
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.Start ) ) { n++; m_gPanel.StartE = true; }
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.Back ) ) { n++; m_gPanel.BackE = true; }
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.LeftShoulder ) ) { n++; m_gPanel.ShoulderLE = true; }
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.RightShoulder ) ) { n++; m_gPanel.ShoulderRE = true; }
m_gPanel.nButtons = n.ToString( );
n = 0;
if ( m_gpCaps.Gamepad.LeftTrigger > 0 ) { n++; m_gPanel.TriggerLE = true; }
if ( m_gpCaps.Gamepad.RightTrigger > 0 ) { n++; m_gPanel.TriggerRE = true; }
m_gPanel.nTriggers = n.ToString( );
m_gPanel.ButtonE = true; // what else ...
ApplySettings( ); // get whatever is needed here from Settings
Activated = true;
}
/// <summary>
/// Shutdown device access
/// </summary>
public override void FinishDX( )
{
log.DebugFormat( "Release Input device: {0}", m_device );
}
/// <summary>
/// Tells the Joystick to re-read settings
/// </summary>
public override void ApplySettings( )
{
appSettings.Reload( );
}
/// <summary>
/// Returns true if a modifer button is pressed
/// </summary>
/// <returns></returns>
private Boolean ModButtonPressed( )
{
Boolean retVal = m_state.Gamepad.Buttons != GamepadButtonFlags.None;
retVal = ( retVal || ( Math.Abs( ( Int32 )m_state.Gamepad.LeftTrigger ) > 0 ) );
retVal = ( retVal || ( Math.Abs( ( Int32 )m_state.Gamepad.RightTrigger ) > 0 ) );
return retVal;
}
/// <summary>
/// Find the last change the user did on that device
/// </summary>
/// <returns>The last action as CryEngine compatible string</returns>
public override String GetLastChange( )
{
if ( ModButtonPressed() ) {
m_lastItem = "";
if ( ( Math.Abs( ( Int32 )m_state.Gamepad.LeftThumbX ) > m_senseLimit )
&& ( Math.Abs( ( Int32 )m_state.Gamepad.LeftThumbX ) > Math.Abs( ( Int32 )m_state.Gamepad.LeftThumbY ) )
&& !Bit(m_state.Gamepad.Buttons, GamepadButtonFlags.LeftThumb) ) m_lastItem += "xi_thumblx+";
if ( ( Math.Abs( ( Int32 )m_state.Gamepad.LeftThumbY ) > m_senseLimit )
&& ( Math.Abs( ( Int32 )m_state.Gamepad.LeftThumbY ) > Math.Abs( ( Int32 )m_state.Gamepad.LeftThumbX ) )
&& !Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.LeftThumb ) ) m_lastItem += "xi_thumbly+";
if ( ( Math.Abs( ( Int32 )m_state.Gamepad.RightThumbX ) > m_senseLimit )
&& ( Math.Abs( ( Int32 )m_state.Gamepad.RightThumbX ) > Math.Abs( ( Int32 )m_state.Gamepad.RightThumbY ) )
&& !Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.RightThumb ) ) m_lastItem += "xi_thumbrx+";
if ( ( Math.Abs( ( Int32 )m_state.Gamepad.RightThumbY ) > m_senseLimit )
&& ( Math.Abs( ( Int32 )m_state.Gamepad.RightThumbY ) > Math.Abs( ( Int32 )m_state.Gamepad.RightThumbX ) )
&& !Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.RightThumb ) ) m_lastItem += "xi_thumbry+";
if ( Math.Abs( ( Int32 )m_state.Gamepad.LeftTrigger ) > 0 ) m_lastItem += "xi_triggerl_btn+";
if ( Math.Abs( ( Int32 )m_state.Gamepad.RightTrigger ) > 0 ) m_lastItem += "xi_triggerr_btn+";
if ( Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.A ) ) m_lastItem += "xi_a+";
if ( Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.B ) ) m_lastItem += "xi_b+";
if ( Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.X ) ) m_lastItem += "xi_x+";
if ( Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.Y ) ) m_lastItem += "xi_y+";
if ( Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.Start ) ) m_lastItem += "xi_start+";
if ( Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.Back ) ) m_lastItem += "xi_back+";
if ( Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.DPadDown ) ) m_lastItem += "xi_dpad_down+";
if ( Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.DPadLeft ) ) m_lastItem += "xi_dpad_left+";
if ( Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.DPadRight ) ) m_lastItem += "xi_dpad_right+";
if ( Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.DPadUp ) ) m_lastItem += "xi_dpad_up+";
if ( Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.LeftShoulder ) ) m_lastItem += "xi_shoulderl+";
if ( Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.RightShoulder ) ) m_lastItem += "xi_shoulderr+";
if ( Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.LeftThumb ) ) m_lastItem += "xi_thumbl+";
if ( Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.RightThumb ) ) m_lastItem += "xi_thumbr+";
}
else {
// no button -> only non button items will reported - single events
if ( ( Math.Abs( ( Int32 )m_state.Gamepad.LeftThumbX ) > m_senseLimit )
&& ( Math.Abs( ( Int32 )m_state.Gamepad.LeftThumbX ) > Math.Abs( ( Int32 )m_state.Gamepad.LeftThumbY )) ) m_lastItem = "xi_thumblx+";
if ( ( Math.Abs( ( Int32 )m_state.Gamepad.LeftThumbY ) > m_senseLimit )
&& ( Math.Abs( ( Int32 )m_state.Gamepad.LeftThumbY ) > Math.Abs( ( Int32 )m_state.Gamepad.LeftThumbX )) ) m_lastItem = "xi_thumbly+";
if ( ( Math.Abs( ( Int32 )m_state.Gamepad.RightThumbX ) > m_senseLimit )
&& ( Math.Abs( ( Int32 )m_state.Gamepad.RightThumbX ) > Math.Abs( ( Int32 )m_state.Gamepad.RightThumbY ) ) ) m_lastItem = "xi_thumbrx+";
if ( ( Math.Abs( ( Int32 )m_state.Gamepad.RightThumbY ) > m_senseLimit )
&& ( Math.Abs( ( Int32 )m_state.Gamepad.RightThumbY ) > Math.Abs( ( Int32 )m_state.Gamepad.RightThumbX ) ) ) m_lastItem = "xi_thumbry+";
if ( Math.Abs( ( Int32 )m_state.Gamepad.LeftTrigger ) > 0 ) m_lastItem = "xi_triggerl_btn+";
if ( Math.Abs( ( Int32 )m_state.Gamepad.RightTrigger ) > 0 ) m_lastItem = "xi_triggerr_btn+";
}
return m_lastItem.TrimEnd( new char[] { '+' } ); ;
}
///<summary>
/// Figure out if an axis changed enough to consider it as a changed state
/// The change is polled every 100ms (timer1) so the user has to change so much within that time
/// Then an axis usually swings back when left alone - that is the real recording of a change.
/// We know that the range is -32758 .. 32767 so we can judge absolute
/// % relative is prone to small changes around 0 - which is likely the case with axes
/// </summary>
private bool DidAxisChange2( int current, int prev )
{
// determine if the axis drifts more than x units to account for bounce
// old-new/old
if ( current == prev )
return false;
int change = (Math.Abs( current ) - Math.Abs( prev ) ) / 32;
// if the axis has changed more than x units to it's last value
return change > m_senseLimit ? true : false;
}
///<summary>
/// Figure out if an axis changed enough to consider it as a changed state
/// </summary>
private bool DidAxisChange( int current, int prev )
{
// determine if the axis drifts more than x% to account for bounce
// old-new/old
if ( current == prev )
return false;
if ( prev == 0 )
prev = 1;
int changepct = Math.Abs( prev ) - Math.Abs( current ) / Math.Abs( prev );
// if the axis has changed more than 70% relative to it's last value
return changepct > 70 ? true : false;
}
/// <summary>
/// Show the current props in the GUI
/// </summary>
private void UpdateUI( )
{
// This function updated the UI with joystick state information.
string strText = "";
strText += ( ( m_state.Gamepad.Buttons & GamepadButtonFlags.DPadDown ) > 0 ) ? "d" : " ";
strText += ( ( m_state.Gamepad.Buttons & GamepadButtonFlags.DPadLeft ) > 0 ) ? "l" : " ";
strText += ( ( m_state.Gamepad.Buttons & GamepadButtonFlags.DPadRight ) > 0 ) ? "r" : " ";
strText += ( ( m_state.Gamepad.Buttons & GamepadButtonFlags.DPadUp ) > 0 ) ? "u" : " ";
m_gPanel.DPad = strText;
m_gPanel.TStickXL = m_state.Gamepad.LeftThumbX.ToString( );
m_gPanel.TStickYL = m_state.Gamepad.LeftThumbY.ToString( );
m_gPanel.TStickBtL = ( ( m_state.Gamepad.Buttons & GamepadButtonFlags.LeftThumb ) > 0 ) ? "pressed" : "_";
m_gPanel.TStickXR = m_state.Gamepad.RightThumbX.ToString( );
m_gPanel.TStickYR = m_state.Gamepad.RightThumbY.ToString( );
m_gPanel.TStickBtR = ( ( m_state.Gamepad.Buttons & GamepadButtonFlags.RightThumb ) > 0 ) ? "pressed" : "_";
m_gPanel.TriggerL = m_state.Gamepad.LeftTrigger.ToString( );
m_gPanel.TriggerR = m_state.Gamepad.RightTrigger.ToString( );
m_gPanel.ShoulderL = ( ( m_state.Gamepad.Buttons & GamepadButtonFlags.LeftShoulder ) > 0 ) ? "pressed" : "_";
m_gPanel.ShoulderR = ( ( m_state.Gamepad.Buttons & GamepadButtonFlags.RightShoulder ) > 0 ) ? "pressed" : "_";
m_gPanel.Start = ( ( m_state.Gamepad.Buttons & GamepadButtonFlags.Start ) > 0 ) ? "pressed" : "_";
m_gPanel.Back = ( ( m_state.Gamepad.Buttons & GamepadButtonFlags.Back ) > 0 ) ? "pressed" : "_";
String buttons = "";
buttons += ( Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.A ) ) ? "A" : "_";
buttons += ( Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.B ) ) ? "B" : "_";
buttons += ( Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.X ) ) ? "X" : "_";
buttons += ( Bit( m_state.Gamepad.Buttons, GamepadButtonFlags.Y ) ) ? "Y" : "_";
m_gPanel.Button = buttons;
}
/// <summary>
/// Collect the current data from the device
/// </summary>
public override void GetData( )
{
// Make sure there is a valid device.
if ( m_device == null )
return;
// Get the state of the device - retaining the previous state to find the lates change
m_prevState = m_state;
// Poll the device for info.
try {
m_state = m_device.GetState( );
}
catch ( SharpDXException e ) {
log.Error( "Gamepad-GetData: Unexpected Poll Exception", e );
return; // EXIT see ex code
}
UpdateUI( ); // and update the GUI
}
}
}

@ -0,0 +1,479 @@
namespace SCJMapper_V2
{
partial class UC_GpadPanel
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose( bool disposing )
{
if ( disposing && ( components != null ) ) {
components.Dispose( );
}
base.Dispose( disposing );
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent( )
{
this.gBoxCap = new System.Windows.Forms.GroupBox();
this.lblnButtons = new System.Windows.Forms.Label();
this.lblnTSticks = new System.Windows.Forms.Label();
this.lblnDPad = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.gBox = new System.Windows.Forms.GroupBox();
this.lbl1Buttons = new System.Windows.Forms.Label();
this.lB = new System.Windows.Forms.Label();
this.iBtBack = new System.Windows.Forms.Label();
this.iTrigR = new System.Windows.Forms.Label();
this.iTrigL = new System.Windows.Forms.Label();
this.iBtStart = new System.Windows.Forms.Label();
this.iShR = new System.Windows.Forms.Label();
this.iShL = new System.Windows.Forms.Label();
this.iTStickXR = new System.Windows.Forms.Label();
this.iTStickXL = new System.Windows.Forms.Label();
this.iDPad = new System.Windows.Forms.Label();
this.lH3 = new System.Windows.Forms.Label();
this.lH2 = new System.Windows.Forms.Label();
this.lH1 = new System.Windows.Forms.Label();
this.lH0 = new System.Windows.Forms.Label();
this.lTrigR = new System.Windows.Forms.Label();
this.lTrigL = new System.Windows.Forms.Label();
this.lTStickR = new System.Windows.Forms.Label();
this.lTStickL = new System.Windows.Forms.Label();
this.lDPad = new System.Windows.Forms.Label();
this.lblnTriggers = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.iTStickYL = new System.Windows.Forms.Label();
this.iTStickYR = new System.Windows.Forms.Label();
this.iTStickBtL = new System.Windows.Forms.Label();
this.iTStickBtR = new System.Windows.Forms.Label();
this.gBoxCap.SuspendLayout();
this.gBox.SuspendLayout();
this.SuspendLayout();
//
// gBoxCap
//
this.gBoxCap.Controls.Add(this.lblnTriggers);
this.gBoxCap.Controls.Add(this.label4);
this.gBoxCap.Controls.Add(this.lblnButtons);
this.gBoxCap.Controls.Add(this.lblnTSticks);
this.gBoxCap.Controls.Add(this.lblnDPad);
this.gBoxCap.Controls.Add(this.label5);
this.gBoxCap.Controls.Add(this.label3);
this.gBoxCap.Controls.Add(this.label2);
this.gBoxCap.Location = new System.Drawing.Point(3, 3);
this.gBoxCap.Name = "gBoxCap";
this.gBoxCap.Size = new System.Drawing.Size(232, 60);
this.gBoxCap.TabIndex = 5;
this.gBoxCap.TabStop = false;
this.gBoxCap.Text = "Device Capabilities";
//
// lblnButtons
//
this.lblnButtons.AutoSize = true;
this.lblnButtons.Location = new System.Drawing.Point(81, 40);
this.lblnButtons.Name = "lblnButtons";
this.lblnButtons.Size = new System.Drawing.Size(13, 13);
this.lblnButtons.TabIndex = 14;
this.lblnButtons.Text = "0";
//
// lblnTSticks
//
this.lblnTSticks.AutoSize = true;
this.lblnTSticks.Location = new System.Drawing.Point(188, 24);
this.lblnTSticks.Name = "lblnTSticks";
this.lblnTSticks.Size = new System.Drawing.Size(13, 13);
this.lblnTSticks.TabIndex = 14;
this.lblnTSticks.Text = "0";
//
// lblnDPad
//
this.lblnDPad.AutoSize = true;
this.lblnDPad.Location = new System.Drawing.Point(81, 24);
this.lblnDPad.Name = "lblnDPad";
this.lblnDPad.Size = new System.Drawing.Size(13, 13);
this.lblnDPad.TabIndex = 14;
this.lblnDPad.Text = "0";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(9, 40);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(56, 13);
this.label5.TabIndex = 13;
this.label5.Text = "# Buttons:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(124, 24);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(56, 13);
this.label3.TabIndex = 13;
this.label3.Text = "# TSticks:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(9, 24);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(47, 13);
this.label2.TabIndex = 13;
this.label2.Text = "# DPad:";
//
// gBox
//
this.gBox.Controls.Add(this.iTStickBtR);
this.gBox.Controls.Add(this.iTStickBtL);
this.gBox.Controls.Add(this.iTStickYL);
this.gBox.Controls.Add(this.lbl1Buttons);
this.gBox.Controls.Add(this.lB);
this.gBox.Controls.Add(this.iBtBack);
this.gBox.Controls.Add(this.iTrigR);
this.gBox.Controls.Add(this.iTrigL);
this.gBox.Controls.Add(this.iBtStart);
this.gBox.Controls.Add(this.iShR);
this.gBox.Controls.Add(this.iShL);
this.gBox.Controls.Add(this.iTStickYR);
this.gBox.Controls.Add(this.iTStickXR);
this.gBox.Controls.Add(this.iTStickXL);
this.gBox.Controls.Add(this.iDPad);
this.gBox.Controls.Add(this.lH3);
this.gBox.Controls.Add(this.lH2);
this.gBox.Controls.Add(this.lH1);
this.gBox.Controls.Add(this.lH0);
this.gBox.Controls.Add(this.lTrigR);
this.gBox.Controls.Add(this.lTrigL);
this.gBox.Controls.Add(this.lTStickR);
this.gBox.Controls.Add(this.lTStickL);
this.gBox.Controls.Add(this.lDPad);
this.gBox.Location = new System.Drawing.Point(3, 67);
this.gBox.Name = "gBox";
this.gBox.Size = new System.Drawing.Size(232, 161);
this.gBox.TabIndex = 6;
this.gBox.TabStop = false;
this.gBox.Text = "GamePad State";
//
// lbl1Buttons
//
this.lbl1Buttons.Location = new System.Drawing.Point(65, 141);
this.lbl1Buttons.Name = "lbl1Buttons";
this.lbl1Buttons.Size = new System.Drawing.Size(154, 13);
this.lbl1Buttons.TabIndex = 25;
//
// lB
//
this.lB.AutoSize = true;
this.lB.Location = new System.Drawing.Point(9, 141);
this.lB.Name = "lB";
this.lB.Size = new System.Drawing.Size(46, 13);
this.lB.TabIndex = 24;
this.lB.Text = "Buttons:";
//
// iBtBack
//
this.iBtBack.AutoSize = true;
this.iBtBack.Enabled = false;
this.iBtBack.Location = new System.Drawing.Point(185, 122);
this.iBtBack.Name = "iBtBack";
this.iBtBack.Size = new System.Drawing.Size(13, 13);
this.iBtBack.TabIndex = 23;
this.iBtBack.Text = "0";
//
// iTrigR
//
this.iTrigR.AutoSize = true;
this.iTrigR.Enabled = false;
this.iTrigR.Location = new System.Drawing.Point(81, 88);
this.iTrigR.Name = "iTrigR";
this.iTrigR.Size = new System.Drawing.Size(13, 13);
this.iTrigR.TabIndex = 22;
this.iTrigR.Text = "0";
//
// iTrigL
//
this.iTrigL.AutoSize = true;
this.iTrigL.Enabled = false;
this.iTrigL.Location = new System.Drawing.Point(81, 72);
this.iTrigL.Name = "iTrigL";
this.iTrigL.Size = new System.Drawing.Size(13, 13);
this.iTrigL.TabIndex = 21;
this.iTrigL.Text = "0";
//
// iBtStart
//
this.iBtStart.AutoSize = true;
this.iBtStart.Enabled = false;
this.iBtStart.Location = new System.Drawing.Point(185, 106);
this.iBtStart.Name = "iBtStart";
this.iBtStart.Size = new System.Drawing.Size(13, 13);
this.iBtStart.TabIndex = 20;
this.iBtStart.Text = "0";
//
// iShR
//
this.iShR.AutoSize = true;
this.iShR.Enabled = false;
this.iShR.Location = new System.Drawing.Point(81, 122);
this.iShR.Name = "iShR";
this.iShR.Size = new System.Drawing.Size(13, 13);
this.iShR.TabIndex = 19;
this.iShR.Text = "0";
//
// iShL
//
this.iShL.AutoSize = true;
this.iShL.Enabled = false;
this.iShL.Location = new System.Drawing.Point(81, 106);
this.iShL.Name = "iShL";
this.iShL.Size = new System.Drawing.Size(13, 13);
this.iShL.TabIndex = 18;
this.iShL.Text = "0";
//
// iTStickXR
//
this.iTStickXR.AutoSize = true;
this.iTStickXR.Enabled = false;
this.iTStickXR.Location = new System.Drawing.Point(81, 56);
this.iTStickXR.Name = "iTStickXR";
this.iTStickXR.Size = new System.Drawing.Size(13, 13);
this.iTStickXR.TabIndex = 14;
this.iTStickXR.Text = "0";
//
// iTStickXL
//
this.iTStickXL.AutoSize = true;
this.iTStickXL.Enabled = false;
this.iTStickXL.Location = new System.Drawing.Point(81, 40);
this.iTStickXL.Name = "iTStickXL";
this.iTStickXL.Size = new System.Drawing.Size(13, 13);
this.iTStickXL.TabIndex = 13;
this.iTStickXL.Text = "0";
//
// iDPad
//
this.iDPad.AutoSize = true;
this.iDPad.Enabled = false;
this.iDPad.Location = new System.Drawing.Point(81, 24);
this.iDPad.Name = "iDPad";
this.iDPad.Size = new System.Drawing.Size(13, 13);
this.iDPad.TabIndex = 12;
this.iDPad.Text = "0";
//
// lH3
//
this.lH3.AutoSize = true;
this.lH3.Enabled = false;
this.lH3.Location = new System.Drawing.Point(124, 122);
this.lH3.Name = "lH3";
this.lH3.Size = new System.Drawing.Size(35, 13);
this.lH3.TabIndex = 11;
this.lH3.Text = "Back:";
//
// lH2
//
this.lH2.AutoSize = true;
this.lH2.Enabled = false;
this.lH2.Location = new System.Drawing.Point(124, 106);
this.lH2.Name = "lH2";
this.lH2.Size = new System.Drawing.Size(32, 13);
this.lH2.TabIndex = 10;
this.lH2.Text = "Start:";
//
// lH1
//
this.lH1.AutoSize = true;
this.lH1.Enabled = false;
this.lH1.Location = new System.Drawing.Point(9, 122);
this.lH1.Name = "lH1";
this.lH1.Size = new System.Drawing.Size(51, 13);
this.lH1.TabIndex = 9;
this.lH1.Text = "Sh Right:";
//
// lH0
//
this.lH0.AutoSize = true;
this.lH0.Enabled = false;
this.lH0.Location = new System.Drawing.Point(9, 106);
this.lH0.Name = "lH0";
this.lH0.Size = new System.Drawing.Size(44, 13);
this.lH0.TabIndex = 8;
this.lH0.Text = "Sh Left:";
//
// lTrigR
//
this.lTrigR.AutoSize = true;
this.lTrigR.Enabled = false;
this.lTrigR.Location = new System.Drawing.Point(9, 88);
this.lTrigR.Name = "lTrigR";
this.lTrigR.Size = new System.Drawing.Size(54, 13);
this.lTrigR.TabIndex = 7;
this.lTrigR.Text = "Trigger R:";
//
// lTrigL
//
this.lTrigL.AutoSize = true;
this.lTrigL.Enabled = false;
this.lTrigL.Location = new System.Drawing.Point(9, 72);
this.lTrigL.Name = "lTrigL";
this.lTrigL.Size = new System.Drawing.Size(52, 13);
this.lTrigL.TabIndex = 6;
this.lTrigL.Text = "Trigger L:";
//
// lTStickR
//
this.lTStickR.AutoSize = true;
this.lTStickR.Enabled = false;
this.lTStickR.Location = new System.Drawing.Point(9, 56);
this.lTStickR.Name = "lTStickR";
this.lTStickR.Size = new System.Drawing.Size(69, 13);
this.lTStickR.TabIndex = 2;
this.lTStickR.Text = "TStick Right:";
//
// lTStickL
//
this.lTStickL.AutoSize = true;
this.lTStickL.Enabled = false;
this.lTStickL.Location = new System.Drawing.Point(9, 40);
this.lTStickL.Name = "lTStickL";
this.lTStickL.Size = new System.Drawing.Size(62, 13);
this.lTStickL.TabIndex = 1;
this.lTStickL.Text = "TStick Left:";
//
// lDPad
//
this.lDPad.AutoSize = true;
this.lDPad.Enabled = false;
this.lDPad.Location = new System.Drawing.Point(9, 24);
this.lDPad.Name = "lDPad";
this.lDPad.Size = new System.Drawing.Size(37, 13);
this.lDPad.TabIndex = 0;
this.lDPad.Text = "DPad:";
//
// lblnTriggers
//
this.lblnTriggers.AutoSize = true;
this.lblnTriggers.Location = new System.Drawing.Point(188, 40);
this.lblnTriggers.Name = "lblnTriggers";
this.lblnTriggers.Size = new System.Drawing.Size(13, 13);
this.lblnTriggers.TabIndex = 16;
this.lblnTriggers.Text = "0";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(124, 40);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(58, 13);
this.label4.TabIndex = 15;
this.label4.Text = "# Triggers:";
//
// iTStickYL
//
this.iTStickYL.AutoSize = true;
this.iTStickYL.Enabled = false;
this.iTStickYL.Location = new System.Drawing.Point(124, 40);
this.iTStickYL.Name = "iTStickYL";
this.iTStickYL.Size = new System.Drawing.Size(13, 13);
this.iTStickYL.TabIndex = 26;
this.iTStickYL.Text = "0";
//
// iTStickYR
//
this.iTStickYR.AutoSize = true;
this.iTStickYR.Enabled = false;
this.iTStickYR.Location = new System.Drawing.Point(124, 56);
this.iTStickYR.Name = "iTStickYR";
this.iTStickYR.Size = new System.Drawing.Size(13, 13);
this.iTStickYR.TabIndex = 14;
this.iTStickYR.Text = "0";
//
// iTStickBtL
//
this.iTStickBtL.AutoSize = true;
this.iTStickBtL.Enabled = false;
this.iTStickBtL.Location = new System.Drawing.Point(185, 40);
this.iTStickBtL.Name = "iTStickBtL";
this.iTStickBtL.Size = new System.Drawing.Size(13, 13);
this.iTStickBtL.TabIndex = 27;
this.iTStickBtL.Text = "0";
//
// iTStickBtR
//
this.iTStickBtR.AutoSize = true;
this.iTStickBtR.Enabled = false;
this.iTStickBtR.Location = new System.Drawing.Point(185, 56);
this.iTStickBtR.Name = "iTStickBtR";
this.iTStickBtR.Size = new System.Drawing.Size(13, 13);
this.iTStickBtR.TabIndex = 27;
this.iTStickBtR.Text = "0";
//
// UC_GpadPanel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.gBox);
this.Controls.Add(this.gBoxCap);
this.Name = "UC_GpadPanel";
this.Size = new System.Drawing.Size(239, 295);
this.gBoxCap.ResumeLayout(false);
this.gBoxCap.PerformLayout();
this.gBox.ResumeLayout(false);
this.gBox.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox gBoxCap;
private System.Windows.Forms.Label lblnButtons;
private System.Windows.Forms.Label lblnTSticks;
private System.Windows.Forms.Label lblnDPad;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.GroupBox gBox;
private System.Windows.Forms.Label lbl1Buttons;
private System.Windows.Forms.Label lB;
private System.Windows.Forms.Label iBtBack;
private System.Windows.Forms.Label iTrigR;
private System.Windows.Forms.Label iTrigL;
private System.Windows.Forms.Label iBtStart;
private System.Windows.Forms.Label iShR;
private System.Windows.Forms.Label iShL;
private System.Windows.Forms.Label iTStickXR;
private System.Windows.Forms.Label iTStickXL;
private System.Windows.Forms.Label iDPad;
private System.Windows.Forms.Label lH3;
private System.Windows.Forms.Label lH2;
private System.Windows.Forms.Label lH1;
private System.Windows.Forms.Label lH0;
private System.Windows.Forms.Label lTrigR;
private System.Windows.Forms.Label lTrigL;
private System.Windows.Forms.Label lTStickR;
private System.Windows.Forms.Label lTStickL;
private System.Windows.Forms.Label lDPad;
private System.Windows.Forms.Label lblnTriggers;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label iTStickYL;
private System.Windows.Forms.Label iTStickYR;
private System.Windows.Forms.Label iTStickBtR;
private System.Windows.Forms.Label iTStickBtL;
}
}

@ -0,0 +1,190 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace SCJMapper_V2
{
public partial class UC_GpadPanel : UserControl
{
public UC_GpadPanel( )
{
InitializeComponent( );
}
#region Strings
/// <summary>
/// Return s only if length is max 12 (some crazy names may kill the layout...)
/// </summary>
/// <param name="s">String to return if length less than 12</param>
/// <param name="d">String to return if s length more than 12</param>
/// <returns>A string</returns>
private String Chk( String s, String d )
{
if ( s.Length > 12 ) return d; else return s;
}
public String Caption
{
set { gBoxCap.Text = value; }
}
public String DPad
{
set { iDPad.Text = value; }
}
public String TStickXL
{
set { iTStickXL.Text = value; }
}
public String TStickYL
{
set { iTStickYL.Text = value; }
}
public String TStickBtL
{
set { iTStickBtL.Text = value; }
}
public String TStickXR
{
set { iTStickXR.Text = value; }
}
public String TStickYR
{
set { iTStickYR.Text = value; }
}
public String TStickBtR
{
set { iTStickBtR.Text = value; }
}
public String TriggerL
{
set { iTrigL.Text = value; }
}
public String TriggerR
{
set { iTrigR.Text = value; }
}
public String ShoulderL
{
set { iShL.Text = value; }
}
public String ShoulderR
{
set { iShR.Text = value; }
}
public String Start
{
set { iBtStart.Text = value; }
}
public String Back
{
set { iBtBack.Text = value; }
}
public String Button
{
set { lbl1Buttons.Text = value; }
}
// Caps
public String nButtons
{
set { lblnButtons.Text = value; }
}
public String nDPads
{
set { lblnDPad.Text = value; }
}
public String nTSticks
{
set { lblnTSticks.Text = value; }
}
public String nTriggers
{
set { lblnTriggers.Text = value; }
}
#endregion
#region Enables
public Boolean DPadE
{
set { iDPad.Enabled = value; lDPad.Enabled = value; }
}
public Boolean TStickLE
{
set { iTStickXL.Enabled = value; iTStickYL.Enabled = value; iTStickBtL.Enabled = true; lTStickL.Enabled = value; }
}
public Boolean TStickRE
{
set { iTStickXR.Enabled = value; iTStickYR.Enabled = value; iTStickBtR.Enabled = true; lTStickR.Enabled = value; }
}
public Boolean TriggerLE
{
set { iTrigL.Enabled = value; lTrigL.Enabled = value; }
}
public Boolean TriggerRE
{
set { iTrigR.Enabled = value; lTrigR.Enabled = value; }
}
public Boolean ShoulderLE
{
set { iShL.Enabled = value; lH0.Enabled = value; }
}
public Boolean ShoulderRE
{
set { iShR.Enabled = value; lH1.Enabled = value; }
}
public Boolean StartE
{
set { iBtStart.Enabled = value; lH2.Enabled = value; }
}
public Boolean BackE
{
set { iBtBack.Enabled = value; lH3.Enabled = value; }
}
public Boolean ButtonE
{
set { lbl1Buttons.Enabled = value; lB.Enabled = value; }
}
#endregion
}
}

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

@ -15,40 +15,63 @@ namespace SCJMapper_V2
/// In addition provide some static tools to handle JS props here in one place
/// Also owns the GUI i.e. the user control that shows all values
/// </summary>
public class JoystickCls
public class JoystickCls : DeviceCls
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
private static readonly AppSettings appSettings = new AppSettings( );
#region Static Items
public const String DeviceName = "joystick"; // the device name used throughout this app
public new const String DeviceName = "joystick"; // the device name used throughout this app
public const String JsUnknown = "jsx_";
public const String BlendedJsInput = JsUnknown + "reserved"; // the device name used throughout this app
public new const String BlendedInput = "jsx_reserved";
static private int JSnum_UNKNOWN = 0;
static public int JSnum_MAX = 8; // can only assign 4 jsN devices in SC
static public System.Drawing.Color[] JColor = (System.Drawing.Color[])MyColors.JColor.Clone(); // default
/// <summary>
/// Reassigns the mapping color based on the jsAssignment list given
/// i.e. prepare the mapping colors for a given jsN assignment
/// </summary>
/// <param name="newJsList">List of 0.. tabs where the value is the jsN number </param>
static public void ReassignJsColor( List<int> newJsList )
{
// the default colors are aligned with the tabs - the tabs color is never changed but the jsN may
// i.e. if the first Tab is assigned as js2 then the second MapColor must get the color of the first Tab
int idx = 0;
foreach ( int i in newJsList ) {
// walk through the tabs
if ( i > 0 ) {
JColor[i - 1] = MyColors.JColor[idx++];
// this is the jsN for the tab indexed (make it 0 based)
MyColors.MapColor[i - 1] = MyColors.TabColor[idx];
}
idx++;
}
}
/// <summary>
/// Returns the currently valid color for a jsN assignment
/// </summary>
/// <param name="jsN">The jsN number of the command</param>
/// <returns>A color</returns>
static public System.Drawing.Color JsNColor( int jsN )
{
if ( jsN == JSnum_UNKNOWN ) return MyColors.BlendedColor;
if ( jsN < 1 ) return MyColors.ErrorColor;
if ( jsN > JoystickCls.JSnum_MAX ) return MyColors.ErrorColor;
return MyColors.MapColor[jsN - 1]; // jsN is 1 based, color array is 0 based
}
/// <summary>
/// Returns true if the devicename is a joystick
/// </summary>
/// <param name="device"></param>
/// <returns></returns>
static public Boolean IsJoystick( String device )
static public new Boolean IsDevice( String device )
{
return ( device == DeviceName );
}
@ -100,7 +123,7 @@ namespace SCJMapper_V2
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
static public Bool IsJsN( String input )
static public Boolean IsJsN( String input )
{
return rgx_js.IsMatch( input );
}
@ -181,7 +204,7 @@ namespace SCJMapper_V2
private bool m_activated = false;
private UC_JoyPanel m_jPanel = null; // the GUI panel
private TabPage m_jTab = null;
internal int MyTabPageIndex = -1;
/// <summary>
/// Returns a CryEngine compatible hat direction
@ -202,7 +225,7 @@ namespace SCJMapper_V2
/// <summary>
/// The JS ProductName property
/// </summary>
public String DevName { get { return m_device.Properties.ProductName; } }
public override String DevName { get { return m_device.Properties.ProductName; } }
/// <summary>
/// The JS Instance GUID for multiple device support (VJoy gets 2 of the same name)
/// </summary>
@ -220,12 +243,21 @@ namespace SCJMapper_V2
set { m_jPanel.JsAssignment = value; }
}
/// <summary>
/// Returns the mapping color for this device
/// </summary>
public override System.Drawing.Color MapColor
{
get { return JsNColor( JSAssignment ); }
}
// device props
public int AxisCount { get { return m_device.Capabilities.AxeCount; } }
public int ButtonCount { get { return m_device.Capabilities.ButtonCount; } }
public int POVCount { get { return m_device.Capabilities.PovCount; } }
public Boolean Activated
public override Boolean Activated
{
get { return m_activated;}
set { m_activated = value;
@ -240,15 +272,15 @@ namespace SCJMapper_V2
/// <param name="device">A DXInput device</param>
/// <param name="hwnd">The WinHandle of the main window</param>
/// <param name="panel">The respective JS panel to show the properties</param>
public JoystickCls( Joystick device, Control hwnd, int joystickNum, UC_JoyPanel panel, TabPage tab )
public JoystickCls( Joystick device, Control hwnd, int joystickNum, UC_JoyPanel panel, int tabIndex )
{
log.DebugFormat( "ctor - Entry with {0}", device.Information.ProductName );
log.DebugFormat( "JoystickCls ctor - Entry with {0}", device.Information.ProductName );
m_device = device;
m_hwnd = hwnd;
m_joystickNumber = joystickNum;
m_jPanel = panel;
m_jTab = tab;
MyTabPageIndex = tabIndex;
Activated = false;
m_senseLimit = AppConfiguration.AppConfig.jsSenseLimit; // can be changed in the app.config file if it is still too little
@ -296,7 +328,7 @@ namespace SCJMapper_V2
/// <summary>
/// Shutdown device access
/// </summary>
public void FinishDX( )
public override void FinishDX( )
{
if ( null != m_device ) {
log.DebugFormat( "Release DirectInput device: {0}", m_device.Information.ProductName );
@ -314,7 +346,7 @@ namespace SCJMapper_V2
/// <summary>
/// Tells the Joystick to re-read settings
/// </summary>
public void ApplySettings( )
public override void ApplySettings( )
{
appSettings.Reload( );
@ -422,7 +454,7 @@ namespace SCJMapper_V2
/// Find the last change the user did on that device
/// </summary>
/// <returns>The last action as CryEngine compatible string</returns>
public String GetLastChange( )
public override String GetLastChange( )
{
// TODO: Expand this out into a joystick class (see commit for details)
Dictionary<string, string> axies = new Dictionary<string, string>( )
@ -664,7 +696,7 @@ namespace SCJMapper_V2
/// <summary>
/// Collect the current data from the device
/// </summary>
public void GetData( )
public override void GetData( )
{
// Make sure there is a valid device.
if ( null == m_device )

@ -45,10 +45,16 @@ namespace SCJMapper_V2
public void ResetJsNAssignment( )
{
ClearJsNAssignment( );
foreach ( JoystickCls j in this ) j.JSAssignment = 0;
if ( this.Count > 0 ) this[0].JSAssignment = this[0].MyTabPageIndex + 1;
if ( this.Count > 1 ) this[1].JSAssignment = this[1].MyTabPageIndex + 1;
}
public void ClearJsNAssignment( )
{
foreach ( JoystickCls j in this ) j.JSAssignment = 0;
if ( this.Count > 0 ) this[0].JSAssignment = 1;
if ( this.Count > 1 ) this[1].JSAssignment = 2;
}

@ -1,26 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
namespace SCJMapper_V2
{
/// <summary>
/// Provide the colors used
/// </summary>
class MyColors
{
static public Color[] JColor = { Color.LightGreen, Color.LightBlue, Color.Khaki, Color.LightSalmon, Color.Beige, Color.Yellow, Color.Plum, Color.Lavender };
static public Color UnassignedColor = Color.WhiteSmoke;
static public Color DirtyColor = Color.Tomato;
static public Color SuccessColor = Color.GreenYellow;
static public Color ValidColor = Color.White;
static public Color InvalidColor = Color.Tomato;
static public Color ErrorColor = Color.Gold;
static public Color ProfileColor = Color.DarkKhaki;
static public Color MappingColor = Color.DarkSeaGreen;
}
}

@ -0,0 +1,291 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SharpDX.DirectInput;
using System.Windows.Forms;
using SharpDX;
namespace SCJMapper_V2
{
/// <summary>
/// Handles one Keyboard device as DXInput device
/// In addition provide some static tools to handle KBD props here in one place
/// </summary>
public class KeyboardCls : DeviceCls
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
#region Static Items
public new const String DeviceName = "keyboard"; // the device name used throughout this app
public new const String BlendedInput = " "; // the device name used throughout this app
/// <summary>
/// Returns the currently valid color
/// </summary>
/// <returns>A color</returns>
static public System.Drawing.Color KbdColor( )
{
return MyColors.KeyboardColor;
}
/// <summary>
/// Returns true if the devicename is a joystick
/// </summary>
/// <param name="device"></param>
/// <returns></returns>
static new public Boolean IsDevice( String device )
{
return ( device == DeviceName );
}
// See also SC keybinding_localization.xml
// space, tab, semicolon, apostrophe, insert, left, right, up, down, home, pgup, pgdown, end, backspace
// lbracket, rbracket, np_0, np_1.., np_period, np_divide f1.., equal, minus, slash, comma, enter, backslash, equals,
// capslock
// Modifiers: lalt, ralt, lctrl, rctrl (e.g. ralt+l, lshift+lctrl+1, lalt+lctrl+1)
/// <summary>
/// Translate the DX Keypressed list into SC keycode string
/// </summary>
/// <param name="pressedKeys">The list of pressed DX keys</param>
/// <returns>The SC keycode string</returns>
public static String DXKeyboardCmd( List<Key> pressedKeys )
{
String altMod = "";
String shiftMod = "";
String ctrlMod = "";
String key = "";
foreach ( Key k in pressedKeys ) {
switch ( ( int )k ) {
// handle modifiers first
case ( int )Key.LeftAlt: altMod += "lalt+"; break;
case ( int )Key.RightAlt: altMod += "ralt+"; break;
case ( int )Key.LeftShift: shiftMod += "lshift+"; break;
case ( int )Key.RightShift: shiftMod += "rshift+"; break;
case ( int )Key.LeftControl: ctrlMod += "lctrl+"; break;
case ( int )Key.RightControl: ctrlMod += "rctrl+"; break;
// all keys where the DX name does not match the SC name
// Numpad
case ( int )Key.NumberLock: key += "numlock+"; break;
case ( int )Key.Divide: key += "np_divide+"; break;
case ( int )Key.Multiply: key += "np_multiply+"; break;
case ( int )Key.Subtract: key += "np_subtract+"; break;
case ( int )Key.Add: key += "np_add+"; break;
case ( int )Key.Decimal: key += "np_period+"; break;
case ( int )Key.NumberPadEnter: key += "np_enter+"; break;
case ( int )Key.NumberPad0: key += "np_0+"; break;
case ( int )Key.NumberPad1: key += "np_1+"; break;
case ( int )Key.NumberPad2: key += "np_2+"; break;
case ( int )Key.NumberPad3: key += "np_3+"; break;
case ( int )Key.NumberPad4: key += "np_4+"; break;
case ( int )Key.NumberPad5: key += "np_5+"; break;
case ( int )Key.NumberPad6: key += "np_6+"; break;
case ( int )Key.NumberPad7: key += "np_7+"; break;
case ( int )Key.NumberPad8: key += "np_8+"; break;
case ( int )Key.NumberPad9: key += "np_9+"; break;
// Digits
case ( int )Key.D0: key += "0+"; break;
case ( int )Key.D1: key += "1+"; break;
case ( int )Key.D2: key += "2+"; break;
case ( int )Key.D3: key += "3+"; break;
case ( int )Key.D4: key += "4+"; break;
case ( int )Key.D5: key += "5+"; break;
case ( int )Key.D6: key += "6+"; break;
case ( int )Key.D7: key += "7+"; break;
case ( int )Key.D8: key += "8+"; break;
case ( int )Key.D9: key += "9+"; break;
// navigation
case ( int )Key.Insert: key += "insert+"; break;
case ( int )Key.Home: key += "home+"; break;
case ( int )Key.Delete: key += "delete+"; break;
case ( int )Key.End: key += "end+"; break;
case ( int )Key.PageUp: key += "pgup+"; break;
case ( int )Key.PageDown: key += "pgdown+"; break;
case ( int )Key.PrintScreen: key += "print+"; break;
case ( int )Key.ScrollLock: key += "scrolllock+"; break;
case ( int )Key.Pause: key += "pause+"; break;
// Arrows
case ( int )Key.Up: key += "up+"; break;
case ( int )Key.Down: key += "down+"; break;
case ( int )Key.Left: key += "left+"; break;
case ( int )Key.Right: key += "right+"; break;
// non letters
case ( int )Key.Escape: key += "escape+"; break;
case ( int )Key.Minus: key += "minus+"; break;
case ( int )Key.Equals: key += "equal+"; break;
case ( int )Key.Grave: key += ""; break; // "grave+"; break; // reserved for Console
case ( int )Key.Underline: key += "underline+"; break;
case ( int )Key.Back: key += "backspace+"; break;
case ( int )Key.Tab: key += "tab+"; break;
case ( int )Key.LeftBracket: key += "lbracket+"; break;
case ( int )Key.RightBracket: key += "rbracket+"; break;
case ( int )Key.Return: key += "enter+"; break;
case ( int )Key.Capital: key += "capslock+"; break;
case ( int )Key.Colon: key += "colon+"; break;
case ( int )Key.Backslash: key += "backslash+"; break;
case ( int )Key.Comma: key += "comma+"; break;
case ( int )Key.Period: key += "period+"; break;
case ( int )Key.Slash: key += "slash+"; break;
case ( int )Key.Space: key += "space+"; break;
case ( int )Key.Semicolon: key += "semicolon+"; break;
case ( int )Key.Apostrophe: key += "apostrophe+"; break;
// all where the lowercase DX name matches the SC name
default:
if ( ( ( int )k >= ( int )Key.Q ) && ( ( int )k <= ( int )Key.P ) ) key += k.ToString( ).ToLowerInvariant( ) + "+"; // ranges are based on the enum values...
else if ( ( ( int )k >= ( int )Key.A ) && ( ( int )k <= ( int )Key.L ) ) key += k.ToString( ).ToLowerInvariant( ) + "+"; // ranges are based on the enum values...
else if ( ( ( int )k >= ( int )Key.Z ) && ( ( int )k <= ( int )Key.M ) ) key += k.ToString( ).ToLowerInvariant( ) + "+"; // ranges are based on the enum values...
else if ( ( ( int )k >= ( int )Key.F1 ) && ( ( int )k <= ( int )Key.F10 ) ) key += k.ToString( ).ToLowerInvariant( ) + "+"; // ranges are based on the enum values...
else if ( ( ( int )k >= ( int )Key.F11 ) && ( ( int )k <= ( int )Key.F15 ) ) key += k.ToString( ).ToLowerInvariant( ) + "+"; // ranges are based on the enum values...
else { } // no other ones handled
break;
}
}
key = altMod + shiftMod + ctrlMod + key; // combine in proper order
return key.TrimEnd( new char[] { '+' } ); // return killing the last +
}
#endregion
private Keyboard m_device;
private KeyboardState m_state = new KeyboardState( );
private Control m_hwnd;
private bool m_activated = false;
/// <summary>
/// The JS ProductName property
/// </summary>
public override String DevName { get { return m_device.Properties.ProductName; } }
/// <summary>
/// The JS Instance GUID for multiple device support (VJoy gets 2 of the same name)
/// </summary>
public String DevInstanceGUID { get { return m_device.Information.InstanceGuid.ToString( ); } }
/// <summary>
/// Returns the mapping color for this device
/// </summary>
public override System.Drawing.Color MapColor
{
get { return MyColors.KeyboardColor; }
}
public override Boolean Activated
{
get { return m_activated; }
set
{
m_activated = value;
if ( m_activated == false ) m_device.Unacquire( ); // explicitely if not longer active
}
}
/// <summary>
/// ctor and init
/// </summary>
/// <param name="device">A DXInput device</param>
/// <param name="hwnd">The WinHandle of the main window</param>
public KeyboardCls( Keyboard device, Control hwnd )
{
log.DebugFormat( "KeyboardCls ctor - Entry with {0}", device.Information.ProductName );
m_device = device;
m_hwnd = hwnd;
Activated = false;
// Set BufferSize in order to use buffered data.
m_device.Properties.BufferSize = 128;
log.Debug( "Get KBD Object" );
try {
// Set the data format to the c_dfDIJoystick pre-defined format.
//m_device.SetDataFormat( DeviceDataFormat.Joystick );
// Set the cooperative level for the device.
m_device.SetCooperativeLevel( m_hwnd, CooperativeLevel.NonExclusive | CooperativeLevel.Background );
// Enumerate all the objects on the device.
}
catch ( Exception ex ) {
log.Error( "Get Keyboard Object failed", ex );
}
Activated = true;
}
public void Deactivate( )
{
this.Activated = false;
}
public void Activate( )
{
this.Activated = true;
}
/// <summary>
/// Find the last change the user did on that device
/// </summary>
/// <returns>The last action as CryEngine compatible string</returns>
public override String GetLastChange( )
{
return DXKeyboardCmd( m_state.PressedKeys );
}
/// <summary>
/// Collect the current data from the device
/// </summary>
public override void GetData( )
{
// Make sure there is a valid device.
if ( null == m_device )
return;
// Poll the device for info.
try {
m_device.Poll( );
}
catch ( SharpDXException e ) {
if ( ( e.ResultCode == ResultCode.NotAcquired ) || ( e.ResultCode == ResultCode.InputLost ) ) {
// Check to see if either the app needs to acquire the device, or
// if the app lost the device to another process.
try {
// Acquire the device - if the (main)window is active
if ( Activated ) m_device.Acquire( );
}
catch ( SharpDXException ) {
// Failed to acquire the device. This could be because the app doesn't have focus.
return; // EXIT unaquired
}
}
else {
log.Error( "Unexpected Poll Exception", e );
return; // EXIT see ex code
}
}
// Get the state of the device - retaining the previous state to find the lates change
try { m_state = m_device.GetCurrentState( ); }
// Catch any exceptions. None will be handled here,
// any device re-aquisition will be handled above.
catch ( SharpDXException ) {
return;
}
}
}
}

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace SCJMapper_V2
{
public class MouseCls
{
// mwheel_up, mwheel_down
public static String MouseCmd(MouseEventArgs e )
{
String mbs = "";
switch ( e.Button ) {
case MouseButtons.Left: {
mbs = "mouse1";
break;
}
case MouseButtons.Middle: {
mbs = "mouse3";
break;
}
case MouseButtons.Right: {
mbs = "mouse2";
break;
}
case MouseButtons.XButton1: {
mbs = "mouse4";
break;
}
case MouseButtons.XButton2: {
mbs = "mouse5";
break;
}
}
return mbs;
}
}
}

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "2.7.0.33" )]
[assembly: AssemblyFileVersion( "2.7.0.33" )]
[assembly: AssemblyVersion( "2.8.0.34" )]
[assembly: AssemblyFileVersion( "2.8.0.34" )]

@ -124,6 +124,16 @@ namespace SCJMapper_V2.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Notes {
get {
object obj = ResourceManager.GetObject("Notes", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

@ -136,4 +136,7 @@
<data name="aurora" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\graphics\aurora.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Notes" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\graphics\Notes.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

@ -26,8 +26,8 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>33</ApplicationRevision>
<ApplicationVersion>2.7.0.%2a</ApplicationVersion>
<ApplicationRevision>34</ApplicationRevision>
<ApplicationVersion>2.8.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
@ -91,11 +91,16 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\OpenTK.GLControl.1.1.1589.5942\lib\NET40\OpenTK.GLControl.dll</HintPath>
</Reference>
<Reference Include="SharpDX">
<HintPath>$(SharpDXPackageBinDir)\SharpDX.dll</HintPath>
<Reference Include="SharpDX, Version=2.6.2.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\SharpDX.2.6.3\Bin\DirectX11-Signed-net40\SharpDX.dll</HintPath>
</Reference>
<Reference Include="SharpDX.DirectInput, Version=2.6.2.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\SharpDX.2.6.3\Bin\DirectX11-Signed-net40\SharpDX.DirectInput.dll</HintPath>
</Reference>
<Reference Include="SharpDX.DirectInput">
<HintPath>$(SharpDXPackageBinDir)\SharpDX.DirectInput.dll</HintPath>
<Reference Include="SharpDX.XInput">
<HintPath>packages\SharpDX.2.6.3\Bin\DirectX11-Signed-net40\SharpDX.XInput.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
@ -113,6 +118,10 @@
<ItemGroup>
<Compile Include="appConfiguration.cs" />
<Compile Include="AppSettings.cs" />
<Compile Include="DeviceCls.cs" />
<Compile Include="Gamepad\GamepadCls.cs" />
<Compile Include="Keyboard\KeyboardCls.cs" />
<Compile Include="Mouse\MouseCls.cs" />
<Compile Include="OGL\BezierSeries.cs" />
<Compile Include="OGL\CalcBezierCurve.cs" />
<Compile Include="Joystick\JoystickTuningParameter.cs" />
@ -144,13 +153,13 @@
<DependentUpon>FormSettings.cs</DependentUpon>
</Compile>
<Compile Include="Joystick\JoystickList.cs" />
<Compile Include="Joystick\ActionCls.cs" />
<Compile Include="Joystick\ActionMapCls.cs" />
<Compile Include="Joystick\ActionMapsCls.cs" />
<Compile Include="Joystick\ActionTree.cs" />
<Compile Include="actions\ActionCls.cs" />
<Compile Include="actions\ActionMapCls.cs" />
<Compile Include="actions\ActionMapsCls.cs" />
<Compile Include="actions\ActionTree.cs" />
<Compile Include="Joystick\DProfileReader.cs" />
<Compile Include="Joystick\JoystickCls.cs" />
<Compile Include="Joystick\MyColors.cs" />
<Compile Include="actions\MyColors.cs" />
<Compile Include="Joystick\UC_JoyPanel.cs">
<SubType>UserControl</SubType>
</Compile>
@ -169,6 +178,12 @@
<Compile Include="Joystick\UICustHeader.cs" />
<Compile Include="OGL\TriDiagonalMatrix.cs" />
<Compile Include="Joystick\xyPoints.cs" />
<Compile Include="Gamepad\UC_GpadPanel.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Gamepad\UC_GpadPanel.Designer.cs">
<DependentUpon>UC_GpadPanel.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
<SubType>Designer</SubType>
@ -195,6 +210,9 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="Gamepad\UC_GpadPanel.resx">
<DependentUpon>UC_GpadPanel.cs</DependentUpon>
</EmbeddedResource>
<None Include="app.config" />
<None Include="graphics\SB_BigSight.dds">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
@ -241,6 +259,7 @@
<Content Include="graphics\Joystick.ico" />
<Content Include="graphics\keyboard_key.ico" />
<Content Include="graphics\map.png" />
<None Include="graphics\Notes.png" />
<Content Include="graphics\PS3.ico" />
<Content Include="graphics\Readme.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
@ -270,13 +289,14 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="packages\SharpDX.2.6.2\build\SharpDX.targets" Condition="Exists('packages\SharpDX.2.6.2\build\SharpDX.targets')" />
<Import Project="packages\SharpDX.2.6.3\build\SharpDX.targets" Condition="Exists('packages\SharpDX.2.6.3\build\SharpDX.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\SharpDX.2.6.2\build\SharpDX.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\SharpDX.2.6.2\build\SharpDX.targets'))" />
<Error Condition="!Exists('packages\SharpDX.2.6.3\build\SharpDX.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\SharpDX.2.6.3\build\SharpDX.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

@ -27,7 +27,7 @@ namespace SCJMapper_V2
static public String DevID( String device )
{
switch ( device.ToLower( ) ) {
case "keyboard": return "K";
case KeyboardCls.DeviceName: return "K";
case JoystickCls.DeviceName: return "J";
case "xboxpad": return "X";
case "ps3pad": return "P";
@ -43,7 +43,7 @@ namespace SCJMapper_V2
static public String DeviceFromID( String devID )
{
switch ( devID ) {
case "K": return "keyboard";
case "K": return KeyboardCls.DeviceName;
case "J": return JoystickCls.DeviceName;
case "X": return "xboxpad";
case "P": return "ps3pad";
@ -74,7 +74,7 @@ namespace SCJMapper_V2
/// </summary>
/// <param name="newJsList">The JsN reassign list</param>
/// <returns>The action copy with reassigned input</returns>
public ActionCls ReassignJsN( Dictionary<int,int> newJsList )
public ActionCls ReassignJsN( Dictionary<int, int> newJsList )
{
ActionCls newAc = new ActionCls( );
// full copy from 'this'
@ -83,10 +83,12 @@ namespace SCJMapper_V2
newAc.device = this.device;
newAc.defBinding = this.defBinding;
newAc.input = this.input;
// reassign the jsX part
int oldJsN = JoystickCls.JSNum(this.input);
if ( JoystickCls.IsJSValid( oldJsN ) ) {
if ( newJsList.ContainsKey(oldJsN) ) newAc.input = JoystickCls.ReassignJSTag( this.input, newJsList[oldJsN] );
// reassign the jsX part for Joystick commands
if ( ( this.device == JoystickCls.DeviceName ) && ( newAc.device == JoystickCls.DeviceName ) ) {
int oldJsN = JoystickCls.JSNum( this.input );
if ( JoystickCls.IsJSValid( oldJsN ) ) {
if ( newJsList.ContainsKey( oldJsN ) ) newAc.input = JoystickCls.ReassignJSTag( this.input, newJsList[oldJsN] );
}
}
return newAc;
@ -143,7 +145,7 @@ namespace SCJMapper_V2
if ( reader.HasAttributes ) {
device = reader["device"];
input = reader["input"];
if ( input == JoystickCls.BlendedJsInput ) input = ""; // don't carry jsx reserved into the action
if ( input == JoystickCls.BlendedInput ) input = ""; // don't carry jsx reserved into the action
key = DevID( device ) + name; // unique id of the action
// Move the reader back to the element node.
reader.ReadStartElement( "rebind" );

@ -64,6 +64,14 @@ namespace SCJMapper_V2
get { return m_GUIDs; }
}
/// <summary>
/// Clears a read but not longer known entry
/// </summary>
public void Clear_jsEntry(int index)
{
m_js[index] = "";
m_GUIDs[index] = "";
}
// provide access to Tuning items of the Options obj to the owner

@ -38,9 +38,13 @@ namespace SCJMapper_V2
public Boolean Dirty { get; set; }
/// <summary>
/// Blend (insert jsx_reserved") into undmapped items
/// Blend (insert jsx_reserved") into undmapped Joystick items
/// </summary>
public Boolean BlendUnmapped { get; set; }
public Boolean BlendUnmappedJS { get; set; }
/// <summary>
/// Blend (insert xi_reserved") into undmapped Gamepad items
/// </summary>
public Boolean BlendUnmappedGP { get; set; }
/// <summary>
/// a comma separated list of actionmaps to ignore
@ -53,9 +57,11 @@ namespace SCJMapper_V2
/// <summary>
/// ctor
/// </summary>
public ActionTree( Boolean blendUnmapped, JoystickList jsList )
public ActionTree( Boolean blendUnmappedJS, Boolean blendUnmappedGP, JoystickList jsList )
{
BlendUnmapped = blendUnmapped;
BlendUnmappedJS = blendUnmappedJS;
BlendUnmappedGP = blendUnmappedGP;
m_jsList = jsList;
IgnoreMaps = ""; // nothing to ignore
@ -69,7 +75,7 @@ namespace SCJMapper_V2
/// <returns>The ActionTree Copy with reassigned input</returns>
public ActionTree ReassignJsN( Dictionary<int, int> newJsList )
{
ActionTree nTree = new ActionTree( BlendUnmapped, m_jsList );
ActionTree nTree = new ActionTree( BlendUnmappedJS, BlendUnmappedGP, m_jsList );
// full copy from 'this'
nTree.m_MasterTree = this.m_MasterTree;
nTree.m_ctrl = this.m_ctrl;
@ -101,6 +107,20 @@ namespace SCJMapper_V2
return nn;
}
private void UpdateMasterNode( TreeNode node )
{
// copy to master node
TreeNode[] masterNode = m_MasterTree.Nodes.Find( node.Name, true ); // find the same node in master
if ( masterNode.Length == 0 ) throw new IndexOutOfRangeException( "ActionTree ERROR - cannot find synched node in master" ); // OUT OF SYNC
// could return more than one if the action is the same in different actionmaps
foreach ( TreeNode mtn in masterNode ) {
if ( mtn.Parent.Text == node.Parent.Text ) {
mtn.Text = node.Text;
mtn.BackColor = node.BackColor;
}
}
}
/// <summary>
/// Apply the filter to the GUI TreeView
@ -211,6 +231,7 @@ namespace SCJMapper_V2
// process items
for ( int ei=1; ei < elem.Length; ei += 2 ) { // step 2 - action;defaultBinding come in pairs
if ( !String.IsNullOrEmpty( elem[ei] ) ) {
// default assignments
String action = elem[ei].Substring( 1 );
String defBinding = elem[ei + 1].Substring( 0 );
cn = new TreeNode( action ); cn.Name = elem[ei]; cn.BackColor = Color.White; // name with the key it to find it..
@ -223,29 +244,48 @@ namespace SCJMapper_V2
ac = new ActionCls( ); ac.key = cn.Name; ac.name = action; ac.device = device; ac.defBinding = defBinding;
acm.Add( ac ); // add to our map
if ( applyDefaults ) {
// right now this application only works with joysticks
if ( JoystickCls.IsJoystick( ac.device ) ) {
// apply the default mappings
if ( JoystickCls.IsDevice( ac.device ) ) {
int jNum = JoystickCls.JSNum( ac.defBinding );
if ( JoystickCls.IsJSValid( jNum ) ) {
ac.input = ac.defBinding;
cn.Text += " - " + ac.defBinding;
cn.BackColor = JoystickCls.JColor[jNum - 1]; // color list is 0 based
cn.Text += " - " + ac.defBinding; cn.BackColor = JoystickCls.JsNColor( jNum );
}
else if ( BlendUnmappedJS ) {
// jsx_reserved gets here
ac.input = JoystickCls.BlendedInput;
cn.Text += " - " + JoystickCls.BlendedInput; cn.BackColor = MyColors.BlendedColor;
}
}
else if ( GamepadCls.IsDevice( ac.device ) ) {
if ( GamepadCls.IsXiValid( ac.defBinding ) ) {
ac.input = ac.defBinding;
cn.Text += " - " + ac.defBinding; cn.BackColor = GamepadCls.XiColor( );
}
else if ( BlendUnmappedGP ) {
// xi_reserved gets here
ac.input = GamepadCls.BlendedInput;
cn.Text += " - " + GamepadCls.BlendedInput; cn.BackColor = MyColors.BlendedColor;
}
else {
if ( BlendUnmapped ) {
ac.input = JoystickCls.BlendedJsInput;
cn.Text += " - " + JoystickCls.BlendedJsInput;
}
}
else if ( KeyboardCls.IsDevice( ac.device ) ) {
if ( !String.IsNullOrEmpty( ac.defBinding ) ) {
ac.input = ac.defBinding;
cn.Text += " - " + ac.defBinding; cn.BackColor = KeyboardCls.KbdColor( );
}
}
}
// Don't apply defaults - but blend if checked
else {
// init empty
if ( JoystickCls.IsJoystick( ac.device ) && BlendUnmapped ) {
ac.input = JoystickCls.BlendedJsInput;
cn.Text += " - " + JoystickCls.BlendedJsInput;
if ( JoystickCls.IsDevice( ac.device ) && BlendUnmappedJS ) {
ac.input = JoystickCls.BlendedInput;
cn.Text += " - " + JoystickCls.BlendedInput; cn.BackColor = MyColors.BlendedColor;
}
else if ( GamepadCls.IsDevice( ac.device ) && BlendUnmappedGP ) {
ac.input = GamepadCls.BlendedInput;
cn.Text += " - " + GamepadCls.BlendedInput; cn.BackColor = MyColors.BlendedColor;
}
}
}
@ -279,64 +319,124 @@ namespace SCJMapper_V2
}
// input is like js1_button3
// input is like js1_button3 OR keyboard such as lctrl+x (mouse is keyboard too)
/// <summary>
/// Apply an update the the treenode
/// First apply to the GUI tree where the selection happend then copy it over to master tree
/// </summary>
/// <param name="input">The new Text property</param>
public void UpdateSelectedItem( String input )
public void UpdateSelectedItem( String input, DeviceCls.InputKind inKind )
{
log.Debug( "UpdateSelectedItem - Entry" );
if ( Ctrl.SelectedNode == null ) return;
ActionCls ac = FindAction( Ctrl.SelectedNode.Parent.Name, Ctrl.SelectedNode.Name );
UpdateActionFromInput( input, ac );
UpdateNodeFromAction( Ctrl.SelectedNode, ac, inKind );
}
/// <summary>
/// Find an action with name in a actionmap
/// </summary>
/// <param name="actionMap">The actionmap name</param>
/// <param name="action">The action</param>
/// <returns>An action or null if not found</returns>
private ActionCls FindAction( String actionMap, String action )
{
log.Debug( "UpdateAction - Entry" );
// Apply the input to the ActionTree
ActionCls ac = null;
ActionMapCls ACM = ActionMaps.Find( delegate( ActionMapCls acm ) { return acm.name == Ctrl.SelectedNode.Parent.Name; } );
if ( ACM != null ) {
ac = ACM.Find( delegate( ActionCls _AC ) { return _AC.key == Ctrl.SelectedNode.Name; } );
if ( ac != null ) {
if ( String.IsNullOrEmpty( input ) ) {
// unmapped
if ( JoystickCls.IsJoystick( ac.device ) && BlendUnmapped ) ac.input = JoystickCls.BlendedJsInput;
else ac.input = "";
}
else {
// mapped
ac.input = input;
}
Dirty = true;
}
else {
log.Error( "UpdateSelectedItem - Action Not found in tree" );
return; // ERROR - Action Not found in tree
}
ActionMapCls ACM = ActionMaps.Find( delegate( ActionMapCls acm ) { return acm.name == actionMap; } );
if ( ACM != null ) ac = ACM.Find( delegate( ActionCls _AC ) { return _AC.key == action; } );
if ( ac == null ) {
log.Error( "FindAction - Action Not found in tree" );
return null; // ERROR - Action Not found in tree
}
return ac;
}
/// <summary>
/// Updates an action with a new input (command)
/// </summary>
/// <param name="input">The input command</param>
/// <param name="action">The action to update</param>
/// <param name="inKind">The input device</param>
private void UpdateActionFromInput( String input, ActionCls action )
{
log.Debug( "UpdateAction - Entry" );
if ( action == null ) return;
// Apply the input to the ActionTree
if ( String.IsNullOrEmpty( input ) ) {
// unmapped - handle the blended ones from setting
if ( JoystickCls.IsDevice( action.device ) && BlendUnmappedJS ) action.input = JoystickCls.BlendedInput;
else if ( GamepadCls.IsDevice( action.device ) && BlendUnmappedGP ) action.input = GamepadCls.BlendedInput;
else action.input = "";
}
else {
// mapped ones
action.input = input;
}
Dirty = true;
}
/// <summary>
/// Apply an update from the action to the treenode
/// First apply to the GUI tree where the selection happend then copy it over to master tree
/// </summary>
/// <param name="input">The input command</param>
/// <param name="node">The TreeNode to update</param>
/// <param name="action">The action that carries the update</param>
/// <param name="inKind">The input device</param>
private void UpdateNodeFromAction( TreeNode node, ActionCls action, DeviceCls.InputKind inKind )
{
log.Debug( "UpdateNode - Entry" );
if ( action == null ) return;
// applies only to ActionNodes
if ( Ctrl.SelectedNode.Level == 1 ) {
String[] elements = Ctrl.SelectedNode.Text.Split( );
if ( String.IsNullOrEmpty( input ) ) {
// unmapped
if ( JoystickCls.IsJoystick( ac.device ) && BlendUnmapped ) Ctrl.SelectedNode.Text = elements[0] + " - " + JoystickCls.BlendedJsInput;
else Ctrl.SelectedNode.Text = elements[0];
Ctrl.SelectedNode.BackColor = Color.White;
if ( node.Level == 1 ) {
// input is either "" or a valid mapping or a blended mapping
if ( String.IsNullOrEmpty( action.input ) ) {
// new unmapped
node.Text = action.name;
node.BackColor = MyColors.UnassignedColor;
}
// blended mapped ones - can only get a Blend Background
else if ( JoystickCls.IsDevice( action.device ) && ( action.input == JoystickCls.BlendedInput ) ) {
node.Text = action.name + " - " + action.input;
node.BackColor = MyColors.BlendedColor;
}
else if ( GamepadCls.IsDevice( action.device ) && ( action.input == GamepadCls.BlendedInput ) ) {
node.Text = action.name + " - " + action.input;
node.BackColor = MyColors.BlendedColor;
}
else if ( action.input == DeviceCls.BlendedInput ) {
// Manually Blended input
node.Text = action.name + " - " + action.input;
node.BackColor = MyColors.BlendedColor;
}
else {
// mapped
Ctrl.SelectedNode.Text = elements[0] + " - " + input;
int jNum = JoystickCls.JSNum( input );
Ctrl.SelectedNode.BackColor = JoystickCls.JColor[jNum - 1]; // color list is 0 based
// mapped ( regular ones )
node.Text = action.name + " - " + action.input;
// background is along the input
if ( inKind == DeviceCls.InputKind.Joystick ) {
int jNum = JoystickCls.JSNum( action.input );
node.BackColor = JoystickCls.JsNColor( jNum );
}
else if ( inKind == DeviceCls.InputKind.Gamepad ) {
node.BackColor = GamepadCls.XiColor( );
}
else if ( inKind == DeviceCls.InputKind.Kbd ) {
node.BackColor = KeyboardCls.KbdColor( );
}
else {
// ?? what else
node.BackColor = MyColors.UnassignedColor;
}
}
// copy to master node
TreeNode[] masterNode = m_MasterTree.Nodes.Find( Ctrl.SelectedNode.Name, true ); // find the same node in master
if ( masterNode.Length == 0 ) throw new IndexOutOfRangeException( "ActionTree ERROR - cannot find synched node in master" ); // OUT OF SYNC
masterNode[0].Text = Ctrl.SelectedNode.Text;
masterNode[0].BackColor = Ctrl.SelectedNode.BackColor;
UpdateMasterNode( node );
}
}
@ -346,9 +446,9 @@ namespace SCJMapper_V2
/// Loads the mappings back into the treeview control
/// Note: this takes a while as the list grows...
/// </summary>
public void ReloadCtrl( )
public void ReloadTreeView( )
{
log.Debug( "ReloadCtrl - Entry" );
log.Debug( "ReloadTreeView - Entry" );
foreach ( ActionMapCls acm in ActionMaps ) {
if ( IgnoreMaps.Contains( "," + acm.name + "," ) ) break; // next
@ -358,25 +458,29 @@ namespace SCJMapper_V2
foreach ( ActionCls ac in acm ) {
try {
TreeNode tnl = amTn.Nodes[ac.key];
String[] elements = tnl.Text.Split( );
if ( String.IsNullOrEmpty( ac.input ) || ( ac.input == JoystickCls.BlendedJsInput ) ) {
// grabed input is not mapped
if ( JoystickCls.IsJoystick( ac.device ) && BlendUnmapped ) {
ac.input = JoystickCls.BlendedJsInput;
tnl.Text = elements[0] + " - " + JoystickCls.BlendedJsInput;
}
else {
ac.input = "";
tnl.Text = elements[0];
}
tnl.BackColor = Color.White;
UpdateActionFromInput(ac.input, ac ); // this may apply (un)Blending if needed
// input kind priority first
if ( JoystickCls.IsJsN( ac.input ) ) {
UpdateNodeFromAction( tnl, ac, DeviceCls.InputKind.Joystick );
}
else if ( GamepadCls.IsXiValid( ac.input ) ) {
UpdateNodeFromAction( tnl, ac, DeviceCls.InputKind.Gamepad );
}
// device priority second
else if ( JoystickCls.IsDevice( ac.device ) ) {
UpdateNodeFromAction( tnl, ac, DeviceCls.InputKind.Joystick );
}
else if ( GamepadCls.IsDevice( ac.device ) ) {
UpdateNodeFromAction( tnl, ac, DeviceCls.InputKind.Gamepad );
}
else if ( KeyboardCls.IsDevice( ac.device ) ) {
UpdateNodeFromAction( tnl, ac, DeviceCls.InputKind.Kbd );
}
else {
// mapped
int jNum = JoystickCls.JSNum( ac.input );
tnl.Text = elements[0] + " - " + ac.input;
tnl.BackColor = JoystickCls.JColor[jNum - 1]; // color list is 0 based
// ?? defaults to unassigned color
UpdateNodeFromAction( tnl, ac, DeviceCls.InputKind.Other );
}
}
catch {
; // key not found
@ -450,7 +554,7 @@ namespace SCJMapper_V2
String repList = "";
// JS assignments
for ( int i=0; i < JoystickCls.JSnum_MAX; i++ ) {
if ( !String.IsNullOrEmpty( ActionMaps.jsN[i] ) ) repList += String.Format( "** js{0} = {1}\n", i+1, ActionMaps.jsN[i] );
if ( !String.IsNullOrEmpty( ActionMaps.jsN[i] ) ) repList += String.Format( "** js{0} = {1}\n", i + 1, ActionMaps.jsN[i] );
}
// now the mapped actions
repList += String.Format( "\n" );
@ -458,8 +562,8 @@ namespace SCJMapper_V2
String rep = String.Format( "*** {0}\n", acm.name );
repList += rep;
foreach ( ActionCls ac in acm ) {
if ( !String.IsNullOrEmpty( ac.input ) && !( ac.input == JoystickCls.BlendedJsInput ) ) {
rep = String.Format( " {0} - {1} - ({2})\n", ac.name.PadRight( 35 ), ac.input.PadRight( 20 ), ac.device );
if ( !String.IsNullOrEmpty( ac.input ) && !( ac.input == JoystickCls.BlendedInput ) ) {
rep = String.Format( " {0} - {1} - ({2})\n", ac.name.PadRight( 35 ), ac.input.PadRight( 30 ), ac.device );
repList += rep;
}
}

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
namespace SCJMapper_V2
{
/// <summary>
/// Provide the colors used
/// </summary>
class MyColors
{
static public Color[] TabColor = { Color.LightGreen, Color.LightBlue, Color.Khaki, Color.LightSalmon, Color.Beige, Color.Yellow, Color.Plum, Color.MintCream };
static public Color GamepadColorDefault = Color.Pink; // will be changed on init (else we see pink..)
static public Color[] MapColor = ( System.Drawing.Color[] )TabColor.Clone( );
static public Color GamepadColor = GamepadColorDefault;
static public Color KeyboardColor = Color.Lavender;
static public Color BlendedColor = Color.LightGray;
static public Color UnassignedColor = Color.White;
static public Color DirtyColor = Color.Tomato;
static public Color SuccessColor = Color.GreenYellow;
static public Color ValidColor = Color.White;
static public Color InvalidColor = Color.Tomato;
static public Color ErrorColor = Color.Gold;
static public Color ProfileColor = Color.DarkKhaki;
static public Color MappingColor = Color.DarkSeaGreen;
static public void Reset( )
{
MapColor = ( System.Drawing.Color[] )TabColor.Clone( );
GamepadColor = GamepadColorDefault;
}
}
}

@ -1,34 +1,26 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="AppConfiguration"
type="SCJMapper_V2.AppConfiguration, SCJMapper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
allowDefinition="Everywhere" allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" />
<section name="AppConfiguration" type="SCJMapper_V2.AppConfiguration, SCJMapper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" allowDefinition="Everywhere"
allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
<!-- This is the minimal change that detects a movement of an axis
default is 150 - you may change it to get the detection less sensitive -->
<AppConfiguration jsSenseLimit="150"
scActionmaps="multiplayer,
singleplayer,
player,
flycam,
vehicle_driver,
spaceship_general,
spaceship_view,
spaceship_movement,
spaceship_targeting,
spaceship_turret,
spaceship_weapons,
spaceship_missiles,
spaceship_defensive,
spaceship_auto_weapons,
spaceship_radar,
spaceship_hud,
IFCS_controls"/>
<AppConfiguration jsSenseLimit="150" gpSenseLimit="500"
scActionmaps="multiplayer, singleplayer, player, flycam, vehicle_driver, spaceship_general, spaceship_view, spaceship_movement, spaceship_targeting,
spaceship_turret, spaceship_weapons, spaceship_missiles, spaceship_defensive, spaceship_auto_weapons, spaceship_radar, spaceship_hud, IFCS_controls" />
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="SharpDX" publicKeyToken="b4dcf0f35e5521f1" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.3.0" newVersion="2.6.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

@ -17,6 +17,10 @@ namespace SCJMapper_V2
private static readonly ConfigurationProperty _jsSenseLimit =
new ConfigurationProperty( "jsSenseLimit", typeof( int ), ( int )150, ConfigurationPropertyOptions.None );
// The gpSenseLimit property.
private static readonly ConfigurationProperty _gpSenseLimit =
new ConfigurationProperty( "gpSenseLimit", typeof( int ), ( int )500, ConfigurationPropertyOptions.None );
// The scActionmaps property.
private static String _defaultActionmaps = "multiplayer,singleplayer,player,flycam,vehicle_driver,spaceship_general,spaceship_view,spaceship_movement,spaceship_targeting,spaceship_turret"
+ ",spaceship_weapons,spaceship_missiles,spaceship_defensive,spaceship_auto_weapons,spaceship_radar,spaceship_hud,IFCS_controls";
@ -54,6 +58,19 @@ namespace SCJMapper_V2
}
}
[IntegerValidator( MinValue = 1, MaxValue = 32000, ExcludeRange = false )]
public int gpSenseLimit
{
get
{
return ( int )this["gpSenseLimit"];
}
set
{
this["gpSenseLimit"] = value;
}
}
[StringValidator( InvalidCharacters = " ~!@#$%^&*()[]{}/;'\"|\\", MinLength = 10, MaxLength = 500 )]
public String scActionmaps
{
@ -93,7 +110,7 @@ namespace SCJMapper_V2
/// <summary>
/// The axis detection sense limit
/// The Joystick axis detection sense limit
/// </summary>
static public int jsSenseLimit
{
@ -105,6 +122,19 @@ namespace SCJMapper_V2
}
}
/// <summary>
/// The Gamepad axis detection sense limit
/// </summary>
static public int gpSenseLimit
{
get
{
AppConfiguration s = GetAppSection( );
if ( s != null ) return s.gpSenseLimit;
else return 500; // default if things go wrong...
}
}
/// <summary>
/// The actionmaps supported
/// </summary>

@ -21,7 +21,7 @@
<optiontree type="shared" name="root">
<!-- Digital -->
<optiongroup name="pilot">
<optiongroup name="pilot_aim" sensitivity="0.025" />
<optiongroup name="pilot_aim" />
</optiongroup>
</optiontree>
<optiontree type="keyboard" name="root">
@ -32,19 +32,30 @@
</optiontree>
<optiontree type="xboxpad" name="root">
<!-- LS / RS -->
<optiongroup name="pilot" sensitivity_cvar="v_gamepadSensitivity" exponent="1">
<optiongroup name="pilot">
<nonlinearity_curve>
<point in="0.1" out="0.001"/>
<point in="0.2" out="0.01"/>
<point in="0.3" out="0.05"/>
<point in="0.4" out="0.075"/>
<point in="0.75" out="0.1"/>
<point in="0.8" out="0.15"/>
<point in="0.85" out="0.2"/>
<point in="0.9" out="0.45"/>
<point in="0.95" out="0.8"/>
<point in="0.1" out="0.0"/>
<point in="0.2" out="0.01"/>
<point in="0.3" out="0.02"/>
<point in="0.4" out="0.03"/>
<point in="0.5" out="0.041"/>
<point in="0.6" out="0.064"/>
<point in="0.7" out="0.105"/>
<point in="0.75" out="0.137"/>
<point in="0.8" out="0.178"/>
<point in="0.85" out="0.236"/>
<point in="0.88" out="0.283"/>
<point in="0.9" out="0.324"/>
<point in="0.91" out="0.348"/>
<point in="0.92" out="0.375"/>
<point in="0.93" out="0.408"/>
<point in="0.94" out="0.449"/>
<point in="0.95" out="0.506"/>
<point in="0.96" out="0.6"/>
<point in="0.98" out="0.8"/>
<point in="0.99" out="0.9"/>
</nonlinearity_curve>
<optiongroup name="pilot_aim" sensitivity_cvar="v_gamepadAimSensitivity" exponent_cvar="v_gamepadAimNonLinearity">
<optiongroup name="pilot_aim">
<optiongroup name="pilot_aimpitch" invert="0" />
</optiongroup>
<optiongroup name="pilot_move">
@ -61,12 +72,12 @@
<!-- Normal and twist axis -->
<optiongroup name="pilot">
<optiongroup name="pilot_move">
<optiongroup name="pilot_move_main" sensitivity_cvar="v_joystickSensitivity" exponent_cvar="v_joystickNonLinearity">
<optiongroup name="pilot_move_main">
<optiongroup name="pilot_move_x" />
<optiongroup name="pilot_move_y" />
<optiongroup name="pilot_move_z" />
</optiongroup>
<optiongroup name="pilot_move_rot" sensitivity_cvar="v_joystickTwistSensitivity" exponent_cvar="v_joystickTwistNonLinearity">
<optiongroup name="pilot_move_rot">
<optiongroup name="pilot_move_rotx" />
<optiongroup name="pilot_move_roty" />
<optiongroup name="pilot_move_rotz" />
@ -76,22 +87,21 @@
<optiongroup name="pilot_move_slider2" />
</optiongroup>
</optiongroup>
<optiongroup name="pilot_throttle" invert="1"/>
<optiongroup name="pilot_aim">
<optiongroup name="pilot_aim_main" sensitivity_cvar="v_joystickSensitivity" exponent_cvar="v_joystickNonLinearity">
<optiongroup name="pilot_aim_main">
<optiongroup name="pilot_aim_x" />
<optiongroup name="pilot_aim_y" />
</optiongroup>
<optiongroup name="pilot_aim_rot" sensitivity_cvar="v_joystickTwistSensitivity" exponent_cvar="v_joystickTwistNonLinearity">
<optiongroup name="pilot_aim_rot">
<optiongroup name="pilot_aim_rotz" />
</optiongroup>
</optiongroup>
<optiongroup name="pilot_view">
<optiongroup name="pilot_view_main" sensitivity_cvar="v_joystickSensitivity" exponent_cvar="v_joystickNonLinearity">
<optiongroup name="pilot_view_main">
<optiongroup name="pilot_view_x" />
<optiongroup name="pilot_view_y" />
</optiongroup>
<optiongroup name="pilot_view_rot" sensitivity_cvar="v_joystickTwistSensitivity" exponent_cvar="v_joystickTwistNonLinearity">
<optiongroup name="pilot_view_rot">
<optiongroup name="pilot_view_rotz" />
</optiongroup>
</optiongroup>
@ -386,7 +396,7 @@
<!-- CIG END David Campbell BHVR -->
</actionmap>
<actionmap name="spaceship_view" version="19" UILabel="@ui_CGSpaceFlight">
<actionmap name="spaceship_view" version="20" UILabel="@ui_CGSpaceFlight">
<!-- Camera view -->
<action name="v_view_yaw_left" onPress="1" onHold ="1" onRelease="1" retriggerable="1" keyboard=" " joystick="js1_hat2_left" UILabel="@ui_CIRotateViewLeft" UIDescription="@ui_CIRotateViewLeftDesc" />
<action name="v_view_yaw_right" onPress="1" onHold ="1" onRelease="1" retriggerable="1" keyboard=" " joystick="js1_hat2_right" UILabel="@ui_CIRotateViewRight" UIDescription="@ui_CIRotateViewRightDesc" />
@ -402,14 +412,14 @@
<action name="v_view_cycle_fwd" onPress="1" keyboard="insert" xboxpad="xi_triggerl_btn+xi_thumbr" joystick="js1_button6" UILabel="@ui_CICycleView" UIDescription="@ui_CICycleViewDesc" />
<action name="v_view_cycle_internal_fwd" onPress="1" keyboard="home" xboxpad="" joystick=""/>
<action name="v_view_option" onPress="1" onRelease="1" keyboard=" " xboxpad="xi_reserved" joystick="jsx_reserved"/>
<action name="v_view_mode" onPress="1" onRelease="1" keyboard="pgup" xboxpad="xi_thumbr" joystick="jsx_reserved" UILabel="@ui_CICycleViewMode" UIDescription="@ui_CICycleViewModeDesc" />
<action name="v_view_zoom_in" onPress="1" onHold ="1" keyboard="mwheel_up" xboxpad="xi_dpad_up" joystick="js1_hat1_up" UILabel="@ui_CIZoomIn" UIDescription="@ui_CIZoomInDesc" />
<action name="v_view_zoom_out" onPress="1" onHold ="1" keyboard="mwheel_down" xboxpad="xi_dpad_down" joystick="js1_hat1_down" UILabel="@ui_CIZoomOut" UIDescription="@ui_CIZoomOutDesc" />
<action name="v_view_mode" onPress="1" keyboard="pgup" xboxpad="xi_thumbr" joystick="jsx_reserved" UILabel="@ui_CICycleViewMode" UIDescription="@ui_CICycleViewModeDesc" />
<action name="v_view_zoom_in" onPress="1" onHold ="1" keyboard="mwheel_up" xboxpad="xi_triggerl_btn+xi_dpad_up" joystick="jsx_reserved" UILabel="@ui_CIZoomIn" UIDescription="@ui_CIZoomInDesc" />
<action name="v_view_zoom_out" onPress="1" onHold ="1" keyboard="mwheel_down" xboxpad="xi_triggerl_btn+xi_dpad_down" joystick="jsx_reserved" UILabel="@ui_CIZoomOut" UIDescription="@ui_CIZoomOutDesc" />
<action name="v_view_interact" onPress="1" onRelease="1" keyboard="f" xboxpad="xi_a" joystick=""/>
<action name="v_view_cycle_headlook_mode" onRelease="1" releaseTriggerThreshold="0.25" keyboard="tab" xboxpad="xi_reserved" joystick="jsx_reserved" UILabel="@ui_CIUnlockView" UIDescription="@ui_CIUnlockViewDesc" />
<action name="v_view_dynamic_focus" keyboard="maxis_z"/>
<action name="v_view_dynamic_focus_toggle" onPress="1" xboxpad="xi_thumbr" joystick="js1_button11"/>
<action name="v_view_track_target" onPress="1" onRelease="1" keyboard="lctrl+tab" xboxpad="" joystick=""/>
<action name="v_view_dynamic_focus" keyboard="maxis_z" xboxpad="xi_reserved" joystick="jsx_reserved" UILabel="@ui_CIDynamicZoomInOut" UIDescription="@ui_CIDynamicZoomInOutDesc" />
<action name="v_view_dynamic_focus_in" onPress="1" onHold="1" onRelease="1" keyboard="rbracket" xboxpad="xi_triggerl_btn+xi_dpad_up" joystick="jsx_reserved" UILabel="@ui_CIDynamicZoomIn" UIDescription="@ui_CIDynamicZoomInDesc" />
<action name="v_view_dynamic_focus_out" onPress="1" onHold="1" onRelease="1" keyboard="lbracket" xboxpad="xi_triggerl_btn+xi_dpad_down" joystick="jsx_reserved" UILabel="@ui_CIDynamicZoomOut" UIDescription="@ui_CIDynamicZoomOutDesc" />
<!-- Pad stick input options -->
<optiongroup type="xboxpad">
@ -426,7 +436,7 @@
</optiongroup>
</actionmap>
<actionmap name="spaceship_movement" version="14" UILabel="@ui_CGSpaceFlight">
<actionmap name="spaceship_movement" version="17" UILabel="@ui_CGSpaceFlight">
<!-- Action map for a spaceship piloting -->
<!-- IFCS (requires avionics) -->
@ -436,14 +446,14 @@
<action name="v_pitch_mouse" keyboard="maxis_y" UILabel="@ui_CIPitch" UIDescription="@ui_CIPitchDesc" />
<action name="v_yaw_left" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard=" " xboxpad="" joystick="jsx_reserved" UILabel="@ui_CIYawLeft" UIDescription="@ui_CIYawLeftDesc" />
<action name="v_yaw_right" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard=" " xboxpad="" joystick="jsx_reserved" UILabel="@ui_CIYawRight" UIDescription="@ui_CIYawRightDesc" />
<action name="v_yaw" xboxpad="xi_thumblx" joystick="js1_rotz" UILabel="@ui_CIYaw" UIDescription="@ui_CIYawDesc" />
<action name="v_yaw" xboxpad="xi_thumblx" joystick="js1_x" UILabel="@ui_CIYaw" UIDescription="@ui_CIYawDesc" />
<action name="v_yaw_mouse" keyboard="maxis_x" UILabel="@ui_CIYaw" UIDescription="@ui_CIYawDesc" />
<action name="v_toggle_relative_mouse_mode" onPress="1" onRelease="1" keyboard="lctrl+c" xboxpad="" joystick=""/>
<action name="v_roll_left" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard="a" xboxpad="" joystick="" UILabel="@ui_CIRollLeft" UIDescription="@ui_CIRollLeftDesc" />
<action name="v_roll_right" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard="d" xboxpad="" joystick="" UILabel="@ui_CIRollRight" UIDescription="@ui_CIRollRightDesc" />
<action name="v_roll" xboxpad="xi_triggerl_btn+xi_thumblx" joystick="js1_x" UILabel="@ui_CIRoll" UIDescription="@ui_CIRollDesc" />
<action name="v_toggle_relative_mouse_mode" onPress="1" onRelease="1" releaseTriggerDelay="0.15" keyboard="lctrl+c" xboxpad="" joystick="" UILabel="@ui_CICycleMouseMoveMode" UIDescription="@ui_CICycleMouseMoveModeDesc" />
<action name="v_roll_left" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard="a" xboxpad="" joystick="jsx_reserved" UILabel="@ui_CIRollLeft" UIDescription="@ui_CIRollLeftDesc" />
<action name="v_roll_right" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard="d" xboxpad="" joystick="jsx_reserved" UILabel="@ui_CIRollRight" UIDescription="@ui_CIRollRightDesc" />
<action name="v_roll" xboxpad="xi_triggerl_btn+xi_thumblx" joystick="js1_rotz" UILabel="@ui_CIRoll" UIDescription="@ui_CIRollDesc" />
<action name="v_throttle_toggle_minmax" onPress="1" keyboard="backspace" xboxpad="" joystick="" UILabel="@ui_CIThrottleMinMax" UIDescription="@ui_CIThrottleMinMaxDesc" />
<action name="v_throttle_zero" onPress="1" joystick="" UILabel="@ui_CIThrottleZero" UIDescription="@ui_CIThrottleZeroDesc">
<action name="v_throttle_zero" onPress="1" joystick="jsx_reserved" UILabel="@ui_CIThrottleZero" UIDescription="@ui_CIThrottleZeroDesc">
<xboxpad multiTap="2" input="xi_shoulderl" />
<keyboard multiTap="2" input="s" />
</action>
@ -452,14 +462,16 @@
</action>
<action name="v_throttle_up" onPress="1" onHold="1" onRelease="1" keyboard="w" xboxpad="xi_shoulderr" joystick="" UILabel="@ui_CIThrottleUp" UIDescription="@ui_CIThrottleUpDesc" />
<action name="v_throttle_down" onPress="1" onHold="1" onRelease="1" keyboard ="s" xboxpad="xi_shoulderl" joystick="" UILabel="@ui_CIThrottleDown" UIDescription="@ui_CIThrottleDownDesc" />
<action name="v_throttle_abs" keyboard="" xboxpad="" joystick="js1_throttlez" UILabel="@ui_CIThrottle" UIDescription="@ui_CIThrottleDesc" />
<action name="v_throttle_abs" keyboard="" xboxpad="" UILabel="@ui_CIThrottle" UIDescription="@ui_CIThrottleDesc">
<joystick invert="1" input="js1_throttlez" />
</action>
<action name="v_throttle_rel" keyboard=" " xboxpad="xi_reserved" joystick="jsx_reserved" UILabel="@ui_CIThrottleRel" UIDescription="@ui_CIThrottleRelDesc" />
<action name="v_brake" onPress="1" onHold="1" onRelease="1" keyboard="space" xboxpad="xi_shoulderl+xi_shoulderr" joystick="jsx_reserved" UILabel="@ui_CIBrake" UIDescription="@ui_CIBrakeDesc" />
<action name="v_brake" onPress="1" onRelease="1" keyboard="space" xboxpad="xi_shoulderl+xi_shoulderr" joystick="jsx_reserved" UILabel="@ui_CIBrake" UIDescription="@ui_CIBrakeDesc" />
<action name="v_target_match_vel" onPress="1" onRelease="1" keyboard="m" joystick="js1_button8" UILabel="@ui_CIMatchTargetSpeed" UIDescription="@ui_CIMatchTargetSpeedDesc">
<xboxpad multiTap="2" input="xi_shoulderr" />
</action>
<!-- Advanced IFCS on (requires IFCS) -->
<action name="v_ifcs_toggle_vector_decoupling" onPress="1" keyboard="capslock" xboxpad="xi_thumbl" joystick="jsx_reserved" UILabel="@ui_CIToggleDecoupledMode" UIDescription="@ui_CIToggleDecoupledModeDesc" />
<action name="v_ifcs_toggle_vector_decoupling" onPress="1" keyboard="capslock" xboxpad="xi_triggerl_btn+xi_thumbl" joystick="jsx_reserved" UILabel="@ui_CIToggleDecoupledMode" UIDescription="@ui_CIToggleDecoupledModeDesc" />
<action name="v_strafe_up" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard="r" xboxpad="xi_reserved" joystick="jsx_reserved" UILabel="@ui_CIStrafeUp" UIDescription="@ui_CIStrafeUpDesc" />
<action name="v_strafe_down" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard="f" xboxpad="xi_reserved" joystick="jsx_reserved" UILabel="@ui_CIStrafeDown" UIDescription="@ui_CIStrafeDownDesc" />
<action name="v_strafe_vertical" xboxpad="xi_triggerl_btn+xi_thumbry" joystick="jsx_reserved" UILabel="@ui_CIStrafeUpDown" UIDescription="@ui_CIStrafeUpDownDesc" />
@ -469,9 +481,9 @@
<action name="v_strafe_forward" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard=" " xboxpad="xi_reserved" joystick="jsx_reserved" UILabel="@ui_CIStrafeFwd" UIDescription="@ui_CIStrafeFwdDesc" />
<action name="v_strafe_back" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard=" " xboxpad="xi_reserved" joystick="jsx_reserved" UILabel="@ui_CIStrafeBack" UIDescription="@ui_CIStrafeBackDesc" />
<action name="v_strafe_longitudinal" xboxpad="xi_reserved" joystick="jsx_reserved" UILabel="@ui_CIStrafeFwdBack" UIDescription="@ui_CIStrafeFwdBackDesc" />
<action name="v_ifcs_toggle_safeties" onPress="1" keyboard="lctrl+capslock" xboxpad="xi_triggerl_btn+xi_thumbl" joystick="jsx_reserved" UILabel="@ui_CICycleIFCSSafeties" UIDescription="@ui_CICycleIFCSSafetiesDesc" />
<action name="v_ifcs_toggle_gforce_safety" onPress="1" keyboard=" " xboxpad="xi_reserved" joystick="jsx_reserved" UILabel="@ui_CIToggleGSafe" UIDescription="@ui_CIToggleGSafeDesc" />
<action name="v_ifcs_toggle_comstab" onPress="1" keyboard=" " xboxpad="xi_reserved" joystick="jsx_reserved" UILabel="@ui_CIToggleComstab" UIDescription="@ui_CIToggleComstabDesc" />
<action name="v_ifcs_toggle_safeties" onPress="1" keyboard="lctrl+capslock" xboxpad="xi_reserved" joystick="jsx_reserved" UILabel="@ui_CICycleIFCSSafeties" UIDescription="@ui_CICycleIFCSSafetiesDesc" />
<action name="v_ifcs_toggle_gforce_safety" onPress="1" keyboard=" " xboxpad="xi_triggerl_btn+xi_dpad_right" joystick="jsx_reserved" UILabel="@ui_CIToggleGSafe" UIDescription="@ui_CIToggleGSafeDesc" />
<action name="v_ifcs_toggle_comstab" onPress="1" keyboard=" " xboxpad="xi_triggerl_btn+xi_dpad_left" joystick="jsx_reserved" UILabel="@ui_CIToggleComstab" UIDescription="@ui_CIToggleComstabDesc" />
<!-- Decoupled flight mode (requires advanced IFCS) -->
<action name="v_decoupled_strafe_up" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard="r" xboxpad="xi_reserved" joystick="jsx_reserved" UILabel="@ui_CIDecoupledStrafeUp" UIDescription="@ui_CIDecoupledStrafeUpDesc" />
<action name="v_decoupled_strafe_down" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard="f" xboxpad="xi_reserved" joystick="jsx_reserved" UILabel="@ui_CIDecoupledStrafeDown" UIDescription="@ui_CIDecoupledStrafeDownDesc" />
@ -482,16 +494,16 @@
<action name="v_decoupled_strafe_forward" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard="w" xboxpad="xi_shoulderr" joystick="jsx_reserved" UILabel="@ui_CIDecoupledStrafeFwd" UIDescription="@ui_CIDecoupledStrafeFwdDesc" />
<action name="v_decoupled_strafe_back" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard="s" xboxpad="xi_shoulderl" joystick="jsx_reserved" UILabel="@ui_CIDecoupledStrafeBack" UIDescription="@ui_CIDecoupledStrafeBackDesc" />
<action name="v_decoupled_strafe_longitudinal" xboxpad="xi_reserved" joystick="jsx_reserved" UILabel="@ui_CIDecoupledStrafeFwdBack" UIDescription="@ui_CIDecoupledStrafeFwdBackDesc" />
<action name="v_decoupled_yaw" xboxpad="xi_thumblx" joystick="js1_rotz" UILabel="@ui_CIDecoupledYaw" UIDescription="@ui_CIDecoupledYawDesc" />
<action name="v_decoupled_yaw_left" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard=" " UILabel="@ui_CIDecoupledYawLeft" UIDescription="@ui_CIDecoupledYawLeftDesc" />
<action name="v_decoupled_yaw_right" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard=" " UILabel="@ui_CIDecoupledYawRight" UIDescription="@ui_CIDecoupledYawRightDesc" />
<action name="v_decoupled_yaw" xboxpad="xi_thumblx" joystick="js1_x" UILabel="@ui_CIDecoupledYaw" UIDescription="@ui_CIDecoupledYawDesc" />
<action name="v_decoupled_yaw_left" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard=" " xboxpad="" joystick="jsx_reserved" UILabel="@ui_CIDecoupledYawLeft" UIDescription="@ui_CIDecoupledYawLeftDesc" />
<action name="v_decoupled_yaw_right" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard=" " xboxpad="" joystick="jsx_reserved" UILabel="@ui_CIDecoupledYawRight" UIDescription="@ui_CIDecoupledYawRightDesc" />
<action name="v_decoupled_pitch" xboxpad="xi_thumbly" joystick="js1_y" UILabel="@ui_CIDecoupledPitch" UIDescription="@ui_CIDecoupledPitchDesc" />
<action name="v_decoupled_pitch_up" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard=" " UILabel="@ui_CIDecoupledPitchUp" UIDescription="@ui_CIDecoupledPitchUpDesc" />
<action name="v_decoupled_pitch_down" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard=" " UILabel="@ui_CIDecoupledPitchDown" UIDescription="@ui_CIDecoupledPitchDownDesc" />
<action name="v_decoupled_roll_left" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard="a" UILabel="@ui_CIDecoupledRollLeft" UIDescription="@ui_CIDecoupledRollLeftDesc" />
<action name="v_decoupled_roll_right" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard="d" UILabel="@ui_CIDecoupledRollRight" UIDescription="@ui_CIDecoupledRollRightDesc" />
<action name="v_decoupled_roll" xboxpad="xi_triggerl_btn+xi_thumblx" joystick="js1_x" UILabel="@ui_CIDecoupledRoll" UIDescription="@ui_CIDecoupledRollDesc" />
<action name="v_decoupled_brake" onPress="1" onHold="1" onRelease="1" keyboard="space" xboxpad="xi_shoulderr+xi_shoulderl" joystick="jsx_reserved" UILabel="@ui_CIDecoupledBrake" UIDescription="@ui_CIDecoupledBrakeDesc" />
<action name="v_decoupled_roll_left" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard="a" joystick="jsx_reserved" UILabel="@ui_CIDecoupledRollLeft" UIDescription="@ui_CIDecoupledRollLeftDesc" />
<action name="v_decoupled_roll_right" onPress="1" onHold="1" onRelease="1" retriggerable="1" keyboard="d" joystick="jsx_reserved" UILabel="@ui_CIDecoupledRollRight" UIDescription="@ui_CIDecoupledRollRightDesc" />
<action name="v_decoupled_roll" xboxpad="xi_triggerl_btn+xi_thumblx" joystick="js1_rotz" UILabel="@ui_CIDecoupledRoll" UIDescription="@ui_CIDecoupledRollDesc" />
<action name="v_decoupled_brake" onPress="1" onRelease="1" keyboard="space" xboxpad="xi_shoulderr+xi_shoulderl" joystick="jsx_reserved" UILabel="@ui_CIDecoupledBrake" UIDescription="@ui_CIDecoupledBrakeDesc" />
<!-- Afterburner installed (requires IFCS) -->
<action name="v_afterburner" onPress="1" onHold="1" onRelease="1" keyboard="lshift" xboxpad="xi_b" joystick="js1_button7" UILabel="@ui_CIBoost" UIDescription="@ui_CIBoostDesc" />
<action name="v_toggle_landing_gear" onPress="1" onRelease="1" keyboard="end" joystick="jsx_reserved" />
@ -521,12 +533,10 @@
<!-- sliders -->
<option input="_slider1" group="pilot_move_slider1" />
<option input="_slider2" group="pilot_move_silder2" />
<!-- throttle specific -->
<option action="v_throttle_abs" group="pilot_throttle" />
</optiongroup>
</actionmap>
<actionmap name="spaceship_targeting" version="7" UILabel="@ui_CGSpaceFlight">
<actionmap name="spaceship_targeting" version="8" UILabel="@ui_CGSpaceFlight">
<!-- Action map for a spaceship targeting controls -->
<!-- Aiming -->
@ -541,6 +551,9 @@
<action name="v_aim_snap" onPress="1" joystick="jsx_reserved" UILabel="@ui_CICenterAim" UIDescription="@ui_CICenterAim">
<xboxpad multiTap="2" input="xi_thumbr" />
</action>
<action name="v_couple_aim_to_move" onPress="1" onRelease="1" releaseTriggerDelay="0.25" keyboard="ralt+m" xboxpad="xi_reserved" joystick="jsx_reserved" UILabel="@ui_CICoupleAimMove" UIDescription="@ui_CICoupleAimMoveDesc" />
<action name="v_toggle_vj_mouse_aim_only" onPress="1" onRelease="1" releaseTriggerDelay="0.25" keyboard="rshift" xboxpad="" joystick="" UILabel="@ui_CICycleMouseAimMode" UIDescription="@ui_CICycleMouseAimModeDesc" />
<action name="v_toggle_weapon_gimbal_lock" onPress="1" onRelease="1" releaseTriggerDelay="0.25" keyboard="lalt" xboxpad="xi_reserved" joystick="jsx_reserved" UILabel="@ui_CIGimbalLock" UIDescription="@ui_CIGimbalLockDesc" />
<!-- Targeting computer controls (requires avionics) -->
<action name="v_target_toggle_computer_onoff" onPress="1" onRelease="1" keyboard="" xboxpad="" joystick=""/>
<action name="v_target_reticle_focus" onPress="1" onRelease="1" keyboard="v" xboxpad="xi_dpad_up" joystick="js1_hat1_up" UILabel="@ui_CITargetReticleFocus" UIDescription="@ui_CITargetReticleFocusDesc"/>
@ -550,7 +563,7 @@
<action name="v_target_cycle_friendly_back" onPress="1" onRelease="1" keyboard="lctrl+h" xboxpad="" joystick="jsx_reserved" UILabel="@ui_CICycleFriendlyBack" UIDescription="@ui_CICycleFriendlyBackDesc" />
<action name="v_target_toggle_pinned_focused" onPress="1" onRelease="1" keyboard="g" xboxpad="xi_reserved" joystick="jsx_reserved" UILabel="@ui_CIPinTargeted" UIDescription="@ui_CIPinTargetedDesc" />
<action name="v_target_missile_lock_focused" onPress="1" onRelease="1" keyboard="mouse3" xboxpad="xi_y" joystick="js1_button4" UILabel="@ui_CILockMissile" UIDescription="@ui_CILockMissileDesc" />
<!--Additional targeting computer controls (requires flight avionics) -->
<!-- Additional targeting computer controls (requires flight avionics) -->
<action name="v_target_cycle_hostile_fwd" onPress="1" onRelease="1" keyboard="t" xboxpad="xi_dpad_right" joystick="js1_hat1_right" UILabel="@ui_CICycleHostileFwd" UIDescription="@ui_CICycleHostileFwdDesc" />
<action name="v_target_cycle_hostile_back" onPress="1" onRelease="1" keyboard="lctrl+t" xboxpad="" joystick="jsx_reserved" UILabel="@ui_CICycleHostileBack" UIDescription="@ui_CICycleHostileBackDesc" />
<action name="v_target_nearest_hostile" onPress="1" onRelease="1" keyboard="c" xboxpad="xi_dpad_left" joystick="js1_hat1_left" UILabel="@ui_CITargetNearestHostile" UIDescription="@ui_CITargetNearestHostileDesc" />
@ -558,6 +571,8 @@
<action name="v_target_pin_reticule" onPress="1" onRelease="1" keyboard="lctrl+g" xboxpad="" joystick="jsx_reserved" />
<action name="v_target_cycle_subsystem_fwd" onPress="1" onRelease="1" keyboard="b" xboxpad="" joystick=""/>
<action name="v_target_cycle_subsystem_back" onPress="1" onRelease="1" keyboard="lctrl+b" xboxpad="" joystick=""/>
<!-- Advanced assisted camera tracking -->
<action name="v_target_head_tracking" onPress="1" onRelease="1" releaseTriggerDelay="0.25" keyboard="l" xboxpad="xi_thumbr" joystick="js1_button11" UILabel="@ui_CITargetHeadTracking" UIDescription="@ui_CITargetHeadTrackingDesc" />
<optiongroup type="shared">
<!-- Digital buttons input options -->
@ -741,7 +756,7 @@
<action name="v_hud_num_8" onPress="1" onRelease="1" keyboard="np_8" xboxpad="" joystick=""/>
<action name="v_hud_num_9" onPress="1" onRelease="1" keyboard="np_9" xboxpad="" joystick=""/>
-->
<action name="v_hud_open_scoreboard" onPress="1" onRelease="1" keyboard="lalt" xboxpad="xi_reserved" joystick="jsx_reserved" UILabel="@ui_CIOpenScoreboard" UIDescription="@ui_CIOpenScoreboardDesc" />
<action name="v_hud_open_scoreboard" onPress="1" onRelease="1" keyboard="lctrl+space" xboxpad="xi_reserved" joystick="jsx_reserved" UILabel="@ui_CIOpenScoreboard" UIDescription="@ui_CIOpenScoreboardDesc" />
<action name="v_hud_toggle_maximised" onPress="1" onRelease="1" keyboard="f11" xboxpad="" joystick="" UILabel="@ui_CIHUDMaximise" UIDescription="@ui_CIHUDMaximiseDesc"/>
<!-- HUD controls (interaction) -->
<action name="v_hud_interact_toggle" onPress="1" onRelease="0" keyboard="home" xboxpad="xi_back" joystick="jsx_reserved" UILabel="@ui_CIHUDInteract" UIDescription="@ui_CIHUDInteractDesc" />

@ -1,29 +1,42 @@
SC Joystick Mapper V 2.5
(c) Cassini, StandardToaster - 20-September-2014
SC Joystick Mapper V 2.7 - Build 33
(c) Cassini, StandardToaster - 13-November-2014
Contains 9 files:
SCJMapper.exe The program (V2.5)
SCJMapper.exe.config Program config (V2.5) - MUST be in the same folder as the Exe file
SCJMapper.exe The program (V2.7)
SCJMapper.exe.config Program config (V2.7) - MUST be in the same folder as the Exe file
SharpDX.DirectInput.dll Managed DirectInput Assembly - MUST be in the same folder as the Exe file
SharpDX.dll Managed DirectX Assembly - MUST be in the same folder as the Exe file
OpenTK.dll Managed OpenGL Assembly - MUST be in the same folder as the Exe file
OpenTK.GLControl.dll Managed OpenGL Assembly - MUST be in the same folder as the Exe file
Ionic.Zip.Reduced.dll Managed Zip Assembly - MUST be in the same folder as the Exe file
log4net.dll Managed Logging Assembly - MUST be in the same folder as the Exe file
log4net.config.OFF Config file for logging - To use it - rename as log4net.config and run the program
then look for trace.log in the same folder
SCJMapper_QGuide V2.5.pdf Quick Guide
SCJMapper_QGuide V2.7.pdf Quick Guide
ReadMe.txt This file
graphics folder Skybox Images - graphics folder MUST be in the same folder as the Exe file
Read the Guide first RTFM ;-)
Put all files into one folder and hit SCJMapper.exe to run it
For Updates and information visit:
https://github.com/SCToolsfactory/SCJMapper-V2/releases
https://github.com/bm98/SCJMapper-V2/
Scanned for viruses before packing...
cassini@burri-web.org
Changelog:
V 2.7 - Build 33
- fix - if an axis is not mapped the prog will not longer crash (was null ptr exception)
- doc update 2.7
V 2.7 - BETA
- new feature - Joystick Tuning
V 2.6
- fix - taking actionmaps from config file now works
- improvement - added actionmap vehicle_driver
V 2.5
- new feature - support and maintain option tags
- improvement - support and maintain version and ignoreversion attribute / can force ignoreversion="1"

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -4,6 +4,6 @@
<package id="log4net" version="2.0.3" targetFramework="net40" />
<package id="OpenTK" version="1.1.1589.5942" targetFramework="net40" />
<package id="OpenTK.GLControl" version="1.1.1589.5942" targetFramework="net40" />
<package id="SharpDX" version="2.6.2" targetFramework="net20" />
<package id="SharpDX.DirectInput" version="2.6.2" targetFramework="net40" />
<package id="SharpDX" version="2.6.3" targetFramework="net40" />
<package id="SharpDX.DirectInput" version="2.6.3" targetFramework="net40" />
</packages>
Loading…
Cancel
Save