질문과 답변
소프트웨어 ahk 스크립트 수정 좀 부탁드려도 될까요
2018.04.06 22:28
작업 때문에 일반 가로 모니터를 표시 방식만 세로로 하고 사용하는 중입니다. 반시계 방향 90도구요.
마우스를 움직이려면 고개를 꺾어서 봐야되기에 가로로 놓여있는 모니터에서 마우스 축만 돌려서 사용하는 스크립트를 찾았는데요.
아래 스크립트에서 반대값으로 수정 할줄 모르겠습니다. 스크립트는 모니터를 우측으로 90도 돌렸을 때 마우스 축을 돌린거거든요..
저는 모니터를 시계 반대방향으로 90도 회전으로 설정했습니다.
마우스는 현실에서 좌로 드래그 하면 위로, 우로 드래그 하면 밑으로 움직이는 형식으로 만들고 싶거든요..;;;
까막눈이라 몇줄 수정 조차 감이 안옵니다. 혹시 간단하게 수정해주실 수 있으신 분 계실까요. 부탁드립니다. ;;
이건 혹시나 해서 문의드립니다. 제가 지금 모니터 표현 방식을 반시계 90도로 돌릴 때도 바탕화면에서 우클릭-설정 들어가서 변경하고 있는데
ahk 로 모니터도 반시계로 돌리고 마우스 축도 위처럼 돌리고 싶은데 동시에 하는 방법이 있을까요 ;;;;
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
#NoEnv SetBatchLines -1 Process Priority,,R BlockInput Mouse ; user mouse input is ignored during MouseMove CoordMode Mouse, Screen ; absolute coordinates SetMouseDelay -1 ; fastest action MouseGetPos x0, y0 ; get initial mouse pointer location SetTimer WatchMouse, 1 ; run the subroutine fast (10..16ms) Return WatchMouse: MouseGetPos x, y ; get current mouse position xn:=x0+y0-y yn:=y0-x0+x x0:=(xn>A_ScreenWidth) ? A_ScreenWidth : (xn<0) ? 0 : xn y0:=(yn>A_ScreenHeight) ? A_ScreenHeight : (yn<0) ? 0 : yn MouseMove x0, y0, 0 ; set new position as old, for the next timer Return z::ExitApp
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
댓글 [2]
번호 | 제목 | 글쓴이 | 조회 | 등록일 |
---|---|---|---|---|
[공지] | 질문과 답변 게시판 이용간 유의사항 | gooddew | - | - |
73499 | 하드웨어| 마우스의 [2] | 솔모로 | 352 | 04-13 |
73498 | 기 타| 좀 더 완벽한 해킨토시 부품들이 있을까요? [8] | 파풍초 | 656 | 04-13 |
73497 | 윈 도 우| 원클릭PE 작업표시줄아이콘과 시작메뉴아이콘 바로가기설정... [9] | 복태취업했 | 972 | 04-12 |
73496 | 기 타| 메인보드 부자 울릴때가 있고 그렇지 [5] | aqz | 516 | 04-12 |
73495 | 윈 도 우| 윈도우 업데이트 할 수 없습니다. [4] | 가드리아 | 684 | 04-12 |
73494 | 소프트웨어| 프리모 램디스크 사용기한 만료? [4] | shot4u | 850 | 04-12 |
73493 | 하드웨어| 모니터를 본체의 메인보드에 꼽으면 GPU는 안쓰는건가요? [8] | blackrains | 1044 | 04-12 |
73492 | 윈 도 우| DataExchangeHost 이 프로세서는뭐에요.?? | 미미마 | 416 | 04-12 |
73491 | 윈 도 우| 익스플로러가 없어졌어요 [3] | 가드리아 | 893 | 04-12 |
73490 | 윈 도 우| OS 설치방법 [9] | 칸콩 | 1102 | 04-12 |
73489 | 윈 도 우| USB하나에 여러 OS설치 [12] | 칸콩 | 1301 | 04-12 |
73488 | 윈 도 우| 탐색기 폴더영역에서 마우스오른쪽 시 전체선택 선택반전 ... [2] | 아름드리나 | 524 | 04-12 |
73487 | 소프트웨어| 오피스 2013 누적업데이트 없나요? [1] | 너구리세상 | 309 | 04-12 |
73486 | 윈 도 우| 타면자건님 보세요 (부팅) | 눈이 | 284 | 04-12 |
73485 | 윈 도 우| OS 탑재된 M.2 SSD달린 노트북 SSD교체 하는 방법 어떤게 ... [12] | 프리머스 | 1012 | 04-12 |
73484 | 윈 도 우| 닷넷 4.7.1 언어팩 통합 관련 문의 드립니다. [2] | 어부바 | 162 | 04-12 |
73483 | 윈 도 우| Windows 10 Pro, RS4 빌드 17133 네트워크 질문 있습니다. [4] | tuyyo | 644 | 04-12 |
73482 | 윈 도 우| 레지스트리 정리 효과 있나요? [3] | billy | 703 | 04-12 |
73481 | 윈 도 우| 안녕하세요 회원님들 한가지 질문이 있어서 이렇게 글을 남... [2] | 화랑 | 169 | 04-12 |
73480 | 소프트웨어| 구글드라이브 공유문서함 파일이 삭제가 안됩니다. [2] | 영동탑클래 | 7183 | 04-11 |
#NoEnv
SetBatchLines -1
Process Priority,,R
ChangeDisplayOrientation(1)
BlockInput Mouse ; user mouse input is ignored during MouseMove
CoordMode Mouse, Screen ; absolute coordinates
SetMouseDelay -1 ; fastest action
MouseGetPos x0, y0 ; get initial mouse pointer location
SetTimer WatchMouse, 1 ; run the subroutine fast (10..16ms)
Return
WatchMouse:
MouseGetPos x, y ; get current mouse position
xn:=x0+y0-y
yn:=y0-x0+x
x0:=(xn>A_ScreenWidth) ? A_ScreenWidth : (xn<0) ? 0 : xn
y0:=(yn>A_ScreenHeight) ? A_ScreenHeight : (yn<0) ? 0 : yn
MouseMove x0, y0, 0 ; set new position as old, for the next timer
Return
z::
ResetDisplay(0)
ExitApp
return
; Orientation
; 0 - DMDO_DEFAULT
; 1 - DMDO_90
; 2 - DMDO_180
; 3 - DMDO_270
; Display:
; The name of the display device. Usually something like: \\.\DISPLAY1
; If omitted, uses the default display device.
; dwflags:
; 0 - change dynamically (use ResetDisplay() to reset to settings in registry)
; 1 - change dynamically and update registry (CDS_UPDATEREGISTRY)
; 2 - test if the requested mode could be set (CDS_TEST)
ChangeDisplayOrientation(Orientation, Display="", dwflags=0)
{
; DEVMODE is 156 bytes on Windows XP and later.
; It is smaller on earlier versions of Windows, but that's okay.
VarSetCapacity(devmode, 156, 0)
NumPut(156, devmode, 36) ; devmode.dmSize := sizeof(devmode)
; Get the current resolution and orientation.
if ! DllCall("EnumDisplaySettingsA"
, "uint", Display ? &Display : 0 ; device name or NULL
, "int", -1 ; ENUM_CURRENT_SETTINGS
, "uint", &devmode
, "uint", 0)
return ; FAILED
; Get current resolution.
dmPelsWidth := NumGet(devmode, 108)
dmPelsHeight := NumGet(devmode, 112)
if (mod(NumGet(devmode, 52),2) != mod(Orientation,2))
{ ; Swap height and width.
NumPut(dmPelsHeight, devmode, 108) ; width
NumPut(dmPelsWidth, devmode, 112) ; height
}
; Set orientation.
NumPut(Orientation, devmode, 52)
; Update display settings.
return DllCall("ChangeDisplaySettingsExA"
, "uint", Display ? &Display : 0
, "uint", &devmode
, "uint", 0
, "uint", dwflags
, "uint", 0)
/* Return values for ChangeDisplaySettings
#define DISP_CHANGE_SUCCESSFUL 0
#define DISP_CHANGE_RESTART 1
#define DISP_CHANGE_FAILED -1
#define DISP_CHANGE_BADMODE -2
#define DISP_CHANGE_NOTUPDATED -3
#define DISP_CHANGE_BADFLAGS -4
#define DISP_CHANGE_BADPARAM -5
#define DISP_CHANGE_BADDUALVIEW -6
*/
}
ResetDisplay(Display="")
{
return DllCall("ChangeDisplaySettingsExA"
, "uint", Display ? &Display : 0 ; device name or NULL
, "uint", 0, "uint", 0, "uint", 0, "uint", 0)
}
32비트 유니코드버전으로 컴파일 하시어 사용하면 되구요. 첨부합니다