🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

H.InputSimulatorUnityCompatibility

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package version was removed
This package version has been unpublished, mostly likely due to security reasons

H.InputSimulatorUnityCompatibility

Based on HavenDV/H.InputSimulator, downgraded dependencies which conflict with Unity.Container Allows you to simulate global mouse and keyboard events. Features: - Supports scan codes and multi-language input. - Supports WPF/WinForms/Console windows apps. - Supports .NET Standard, .Net Core and .Net 5/6. Supported OS: - Windows

2.1.0-dev.84
unpublished
NuGet
Maintainers
1
Created
Source

H.InputSimulator

Allows you to simulate global mouse and keyboard events. Features:

  • Supports scan codes and multi-language input.
  • Supports WPF/WinForms/Console windows apps.
  • Supports .NET Standard 2.0+, .Net Framework 4.6.2 and .Net 8+.
  • Supports trimming/nativeAOT, nullability, and other modern C# features.

Supported OS:

  • Windows

Nuget

NuGet

Install-Package H.InputSimulator

Examples

SelectCopyPaste

new InputSimulator().Keyboard
    .ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_A)
    .ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_C)
    .ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_V);

OpenWindowsExplorer

new InputSimulator().Keyboard
    .ModifiedKeyStroke(VirtualKeyCode.LWIN, VirtualKeyCode.VK_E);

SelfDestructMessage

new InputSimulator().Keyboard
    .ModifiedKeyStroke(VirtualKeyCode.LWIN, VirtualKeyCode.VK_R)
    .Sleep(1000)
    .TextEntry("notepad")
    .Sleep(1000)
    .KeyPress(VirtualKeyCode.RETURN)
    .Sleep(1000)
    .TextEntry("These are your orders if you choose to accept them...")
    .TextEntry("This message will self destruct in 5 seconds.")
    .Sleep(5000)
    .ModifiedKeyStroke(VirtualKeyCode.MENU, VirtualKeyCode.F4)
    .KeyPress(VirtualKeyCode.VK_N);

OpenPaintAndCreateLine

new InputSimulator().Keyboard
    .ModifiedKeyStroke(VirtualKeyCode.LWIN, VirtualKeyCode.VK_R)
    .Sleep(1000)
    .TextEntry("mspaint")
    .Sleep(1000)
    .KeyPress(VirtualKeyCode.RETURN)
    .Sleep(1000)
    .Mouse
    .LeftButtonDown()
    .MoveMouseToPositionOnVirtualDesktop(65535 / 2, 65535 / 2)
    .LeftButtonUp();

Common problems

Some simulated input commands were not sent successfully.

Please think of the library as a high-level wrapper over Win32 SendInput call. Unfortunately, this is a limitation of the API itself, according to this documentation:

The easiest way to get around this is to run your application as an administrator.

Support

Priority place for bugs: https://github.com/HavenDV/H.InputSimulator/issues
Priority place for ideas and general questions: https://github.com/HavenDV/H.InputSimulator/discussions
I also have a Discord support channel:
https://discord.gg/g8u2t9dKgE

Keywords

simulate

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts