AutoHotKey
사용자 핫키 설정 예제
쵸코난
2021. 12. 6. 01:15
AutoHotKey 단축키를 사용자가 설정하는 예제라고 볼 수 있습니다.
여기서는 사용자가 설정한 단축키(HotKey)를 누르면 마우스우클릭+R키를 눌러주도록 했습니다.
파워포인트 슬라이드쇼 도중 단축키로 발표자 보기를 켜거나 끄는 용도입니다.
기본 단축키는 F3입니다. 다른 키를 눌러도 됩니다.
Set This Hotkey를 누르면 Gui창을 닫고 트레이로 들어갑니다.
이제 슬라이드쇼 도중에 F3을 누르면 마우스우클릭과 R키가 눌려서 발표자보기 모드로 전환합니다.
한번 더 누르면 발표자보기 모드와 기본 보기를 번갈아 가며 전환합니다.
Win+X를 누르면 핫키를 종료합니다.
HotKey.Ahk 코드 내용:
#SingleInstance
defaultHK = F3 ;^ (Control), ! (Alt), + (Shift) https://ahkscript.github.io/ko/docs/KeyList.htm
Gui, add, text, Left, Hotkey for Presenter View
Gui, add, Hotkey, vMyHK, %defaultHK%
Gui, add, text, Left, press [Win+X] to quit.
Gui, add, Button, Default gSubmit x250 y21 w100 h40, Set this Hotkey
Gui, show,,HotKey Setting
return
Submit:
Gui, Submit
Menu, Tray, Icon, shell32.dll, 35
Menu, Tray, Tip, [%MyHK%]: Presenter View [Win+X]: Exit
;Menu, Tray, NoStandard
if MyHK
Hotkey, % MyHK, MyLabel
/*
else {
msgbox, Press a Hotkey
Gui, show
GuiControl, Focus, MyHK
}
*/
return
MyLabel:
;Presenter View
send, {RButton}R
return
#x::
GuiClose:
ExitApp
다운로드:
HotKey.exe
0.49MB
HotKey_EN.exe
0.49MB
HotKey_EN.ahk
0.00MB
HotKey.ahk
0.00MB
한글판 보기:
더보기
#SingleInstance
defaultHK = F3 ;기본 핫키: ^ (Control), ! (Alt), + (Shift) https://ahkscript.github.io/ko/docs/KeyList.htm
Gui, add, text, Left, 슬라이드쇼에서 [발표자보기 모드]를 위한 핫키를 설정하세요.
Gui, add, Hotkey, vMyHK, %defaultHK%
Gui, add, text, Left, ※ 종료하려면 [Win+X] 를 누르세요.
Gui, add, Button, Default gSubmit x250 y21 w100 h40, 핫키설정완료
Gui, show,,HotKey 설정
return
Submit:
Gui, Submit
Menu, Tray, Icon, shell32.dll, 35
Menu, Tray, Tip, [%MyHK%]: 발표자보기 [Win+X]: 종료
;Menu, Tray, NoStandard
if MyHK
Hotkey, % MyHK, MyLabel
/*
else {
msgbox, 핫키를 누르세요
Gui, show
GuiControl, Focus, MyHK
}
*/
return
MyLabel:
;발표자보기 모드
send, {RButton}R
return
#x::
GuiClose:
ExitApp