0w0

[autohotkeyBase] 01.hotkey, hotstring, reload, exitapp, send 본문

Coding/Autohotkey

[autohotkeyBase] 01.hotkey, hotstring, reload, exitapp, send

0w0 2020. 1. 5. 16:16
728x90
반응형

ref.

https://pnal.kr/

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

https://www.autohotkey.com/

 

Active Window Info

- 윈도우+A키를 눌러서 출력 정보 유지

Active Window Info.zip
0.37MB

 

● 노트패드 혹은 저장텍스트 파일 설정

- 스크립트가 깨질경우 해당 ahk 파일을 유니코드로 저장되어있는지 확인해야함.

 

● reload

- 명령을 사용해서 스크립트 수정 및 재실행을 원활히 가능

F9::
{
msgbox, 4,Reload,script_reload,2     
reload

;Msgbox, [옵션], [타이틀], [컨텐츠], [타임아웃]

 

● exitapp

- 스크립트 종료

F9::
{
msgbox, 4,Reload,script_exit,2     
exitapp

;Msgbox, [옵션], [타이틀], [컨텐츠], [타임아웃]

 

 

● Hotkey
- 단축키
- hotkey(단축키)입력을 통한 스크립트 실행

 

● 예시

F1::
Send {Enter}
msgbox,,,hi,3
return

 

● 기능키를 핫키로 주기

$ 상단 숫자 키([$0-$9])
# Window키
^ Ctrl 키
! Alt 키
+ Shift 키

 

 키입력 형식

{Enter} = enter 키 입력

{Space} = space 키 입력

{ESC} = ESC 키 입력

{Tap} = tap 키 입력

{Ctrl} = Ctrl 키 입력

{Shift} = Shift 키 입력

{F1} = F1 키 입력               

등등 하단에 참조 확인.

 

예시

`:: Send {Space 3}(...이하생략)

$1:: Send ^c   
;copy

$2:: Send ^v  
;paste

$3:: Send ^f  
;find

$4:: Send ^a
;all sellect

;상단 숫자 키로 복사, 붙여넣기, 검색, 전체선택 핫키 생성

 

 

F1::Send {Enter}
;enter here good

F2::Send {BS}
;{Backspace}

1 & 2::
send {Enter}
return

 

&을 사용한 조합키 (앞에 키를 누르는 상태에서 뒤에 키를 누르는 방식)

;조합키로 스크립트 실행

1 & 2::          ;1을 누르고 있는 상태에서 2를 누르는 방식
send {Enter}
return

2 & 3::
send {BS}
return 

 

1 & 2에서는 1이 대기상태가 되어버림 마찬가지로  2 & 3에서는 2가 대기상태로 되어 버림.

!나 #은 입력할 수 없게됨.

 

해결예시 (!, # 정상입력)

1 & 2::
send {Enter}
return

+1::        ;Shift + 1 키입력
send {!}
return

2 & 3::
send {BS}
return 

+2::
send {#}
return

 

; 스페이스바 조합

space & 1::  
mouseclick, ,300,220
return

 

;캡스락 조합

CapsLock & 1::  
mouseclick, ,300,220
return

 

● 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::
send {shift down}
send 1
send {shift up}
return

;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.

 

 

 

 

728x90
반응형
Comments