HumanInterfaceDevice.cs
author sl
Sat, 06 Dec 2014 13:08:50 +0100
changeset 25 5f4e0fbb3ea1
parent 21 fb4f80d5cf57
permissions -rw-r--r--
Adding HidDevice class.
     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     public enum UsageIdGenericDesktop : ushort
    52     {      
    53         Pointer = 0x01,
    54         Mouse = 0x02,
    55         Joystick = 0x04,
    56         GamePad = 0x05,
    57         Keyboard = 0x06,
    58         KeyPad = 0x07,
    59         MultiAxisController = 0x08,
    60         TabletPCSystemControls = 0x09,
    61         SystemControl = 0x80
    62     }
    63 
    64     public enum UsageIdConsumer : ushort
    65     {
    66         ConsumerControl = 0x01,
    67         NumericKeyPad = 0x02,
    68         ProgrammableButtons = 0x03,
    69         Microphone = 0x04,
    70         Headphone = 0x05,
    71         GraphicEqualizer = 0x06,
    72         Selection = 0x80,
    73     }
    74 
    75     
    76     public enum UsageIdMce: ushort
    77     {
    78         MceRemote = 0x88        
    79     }
    80 
    81 
    82 
    83     namespace UsageTables
    84     {
    85         /// <summary>
    86         ///
    87         /// </summary>
    88         public enum MceButton: ushort
    89         {
    90             /// <summary>
    91             /// Not defined by the Microsoft specs.
    92             /// </summary>
    93             Null                    =   0x00,
    94             GreenStart              =   0x0D,
    95             ClosedCaptioning        =   0x2B,
    96             Teletext                =   0x5A,
    97             TeletextRed             =   0x5B,
    98             TeletextGreen           =   0x5C,
    99             TeletextYellow          =   0x5D,
   100             TeletextBlue            =   0x5E,
   101             LiveTv                  =   0x25,
   102             Music                   =   0x47,
   103             RecordedTv              =   0x48,
   104             Pictures                =   0x49,
   105             Videos                  =   0x4A,
   106             FmRadio                 =   0x50,
   107             Extras                  =   0x3C,
   108             ExtrasApp               =   0x3D,
   109             DvdMenu                 =   0x24,
   110             DvdAngle                =   0x4B,
   111             DvdAudio                =   0x4C,
   112             DvdSubtitle             =   0x4D,
   113             /// <summary>
   114             /// First press action: Ejects a DVD drive.
   115             /// <para />
   116             /// Second press action: Repeats first press action.
   117             /// <para />
   118             /// Notably issued by XBOX360 remote as defined in irplus - Remote Control - Android application.
   119             /// </summary>
   120             Eject                   =   0x28,
   121             DvdTopMenu              =   0x43,
   122             /// <summary>
   123             /// First press action: Generates EXTn HID message in the Media Center Vendor Specific
   124             /// Collection (page 0xFFBC, usage 0x88).
   125             /// <para />
   126             /// Second press action: Repeats message.
   127             /// <para />
   128             /// Auto-repeat: No
   129             /// <para />
   130             /// Notably sent by the 'Visualization' button of HP Windows Media Center Remote (TSGH-IR08).
   131             /// <para />
   132             /// According to HP specs it displays visual imagery that is synchronized to the sound of your music tracks.
   133             /// </summary>
   134             Ext0                    =   0x32,
   135             /// <summary>
   136             /// First press action: Generates EXTn HID message in the Media Center Vendor Specific
   137             /// Collection (page 0xFFBC, usage 0x88).
   138             /// <para />
   139             /// Second press action: Repeats message.
   140             /// <para />
   141             /// Auto-repeat: No
   142             /// <para />
   143             /// Notably sent by the 'Slide Show' button of HP Windows Media Center Remote (TSGH-IR08).
   144             /// <para />
   145             /// According to HP specs it plays a slide show of all the pictures on your hard disk drive.
   146             /// </summary>
   147             Ext1                    =   0x33,
   148             /// <summary>
   149             /// First press action: Generates EXTn HID message in the Media Center Vendor Specific
   150             /// Collection (page 0xFFBC, usage 0x88).
   151             /// <para />
   152             /// Second press action: Repeats message.
   153             /// <para />
   154             /// Auto-repeat: No
   155             /// <para />
   156             /// Notably sent by the 'Eject' button of HP Windows Media Center Remote (TSGH-IR08).
   157             /// Also interpreted as 'Eject' action by SoundGraph iMON Manager in MCE mode (OrigenAE VF310).
   158             /// </summary>
   159             Ext2                    =   0x34,
   160             /// <summary>
   161             /// First press action: Generates EXTn HID message in the Media Center Vendor Specific
   162             /// Collection (page 0xFFBC, usage 0x88).
   163             /// <para />
   164             /// Second press action: Repeats message.
   165             /// <para />
   166             /// Auto-repeat: No
   167             /// <para />
   168             /// Notably sent by the 'Input selection' button of HP Windows Media Center Remote (TSGH-IR08).
   169             /// </summary>
   170             Ext3                    =   0x35,
   171             Ext4                    =   0x36,
   172             Ext5                    =   0x37,
   173             Ext6                    =   0x38,
   174             Ext7                    =   0x39,
   175             Ext8                    =   0x3A,
   176             Ext9                    =   0x80,
   177             Ext10                   =   0x81,
   178             Ext11                   =   0x6F,
   179             Zoom                    =   0x27,
   180             ChannelInput            =   0x42,
   181             SubAudio                =   0x2D,
   182             Channel10               =   0x3E,
   183             Channel11               =   0x3F,
   184             Channel12               =   0x40,
   185             /// <summary>
   186             /// First press action: Generates OEM2 HID message in the Media Center Vendor Specific
   187             /// Collection. This button is intended to control the front panel display of home entertainment
   188             /// computers. When this button is pressed, the display could be turned on or off, or the display
   189             /// mode could change.
   190             /// <para />
   191             /// Second press action: Repeats message.
   192             /// <para />
   193             /// Auto-repeat: No
   194             /// <para />
   195             /// Notably issued by XBOX360 remote as defined in irplus - Remote Control - Android application.
   196             /// </summary>
   197             Display                 =   0x4F,
   198             /// <summary>
   199             /// First press action: To be determined.
   200             /// <para />
   201             /// Second press action: Repeats message.
   202             /// <para />
   203             /// Auto-repeat: No
   204             /// </summary>
   205             Kiosk                   =   0x6A,
   206             NetworkSelection        =   0x2C,
   207             BlueRayTool             =   0x78,
   208             ChannelInfo             =   0x41,
   209             VideoSelection          =   0x61
   210         }
   211 
   212         /// <summary>
   213         /// Those codes come from experimenting with HP remotes.
   214         /// </summary>
   215         public enum HpMceButton: ushort
   216         {
   217             /// <summary>
   218             /// Displays visual imagery that is synchronized to the sound of your music tracks.
   219             /// <para />
   220             /// Second press action: Repeats message.
   221             /// <para />
   222             /// Auto-repeat: No
   223             /// <para />
   224             /// Notably sent by the 'Visualization' button of HP Windows Media Center Remote (TSGH-IR08).
   225             /// <para />
   226             /// According to HP specs it displays visual imagery that is synchronized to the sound of your music tracks.
   227             /// </summary>
   228             Visualization = MceButton.Ext0,
   229             /// <summary>
   230             /// Plays a slide show of all the pictures on your hard disk drive.
   231             /// <para />
   232             /// Second press action: Repeats message.
   233             /// <para />
   234             /// Auto-repeat: No
   235             /// <para />
   236             /// Notably sent by the 'Slide Show' button of HP Windows Media Center Remote (TSGH-IR08).
   237             /// <para />
   238             /// According to HP specs it plays a slide show of all the pictures on your hard disk drive.
   239             /// </summary>
   240             SlideShow = MceButton.Ext1,
   241             /// <summary>
   242             /// Eject optical drive.
   243             /// <para />
   244             /// Second press action: Repeats message.
   245             /// <para />
   246             /// Auto-repeat: No
   247             /// <para />
   248             /// Notably sent by the 'Eject' button of HP Windows Media Center Remote (TSGH-IR08).
   249             /// Also interpreted as 'Eject' action by SoundGraph iMON Manager in MCE mode (OrigenAE VF310).
   250             /// </summary>
   251             Eject = MceButton.Ext2,
   252             /// <summary>
   253             /// Not sure what this should do.
   254             /// <para />
   255             /// Second press action: Repeats message.
   256             /// <para />
   257             /// Auto-repeat: No
   258             /// <para />
   259             /// Notably sent by the 'Input selection' button of HP Windows Media Center Remote (TSGH-IR08).
   260             /// </summary>
   261             InputSelection = MceButton.Ext3,
   262         }
   263 
   264         /// <summary>
   265         /// Usage Table for Consumer Controls
   266         /// 0x0C 0X01
   267         /// </summary>
   268         public enum ConsumerControl: ushort
   269         {
   270             Null = 0x0000,           
   271             //           
   272             Channel = 0x0086,
   273             MediaSelection = 0x0087,
   274             MediaSelectComputer = 0x0088,
   275             MediaSelectTV = 0x0089,
   276             MediaSelectWWW = 0x008A,
   277             MediaSelectDVD = 0x008B,
   278             MediaSelectTelephone = 0x008C,
   279             MediaSelectProgramGuide = 0x008D,
   280             MediaSelectVideoPhone = 0x008E,
   281             MediaSelectGames = 0x008F,
   282             MediaSelectMessages = 0x0090,
   283             MediaSelectCD = 0x0091,
   284             MediaSelectVCR = 0x0092,
   285             MediaSelectTuner = 0x0093,
   286             Quit = 0x0094,
   287             Help = 0x0095,
   288             MediaSelectTape = 0x0096,
   289             MediaSelectCable = 0x0097,
   290             MediaSelectSatellite = 0x0098,
   291             MediaSelectSecurity = 0x0099,
   292             MediaSelectHome = 0x009A,
   293             MediaSelectCall = 0x009B,
   294             ChannelIncrement = 0x009C,
   295             ChannelDecrement = 0x009D,
   296             MediaSelectSAP = 0x009E,
   297             //
   298             Play = 0x00B0,
   299             Pause = 0x00B1,
   300             Record = 0x00B2,
   301             FastForward = 0x00B3,
   302             Rewind = 0x00B4,
   303             ScanNextTrack = 0x00B5,
   304             ScanPreviousTrack = 0x00B6,
   305             Stop = 0x00B7,
   306             Eject = 0x00B8,
   307             RandomPlay = 0x00B9,
   308             SelectDisc = 0x00BA,
   309             EnterDisc = 0x00BB,
   310             Repeat = 0x00BC,
   311             Tracking = 0x00BD,
   312             TrackNormal = 0x00BE,
   313             SlowTracking = 0x00BF,
   314             FrameForward = 0x00C0,
   315             FrameBack = 0x00C1,
   316             Mark = 0x00C2,
   317             ClearMark = 0x00C3,
   318             RepeatFromMark = 0x00C4,
   319             ReturnToMark = 0x00C5,
   320             SearchMarkForward = 0x00C6,
   321             SearchMarkBackwards = 0x00C7,
   322             CounterReset = 0x00C8,
   323             ShowCounter = 0x00C9,
   324             TrackingIncrement = 0x00CA,
   325             TrackingDecrement = 0x00CB,
   326             StopEject = 0x00CC,
   327             PlayPause = 0x00CD,
   328             PlaySkip = 0x00CE,
   329 
   330             /// <summary>
   331             /// Audio controls
   332             /// </summary>
   333             Volume = 0x00E0,
   334             Balance = 0x00E1,
   335             Mute = 0x00E2,
   336             Bass = 0x00E3,
   337             Treble = 0x00E4,
   338             BassBoost = 0x00E5,
   339             SurroundMode = 0x00E6,
   340             Loudness = 0x00E7,
   341             MPX = 0x00E8,
   342             VolumeIncrement = 0x00E9,
   343             VolumeDecrement = 0x00EA,
   344 
   345             //Generic GUI Application Controls
   346             GenericGUIApplicationControls = 0x0200,
   347             AppCtrlNew = 0x0201,
   348             AppCtrlOpen = 0x0202,
   349             AppCtrlClose = 0x0203,
   350             AppCtrlExit = 0x0204,
   351             AppCtrlMaximize = 0x0205,
   352             AppCtrlMinimize = 0x0206,
   353             AppCtrlSave = 0x0207,
   354             AppCtrlPrint = 0x0208,
   355             AppCtrlProperties = 0x0209,
   356             AppCtrlUndo = 0x021A,
   357             AppCtrlCopy = 0x021B,
   358             AppCtrlCut = 0x021C,
   359             AppCtrlPaste = 0x021D,
   360             AppCtrlSelectAll = 0x021E,
   361             AppCtrlFind = 0x021F,
   362             AppCtrlFindAndReplace = 0x0220,
   363             AppCtrlSearch = 0x0221,
   364             AppCtrlGoTo = 0x0222,
   365             AppCtrlHome = 0x0223,
   366             AppCtrlBack = 0x0224,
   367             AppCtrlForward = 0x0225,
   368             AppCtrlStop = 0x0226,
   369             AppCtrlRefresh = 0x0227,
   370             AppCtrlPreviousLink = 0x0228,
   371             AppCtrlNextLink = 0x0229,
   372             AppCtrlBookmarks = 0x022A,
   373             AppCtrlHistory = 0x022B,
   374             AppCtrlSubscriptions = 0x022C,
   375             AppCtrlZoomIn = 0x022D,
   376             AppCtrlZoomOut = 0x022E,
   377             AppCtrlZoom = 0x022F,
   378             AppCtrlFullScreenView = 0x0230,
   379             AppCtrlNormalView = 0x0231,
   380             AppCtrlViewToggle = 0x0232,
   381             AppCtrlScrollUp = 0x0233,
   382             AppCtrlScrollDown = 0x0234,
   383             AppCtrlScroll = 0x0235,
   384             AppCtrlPanLeft = 0x0236,
   385             AppCtrlPanRight = 0x0237,
   386             AppCtrlPan = 0x0238,
   387             AppCtrlNewWindow = 0x0239,
   388             AppCtrlTileHorizontally = 0x023A,
   389             AppCtrlTileVertically = 0x023B,
   390             AppCtrlFormat = 0x023C,
   391             AppCtrlEdit = 0x023D,
   392         }
   393     }
   394 }