Last active
November 18, 2020 21:36
Revisions
-
TLMcode revised this gist
Nov 18, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ ; Variables Increments := 10 ; < lower for a more granular change, higher for larger jump in brightness CurrentBrightness := GetCurrentBrightNess() ; Hot Keys -
TLMcode created this gist
Nov 18, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ ; Variables Increments := 10 ; < lower for a more granular change, higher for larger jump in brightness CurrentBrightness := GetCurrentBrightNess() ; Hot Keys F6::ChangeBrightness( CurrentBrightness -= Increments ) ; decrease brightness F7::ChangeBrightness( CurrentBrightness += Increments ) ; increase brightness ; Functions ChangeBrightness( ByRef brightness, timeout = 1 ) { if ( brightness > 0 && brightness < 100 ) { For property in ComObjGet( "winmgmts:\\.\root\WMI" ).ExecQuery( "SELECT * FROM WmiMonitorBrightnessMethods" ) property.WmiSetBrightness( timeout, brightness ) } else if ( brightness >= 100 ) { brightness := 100 } else if ( brightness <= 0 ) { brightness := 0 } } GetCurrentBrightNess() { For property in ComObjGet( "winmgmts:\\.\root\WMI" ).ExecQuery( "SELECT * FROM WmiMonitorBrightness" ) currentBrightness := property.CurrentBrightness return currentBrightness }