Пример #1
0
        static void Main()
        {
            CustomHIDReceiver device = new CustomHIDReceiver();

            try
            {
                device.Configure(null);

                device.RemoteCallback   += new RemoteHandler(xRemote);
                device.KeyboardCallback += new KeyboardHandler(xKeyboard);
                device.MouseCallback    += new MouseHandler(xMouse);

                Console.WriteLine("Usage: {0}", device._device.usUsage);
                Console.WriteLine("UsagePage: {0}", device._device.usUsagePage);
                Console.WriteLine();

                device.Start();

                Application.Run();

                device.Stop();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
            finally
            {
                device = null;
            }

            Console.ReadKey();
        }
    static void Main()
    {
      CustomHIDReceiver device = new CustomHIDReceiver();
      
      try
      {
        device.Configure(null);

        device.RemoteCallback += new RemoteHandler(xRemote);
        device.KeyboardCallback += new KeyboardHandler(xKeyboard);
        device.MouseCallback += new MouseHandler(xMouse);      

        Console.WriteLine("Usage: {0}", device._device.usUsage);
        Console.WriteLine("UsagePage: {0}", device._device.usUsagePage);
        Console.WriteLine();

        device.Start();

        Application.Run();

        device.Stop();
      }
      catch (Exception ex)
      {
        Console.WriteLine(ex.ToString());
      }
      finally
      {
        device = null;
      }

      Console.ReadKey();
    }