Skip to content

HIDConnector ​

A HID connector for sending keyboard, mouse, and gamepad input to a target process.

Kind: Class

Namespace: ConnectorLib

Inheritance: ConnectorBase → IDisposable → IGameConnector

Public Constructors

HIDConnector()

Creates a new instance of the ConnectorLib.HIDConnector class.

Public Member Functions

void

FindTargetProcess(string processName)

Finds a target process by its name.

virtual override

Task>

Connect()

virtual override

Task

Disconnect(string message)

bool

GamepadAxisLeftX(short value)

Sets the value of the left thumbstick's X-axis on the virtual gamepad.

bool

GamepadAxisLeftY(short value)

Sets the value of the left thumbstick's Y-axis on the virtual gamepad.

bool

GamepadAxisLeft(short xValue, short yValue)

Sets the value of both left thumbstick axes on the virtual gamepad.

bool

GamepadAxisRightX(short value)

Sets the value of the right thumbstick's X-axis on the virtual gamepad.

bool

GamepadAxisRightY(short value)

Sets the value of the right thumbstick's Y-axis on the virtual gamepad.

bool

GamepadAxisRight(short xValue, short yValue)

Sets the value of both right thumbstick axes on the virtual gamepad.

bool

GamepadTriggerLeft(byte value)

Sets the value of the left analog trigger on the virtual gamepad.

bool

GamepadTriggerRight(byte value)

Sets the value of the right analog trigger on the virtual gamepad.

bool

GamepadButtonPress(Buttons button)

Presses a button on the virtual gamepad for the default duration.

bool

GamepadButtonHold(Buttons button, SITimeSpan duration)

bool

GamepadButtonHold(Buttons button, int duration)

bool

GamepadButtonDown(Buttons button)

Holds a button down on the virtual gamepad.

bool

GamepadButtonUp(Buttons button)

Releases a button on the virtual gamepad.

bool

MouseMove(Vector2 location)

Moves the mouse cursor to the specified location within the target process's client area.

bool

MouseMove(Point location)

Moves the mouse cursor to the specified location within the target process's client area.

bool

MouseMove(int x, int y)

Moves the mouse cursor to the specified location within the target process's client area.

bool

MouseClickLeft(Vector2 location)

Clicks the left mouse button at the current cursor location.

bool

MouseClickLeft(Point location)

Clicks the left mouse button at the current cursor location.

bool

MouseClickLeft(int x, int y)

Clicks the left mouse button at the current cursor location.

bool

MouseClickLeft()

Clicks the left mouse button at the current cursor location.

bool

MouseDoubleClickLeft(Vector2 location)

Double-clicks the left mouse button at the current cursor location.

bool

MouseDoubleClickLeft(Point location)

Double-clicks the left mouse button at the current cursor location.

bool

MouseDoubleClickLeft(int x, int y)

Double-clicks the left mouse button at the current cursor location.

bool

MouseDoubleClickLeft()

Double-clicks the left mouse button at the current cursor location.

bool

MouseClickRight(Vector2 location)

Clicks the right mouse button at the current cursor location.

bool

MouseClickRight(Point location)

Clicks the right mouse button at the current cursor location.

bool

MouseClickRight(int x, int y)

Clicks the right mouse button at the current cursor location.

bool

MouseClickRight()

Clicks the right mouse button at the current cursor location.

bool

MouseDoubleClickRight(Vector2 location)

Double-clicks the right mouse button at the current cursor location.

bool

MouseDoubleClickRight(Point location)

Double-clicks the right mouse button at the current cursor location.

bool

MouseDoubleClickRight(int x, int y)

Double-clicks the right mouse button at the current cursor location.

bool

MouseDoubleClickRight()

Double-clicks the right mouse button at the current cursor location.

bool

MouseClickMiddle(Vector2 location)

Clicks the middle mouse button at the current cursor location.

bool

MouseClickMiddle(Point location)

Clicks the middle mouse button at the current cursor location.

bool

MouseClickMiddle(int x, int y)

Clicks the middle mouse button at the current cursor location.

bool

MouseClickMiddle()

Clicks the middle mouse button at the current cursor location.

bool

MouseDoubleClickMiddle(Vector2 location)

Double-clicks the middle mouse button at the current cursor location.

bool

MouseDoubleClickMiddle(Point location)

Double-clicks the middle mouse button at the current cursor location.

bool

MouseDoubleClickMiddle(int x, int y)

Double-clicks the middle mouse button at the current cursor location.

bool

MouseDoubleClickMiddle()

Double-clicks the middle mouse button at the current cursor location.

bool

MouseScrollVertical(int clicks)

Scrolls the mouse wheel vertically by the specified number of clicks.

bool

MouseScrollHorizontal(int clicks)

Scrolls the mouse wheel horizontally by the specified number of clicks.

bool

KeyPress(char key)

Presses a key on the keyboard.

bool

KeyPress(VirtualKeyCode key)

Presses a key on the keyboard.

bool

KeyPress(VirtualKeyCode key, IEnumerable modifiers)

Presses a key on the keyboard.

bool

KeyPress(IEnumerable keys)

Presses a key on the keyboard.

bool

KeyDown(VirtualKeyCode key)

Holds a key on the keyboard.

bool

KeyUp(VirtualKeyCode key)

Releases a key on the keyboard.

Properties

Process

TargetProcess

[get, set]

The target process to which the HID connector will send input.

TimeSpan

ButtonPressDuratiion

[get, set]

Default duration for button press actions.

bool

Connected

[get, ]