Custom keybinding for mode toggle

This commit is contained in:
Serge
2023-05-17 20:33:41 +02:00
parent 14b677514b
commit c66c8e9030
3 changed files with 9 additions and 5 deletions

View File

@@ -122,7 +122,6 @@ public class ASUSWmi
private const uint GENERIC_WRITE = 0x40000000;
private const uint OPEN_EXISTING = 3;
private const uint FILE_ATTRIBUTE_NORMAL = 0x80;
private const uint FILE_FLAG_OVERLAPPED = 0x40000000;
private const uint FILE_SHARE_READ = 1;
private const uint FILE_SHARE_WRITE = 2;
@@ -172,7 +171,7 @@ public class ASUSWmi
FILE_SHARE_READ | FILE_SHARE_WRITE,
IntPtr.Zero,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED,
FILE_ATTRIBUTE_NORMAL,
IntPtr.Zero
);

View File

@@ -16,7 +16,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyVersion>0.63</AssemblyVersion>
<AssemblyVersion>0.64</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -90,8 +90,13 @@ namespace GHelper
unRegPowerNotify = NativeMethods.RegisterPowerSettingNotification(ds, settingGuid.ConsoleDisplayState, NativeMethods.DEVICE_NOTIFY_WINDOW_HANDLE);
// CTRL + SHIFT + F5 to cycle profiles
var ghk = new KeyHandler(KeyHandler.SHIFT | KeyHandler.CTRL, Keys.F5, ds);
ghk.Register();
Keys keybind_profile = (config.getConfig("keybind_profile") != -1) ? (Keys)config.getConfig("keybind_profile") : Keys.F5;
if (keybind_profile != 0)
{
var ghk = new KeyHandler(KeyHandler.SHIFT | KeyHandler.CTRL, keybind_profile, ds);
ghk.Register();
}
if (Environment.CurrentDirectory.Trim('\\') == Application.StartupPath.Trim('\\') || action.Length > 0)
{