www.autohotkey.com/board/topic/83100-laptop-screen-brightness/
www.autohotkey.com/board/topic/39004-how-to-adjust-display-brightness-im-sure-its-possible/
#NoEnv
#AllowSameLineComments
#SingleInstance force
#InstallKeybdHook
;#NoTrayIcon
SetWorkingDir %A_ScriptDir%
SendMode, Input
SC108:: ; SAMSUNG brightness up FN key
MoveBrightness(1)
return
SC109:: ; SAMSUNG brightness down FN key
MoveBrightness(-1)
return
;#a::
;MoveBrightness(1)
;return
;#z::
;MoveBrightness(-1)
;return
;############################################################################
; Functions
;############################################################################
MoveBrightness(IndexMove)
{
VarSetCapacity(SupportedBrightness, 256, 0)
VarSetCapacity(SupportedBrightnessSize, 4, 0)
VarSetCapacity(BrightnessSize, 4, 0)
VarSetCapacity(Brightness, 3, 0)
hLCD := DllCall("CreateFile"
, Str, "\\.\LCD"
, UInt, 0x80000000 | 0x40000000 ;Read | Write
, UInt, 0x1 | 0x2 ; File Read | File Write
, UInt, 0
, UInt, 0x3 ; open any existing file
, UInt, 0
, UInt, 0)
if hLCD != -1
{
DevVideo := 0x00000023, BuffMethod := 0, Fileacces := 0
NumPut(0x03, Brightness, 0, "UChar") ; 0x01 = Set AC, 0x02 = Set DC, 0x03 = Set both
NumPut(0x00, Brightness, 1, "UChar") ; The AC brightness level
NumPut(0x00, Brightness, 2, "UChar") ; The DC brightness level
DllCall("DeviceIoControl"
, UInt, hLCD
, UInt, (DevVideo<<16 | 0x126<<2 | BuffMethod<<14 | Fileacces) ; IOCTL_VIDEO_QUERY_DISPLAY_BRIGHTNESS
, UInt, 0
, UInt, 0
, UInt, &Brightness
, UInt, 3
, UInt, &BrightnessSize
, UInt, 0)
DllCall("DeviceIoControl"
, UInt, hLCD
, UInt, (DevVideo<<16 | 0x125<<2 | BuffMethod<<14 | Fileacces) ; IOCTL_VIDEO_QUERY_SUPPORTED_BRIGHTNESS
, UInt, 0
, UInt, 0
, UInt, &SupportedBrightness
, UInt, 256
, UInt, &SupportedBrightnessSize
, UInt, 0)
ACBrightness := NumGet(Brightness, 1, "UChar")
ACIndex := 0
DCBrightness := NumGet(Brightness, 2, "UChar")
DCIndex := 0
BufferSize := NumGet(SupportedBrightnessSize, 0, "UInt")
MaxIndex := BufferSize-1
Loop, %BufferSize%
{
ThisIndex := A_Index-1
ThisBrightness := NumGet(SupportedBrightness, ThisIndex, "UChar")
if ACBrightness = %ThisBrightness%
ACIndex := ThisIndex
if DCBrightness = %ThisBrightness%
DCIndex := ThisIndex
}
if DCIndex >= %ACIndex%
BrightnessIndex := DCIndex
else
BrightnessIndex := ACIndex
BrightnessIndex += IndexMove
if BrightnessIndex > %MaxIndex%
BrightnessIndex := MaxIndex
if BrightnessIndex < 0
BrightnessIndex := 0
NewBrightness := NumGet(SupportedBrightness, BrightnessIndex, "UChar")
NumPut(0x03, Brightness, 0, "UChar") ; 0x01 = Set AC, 0x02 = Set DC, 0x03 = Set both
NumPut(NewBrightness, Brightness, 1, "UChar") ; The AC brightness level
NumPut(NewBrightness, Brightness, 2, "UChar") ; The DC brightness level
DllCall("DeviceIoControl"
, UInt, hLCD
, UInt, (DevVideo<<16 | 0x127<<2 | BuffMethod<<14 | Fileacces) ; IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESS
, UInt, &Brightness
, UInt, 3
, UInt, 0
, UInt, 0
, UInt, 0
, Uint, 0)
DllCall("CloseHandle", UInt, hLCD)
}
}
위에 방법으로는 아직 안해봤다. 그냥 메모만..
제일 쉽게 하는 방법은 블루라이트 차단프로그램인 f.lux 프로그램을 설치해서 실행하고
Alt+PgUp, Alt+PgDn키로 조작하는 것이다.
[오토핫키/스크랩] 공짜로 3버튼을 5버튼,5버튼을 7버튼 마우스,다기능 마우스로 만드는 방법 (1) | 2021.06.05 |
---|---|
[오토핫키] 2개 이상의 hts에서 종목연동 팁 (1) | 2021.05.25 |
[오토핫키] Send, SendInput에 관한 메모 (0) | 2021.03.12 |
[오토핫키] 비활성 윈도우 조작 (ControlSend, ControlSetText, ControlClick) (0) | 2021.03.07 |
[오토핫키] 화면끄기, 사용자전환, 절전모드, 화면밝기 조절 (0) | 2021.02.18 |