Class UioHook
Contains native methods of libuiohook.
Inherited Members
Namespace: SharpHook.Native
Assembly: SharpHook.dll
Syntax
public static class UioHook
Methods
| Improve this Doc View SourceCreateScreenInfo()
Gets the information about screens.
Declaration
public static ScreenData[] CreateScreenInfo()
Returns
Type | Description |
---|---|
ScreenData[] | The information about screens. |
Remarks
This is the safe version of CreateScreenInfo(out Byte) as it returns a managed array.
See Also
CreateScreenInfo(out Byte)
Gets the information about screens.
Declaration
public static extern IntPtr CreateScreenInfo(out byte count)
Parameters
Type | Name | Description |
---|---|---|
Byte | count | The number of screens. |
Returns
Type | Description |
---|---|
IntPtr | The information about screens as an unmanaged array of ScreenData whose length is returned
as |
Remarks
You should use CreateScreenInfo() instead as it returns a managed array.
See Also
GetAutoRepeatDelay()
Gets the auto-repeat delay.
Declaration
public static extern int GetAutoRepeatDelay()
Returns
Type | Description |
---|---|
Int32 | The auto-repeat delay. |
GetAutoRepeatRate()
Gets the auto-repeat rate.
Declaration
public static extern int GetAutoRepeatRate()
Returns
Type | Description |
---|---|
Int32 | The auto-repeat rate. |
GetMultiClickTime()
Gets the multi-click time.
Declaration
public static extern int GetMultiClickTime()
Returns
Type | Description |
---|---|
Int32 | The multi-click time. |
GetPointerAccelerationMultiplier()
Gets the pointer acceleration multiplier.
Declaration
public static extern int GetPointerAccelerationMultiplier()
Returns
Type | Description |
---|---|
Int32 | The pointer acceleration multiplier. |
GetPointerAccelerationThreshold()
Gets the pointer acceleration threshold.
Declaration
public static extern int GetPointerAccelerationThreshold()
Returns
Type | Description |
---|---|
Int32 | The pointer acceleration threshold. |
GetPointerSensitivity()
Gets the pointer sensitivity.
Declaration
public static extern int GetPointerSensitivity()
Returns
Type | Description |
---|---|
Int32 | The pointer sensitivity. |
PostEvent(ref UioHookEvent)
Posts a fake input event.
Declaration
public static extern UioHookResult PostEvent(ref UioHookEvent e)
Parameters
Type | Name | Description |
---|---|---|
UioHookEvent | e | The event to post. |
Returns
Type | Description |
---|---|
UioHookResult | The result of the operation. |
Remarks
The instance of the event doesn't need all fields to have value. Only Type, Keyboard/Mouse/Wheel should be present.
The following table describes the specifics of simulating each event type.
Event type | Description |
---|---|
HookEnabled | Events of this type are ignored. |
HookDisabled | Events of this type are ignored. |
KeyPressed | Only KeyCode is considered. |
KeyReleased | Only KeyCode is considered. |
KeyTyped | Events of this type are ignored. |
MousePressed | Only X, Y, and Button are considered. |
MouseReleased | Only X, Y, and Button are considered. |
MouseClicked | Events of this type are ignored. |
MouseMoved | Only X and Y are considered. |
MouseDragged | Not recommended to use; same as MouseMoved. |
MouseWheel | Only X, Y, Amount, and Rotation are considered. |
Mouse wheel simulation is a little inconsistent across platforms, and not documented. View the source code of libuiohook for more details.
See Also
Run()
Runs the global hook and blocks the thread until it's stopped.
Declaration
public static extern UioHookResult Run()
Returns
Type | Description |
---|---|
UioHookResult | The result of the operation. |
SetDispatchProc(DispatchProc, IntPtr)
Sets the hook callback function.
Declaration
public static extern void SetDispatchProc(DispatchProc dispatchProc, IntPtr userData)
Parameters
Type | Name | Description |
---|---|---|
DispatchProc | dispatchProc | The function to call when an event is raised, or null to unset the function. |
IntPtr | userData | Custom data to pass to the callback. Should not be used, and Zero should always be passed. |
See Also
SetLoggerProc(LoggerProc, IntPtr)
Sets the log callback function.
Declaration
public static extern void SetLoggerProc(LoggerProc loggerProc, IntPtr userData)
Parameters
Type | Name | Description |
---|---|---|
LoggerProc | loggerProc | The function to call for logging, or null to unset the function. |
IntPtr | userData | Custom data to pass to the callback. Should not be used, and Zero should always be passed. |
See Also
Stop()
Stops the global hook.
Declaration
public static extern UioHookResult Stop()
Returns
Type | Description |
---|---|
UioHookResult | The result of the operation. |