Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
giosali committed Mar 29, 2022
1 parent 8a4df92 commit bb6864a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/advanced_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,16 @@ public static void Main()
}
```

Additionally, **HotkeyUtility** provides an extension method called `Find` that you can use alongside the `GetHotkeys` method to quickly and compactly find a single `Hotkey` in the [ValueCollection](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2.valuecollection). Pass the method a [Key](https://docs.microsoft.com/en-us/dotnet/api/system.windows.input.key) and [ModifierKeys](https://docs.microsoft.com/en-us/dotnet/api/system.windows.input.modifierkeys) to find and match the existing `Hotkey`. If a match was found, the expected `Hotkey` will be returned; otherwise, `null` will be returned.

```csharp linenums="1"
using System;
using HotkeyUtility;
using HotkeyUtility.Extensions;

public static void Main()
{
HotkeyManager hotkeyManager = HotkeyManager.GetHotkeyManager();
Hotkey hotkey = hotkeyManager.GetHotkeys().Find(Key.Space, ModifierKeys.Control);
}
```

0 comments on commit bb6864a

Please sign in to comment.