Пример #1
0
 public void Start(IKeyDownEventHandler keyDownEventHandler)
 {
     Stop();
     _keyDownEventHandler   = keyDownEventHandler;
     _keyboardWatcherThread = new Thread(KeyboardWatcherThreadWork);
     _keyboardWatcherThread.SetApartmentState(ApartmentState.STA);
     _keyboardWatcherThread.Priority     = ThreadPriority.Highest;
     _keyboardWatcherThread.IsBackground = true;
     _keyboardWatcherThread.Name         = "KeyboardWatcherThread";
     _keyboardWatcherThread.Start();
 }
Пример #2
0
 public Keyboard(IKeyDownEventHandler handler)
 {
     this.handler = handler;
     Start();
 }