diff -r e8bb372ae58b -r 831ebeeecfdf HidEvent.cs --- a/HidEvent.cs Sun Mar 15 14:07:17 2015 +0100 +++ b/HidEvent.cs Sun Mar 15 14:39:21 2015 +0100 @@ -1,3 +1,23 @@ +// +// Copyright (C) 2014-2015 Stéphane Lenclud. +// +// This file is part of SharpLibHid. +// +// SharpDisplayManager is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// SharpDisplayManager is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with SharpDisplayManager. If not, see . +// + + using System; using System.Windows.Forms; using System.Runtime.InteropServices; @@ -7,9 +27,10 @@ using Win32; using System.Collections.Generic; using System.Timers; +using SharpLibHid.Usage; -namespace Hid +namespace SharpLibHid { /// /// We provide utility functions to interpret gamepad dpad state. @@ -142,7 +163,7 @@ if (RawInput.header.hDevice != IntPtr.Zero) { //Get various information about this HID device - Device = new Hid.HidDevice(RawInput.header.hDevice); + Device = new HidDevice(RawInput.header.hDevice); } if (RawInput.header.dwType == Win32.RawInputDeviceType.RIM_TYPEHID) //Check that our raw input is HID @@ -412,7 +433,7 @@ /// public DirectionPadState GetDirectionPadState() { - int index=GetValueCapabilitiesIndex((ushort)Hid.UsagePage.GenericDesktopControls, (ushort)Hid.Usage.GenericDesktop.HatSwitch); + int index=GetValueCapabilitiesIndex((ushort)SharpLibHid.UsagePage.GenericDesktopControls, (ushort)GenericDesktop.HatSwitch); if (index < 0) { //No hat switch found @@ -508,12 +529,12 @@ UsagePage usagePage = (UsagePage)UsagePage; switch (usagePage) { - case Hid.UsagePage.Consumer: - usageText += ((Hid.Usage.ConsumerControl)usage).ToString(); + case SharpLibHid.UsagePage.Consumer: + usageText += ((ConsumerControl)usage).ToString(); break; - case Hid.UsagePage.WindowsMediaCenterRemoteControl: - usageText += ((Hid.Usage.WindowsMediaCenterRemoteControl)usage).ToString(); + case SharpLibHid.UsagePage.WindowsMediaCenterRemoteControl: + usageText += ((WindowsMediaCenterRemoteControl)usage).ToString(); break; default: