0w0
[autohotkeyBase] 01.hotkey, hotstring, reload, exitapp, send 본문
[autohotkeyBase] 01.hotkey, hotstring, reload, exitapp, send
0w0 2020. 1. 5. 16:16ref.
http://autohotkeykr.sourceforge.net/docs/AutoHotkey.htm
https://www.autohotkey.com/docs/AutoHotkey.htm
http://www.autohotkey.co.kr/cgi/contents.php?id=tutorial
http://www.autohotkey.co.kr/cgi/contents.php?id=commands _ 함수 및 명령
● Autohotkey Download
● Active Window Info
- 윈도우+A키를 눌러서 출력 정보 유지
● 노트패드 혹은 저장텍스트 파일 설정
- 스크립트가 깨질경우 해당 ahk 파일을 유니코드로 저장되어있는지 확인해야함.
● reload
- 명령을 사용해서 스크립트 수정 및 재실행을 원활히 가능
F9:: ;Msgbox, [옵션], [타이틀], [컨텐츠], [타임아웃] |
● exitapp
- 스크립트 종료
F9:: ;Msgbox, [옵션], [타이틀], [컨텐츠], [타임아웃] |
● Hotkey
- 단축키
- hotkey(단축키)입력을 통한 스크립트 실행
● 예시
F1:: |
● 기능키를 핫키로 주기
$ | 상단 숫자 키([$0-$9]) |
# | Window키 |
^ | Ctrl 키 |
! | Alt 키 |
+ | Shift 키 |
● 키입력 형식
{Enter} = enter 키 입력
{Space} = space 키 입력
{ESC} = ESC 키 입력
{Tap} = tap 키 입력
{Ctrl} = Ctrl 키 입력
{Shift} = Shift 키 입력
{F1} = F1 키 입력
등등 하단에 참조 확인.
● 예시
`:: Send {Space 3}(...이하생략) ;상단 숫자 키로 복사, 붙여넣기, 검색, 전체선택 핫키 생성
F1::Send {Enter} |
● &을 사용한 조합키 (앞에 키를 누르는 상태에서 뒤에 키를 누르는 방식)
;조합키로 스크립트 실행
1 & 2:: ;1을 누르고 있는 상태에서 2를 누르는 방식 send {Enter} return 2 & 3:: send {BS} return |
1 & 2에서는 1이 대기상태가 되어버림 마찬가지로 2 & 3에서는 2가 대기상태로 되어 버림.
!나 #은 입력할 수 없게됨.
● 해결예시 (!, # 정상입력)
1 & 2::
; 스페이스바 조합 space & 1::
;캡스락 조합 CapsLock & 1:: |
● Hotstring
- 스크립트 실행 및 문자열 치환
- hotstring(문자열)입력을 통한 스크립트 실행
- 영문자 입력만 인식
● 예시
:*:tmi::Too Much{Space 2}Information{Enter} |
;tmi를 입력하는 순간 문자열이 입력되며, Too Much 부분 입력 후 스페이스바 두번{Space 2} 입력 후 Information입력 후 엔터{Enter}입력
● Send
- 키입력 전달
예시
$1:: Send ^c ;copy $2:: Send ^v ;paste $3:: Send ^f ;find $4:: Send ^a ;all sellect |
;상단 숫자 키로 복사, 붙여넣기, 검색, 전체선택 핫키 생성
● 키누르고 있기 (Down, Up)
F1:: ;shift키를 누른상태로 1을 누른후 shift키를 때는 스크립트
;출력 ! |
● 참조)키입력 형식
{F1} - {F24} | Function keys. For example: {F12} is the F12 key. |
{!} | ! |
{#} | # |
{+} | + |
{^} | ^ |
{{} | { |
{}} | } |
{Enter} | Enter key on the main keyboard |
{Escape} or {Esc} | Escape |
{Space} | Space (this is only needed for spaces that appear either at the beginning or the end of the string to be sent -- ones in the middle can be literal spaces) |
{Tab} | Tab |
{Backspace} or {BS} | Backspace |
{Delete} or {Del} | Delete |
{Insert} or {Ins} | Insert |
{Up} | ↑ (up arrow) key on main keyboard |
{Down} | ↓ (down arrow) key on main keyboard |
{Left} | ← (left arrow) key on main keyboard |
{Right} | → (right arrow) key on main keyboard |
{Home} | Home key on main keyboard |
{End} | End key on main keyboard |
{PgUp} | PageUp key on main keyboard |
{PgDn} | PageDown key on main keyboard |
{CapsLock} | CapsLock (using SetCapsLockState is more reliable on Win 2k/XP). Sending {CapsLock} might require SetStoreCapsLockMode Off beforehand. |
{ScrollLock} | ScrollLock (see also: SetScrollLockState) |
{NumLock} | NumLock (see also: SetNumLockState) |
{Control} or {Ctrl} | Control (technical info: sends the neutral virtual key but the left scan code) |
{LControl} or {LCtrl} | Left Control key (technical info: sends the left virtual key rather than the neutral one) |
{RControl} or {RCtrl} | Right Control key |
{Control down} or {Ctrl down} | Holds the Control key down until {Ctrl up} is sent. To hold down the left or right key instead, use {RCtrl down} and {RCtrl up}. |
{Alt} | Alt (technical info: sends the neutral virtual key but the left scan code) |
{LAlt} | Left Alt key (technical info: sends the left virtual key rather than the neutral one) |
{RAlt} | Right Alt key (or AltGr, depending on keyboard layout) |
{Alt down} | Holds the Alt key down until {Alt up} is sent. To hold down the left or right key instead, use {RAlt down} and {RAlt up}. |
{Shift} | Shift (technical info: sends the neutral virtual key but the left scan code) |
{LShift} | Left Shift key (technical info: sends the left virtual key rather than the neutral one) |
{RShift} | Right Shift key |
{Shift down} | Holds the Shift key down until {Shift up} is sent. To hold down the left or right key instead, use {RShift down} and {RShift up}. |
{LWin} | Left Win key |
{RWin} | Right Win key |
{LWin down} | Holds the left Win key down until {LWin up} is sent |
{RWin down} | Holds the right Win key down until {RWin up} is sent |
{AppsKey} | Menu key (invokes the right-click or context menu) |
{Sleep} | Sleep key. |
{Numpad0} - {Numpad9} | Numpad digit keys (as seen when NumLock is ON). For example: {Numpad5} is 5. |
{NumpadDot} | . (numpad period) (as seen when NumLock is ON). |
{NumpadEnter} | Enter key on keypad |
{NumpadMult} | * (numpad multiplication) |
{NumpadDiv} | / (numpad division) |
{NumpadAdd} | + (numpad addition) |
{NumpadSub} | - (numpad subtraction) |
{NumpadDel} | Delete key on keypad (this key and the following Numpad keys are used when NumLock is OFF) |
{NumpadIns} | Insert key on keypad |
{NumpadClear} | Clear key on keypad (usually the '5' key when NumLock is OFF). |
{NumpadUp} | ↑ (up arrow) key on keypad |
{NumpadDown} | ↓ (down arrow) key on keypad |
{NumpadLeft} | ← (left arrow) on keypad |
{NumpadRight} | → (right arrow) key on keypad |
{NumpadHome} | Home key on keypad |
{NumpadEnd} | End key on keypad |
{NumpadPgUp} | PageUp key on keypad |
{NumpadPgDn} | PageDown key on keypad |
{Browser_Back} | Select the browser "back" button |
{Browser_Forward} | Select the browser "forward" button |
{Browser_Refresh} | Select the browser "refresh" button |
{Browser_Stop} | Select the browser "stop" button |
{Browser_Search} | Select the browser "search" button |
{Browser_Favorites} | Select the browser "favorites" button |
{Browser_Home} | Launch the browser and go to the home page |
{Volume_Mute} | Mute/unmute the master volume. Usually equivalent to SoundSet, +1, , mute. |
{Volume_Down} | Reduce the master volume. Usually equivalent to SoundSet -5. |
{Volume_Up} | Increase the master volume. Usually equivalent to SoundSet +5. |
{Media_Next} | Select next track in media player |
{Media_Prev} | Select previous track in media player |
{Media_Stop} | Stop media player |
{Media_Play_Pause} | Play/pause media player |
{Launch_Mail} | Launch the email application |
{Launch_Media} | Launch media player |
{Launch_App1} | Launch user app1 |
{Launch_App2} | Launch user app2 |
{PrintScreen} | PrintScreen |
{CtrlBreak} | Ctrl+Pause |
{Pause} | Pause |
{WheelDown}, {WheelUp}, {WheelLeft}, {WheelRight}, {LButton}, {RButton}, {MButton}, {XButton1}, {XButton2} | Sends a mouse button event at the cursor's current position (to have control over position and other options, use {Click} above). The delay between mouse clicks is determined by SetMouseDelay. WheelLeft/Right require [v1.0.48+], but have no effect on operating systems older than Windows Vista. |
'Coding > Autohotkey' 카테고리의 다른 글
[autohotkeyBase] 06.산술연산자, 산술대입연산자, 증감연산자, 비교연산자, 논리연산자 (0) | 2020.01.12 |
---|---|
[autohotkeyBase] 05.변수, 대입연산자 (0) | 2020.01.09 |
[autohotkeyBase] 04.mouse1 (0) | 2020.01.08 |
[autohotkeyBase] 03.sleep, return (0) | 2020.01.06 |
[autohotkeyBase] 02.MessageBox(msgbox), 메시지박스 (0) | 2020.01.05 |