HidEvent.cs
changeset 76 831ebeeecfdf
parent 73 5262f4b7c4ad
child 77 fb9ea5ad8c2d
     1.1 --- a/HidEvent.cs	Sun Mar 15 14:07:17 2015 +0100
     1.2 +++ b/HidEvent.cs	Sun Mar 15 14:39:21 2015 +0100
     1.3 @@ -1,3 +1,23 @@
     1.4 +//
     1.5 +// Copyright (C) 2014-2015 Stéphane Lenclud.
     1.6 +//
     1.7 +// This file is part of SharpLibHid.
     1.8 +//
     1.9 +// SharpDisplayManager is free software: you can redistribute it and/or modify
    1.10 +// it under the terms of the GNU General Public License as published by
    1.11 +// the Free Software Foundation, either version 3 of the License, or
    1.12 +// (at your option) any later version.
    1.13 +//
    1.14 +// SharpDisplayManager is distributed in the hope that it will be useful,
    1.15 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.16 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.17 +// GNU General Public License for more details.
    1.18 +//
    1.19 +// You should have received a copy of the GNU General Public License
    1.20 +// along with SharpDisplayManager.  If not, see <http://www.gnu.org/licenses/>.
    1.21 +//
    1.22 +
    1.23 +
    1.24  using System;
    1.25  using System.Windows.Forms;
    1.26  using System.Runtime.InteropServices;
    1.27 @@ -7,9 +27,10 @@
    1.28  using Win32;
    1.29  using System.Collections.Generic;
    1.30  using System.Timers;
    1.31 +using SharpLibHid.Usage;
    1.32  
    1.33  
    1.34 -namespace Hid
    1.35 +namespace SharpLibHid
    1.36  {
    1.37      /// <summary>
    1.38      /// We provide utility functions to interpret gamepad dpad state.
    1.39 @@ -142,7 +163,7 @@
    1.40                  if (RawInput.header.hDevice != IntPtr.Zero)
    1.41                  {
    1.42                      //Get various information about this HID device
    1.43 -                    Device = new Hid.HidDevice(RawInput.header.hDevice);
    1.44 +                    Device = new HidDevice(RawInput.header.hDevice);
    1.45                  }
    1.46  
    1.47                  if (RawInput.header.dwType == Win32.RawInputDeviceType.RIM_TYPEHID)  //Check that our raw input is HID                        
    1.48 @@ -412,7 +433,7 @@
    1.49          /// <returns></returns>
    1.50          public DirectionPadState GetDirectionPadState()
    1.51          {
    1.52 -            int index=GetValueCapabilitiesIndex((ushort)Hid.UsagePage.GenericDesktopControls, (ushort)Hid.Usage.GenericDesktop.HatSwitch);
    1.53 +            int index=GetValueCapabilitiesIndex((ushort)SharpLibHid.UsagePage.GenericDesktopControls, (ushort)GenericDesktop.HatSwitch);
    1.54              if (index < 0)
    1.55              {
    1.56                  //No hat switch found
    1.57 @@ -508,12 +529,12 @@
    1.58                  UsagePage usagePage = (UsagePage)UsagePage;
    1.59                  switch (usagePage)
    1.60                  {
    1.61 -                    case Hid.UsagePage.Consumer:
    1.62 -                        usageText += ((Hid.Usage.ConsumerControl)usage).ToString();
    1.63 +                    case SharpLibHid.UsagePage.Consumer:
    1.64 +                        usageText += ((ConsumerControl)usage).ToString();
    1.65                          break;
    1.66  
    1.67 -                    case Hid.UsagePage.WindowsMediaCenterRemoteControl:
    1.68 -                        usageText += ((Hid.Usage.WindowsMediaCenterRemoteControl)usage).ToString();
    1.69 +                    case SharpLibHid.UsagePage.WindowsMediaCenterRemoteControl:
    1.70 +                        usageText += ((WindowsMediaCenterRemoteControl)usage).ToString();
    1.71                          break;
    1.72  
    1.73                      default: