유니티
Unity(유니티)_매크로 핫키 만들기(마우스 클릭)
robbercat
2024. 3. 2. 22:09
마우스를 이동시켰으면... 클릭도 가능하게 해야지!
1. using System.Runtime.InteropServices; 추가!
2. [DllImport("user32.dll")]
static extern void mouse_event(uint dwFlags);
추가!
3. const uint LBUTTONDOWN = 0x0002; // 왼쪽 마우스 버튼 누름
const uint LBUTTONUP = 0x0004; // 왼쪽 마우스 버튼 땜
4. public void MouseEvent()
{
mouse_event(LBUTTONDOWN);
mouse_event(LBUTTONUP);
}
위 함수로 실행!
끝!