@@ -15,8 +15,14 @@ public class InputDispatcher
15
15
System . Timers . Timer timer = new System . Timers . Timer ( 1000 ) ;
16
16
public static bool backlightActivity = true ;
17
17
18
- public static Keys keyProfile = Keys . F5 ;
19
- public static Keys keyApp = Keys . F12 ;
18
+ public static Keys keyProfile = ( Keys ) AppConfig . Get ( "keybind_profile" , ( int ) Keys . F5 ) ;
19
+ public static Keys keyApp = ( Keys ) AppConfig . Get ( "keybind_app" , ( int ) Keys . F12 ) ;
20
+
21
+ public static Keys keyProfile0 = ( Keys ) AppConfig . Get ( "keybind_profile_0" , ( int ) Keys . F17 ) ;
22
+ public static Keys keyProfile1 = ( Keys ) AppConfig . Get ( "keybind_profile_1" , ( int ) Keys . F18 ) ;
23
+ public static Keys keyProfile2 = ( Keys ) AppConfig . Get ( "keybind_profile_2" , ( int ) Keys . F16 ) ;
24
+ public static Keys keyProfile3 = ( Keys ) AppConfig . Get ( "keybind_profile_3" , ( int ) Keys . F19 ) ;
25
+ public static Keys keyProfile4 = ( Keys ) AppConfig . Get ( "keybind_profile_4" , ( int ) Keys . F20 ) ;
20
26
21
27
static ModeControl modeControl = Program . modeControl ;
22
28
static ScreenControl screenControl = new ScreenControl ( ) ;
@@ -101,10 +107,6 @@ public void RegisterKeys()
101
107
{
102
108
hook . UnregisterAll ( ) ;
103
109
104
- // CTRL + SHIFT + F5 to cycle profiles
105
- if ( AppConfig . Get ( "keybind_profile" ) != - 1 ) keyProfile = ( Keys ) AppConfig . Get ( "keybind_profile" ) ;
106
- if ( AppConfig . Get ( "keybind_app" ) != - 1 ) keyApp = ( Keys ) AppConfig . Get ( "keybind_app" ) ;
107
-
108
110
string actionM1 = AppConfig . GetString ( "m1" ) ;
109
111
string actionM2 = AppConfig . GetString ( "m2" ) ;
110
112
@@ -118,7 +120,6 @@ public void RegisterKeys()
118
120
119
121
if ( ! AppConfig . Is ( "skip_hotkeys" ) )
120
122
{
121
-
122
123
if ( AppConfig . IsDUO ( ) )
123
124
{
124
125
hook . RegisterHotKey ( ModifierKeys . Shift | ModifierKeys . Control | ModifierKeys . Alt , Keys . F7 ) ;
@@ -130,11 +131,11 @@ public void RegisterKeys()
130
131
hook . RegisterHotKey ( ModifierKeys . Shift | ModifierKeys . Control | ModifierKeys . Alt , Keys . F14 ) ;
131
132
hook . RegisterHotKey ( ModifierKeys . Shift | ModifierKeys . Control | ModifierKeys . Alt , Keys . F15 ) ;
132
133
133
- hook . RegisterHotKey ( ModifierKeys . Shift | ModifierKeys . Control | ModifierKeys . Alt , Keys . F16 ) ;
134
- hook . RegisterHotKey ( ModifierKeys . Shift | ModifierKeys . Control | ModifierKeys . Alt , Keys . F17 ) ;
135
- hook . RegisterHotKey ( ModifierKeys . Shift | ModifierKeys . Control | ModifierKeys . Alt , Keys . F18 ) ;
136
- hook . RegisterHotKey ( ModifierKeys . Shift | ModifierKeys . Control | ModifierKeys . Alt , Keys . F19 ) ;
137
- hook . RegisterHotKey ( ModifierKeys . Shift | ModifierKeys . Control | ModifierKeys . Alt , Keys . F20 ) ;
134
+ hook . RegisterHotKey ( ModifierKeys . Shift | ModifierKeys . Control | ModifierKeys . Alt , keyProfile0 ) ;
135
+ hook . RegisterHotKey ( ModifierKeys . Shift | ModifierKeys . Control | ModifierKeys . Alt , keyProfile1 ) ;
136
+ hook . RegisterHotKey ( ModifierKeys . Shift | ModifierKeys . Control | ModifierKeys . Alt , keyProfile2 ) ;
137
+ hook . RegisterHotKey ( ModifierKeys . Shift | ModifierKeys . Control | ModifierKeys . Alt , keyProfile3 ) ;
138
+ hook . RegisterHotKey ( ModifierKeys . Shift | ModifierKeys . Control | ModifierKeys . Alt , keyProfile4 ) ;
138
139
139
140
hook . RegisterHotKey ( ModifierKeys . Control , Keys . VolumeDown ) ;
140
141
hook . RegisterHotKey ( ModifierKeys . Control , Keys . VolumeUp ) ;
@@ -425,6 +426,12 @@ public void KeyPressed(object sender, KeyPressedEventArgs e)
425
426
if ( e . Modifier == ( ModifierKeys . Control | ModifierKeys . Shift | ModifierKeys . Alt ) )
426
427
{
427
428
if ( e . Key == keyProfile ) modeControl . CyclePerformanceMode ( true ) ;
429
+
430
+ if ( e . Key == keyProfile0 ) modeControl . SetPerformanceMode ( 0 , true ) ;
431
+ if ( e . Key == keyProfile1 ) modeControl . SetPerformanceMode ( 1 , true ) ;
432
+ if ( e . Key == keyProfile2 ) modeControl . SetPerformanceMode ( 2 , true ) ;
433
+ if ( e . Key == keyProfile3 ) modeControl . SetPerformanceMode ( 3 , true ) ;
434
+ if ( e . Key == keyProfile4 ) modeControl . SetPerformanceMode ( 4 , true ) ;
428
435
429
436
switch ( e . Key )
430
437
{
@@ -457,21 +464,6 @@ public void KeyPressed(object sender, KeyPressedEventArgs e)
457
464
Program . toast . RunToast ( Properties . Strings . StandardMode ) ;
458
465
Program . settingsForm . gpuControl . SetGPUMode ( AsusACPI . GPUModeStandard ) ;
459
466
break ;
460
- case Keys . F16 :
461
- modeControl . SetPerformanceMode ( 2 , true ) ;
462
- break ;
463
- case Keys . F17 :
464
- modeControl . SetPerformanceMode ( 0 , true ) ;
465
- break ;
466
- case Keys . F18 :
467
- modeControl . SetPerformanceMode ( 1 , true ) ;
468
- break ;
469
- case Keys . F19 :
470
- modeControl . SetPerformanceMode ( 3 , true ) ;
471
- break ;
472
- case Keys . F20 :
473
- modeControl . SetPerformanceMode ( 4 , true ) ;
474
- break ;
475
467
}
476
468
}
477
469
0 commit comments