Class R3GlobalHook
Represents a reactive R3 global keyboard and mouse hook.
public sealed class R3GlobalHook : BasicGlobalHookBase, IR3GlobalHook, IBasicGlobalHook, IDisposable
- Inheritance
-
R3GlobalHook
- Implements
- Inherited Members
Constructors
R3GlobalHook(GlobalHookType, TimeProvider?, IGlobalHookProvider?, bool)
Initializes a new instance of R3GlobalHook.
public R3GlobalHook(GlobalHookType globalHookType = GlobalHookType.All, TimeProvider? defaultTimeProvider = null, IGlobalHookProvider? globalHookProvider = null, bool runAsyncOnBackgroundThread = false)
Parameters
globalHookTypeGlobalHookTypeThe global hook type.
defaultTimeProviderTimeProviderThe default time provider for observables, or null to use the default one as defined in R3.ObservableSystem.DefaultTimeProvider.
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 Observable<HookEventArgs> HookDisabled { get; }
Property Value
- Observable<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 Observable<HookEventArgs> HookEnabled { get; }
Property Value
- Observable<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 Observable<KeyboardHookEventArgs> KeyPressed { get; }
Property Value
- Observable<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 Observable<KeyboardHookEventArgs> KeyReleased { get; }
Property Value
- Observable<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 Observable<KeyboardHookEventArgs> KeyTyped { get; }
Property Value
- Observable<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 Observable<MouseHookEventArgs> MouseClicked { get; }
Property Value
- Observable<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 Observable<MouseHookEventArgs> MouseDragged { get; }
Property Value
- Observable<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 Observable<MouseHookEventArgs> MouseMoved { get; }
Property Value
- Observable<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 Observable<MouseHookEventArgs> MousePressed { get; }
Property Value
- Observable<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 Observable<MouseHookEventArgs> MouseReleased { get; }
Property Value
- Observable<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 Observable<MouseWheelHookEventArgs> MouseWheel { get; }
Property Value
- Observable<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.