Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New binding to previous performance mode (CTRL + SHIFT + F21) #1167

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/Input/InputDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class InputDispatcher
public static bool backlightActivity = true;

public static Keys keyProfile = Keys.F5;
public static Keys keyProfilePrevious = Keys.F21;
public static Keys keyApp = Keys.F12;

static ModeControl modeControl = Program.modeControl;
Expand Down Expand Up @@ -98,12 +99,14 @@ public void RegisterKeys()

// CTRL + SHIFT + F5 to cycle profiles
if (AppConfig.Get("keybind_profile") != -1) keyProfile = (Keys)AppConfig.Get("keybind_profile");
if (AppConfig.Get("keybind_profile_previous") != -1) keyProfilePrevious = (Keys)AppConfig.Get("keybind_profile_previous");
if (AppConfig.Get("keybind_app") != -1) keyApp = (Keys)AppConfig.Get("keybind_app");

string actionM1 = AppConfig.GetString("m1");
string actionM2 = AppConfig.GetString("m2");

if (keyProfile != Keys.None) hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control, keyProfile);
if (keyProfilePrevious != Keys.None) hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control, keyProfilePrevious);
if (keyApp != Keys.None) hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control, keyApp);

if (!AppConfig.Is("skip_hotkeys"))
Expand Down Expand Up @@ -276,6 +279,8 @@ public void KeyPressed(object sender, KeyPressedEventArgs e)
if (e.Modifier == (ModifierKeys.Control | ModifierKeys.Shift))
{
if (e.Key == keyProfile) modeControl.CyclePerformanceMode();
if (e.Key == keyProfilePrevious) modeControl.ForcePreviousCyclePerformanceMode();//for ROG Ally, which doesn't have a FN key

if (e.Key == keyApp) Program.SettingsToggle();
if (e.Key == Keys.F20) KeyProcess("m3");
}
Expand Down
6 changes: 6 additions & 0 deletions app/Mode/ModeControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ public void CyclePerformanceMode()
SetPerformanceMode(Modes.GetNext(Control.ModifierKeys == Keys.Shift), true);
}

//for ROG Ally, which doesn't have a FN key
public void ForcePreviousCyclePerformanceMode()
{
SetPerformanceMode(Modes.GetNext(true), true);
}

public void AutoFans(bool force = false)
{
customFans = false;
Expand Down