mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Custom keybinding for mode toggle
This commit is contained in:
@@ -122,7 +122,6 @@ public class ASUSWmi
|
|||||||
private const uint GENERIC_WRITE = 0x40000000;
|
private const uint GENERIC_WRITE = 0x40000000;
|
||||||
private const uint OPEN_EXISTING = 3;
|
private const uint OPEN_EXISTING = 3;
|
||||||
private const uint FILE_ATTRIBUTE_NORMAL = 0x80;
|
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_READ = 1;
|
||||||
private const uint FILE_SHARE_WRITE = 2;
|
private const uint FILE_SHARE_WRITE = 2;
|
||||||
|
|
||||||
@@ -172,7 +171,7 @@ public class ASUSWmi
|
|||||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||||
IntPtr.Zero,
|
IntPtr.Zero,
|
||||||
OPEN_EXISTING,
|
OPEN_EXISTING,
|
||||||
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED,
|
FILE_ATTRIBUTE_NORMAL,
|
||||||
IntPtr.Zero
|
IntPtr.Zero
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
<AssemblyVersion>0.63</AssemblyVersion>
|
<AssemblyVersion>0.64</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
|||||||
@@ -90,8 +90,13 @@ namespace GHelper
|
|||||||
unRegPowerNotify = NativeMethods.RegisterPowerSettingNotification(ds, settingGuid.ConsoleDisplayState, NativeMethods.DEVICE_NOTIFY_WINDOW_HANDLE);
|
unRegPowerNotify = NativeMethods.RegisterPowerSettingNotification(ds, settingGuid.ConsoleDisplayState, NativeMethods.DEVICE_NOTIFY_WINDOW_HANDLE);
|
||||||
|
|
||||||
// CTRL + SHIFT + F5 to cycle profiles
|
// CTRL + SHIFT + F5 to cycle profiles
|
||||||
var ghk = new KeyHandler(KeyHandler.SHIFT | KeyHandler.CTRL, Keys.F5, ds);
|
Keys keybind_profile = (config.getConfig("keybind_profile") != -1) ? (Keys)config.getConfig("keybind_profile") : Keys.F5;
|
||||||
ghk.Register();
|
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)
|
if (Environment.CurrentDirectory.Trim('\\') == Application.StartupPath.Trim('\\') || action.Length > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user