mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
Remove autohotkey and add toggle command args
This commit is contained in:
@@ -14,6 +14,7 @@ namespace Wox.CommandArgs
|
||||
|
||||
public void Execute(IList<string> args)
|
||||
{
|
||||
Console.WriteLine("test");
|
||||
if (args.Count > 0)
|
||||
{
|
||||
string query = args[0];
|
||||
|
||||
20
Wox/CommandArgs/ToggleCommandArg.cs
Normal file
20
Wox/CommandArgs/ToggleCommandArg.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Wox.CommandArgs
|
||||
{
|
||||
public class ToggleCommandArg:ICommandArg
|
||||
{
|
||||
public string Command
|
||||
{
|
||||
get { return "toggle"; }
|
||||
}
|
||||
|
||||
public void Execute(IList<string> args)
|
||||
{
|
||||
App.Window.ToggleWox();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -243,9 +243,6 @@ namespace Wox
|
||||
|
||||
public void SetHotkey(string hotkeyStr, EventHandler<HotkeyEventArgs> action)
|
||||
{
|
||||
AHKHotkey ahk = new AHKHotkey();
|
||||
ahk.RegisterHotkey("#R",null);
|
||||
return;
|
||||
var hotkey = new HotkeyModel(hotkeyStr);
|
||||
try
|
||||
{
|
||||
@@ -281,17 +278,21 @@ namespace Wox
|
||||
}
|
||||
|
||||
private void OnHotkey(object sender, HotkeyEventArgs e)
|
||||
{
|
||||
ToggleWox();
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
public void ToggleWox()
|
||||
{
|
||||
if (!IsVisible)
|
||||
{
|
||||
ShowWox();
|
||||
UserSettingStorage.Instance.IncreaseActivateTimes();
|
||||
}
|
||||
else
|
||||
{
|
||||
HideWox();
|
||||
}
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void InitProgressbarAnimation()
|
||||
@@ -430,6 +431,7 @@ namespace Wox
|
||||
|
||||
private void ShowWox(bool selectAll = true)
|
||||
{
|
||||
UserSettingStorage.Instance.IncreaseActivateTimes();
|
||||
if (!double.IsNaN(Left) && !double.IsNaN(Top))
|
||||
{
|
||||
var origScreen = Screen.FromRectangle(new Rectangle((int)Left, (int)Top, (int)ActualWidth, (int)ActualHeight));
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CommandArgs\ToggleCommandArg.cs" />
|
||||
<Compile Include="Converters\ConvertorBase.cs" />
|
||||
<Compile Include="Converters\ImagePathConverter.cs" />
|
||||
<Compile Include="Converters\OpacityModeConverter.cs" />
|
||||
|
||||
Reference in New Issue
Block a user