mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Added Ctr+Shif+F12 binding to toggle app window
This commit is contained in:
12
app/Fans.cs
12
app/Fans.cs
@@ -466,7 +466,6 @@ namespace GHelper
|
||||
chartMid.Visible = true;
|
||||
SetChart(chartMid, AsusFan.Mid);
|
||||
LoadProfile(seriesMid, AsusFan.Mid);
|
||||
Size = MinimumSize = new Size(0, chartCount * 400 + 200);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -481,13 +480,22 @@ namespace GHelper
|
||||
chartXGM.Visible = true;
|
||||
SetChart(chartXGM, AsusFan.XGM);
|
||||
LoadProfile(seriesXGM, AsusFan.XGM);
|
||||
Size = MinimumSize = new Size(0, chartCount * 400 + 200);
|
||||
}
|
||||
else
|
||||
{
|
||||
AppConfig.setConfig("xgm_fan", 0);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (chartCount > 2)
|
||||
Size = MinimumSize = new Size(0, (int)(ControlHelper.GetDpiScale(this).Value * (chartCount * 200 + 100)));
|
||||
} catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine(ex);
|
||||
}
|
||||
|
||||
|
||||
SetChart(chartCPU, AsusFan.CPU);
|
||||
SetChart(chartGPU, AsusFan.GPU);
|
||||
|
||||
|
||||
@@ -60,10 +60,11 @@ namespace GHelper
|
||||
private static nint windowHandle;
|
||||
|
||||
public static Keys keyProfile = Keys.F5;
|
||||
public static Keys keyApp = Keys.F12;
|
||||
|
||||
KeyboardListener listener;
|
||||
|
||||
KeyHandler m1, m2, togggle;
|
||||
KeyHandler m1, m2, handlerProfile, handlerApp;
|
||||
|
||||
public InputDispatcher(nint handle)
|
||||
{
|
||||
@@ -76,11 +77,12 @@ namespace GHelper
|
||||
Program.acpi.SubscribeToEvents(WatcherEventArrived);
|
||||
//Task.Run(Program.acpi.RunListener);
|
||||
|
||||
|
||||
// CTRL + SHIFT + F5 to cycle profiles
|
||||
if (AppConfig.getConfig("keybind_profile") != -1) keyProfile = (Keys)AppConfig.getConfig("keybind_profile");
|
||||
|
||||
togggle = new KeyHandler(KeyHandler.SHIFT | KeyHandler.CTRL, keyProfile, windowHandle);
|
||||
handlerProfile = new KeyHandler(KeyHandler.SHIFT | KeyHandler.CTRL, keyProfile, windowHandle);
|
||||
handlerApp = new KeyHandler(KeyHandler.SHIFT | KeyHandler.CTRL, keyApp, windowHandle);
|
||||
|
||||
m1 = new KeyHandler(KeyHandler.NOMOD, Keys.VolumeDown, windowHandle);
|
||||
m2 = new KeyHandler(KeyHandler.NOMOD, Keys.VolumeUp, windowHandle);
|
||||
|
||||
@@ -144,24 +146,16 @@ namespace GHelper
|
||||
string actionM1 = AppConfig.getConfigString("m1");
|
||||
string actionM2 = AppConfig.getConfigString("m2");
|
||||
|
||||
togggle.Unregiser();
|
||||
handlerProfile.Unregiser();
|
||||
m1.Unregiser();
|
||||
m2.Unregiser();
|
||||
|
||||
if (keyProfile != Keys.None)
|
||||
{
|
||||
togggle.Register();
|
||||
}
|
||||
if (keyProfile != Keys.None) handlerProfile.Register();
|
||||
if (keyApp != Keys.None) handlerApp.Register();
|
||||
|
||||
if (actionM1 is not null && actionM1.Length > 0)
|
||||
{
|
||||
m1.Register();
|
||||
}
|
||||
if (actionM1 is not null && actionM1.Length > 0) m1.Register();
|
||||
|
||||
if (actionM2 is not null && actionM2.Length > 0)
|
||||
{
|
||||
m2.Register();
|
||||
}
|
||||
if (actionM2 is not null && actionM2.Length > 0) m2.Register();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -194,6 +194,7 @@ namespace GHelper
|
||||
break;
|
||||
default:
|
||||
if (key == InputDispatcher.keyProfile) CyclePerformanceMode();
|
||||
if (key == InputDispatcher.keyApp) Program.SettingsToggle();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user