
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
SharpHook provides a cross-platform global keyboard and mouse hook, event simulation, and text entry simulation for .NET.
SharpHook provides a cross-platform global keyboard and mouse hook, event simulation, and text entry simulation for .NET. It is a wrapper of libuiohook and provides direct access to its features as well as higher-level types to work with it.
If you're using Rx.NET, you can use the SharpHook.Reactive package to integrate SharpHook with Rx.NET.
Refer to the SharpHook package for the basic usage guidelines.
SharpHook.Reactive provides the IReactiveGlobalHook
interface along with a default implementation and an adapter
which you can use to use to control the global hook and subscribe to its observables. Here's a basic example:
using SharpHook.Reactive;
// ...
var hook = new ReactiveGlobalHook();
hook.HookEnabled.Subscribe(OnHookEnabled);
hook.HookDisabled.Subscribe(OnHookDisabled);
hook.KeyTyped.Subscribe(OnKeyTyped);
hook.KeyPressed.Subscribe(OnKeyPressed);
hook.KeyReleased.Subscribe(OnKeyReleased);
hook.MouseClicked.Subscribe(OnMouseClicked);
hook.MousePressed.Subscribe(OnMousePressed);
hook.MouseReleased.Subscribe(OnMouseReleased);
hook.MouseMoved
.Throttle(TimeSpan.FromSeconds(0.5))
.Subscribe(OnMouseMoved);
hook.MouseDragged
.Throttle(TimeSpan.FromSeconds(0.5))
.Subscribe(OnMouseDragged);
hook.MouseWheel.Subscribe(OnMouseWheel);
hook.Run();
// or
hook.RunAsync().Subscribe();
Reactive global hooks are basically the same as the default global hooks and the same rules apply to them.
SharpHook.Reactive provides two implementations of IReactiveGlobalHook
:
SharpHook.Reactive.ReactiveGlobalHook
. Since we're dealing with observables, it's up to you to decide when and where
to handle the events through schedulers. A default scheduler can be specified for all observables.
SharpHook.Reactive.ReactiveGlobalHookAdapter
adapts an IGlobalHook
to IReactiveGlobalHook
. All
subscriptions and changes are propagated to the adapted hook. There is no default adapter from IReactiveGlobalHook
to IGlobalHook
. A default scheduler can be specified for all observables.
SharpHook.Reactive contains IReactiveLogSource
and ReactiveLogSourceAdapter
so you can use them in a more reactive
way:
using SharpHook.Logging;
using SharpHook.Reactive.Logging;
// ...
var logSource = LogSource.RegisterOrGet();
var reactiveLogSource = new ReactiveLogSourceAdapter(logSource);
reactiveLogSource.MessageLogged.Subscribe(this.OnMessageLogged);
As an alternative, SharpHook also provides integration with R3 in the SharpHook.R3 package.
Icon made by Freepik from www.flaticon.com.
FAQs
SharpHook provides a cross-platform global keyboard and mouse hook, event simulation, and text entry simulation for .NET.
We found that sharphook.reactive demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.