HumanInterfaceDevice.cs
author sl
Wed, 03 Dec 2014 21:54:45 +0100
changeset 16 9a3e77655031
parent 11 2ff6dbe0d356
child 18 24ac84ab9620
permissions -rw-r--r--
Now supporting alternative codes for program guid and properties/info.
     1 //
     2 //
     3 //
     4 
     5 namespace Hid
     6 {
     7     /// <summary>
     8     /// From USB HID usage tables.
     9     /// http://www.usb.org/developers/hidpage#HID_Usage
    10     /// http://www.usb.org/developers/devclass_docs/Hut1_12v2.pdf
    11     /// </summary>
    12     public enum UsagePage : ushort
    13     {
    14         Undefined = 0,
    15         GenericDesktopControl,
    16         SimulationControl,
    17         VirtualRealityControl,
    18         SportControl,
    19         GameControl,
    20         GenericDeviceControl,
    21         Keyboard,
    22         LightEmittingDiode,
    23         Button,
    24         Ordinal,
    25         Telephony,
    26         Consumer,
    27         Digitiser,
    28         PhysicalInterfaceDevice = 0x0f,
    29         Unicode = 0x10,
    30         AlphaNumericDisplay = 0x14,
    31         MedicalInstruments = 0x40,
    32         MonitorPage0 = 0x80,
    33         MonitorPage1,
    34         MonitorPage2,
    35         MonitorPage3,
    36         PowerPage0,
    37         PowerPage1,
    38         PowerPage2,
    39         PowerPage3,
    40         BarCodeScanner = 0x8c,
    41         Scale,
    42         MagneticStripeReader,
    43         ReservedPointOfSale,
    44         CameraControl,
    45         Arcade,
    46         // http://msdn.microsoft.com/en-us/library/windows/desktop/bb417079.aspx
    47         MceRemote = 0xffbc,
    48         TerraTecRemote = 0xffcc
    49     }
    50 
    51     /// <summary>
    52 /// 
    53 /// </summary>
    54     public enum UsageId: ushort
    55     {
    56         MceRemoteUsage = 0x88,
    57         ConsumerControl = 0x01
    58     }
    59 
    60 
    61 
    62     namespace UsageTables
    63     {
    64         /// <summary>
    65         ///
    66         /// </summary>
    67         public enum MceButton: ushort
    68         {
    69             /// <summary>
    70             /// Not defined by the Microsoft specs.
    71             /// </summary>
    72             Null                    =   0x00,
    73             GreenStart              =   0x0D,
    74             ClosedCaptioning        =   0x2B,
    75             Teletext                =   0x5A,
    76             TeletextRed             =   0x5B,
    77             TeletextGreen           =   0x5C,
    78             TeletextYellow          =   0x5D,
    79             TeletextBlue            =   0x5E,
    80             LiveTv                  =   0x25,
    81             Music                   =   0x47,
    82             RecordedTv              =   0x48,
    83             Pictures                =   0x49,
    84             Videos                  =   0x4A,
    85             FmRadio                 =   0x50,
    86             Extras                  =   0x3C,
    87             ExtrasApp               =   0x3D,
    88             DvdMenu                 =   0x24,
    89             DvdAngle                =   0x4B,
    90             DvdAudio                =   0x4C,
    91             DvdSubtitle             =   0x4D,
    92             /// <summary>
    93             /// First press action: Ejects a DVD drive.
    94             /// <para />
    95             /// Second press action: Repeats first press action.
    96             /// <para />
    97             /// Notably issued by XBOX360 remote as defined in irplus - Remote Control - Android application.
    98             /// </summary>
    99             Eject                   =   0x28,
   100             DvdTopMenu              =   0x43,
   101             /// <summary>
   102             /// First press action: Generates EXTn HID message in the Media Center Vendor Specific
   103             /// Collection (page 0xFFBC, usage 0x88).
   104             /// <para />
   105             /// Second press action: Repeats message.
   106             /// <para />
   107             /// Auto-repeat: No
   108             /// <para />
   109             /// Notably sent by the 'Visualization' button of HP Windows Media Center Remote (TSGH-IR08).
   110             /// <para />
   111             /// According to HP specs it displays visual imagery that is synchronized to the sound of your music tracks.
   112             /// </summary>
   113             Ext0                    =   0x32,
   114             /// <summary>
   115             /// First press action: Generates EXTn HID message in the Media Center Vendor Specific
   116             /// Collection (page 0xFFBC, usage 0x88).
   117             /// <para />
   118             /// Second press action: Repeats message.
   119             /// <para />
   120             /// Auto-repeat: No
   121             /// <para />
   122             /// Notably sent by the 'Slide Show' button of HP Windows Media Center Remote (TSGH-IR08).
   123             /// <para />
   124             /// According to HP specs it plays a slide show of all the pictures on your hard disk drive.
   125             /// </summary>
   126             Ext1                    =   0x33,
   127             /// <summary>
   128             /// First press action: Generates EXTn HID message in the Media Center Vendor Specific
   129             /// Collection (page 0xFFBC, usage 0x88).
   130             /// <para />
   131             /// Second press action: Repeats message.
   132             /// <para />
   133             /// Auto-repeat: No
   134             /// <para />
   135             /// Notably sent by the 'Eject' button of HP Windows Media Center Remote (TSGH-IR08).
   136             /// Also interpreted as 'Eject' action by SoundGraph iMON Manager in MCE mode (OrigenAE VF310).
   137             /// </summary>
   138             Ext2                    =   0x34,
   139             /// <summary>
   140             /// First press action: Generates EXTn HID message in the Media Center Vendor Specific
   141             /// Collection (page 0xFFBC, usage 0x88).
   142             /// <para />
   143             /// Second press action: Repeats message.
   144             /// <para />
   145             /// Auto-repeat: No
   146             /// <para />
   147             /// Notably sent by the 'Input selection' button of HP Windows Media Center Remote (TSGH-IR08).
   148             /// </summary>
   149             Ext3                    =   0x35,
   150             Ext4                    =   0x36,
   151             Ext5                    =   0x37,
   152             Ext6                    =   0x38,
   153             Ext7                    =   0x39,
   154             Ext8                    =   0x3A,
   155             Ext9                    =   0x80,
   156             Ext10                   =   0x81,
   157             Ext11                   =   0x6F,
   158             Zoom                    =   0x27,
   159             ChannelInput            =   0x42,
   160             SubAudio                =   0x2D,
   161             Channel10               =   0x3E,
   162             Channel11               =   0x3F,
   163             Channel12               =   0x40,
   164             /// <summary>
   165             /// First press action: Generates OEM2 HID message in the Media Center Vendor Specific
   166             /// Collection. This button is intended to control the front panel display of home entertainment
   167             /// computers. When this button is pressed, the display could be turned on or off, or the display
   168             /// mode could change.
   169             /// <para />
   170             /// Second press action: Repeats message.
   171             /// <para />
   172             /// Auto-repeat: No
   173             /// <para />
   174             /// Notably issued by XBOX360 remote as defined in irplus - Remote Control - Android application.
   175             /// </summary>
   176             Display                 =   0x4F,
   177             /// <summary>
   178             /// First press action: To be determined.
   179             /// <para />
   180             /// Second press action: Repeats message.
   181             /// <para />
   182             /// Auto-repeat: No
   183             /// </summary>
   184             Kiosk                   =   0x6A,
   185             NetworkSelection        =   0x2C,
   186             BlueRayTool             =   0x78,
   187             ChannelInfo             =   0x41,
   188             VideoSelection          =   0x61
   189         }
   190 
   191         /// <summary>
   192         /// Those codes come from experimenting with HP remotes.
   193         /// </summary>
   194         public enum HpMceButton: ushort
   195         {
   196             /// <summary>
   197             /// Displays visual imagery that is synchronized to the sound of your music tracks.
   198             /// <para />
   199             /// Second press action: Repeats message.
   200             /// <para />
   201             /// Auto-repeat: No
   202             /// <para />
   203             /// Notably sent by the 'Visualization' button of HP Windows Media Center Remote (TSGH-IR08).
   204             /// <para />
   205             /// According to HP specs it displays visual imagery that is synchronized to the sound of your music tracks.
   206             /// </summary>
   207             Visualization = MceButton.Ext0,
   208             /// <summary>
   209             /// Plays a slide show of all the pictures on your hard disk drive.
   210             /// <para />
   211             /// Second press action: Repeats message.
   212             /// <para />
   213             /// Auto-repeat: No
   214             /// <para />
   215             /// Notably sent by the 'Slide Show' button of HP Windows Media Center Remote (TSGH-IR08).
   216             /// <para />
   217             /// According to HP specs it plays a slide show of all the pictures on your hard disk drive.
   218             /// </summary>
   219             SlideShow = MceButton.Ext1,
   220             /// <summary>
   221             /// Eject optical drive.
   222             /// <para />
   223             /// Second press action: Repeats message.
   224             /// <para />
   225             /// Auto-repeat: No
   226             /// <para />
   227             /// Notably sent by the 'Eject' button of HP Windows Media Center Remote (TSGH-IR08).
   228             /// Also interpreted as 'Eject' action by SoundGraph iMON Manager in MCE mode (OrigenAE VF310).
   229             /// </summary>
   230             Eject = MceButton.Ext2,
   231             /// <summary>
   232             /// Not sure what this should do.
   233             /// <para />
   234             /// Second press action: Repeats message.
   235             /// <para />
   236             /// Auto-repeat: No
   237             /// <para />
   238             /// Notably sent by the 'Input selection' button of HP Windows Media Center Remote (TSGH-IR08).
   239             /// </summary>
   240             InputSelection = MceButton.Ext3,
   241         }
   242 
   243         /// <summary>
   244         /// Usage Table for Consumer Controls
   245         /// 0x0C 0X01
   246         /// </summary>
   247         public enum ConsumerControl: ushort
   248         {
   249             /// <summary>
   250             /// Alternative code for properties.
   251             /// Also supported by Windows Media Center.
   252             /// </summary>
   253             MceProperties = 0x000A,
   254             /// <summary>
   255             /// Alternative code for program guide.
   256             /// Also supported by Windows Media Center.
   257             /// </summary>
   258             MceProgramGuide = 0x0012,
   259             /// <summary>
   260             /// Sent by MCE remotes.
   261             /// </summary>
   262             MediaSelectProgramGuide = 0x008D,
   263             /// <summary>
   264             /// Sent by MCE remotes.
   265             /// </summary>
   266             AppCtrlPrint = 0x0208,
   267             /// <summary>
   268             /// Sent by MCE remotes from the 'I' Informations or More Info buttons.
   269             /// </summary>
   270             AppCtrlProperties = 0x0209            
   271         }
   272     }
   273 }