@@ -18,6 +18,8 @@ public class InputDispatcher
1818 public static bool tentMode = false ;
1919 private static bool ? _fnLock = null ;
2020
21+ private static long lastSleep ;
22+
2123 public static Keys keyProfile = ( Keys ) AppConfig . Get ( "keybind_profile" , ( int ) Keys . F5 ) ;
2224 public static Keys keyApp = ( Keys ) AppConfig . Get ( "keybind_app" , ( int ) Keys . F12 ) ;
2325
@@ -703,6 +705,8 @@ static void ToggleTouchpad()
703705
704706 static void SleepEvent ( )
705707 {
708+ if ( Math . Abs ( DateTimeOffset . Now . ToUnixTimeMilliseconds ( ) - lastSleep ) < 1000 ) return ;
709+ lastSleep = DateTimeOffset . Now . ToUnixTimeMilliseconds ( ) ;
706710 Program . acpi . DeviceSet ( AsusACPI . UniversalControl , AsusACPI . KB_Sleep , "Sleep" ) ;
707711 }
708712
@@ -936,7 +940,8 @@ static void HandleOptimizationEvent(int EventID)
936940 ToggleTouchpadEvent ( ) ;
937941 break ;
938942 case 108 : // FN+F11
939- SleepEvent ( ) ;
943+ if ( ! AppConfig . IsHardwareHotkeys ( ) ) SleepEvent ( ) ;
944+ else lastSleep = DateTimeOffset . Now . ToUnixTimeMilliseconds ( ) ;
940945 break ;
941946 case 106 : // Screenpad button on DUO
942947 if ( Control . ModifierKeys == Keys . Shift )
@@ -958,7 +963,7 @@ static void HandleOptimizationEvent(int EventID)
958963 ToggleArrowLock ( ) ;
959964 return ;
960965 case 136 : // FN + F12
961- if ( ! AppConfig . IsNoAirplaneMode ( ) ) Program . acpi . DeviceSet ( AsusACPI . UniversalControl , AsusACPI . Airplane , "Airplane" ) ;
966+ if ( ! AppConfig . IsHardwareHotkeys ( ) ) Program . acpi . DeviceSet ( AsusACPI . UniversalControl , AsusACPI . Airplane , "Airplane" ) ;
962967 return ;
963968 case 50 :
964969 // Sound Mute Event
0 commit comments