mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 18:20:39 +08:00
feat. 回车后自动加载神秘代码对应文本
This commit is contained in:
@@ -479,5 +479,27 @@ namespace MeoAsstGui
|
||||
FocusManager.SetFocusedElement(scope, element);
|
||||
Keyboard.ClearFocus();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 回车键点击后移除界面中元素焦点
|
||||
/// </summary>
|
||||
/// <param name="sender">点击事件发送者</param>
|
||||
/// <param name="e">点击事件</param>
|
||||
public void KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key != Key.Enter)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(sender is UIElement element))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DependencyObject scope = FocusManager.GetFocusScope(element);
|
||||
FocusManager.SetFocusedElement(scope, element);
|
||||
Keyboard.ClearFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
AllowDrop="True"
|
||||
Drop="{s:Action DropFile}"
|
||||
MouseDown="{s:Action MouseDown}"
|
||||
KeyDown="{s:Action KeyDown}"
|
||||
mc:Ignorable="d">
|
||||
<Grid Margin="20" Background="White">
|
||||
<Grid.ColumnDefinitions>
|
||||
|
||||
Reference in New Issue
Block a user