You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I'm not mistaken there's no API documentation for Interception, which would be really helpful to have. I asked ChatGPT to write some documentation and I think it did a decent job. Maybe someone who knows the library well wants check this for correctness and completeness and then make it the official documentation? Thanks!
Interception Library Documentation
Overview
The Interception library provides an interface for capturing and processing keyboard and mouse input at a low level on Windows. It allows applications to intercept, filter, and modify input events before they reach their intended destinations.
API Reference
1. Structs
1.1 InterceptionKeyStroke
Represents a keyboard input event.
Members:
unsigned short code: The key code of the keyboard event.
unsigned short state: The state of the key (e.g., key down or key up).
1.2 InterceptionMouseStroke
Represents a mouse input event.
Members:
unsigned short state: The state of the mouse buttons.
unsigned short flags: Flags representing additional state information.
short rolling: The rolling delta for mouse wheel events.
int x: The x-coordinate of the mouse cursor.
int y: The y-coordinate of the mouse cursor.
unsigned int information: Additional information about the mouse event.
1.3 InterceptionStroke
A union representing an input event (either keyboard or mouse).
Members:
InterceptionKeyStroke key: Represents a keyboard input event.
InterceptionMouseStroke mouse: Represents a mouse input event.
Looks excellent, ChatGPT is crazy good now, given enough information.
This is something that should be added to the project wiki, as this is something i wish i saw right away(and others surely will too).
You should also consider making a pull request and adding it to the interception header file, e.g.,
/**
* @brief Calculates the factorial of a number.
*
* This function computes the factorial of a non-negative integer using
* an iterative approach.
*
* @param n The non-negative integer for which the factorial is to be computed.
* Must be >= 0.
*
* @return The factorial of the given number. Returns 1 if n is 0.
*
* @note This function does not handle negative inputs. Ensure n is non-negative.
*/
int factorial(int n);
Unfortunately it does not seem like @oblitum is active on GitHub anymore, so it's unknown whether the pull request would be accepted or not.
If I'm not mistaken there's no API documentation for Interception, which would be really helpful to have. I asked ChatGPT to write some documentation and I think it did a decent job. Maybe someone who knows the library well wants check this for correctness and completeness and then make it the official documentation? Thanks!
Interception Library Documentation
Overview
The Interception library provides an interface for capturing and processing keyboard and mouse input at a low level on Windows. It allows applications to intercept, filter, and modify input events before they reach their intended destinations.
API Reference
1. Structs
1.1 InterceptionKeyStroke
Represents a keyboard input event.
Members:
unsigned short code
: The key code of the keyboard event.unsigned short state
: The state of the key (e.g., key down or key up).1.2 InterceptionMouseStroke
Represents a mouse input event.
Members:
unsigned short state
: The state of the mouse buttons.unsigned short flags
: Flags representing additional state information.short rolling
: The rolling delta for mouse wheel events.int x
: The x-coordinate of the mouse cursor.int y
: The y-coordinate of the mouse cursor.unsigned int information
: Additional information about the mouse event.1.3 InterceptionStroke
A union representing an input event (either keyboard or mouse).
Members:
InterceptionKeyStroke key
: Represents a keyboard input event.InterceptionMouseStroke mouse
: Represents a mouse input event.2. Enums and Constants
2.1 Key States
Constants for
state
inInterceptionKeyStroke
:INTERCEPTION_KEY_DOWN
INTERCEPTION_KEY_UP
INTERCEPTION_KEY_E0
INTERCEPTION_KEY_E1
INTERCEPTION_KEY_TERMSRV_SET_LED
INTERCEPTION_KEY_TERMSRV_SHADOW
2.2 Mouse States
Constants for
state
inInterceptionMouseStroke
:INTERCEPTION_MOUSE_LEFT_BUTTON_DOWN
INTERCEPTION_MOUSE_LEFT_BUTTON_UP
INTERCEPTION_MOUSE_RIGHT_BUTTON_DOWN
INTERCEPTION_MOUSE_RIGHT_BUTTON_UP
INTERCEPTION_MOUSE_MIDDLE_BUTTON_DOWN
INTERCEPTION_MOUSE_MIDDLE_BUTTON_UP
INTERCEPTION_MOUSE_BUTTON_4_DOWN
INTERCEPTION_MOUSE_BUTTON_4_UP
INTERCEPTION_MOUSE_BUTTON_5_DOWN
INTERCEPTION_MOUSE_BUTTON_5_UP
INTERCEPTION_MOUSE_WHEEL
INTERCEPTION_MOUSE_HWHEEL
2.3 Mouse Flags
Constants for
flags
inInterceptionMouseStroke
:INTERCEPTION_MOUSE_MOVE_RELATIVE
INTERCEPTION_MOUSE_MOVE_ABSOLUTE
INTERCEPTION_MOUSE_VIRTUAL_DESKTOP
INTERCEPTION_MOUSE_ATTRIBUTES_CHANGED
3. Functions
3.1 Context Management
InterceptionContext interception_create_context(void);
interception_destroy_context
.void interception_destroy_context(InterceptionContext context);
context
: The Interception context to be destroyed.3.2 Device Management
InterceptionDevice interception_wait(InterceptionContext context);
context
: The Interception context.int interception_receive(InterceptionContext context, InterceptionDevice device, InterceptionStroke *stroke, unsigned int nstroke);
context
: The Interception context.device
: The device handle.stroke
: Pointer to an array ofInterceptionStroke
structures to receive the events.nstroke
: The number of strokes to receive.int interception_send(InterceptionContext context, InterceptionDevice device, const InterceptionStroke *stroke, unsigned int nstroke);
context
: The Interception context.device
: The device handle.stroke
: Pointer to an array ofInterceptionStroke
structures containing the events to send.nstroke
: The number of strokes to send.unsigned int interception_get_hardware_id(InterceptionContext context, InterceptionDevice device, void *buffer, unsigned int buffer_size);
context
: The Interception context.device
: The device handle.buffer
: Pointer to a buffer to receive the hardware ID.buffer_size
: The size of the buffer.3.3 Filter Management
void interception_set_filter(InterceptionContext context, InterceptionPredicate predicate, InterceptionFilter filter);
context
: The Interception context.predicate
: A function pointer to a predicate function to match devices.filter
: The filter to apply to matching devices.InterceptionFilter interception_get_filter(InterceptionContext context, InterceptionDevice device);
context
: The Interception context.device
: The device handle.3.4 Predicate Functions
int interception_is_keyboard(InterceptionDevice device);
device
: The device handle.int interception_is_mouse(InterceptionDevice device);
device
: The device handle.Example Usage
Notes:
The text was updated successfully, but these errors were encountered: