Carlos487 / awesome-wpf

A collection of awesome WPF resources, libraries and UI controls.
Creative Commons Zero v1.0 Universal
1.74k stars 161 forks source link

Update README.md (Add DeftSharp.Windows.Input) #20

Closed Empiree closed 2 months ago

Empiree commented 6 months ago

Hello! I am developing an open source library that allows you to easily interact with mouse and keyboard events. For example, you can subscribe to press any button, or on the contrary, prohibit its pressing. The project is currently under active development, it is already available on Nuget. I will be glad to any support!

Repository: https://github.com/Empiree/DeftSharp.Windows.Input

I will be adding full documentation with all the library features soon.

Here are small examples of use cases:

Subscription to left mouse click:


var mouseListener = new MouseListener();

mouseListener.Subscribe(MouseEvent.LeftButtonDown, () =>
{
    // This code will be triggered after each left mouse button click
});

One-time subscription for pressing a button on the keyboard:


var keyboardListener = new KeyboardListener();

keyboardListener.SubscribeOnce(Key.A, key =>
{
    // This code will only work once, after pressing button 'A'
});

Furthermore, you can take advantage of specialized classes for different usage scenarios. For example, for the NumPad:

var numpadListener = new NumpadListener(keyboardListener);

// 0-9 numpad buttons
numpadListener.Subscribe(number =>
{
    // Your code here
});
Carlos487 commented 2 months ago

Thanks for your contribution