Ejemplo n.º 1
0
 public void WatchKeyPress()
 {
     while (true)
     {
         byte key    = 1;
         int  result = KmyImporter.ScoutKeyPress(ref key);
         OnKeyPressByteEvent(key);
         OnKeyPressStringEvent(key.ToString());
     }
 }
Ejemplo n.º 2
0
 public void Close()
 {
     if (isOpened)
     {
         KmyImporter.KeyboardControl(1);
         KmyImporter.ClosePort();
         if (watcherThread != null)
         {
             watcherThread.Abort();
         }
     }
 }
Ejemplo n.º 3
0
 public void Open(int type)
 {
     if (!isOpened)
     {
         KmyImporter.OpenPort(port, 9600);
         KmyImporter.KeyboardControl(type);
         this.isOpened = true;
         watcherThread = new Thread(new ThreadStart(WatchKeyPress));
         watcherThread.IsBackground = true;
         watcherThread.Start();
     }
 }