mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Ui - Fixed every hotkey in the same tree receiving input
This commit is contained in:
parent
0107bfdd24
commit
1f0ec791cf
@ -36,16 +36,20 @@ public class HotkeyBox : UserControl
|
|||||||
UpdateDisplayTextBox();
|
UpdateDisplayTextBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
|
protected override void OnGotFocus(GotFocusEventArgs e)
|
||||||
{
|
{
|
||||||
_inputService.KeyboardKeyDown += InputServiceOnKeyboardKeyDown;
|
_inputService.KeyboardKeyDown += InputServiceOnKeyboardKeyDown;
|
||||||
_inputService.KeyboardKeyUp += InputServiceOnKeyboardKeyUp;
|
_inputService.KeyboardKeyUp += InputServiceOnKeyboardKeyUp;
|
||||||
|
|
||||||
|
base.OnGotFocus(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)
|
protected override void OnLostFocus(RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
_inputService.KeyboardKeyDown -= InputServiceOnKeyboardKeyDown;
|
_inputService.KeyboardKeyDown -= InputServiceOnKeyboardKeyDown;
|
||||||
_inputService.KeyboardKeyUp -= InputServiceOnKeyboardKeyUp;
|
_inputService.KeyboardKeyUp -= InputServiceOnKeyboardKeyUp;
|
||||||
|
|
||||||
|
base.OnLostFocus(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void HotkeyChanging(IAvaloniaObject sender, bool before)
|
private static void HotkeyChanging(IAvaloniaObject sender, bool before)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user