HumanInterfaceDevice.cs
author sl
Fri, 07 Nov 2014 20:49:51 +0100
changeset 9 94850bfc12b5
child 11 2ff6dbe0d356
permissions -rw-r--r--
Cast fix and moving Win32 stuff in a dedicated file.
     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
    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         public enum HpMceButton: ushort
   192         {
   193             /// <summary>
   194             /// Displays visual imagery that is synchronized to the sound of your music tracks.
   195             /// <para />
   196             /// Second press action: Repeats message.
   197             /// <para />
   198             /// Auto-repeat: No
   199             /// <para />
   200             /// Notably sent by the 'Visualization' button of HP Windows Media Center Remote (TSGH-IR08).
   201             /// <para />
   202             /// According to HP specs it displays visual imagery that is synchronized to the sound of your music tracks.
   203             /// </summary>
   204             Visualization = MceButton.Ext0,
   205             /// <summary>
   206             /// Plays a slide show of all the pictures on your hard disk drive.
   207             /// <para />
   208             /// Second press action: Repeats message.
   209             /// <para />
   210             /// Auto-repeat: No
   211             /// <para />
   212             /// Notably sent by the 'Slide Show' button of HP Windows Media Center Remote (TSGH-IR08).
   213             /// <para />
   214             /// According to HP specs it plays a slide show of all the pictures on your hard disk drive.
   215             /// </summary>
   216             SlideShow = MceButton.Ext1,
   217             /// <summary>
   218             /// Eject optical drive.
   219             /// <para />
   220             /// Second press action: Repeats message.
   221             /// <para />
   222             /// Auto-repeat: No
   223             /// <para />
   224             /// Notably sent by the 'Eject' button of HP Windows Media Center Remote (TSGH-IR08).
   225             /// Also interpreted as 'Eject' action by SoundGraph iMON Manager in MCE mode (OrigenAE VF310).
   226             /// </summary>
   227             Eject = MceButton.Ext2,
   228             /// <summary>
   229             /// Not sure what this should do.
   230             /// <para />
   231             /// Second press action: Repeats message.
   232             /// <para />
   233             /// Auto-repeat: No
   234             /// <para />
   235             /// Notably sent by the 'Input selection' button of HP Windows Media Center Remote (TSGH-IR08).
   236             /// </summary>
   237             InputSelection = MceButton.Ext3,
   238         }
   239 
   240         /// <summary>
   241         /// Usage Table for Consumer Controls
   242         /// 0x0C 0X01
   243         /// </summary>
   244         public enum ConsumerControl: ushort
   245         {
   246             /// <summary>
   247             /// Sent by MCE remotes.
   248             /// </summary>
   249             MediaSelectProgramGuide = 0x008D,
   250             /// <summary>
   251             /// Sent by MCE remotes.
   252             /// </summary>
   253             AppCtrlPrint = 0x0208,
   254             /// <summary>
   255             /// Sent by MCE remotes from the 'I' Informations or More Info buttons.
   256             /// </summary>
   257             AppCtrlProperties = 0x0209            
   258         }
   259     }
   260 }