From 3f68c9bcb810a32ab6f3674aa1751a5e2846b07c Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sun, 30 Apr 2017 06:42:09 -0700 Subject: [PATCH] Removed usage of some unused namespaces The only real import one is remove System.Windows.Forms for non GUI items --- DS4Windows/DS4Control/DS4StateFieldMapping.cs | 7 +------ DS4Windows/DS4Control/InputMethods.cs | 10 ++++++---- DS4Windows/DS4Control/Log.cs | 3 --- DS4Windows/DS4Control/Mapping.cs | 3 +-- DS4Windows/DS4Control/MouseCursor.cs | 7 +------ DS4Windows/DS4Control/MouseWheel.cs | 1 - DS4Windows/DS4Control/ScpDevice.cs | 1 - DS4Windows/DS4Control/ScpUtil.cs | 2 +- DS4Windows/DS4Control/X360Device.cs | 1 - DS4Windows/DS4Library/DS4Audio.cs | 3 --- DS4Windows/DS4Library/DS4Sixaxis.cs | 4 ---- DS4Windows/DS4Library/DS4State.cs | 3 --- DS4Windows/DS4Library/DS4StateExposed.cs | 6 +----- DS4Windows/DS4Library/DS4Touchpad.cs | 5 +---- 14 files changed, 12 insertions(+), 44 deletions(-) diff --git a/DS4Windows/DS4Control/DS4StateFieldMapping.cs b/DS4Windows/DS4Control/DS4StateFieldMapping.cs index 4376d83..62b464f 100644 --- a/DS4Windows/DS4Control/DS4StateFieldMapping.cs +++ b/DS4Windows/DS4Control/DS4StateFieldMapping.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace DS4Windows { public class DS4StateFieldMapping diff --git a/DS4Windows/DS4Control/InputMethods.cs b/DS4Windows/DS4Control/InputMethods.cs index 8048868..91c4f08 100644 --- a/DS4Windows/DS4Control/InputMethods.cs +++ b/DS4Windows/DS4Control/InputMethods.cs @@ -1,14 +1,13 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Runtime.InteropServices; + namespace DS4Windows { class InputMethods { private static INPUT[] sendInputs = new INPUT[2]; // will allow for keyboard + mouse/tablet input within one SendInput call, or two mouse events private static object lockob = new object(); + public static void MoveCursorBy(int x, int y) { lock (lockob) @@ -43,6 +42,7 @@ namespace DS4Windows sendInputs[inputs].Data.Mouse.Y = 0; inputs++; } + if (horizontal != 0) { sendInputs[inputs].Type = INPUT_MOUSE; @@ -54,6 +54,7 @@ namespace DS4Windows sendInputs[inputs].Data.Mouse.Y = 0; inputs++; } + SendInput(inputs, sendInputs, (int)inputs * Marshal.SizeOf(sendInputs[0])); } } @@ -276,6 +277,7 @@ namespace DS4Windows private static extern ushort MapVirtualKey(uint uCode, uint uMapType); [DllImport("user32.dll", SetLastError = true)] static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo); + //Not used, just here public static void DownKeys(ushort key) { @@ -292,5 +294,5 @@ namespace DS4Windows keybd_event((byte)key, 0, (int)KEYEVENTF_KEYUP, 0); } } - } + diff --git a/DS4Windows/DS4Control/Log.cs b/DS4Windows/DS4Control/Log.cs index f581f77..1eef330 100644 --- a/DS4Windows/DS4Control/Log.cs +++ b/DS4Windows/DS4Control/Log.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace DS4Windows { diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index d6f9665..be0f529 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -1,12 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; -using System.Windows.Forms; using System.Diagnostics; using static DS4Windows.Global; + namespace DS4Windows { public class Mapping diff --git a/DS4Windows/DS4Control/MouseCursor.cs b/DS4Windows/DS4Control/MouseCursor.cs index 5b7202b..bb4010b 100644 --- a/DS4Windows/DS4Control/MouseCursor.cs +++ b/DS4Windows/DS4Control/MouseCursor.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - - + namespace DS4Windows { class MouseCursor diff --git a/DS4Windows/DS4Control/MouseWheel.cs b/DS4Windows/DS4Control/MouseWheel.cs index 55b5809..5529337 100644 --- a/DS4Windows/DS4Control/MouseWheel.cs +++ b/DS4Windows/DS4Control/MouseWheel.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using System.Text; - namespace DS4Windows { class MouseWheel diff --git a/DS4Windows/DS4Control/ScpDevice.cs b/DS4Windows/DS4Control/ScpDevice.cs index e18e43f..8055616 100644 --- a/DS4Windows/DS4Control/ScpDevice.cs +++ b/DS4Windows/DS4Control/ScpDevice.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using System.Windows.Forms; using System.Runtime.InteropServices; using Microsoft.Win32.SafeHandles; diff --git a/DS4Windows/DS4Control/ScpUtil.cs b/DS4Windows/DS4Control/ScpUtil.cs index 0484df2..6e4e86a 100644 --- a/DS4Windows/DS4Control/ScpUtil.cs +++ b/DS4Windows/DS4Control/ScpUtil.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Text; using System.IO; using System.Reflection; @@ -8,6 +7,7 @@ using System.Xml; using System.Drawing; using System.Security.Principal; + namespace DS4Windows { [Flags] diff --git a/DS4Windows/DS4Control/X360Device.cs b/DS4Windows/DS4Control/X360Device.cs index 372c755..2d000f2 100644 --- a/DS4Windows/DS4Control/X360Device.cs +++ b/DS4Windows/DS4Control/X360Device.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using System.Windows.Forms; using System.Runtime.InteropServices; using Microsoft.Win32.SafeHandles; diff --git a/DS4Windows/DS4Library/DS4Audio.cs b/DS4Windows/DS4Library/DS4Audio.cs index 74ba536..edfd251 100644 --- a/DS4Windows/DS4Library/DS4Audio.cs +++ b/DS4Windows/DS4Library/DS4Audio.cs @@ -1,8 +1,5 @@ using System; -using System.Collections.Generic; -using System.Text; using System.Runtime.InteropServices; -using System.Windows.Forms; using DS4Windows.DS4Library.CoreAudio; namespace DS4Windows.DS4Library diff --git a/DS4Windows/DS4Library/DS4Sixaxis.cs b/DS4Windows/DS4Library/DS4Sixaxis.cs index 8777d34..bed25c0 100644 --- a/DS4Windows/DS4Library/DS4Sixaxis.cs +++ b/DS4Windows/DS4Library/DS4Sixaxis.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace DS4Windows { diff --git a/DS4Windows/DS4Library/DS4State.cs b/DS4Windows/DS4Library/DS4State.cs index 921a4fa..80a2994 100644 --- a/DS4Windows/DS4Library/DS4State.cs +++ b/DS4Windows/DS4Library/DS4State.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace DS4Windows { diff --git a/DS4Windows/DS4Library/DS4StateExposed.cs b/DS4Windows/DS4Library/DS4StateExposed.cs index f4ac887..c51cf85 100644 --- a/DS4Windows/DS4Library/DS4StateExposed.cs +++ b/DS4Windows/DS4Library/DS4StateExposed.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - + namespace DS4Windows { public class DS4StateExposed diff --git a/DS4Windows/DS4Library/DS4Touchpad.cs b/DS4Windows/DS4Library/DS4Touchpad.cs index 104b3a4..b1b271a 100644 --- a/DS4Windows/DS4Library/DS4Touchpad.cs +++ b/DS4Windows/DS4Library/DS4Touchpad.cs @@ -1,8 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Runtime.InteropServices; + namespace DS4Windows { public class TouchpadEventArgs : EventArgs