Skip to content

Commit fbe1924

Browse files
committed
FPS Limit binding for Ally #5015
1 parent d012c9e commit fbe1924

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

app/Ally/AllyControl.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public class AllyControl
105105
public const string BindBrightnessUp = "04-04-8C-88-8A-06";
106106
public const string BindXGM = "04-04-8C-88-8A-04";
107107
public const string BindToggleMode = "04-04-8C-88-8A-0C";
108+
public const string BindToggleFPSLimit = "04-04-8C-88-8A-01";
108109
public const string BindToggleTouchScreen = "04-04-8C-88-8A-0B";
109110

110111
public const string BindOverlay = "04-03-8C-88-44";
@@ -158,6 +159,7 @@ public class AllyControl
158159
{ BindXB, "XBox/Steam" },
159160

160161
{ BindToggleMode, "Controller Mode" },
162+
{ BindToggleFPSLimit, "FPS Limit" },
161163
{ BindToggleTouchScreen, "Toggle TouchScreen" },
162164

163165
{ BindVolUp, "Vol Up" },
@@ -425,7 +427,7 @@ public void Init()
425427
settings.VisualiseFPSLimit(fpsLimit);
426428
}
427429

428-
public void ToggleFPSLimit()
430+
public void ToggleFPSLimit(bool toast = false)
429431
{
430432
switch (fpsLimit)
431433
{
@@ -462,6 +464,7 @@ public void ToggleFPSLimit()
462464
Logger.WriteLine($"FPS Limit {fpsLimit}: {result}");
463465

464466
settings.VisualiseFPSLimit(fpsLimit);
467+
if (toast) Program.toast.RunToast("FPS Limit " + ((fpsLimit > 0 && fpsLimit <= 120) ? fpsLimit : "OFF"));
465468

466469
}
467470

app/Input/InputDispatcher.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ public void RegisterKeys()
192192
hook.RegisterHotKey(keyModifierAlt, Keys.F3);
193193
hook.RegisterHotKey(keyModifierAlt, Keys.F4);
194194
hook.RegisterHotKey(keyModifierAlt, Keys.F6);
195+
hook.RegisterHotKey(keyModifierAlt, Keys.F9);
195196
}
196197

197198
// FN-Lock group
@@ -495,6 +496,9 @@ public void KeyPressed(object sender, KeyPressedEventArgs e)
495496
if (AppConfig.IsDUO()) SetScreenpad(10);
496497
else SetBrightnessDimming(10);
497498
break;
499+
case Keys.F9:
500+
Program.settingsForm.BeginInvoke(Program.settingsForm.allyControl.ToggleFPSLimit, true);
501+
break;
498502
case Keys.F13:
499503
ToggleScreenRate();
500504
break;

0 commit comments

Comments
 (0)