🐛 控制主面板热键调用频率

This commit is contained in:
Demo_Liu
2023-04-03 21:18:32 +08:00
parent 4b5cc7b7eb
commit 37dd2f7fb2
3 changed files with 22 additions and 1 deletions

View File

@@ -70,5 +70,13 @@
/// </summary>
public static int EVERYTHING_SEARCH_DELAY_TIME = 300;
/// <summary>
/// 控制主界面热键按下规定时间内只执行一次show hide
/// </summary>
public static bool MAIN_HOT_KEY_DOWN = false;
/// <summary>
/// 控制主界面热键按下规定时间内只执行一次show hide
/// </summary>
public static int MAIN_HOT_KEY_TIME = 500;
}
}

View File

@@ -82,10 +82,15 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridRow}">
<Border CornerRadius="8" MouseRightButtonDown="DataGridRow_MouseRightButtonDown" Margin="0,0,0,5" BorderBrush="Black" BorderThickness="0" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<Border CornerRadius="8" MouseRightButtonDown="DataGridRow_MouseRightButtonDown" Margin="0,0,0,5" BorderBrush="Black" BorderThickness="0" SnapsToDevicePixels="True">
<Border.Style>
<Style TargetType="Border">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="White" Opacity="0.6"/>
</Setter.Value>
</Setter>
</Style>
</Border.Style>
<SelectiveScrollingGrid>

View File

@@ -374,6 +374,14 @@ namespace GeekDesk
{
hotKeyId = GlobalHotKey.RegisterHotKey(appData.AppConfig.HotkeyModifiers, appData.AppConfig.Hotkey, () =>
{
if (RunTimeStatus.MAIN_HOT_KEY_DOWN) return;
RunTimeStatus.MAIN_HOT_KEY_DOWN = true;
new Thread(() =>
{
Thread.Sleep(RunTimeStatus.MAIN_HOT_KEY_TIME);
RunTimeStatus.MAIN_HOT_KEY_DOWN = false;
}).Start();
if (MotionControl.hotkeyFinished)
{
if (CheckSholeShowApp())