Class ReactiveGlobalHook
Represents a reactive global keyboard and mouse hook.
public sealed class ReactiveGlobalHook : BasicGlobalHookBase, IReactiveGlobalHook, IBasicGlobalHook, IDisposable
- Inheritance
-
ReactiveGlobalHook
- Implements
- Inherited Members
Constructors
ReactiveGlobalHook(GlobalHookType, IScheduler?, IGlobalHookProvider?, bool)
Initializes a new instance of ReactiveGlobalHook.
public ReactiveGlobalHook(GlobalHookType globalHookType = GlobalHookType.All, IScheduler? defaultScheduler = null, IGlobalHookProvider? globalHookProvider = null, bool runAsyncOnBackgroundThread = false)
Parameters
globalHookTypeGlobalHookTypeThe global hook type.
defaultSchedulerISchedulerThe default scheduler for observables, or null to use the default one (System.Reactive.Concurrency.Scheduler.Immediate).
globalHookProviderIGlobalHookProviderThe underlying global hook provider, or null to use the default one.
runAsyncOnBackgroundThreadbooltrue if RunAsync() should run the hook on a background thread. Otherwise, false.
Properties
HookDisabled
Gets an observable which emits a value when the global hook is disabled.
public IObservable<HookEventArgs> HookDisabled { get; }
Property Value
- IObservable<HookEventArgs>
An observable which emits a value when the global hook is disabled.
Remarks
HookEnabled
Gets an observable which emits a value when the global hook is enabled.
public IObservable<HookEventArgs> HookEnabled { get; }
Property Value
- IObservable<HookEventArgs>
An observable which emits a value when the global hook is enabled.
Remarks
The observable emits a value when the Run() or RunAsync() method is called.
KeyPressed
Gets an observable which emits a value when a key is pressed.
public IObservable<KeyboardHookEventArgs> KeyPressed { get; }
Property Value
- IObservable<KeyboardHookEventArgs>
An observable which emits a value when a key is pressed.
KeyReleased
Gets an observable which emits a value when a key is released.
public IObservable<KeyboardHookEventArgs> KeyReleased { get; }
Property Value
- IObservable<KeyboardHookEventArgs>
An observable which emits a value when a key is released.
KeyTyped
Gets an observable which emits a value when a key is typed.
public IObservable<KeyboardHookEventArgs> KeyTyped { get; }
Property Value
- IObservable<KeyboardHookEventArgs>
An observable which emits a value when a key is typed.
MouseClicked
Gets an observable which emits a value when a mouse button is clicked.
public IObservable<MouseHookEventArgs> MouseClicked { get; }
Property Value
- IObservable<MouseHookEventArgs>
An observable which emits a value when a mouse button is clicked.
MouseDragged
Gets an observable which emits a value when the mouse cursor is dragged.
public IObservable<MouseHookEventArgs> MouseDragged { get; }
Property Value
- IObservable<MouseHookEventArgs>
An observable which emits a value when the mouse cursor is dragged.
MouseMoved
Gets an observable which emits a value when the mouse cursor is moved.
public IObservable<MouseHookEventArgs> MouseMoved { get; }
Property Value
- IObservable<MouseHookEventArgs>
An observable which emits a value when the mouse cursor is moved.
MousePressed
Gets an observable which emits a value when a mouse button is pressed.
public IObservable<MouseHookEventArgs> MousePressed { get; }
Property Value
- IObservable<MouseHookEventArgs>
An observable which emits a value when a mouse button is pressed.
MouseReleased
Gets an observable which emits a value when a mouse button is released.
public IObservable<MouseHookEventArgs> MouseReleased { get; }
Property Value
- IObservable<MouseHookEventArgs>
An observable which emits a value when a mouse button is released.
MouseWheel
Gets an observable which emits a value when the mouse wheel is scrolled.
public IObservable<MouseWheelHookEventArgs> MouseWheel { get; }
Property Value
- IObservable<MouseWheelHookEventArgs>
An observable which emits a value when the mouse wheel is scrolled.
Methods
Dispose(bool)
Disposes of the global hook, stopping it if it is running.
protected override void Dispose(bool disposing)
Parameters
Exceptions
- HookException
Stopping the hook has failed.
HandleHookEvent(ref UioHookEvent)
Handles the hook event.
protected override void HandleHookEvent(ref UioHookEvent e)
Parameters
eUioHookEventThe event to handle.