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(); }
public Keyboard(IKeyDownEventHandler handler) { this.handler = handler; Start(); }