public KeyboardKeyDownUpSource( Enums.Keys triggerKey, IPointSource pointSource) { this.triggerKey = (System.Windows.Forms.Keys)triggerKey; //Cast to the Windows.Forms.Keys enum this.pointSource = pointSource; keyboardHookListener = new KeyboardHookListener(new GlobalHooker()) { Enabled = true }; System.Windows.Application.Current.Exit += (sender, args) => { keyboardHookListener.Dispose(); Log.Debug("Keyboard hook listener disposed."); }; /* * Keys: http://msdn.microsoft.com/en-GB/library/system.windows.forms.keys.aspx * KeyDown: happens when the person presses a key (when the keyboard first detects a finger on a key, this happens when the key is pressed down). * KeyPress: happens when a key is pressed and then released. * KeyUp: happens when the key is released */ }
public KeyboardKeyDownUpSource( Enums.Keys triggerKey, IObservable <Timestamped <PointAndKeyValue?> > pointAndKeyValueSource) { this.triggerKey = (System.Windows.Forms.Keys)triggerKey; //Cast to the Windows.Forms.Keys enum this.pointAndKeyValueSource = pointAndKeyValueSource; keyboardHookListener = new KeyboardHookListener(new GlobalHooker()) { Enabled = true }; /* * Keys: http://msdn.microsoft.com/en-GB/library/system.windows.forms.keys.aspx * KeyDown: happens when the person presses a key (when the keyboard first detects a finger on a key, this happens when the key is pressed down). * KeyPress: happens when a key is pressed and then released. * KeyUp: happens when the key is released */ }