HumanInterfaceDevice.cs
author sl
Sat, 06 Dec 2014 00:59:59 +0100
changeset 19 d066e3999973
parent 18 24ac84ab9620
child 21 fb4f80d5cf57
permissions -rw-r--r--
Starting to remove special case for app commands.
Adding a whole bunch of consumer controls.
     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             Null = 0x0000,           
   250             //           
   251             Channel = 0x0086,
   252             MediaSelection = 0x0087,
   253             MediaSelectComputer = 0x0088,
   254             MediaSelectTV = 0x0089,
   255             MediaSelectWWW = 0x008A,
   256             MediaSelectDVD = 0x008B,
   257             MediaSelectTelephone = 0x008C,
   258             MediaSelectProgramGuide = 0x008D,
   259             MediaSelectVideoPhone = 0x008E,
   260             MediaSelectGames = 0x008F,
   261             MediaSelectMessages = 0x0090,
   262             MediaSelectCD = 0x0091,
   263             MediaSelectVCR = 0x0092,
   264             MediaSelectTuner = 0x0093,
   265             Quit = 0x0094,
   266             Help = 0x0095,
   267             MediaSelectTape = 0x0096,
   268             MediaSelectCable = 0x0097,
   269             MediaSelectSatellite = 0x0098,
   270             MediaSelectSecurity = 0x0099,
   271             MediaSelectHome = 0x009A,
   272             MediaSelectCall = 0x009B,
   273             ChannelIncrement = 0x009C,
   274             ChannelDecrement = 0x009D,
   275             MediaSelectSAP = 0x009E,
   276             //
   277             Play = 0x00B0,
   278             Pause = 0x00B1,
   279             Record = 0x00B2,
   280             FastForward = 0x00B3,
   281             Rewind = 0x00B4,
   282             ScanNextTrack = 0x00B5,
   283             ScanPreviousTrack = 0x00B6,
   284             Stop = 0x00B7,
   285             Eject = 0x00B8,
   286             RandomPlay = 0x00B9,
   287             SelectDisc = 0x00BA,
   288             EnterDisc = 0x00BB,
   289             Repeat = 0x00BC,
   290             Tracking = 0x00BD,
   291             TrackNormal = 0x00BE,
   292             SlowTracking = 0x00BF,
   293             FrameForward = 0x00C0,
   294             FrameBack = 0x00C1,
   295             Mark = 0x00C2,
   296             ClearMark = 0x00C3,
   297             RepeatFromMark = 0x00C4,
   298             ReturnToMark = 0x00C5,
   299             SearchMarkForward = 0x00C6,
   300             SearchMarkBackwards = 0x00C7,
   301             CounterReset = 0x00C8,
   302             ShowCounter = 0x00C9,
   303             TrackingIncrement = 0x00CA,
   304             TrackingDecrement = 0x00CB,
   305             StopEject = 0x00CC,
   306             PlayPause = 0x00CD,
   307             PlaySkip = 0x00CE,
   308 
   309             /// <summary>
   310             /// Audio controls
   311             /// </summary>
   312             Volume = 0x00E0,
   313             Balance = 0x00E1,
   314             Mute = 0x00E2,
   315             Bass = 0x00E3,
   316             Treble = 0x00E4,
   317             BassBoost = 0x00E5,
   318             SurroundMode = 0x00E6,
   319             Loudness = 0x00E7,
   320             MPX = 0x00E8,
   321             VolumeIncrement = 0x00E9,
   322             VolumeDecrement = 0x00EA,
   323 
   324             //Generic GUI Application Controls
   325             GenericGUIApplicationControls = 0x0200,
   326             AppCtrlNew = 0x0201,
   327             AppCtrlOpen = 0x0202,
   328             AppCtrlClose = 0x0203,
   329             AppCtrlExit = 0x0204,
   330             AppCtrlMaximize = 0x0205,
   331             AppCtrlMinimize = 0x0206,
   332             AppCtrlSave = 0x0207,
   333             AppCtrlPrint = 0x0208,
   334             AppCtrlProperties = 0x0209,
   335             AppCtrlUndo = 0x021A,
   336             AppCtrlCopy = 0x021B,
   337             AppCtrlCut = 0x021C,
   338             AppCtrlPaste = 0x021D,
   339             AppCtrlSelectAll = 0x021E,
   340             AppCtrlFind = 0x021F,
   341             AppCtrlFindAndReplace = 0x0220,
   342             AppCtrlSearch = 0x0221,
   343             AppCtrlGoTo = 0x0222,
   344             AppCtrlHome = 0x0223,
   345             AppCtrlBack = 0x0224,
   346             AppCtrlForward = 0x0225,
   347             AppCtrlStop = 0x0226,
   348             AppCtrlRefresh = 0x0227,
   349             AppCtrlPreviousLink = 0x0228,
   350             AppCtrlNextLink = 0x0229,
   351             AppCtrlBookmarks = 0x022A,
   352             AppCtrlHistory = 0x022B,
   353             AppCtrlSubscriptions = 0x022C,
   354             AppCtrlZoomIn = 0x022D,
   355             AppCtrlZoomOut = 0x022E,
   356             AppCtrlZoom = 0x022F,
   357             AppCtrlFullScreenView = 0x0230,
   358             AppCtrlNormalView = 0x0231,
   359             AppCtrlViewToggle = 0x0232,
   360             AppCtrlScrollUp = 0x0233,
   361             AppCtrlScrollDown = 0x0234,
   362             AppCtrlScroll = 0x0235,
   363             AppCtrlPanLeft = 0x0236,
   364             AppCtrlPanRight = 0x0237,
   365             AppCtrlPan = 0x0238,
   366             AppCtrlNewWindow = 0x0239,
   367             AppCtrlTileHorizontally = 0x023A,
   368             AppCtrlTileVertically = 0x023B,
   369             AppCtrlFormat = 0x023C,
   370             AppCtrlEdit = 0x023D,
   371 
   372         }
   373     }
   374 }