Class ReactiveGlobalHookAdapter
public sealed class ReactiveGlobalHookAdapter : IGlobalHook, IReactiveGlobalHook, IBasicGlobalHook, IDisposable
- Inheritance
-
ReactiveGlobalHookAdapter
- Implements
- Inherited Members
Constructors
ReactiveGlobalHookAdapter(IGlobalHook, IScheduler?)
public ReactiveGlobalHookAdapter(IGlobalHook hook, IScheduler? defaultScheduler = null)
Parameters
hookIGlobalHookdefaultSchedulerIScheduler
Properties
HookDisabled
public IObservable<HookEventArgs> HookDisabled { get; }
Property Value
HookEnabled
public IObservable<HookEventArgs> HookEnabled { get; }
Property Value
IsDisposed
Gets the value which indicates whether the global hook has been disposed.
public bool IsDisposed { get; }
Property Value
Remarks
A disposed global hook cannot be started again.
IsRunning
Gets the value which indicates whether the global hook is running.
public bool IsRunning { get; }
Property Value
KeyPressed
public IObservable<KeyboardHookEventArgs> KeyPressed { get; }
Property Value
KeyReleased
public IObservable<KeyboardHookEventArgs> KeyReleased { get; }
Property Value
KeyTyped
public IObservable<KeyboardHookEventArgs> KeyTyped { get; }
Property Value
MouseClicked
public IObservable<MouseHookEventArgs> MouseClicked { get; }
Property Value
MouseDragged
public IObservable<MouseHookEventArgs> MouseDragged { get; }
Property Value
MouseMoved
public IObservable<MouseHookEventArgs> MouseMoved { get; }
Property Value
MousePressed
public IObservable<MouseHookEventArgs> MousePressed { get; }
Property Value
MouseReleased
public IObservable<MouseHookEventArgs> MouseReleased { get; }
Property Value
MouseWheel
public IObservable<MouseWheelHookEventArgs> MouseWheel { get; }
Property Value
Methods
Dispose()
public void Dispose()
Run()
Runs the global hook on the current thread, blocking it. The hook can be stopped temporarily by calling Stop() or stopped permanently by calling Dispose().
public void Run()
Exceptions
- HookException
Starting the global hook has failed.
- InvalidOperationException
The global hook is already running.
- ObjectDisposedException
The global hook has been disposed.
RunAsync()
Runs the global hook without blocking the current thread. The hook can be stopped temporarily by calling Stop() or stopped permanently by calling Dispose().
public Task RunAsync()
Returns
Remarks
Since the underlying native API for running a global hook is blocking, the only way to run it without blocking the current thread is to run it on a separate thread.
Exceptions
- HookException
Starting the global hook has failed.
- InvalidOperationException
The global hook is already running.
- ObjectDisposedException
The global hook has been disposed.
Stop()
Stops the global hook.
public void Stop()
Remarks
After stopping, the global hook can run again.
Exceptions
- ObjectDisposedException
The global hook has been disposed.