다음 상황이 있습니다 : 프로그램 자체를 변경하지 않고도 멀티 터치 이벤트에 반응 할 수있는 특수 3D 프로그램이 있습니다. 따라서 Windows 7의 멀티 터치 이벤트를 수신하고 해당 마우스 및 키보드 이벤트에서 해당 이벤트를 변환 한 후 해당 이벤트를 처리 할 수 있도록 3D 프로그램에 에뮬레이트 된 이벤트를 보내는 매퍼 프로그램이 필요합니다.Win7 멀티 터치 이벤트를 잡아 마우스 및 키보드 이벤트로 변환하고 다른 응용 프로그램으로 보낼 수 있습니까?
나는 이미 많은 것을 읽고 시도해 왔으며, 현재의 접근 방법은 멀티 터치 이벤트를 포착하기 위해 3D 프로그램 위에 거의 투명한 오버레이 창이 있어야한다는 것입니다. 그러나 이것은 또한 문제입니다. 나는 생성 된 마우스 이벤트를 사용 가능한 3D 프로그램으로 전달할 수 없습니다. 지금은 mouse_event, SendMessage 등과 같은 pinvoke 함수를 사용했지만 그 중 아무 것도 나를 위해 일하지 않았습니다. 필자는 항상 3D 프로그램을 전면에 가져와야하기 때문에 이벤트를 보내고 나중에 매퍼 프로그램을 다시 앞에 배치해야했습니다. 이것은 매우 진절머리 나는 작품이다.
제 질문은 다소 다를 수 있습니다. 위에서 언급 한 작업을 수행 할 수있는 좋은 방법이 있습니까? 또는 백그라운드에서 프로세스에 마우스 및 키보드 이벤트를 보내는 좋은 방법이 있습니까?
private void OnMouseDown(object sender, MouseEventArgs e)
{
Point position = this.PointToScreen(new Point(e.Location.X, e.Location.Y));
//Simulate the mouse event on the given position
this.Visible = false;
Cursor.Position = position;
mouse_event(Convert.ToUInt16(MouseEventFlags.LEFTDOWN), 0, 0, 0, 0);
}
private void OnMouseUp(object sender, MouseEventArgs e)
{
Point position = this.PointToScreen(new Point(e.Location.X, e.Location.Y));
//Simulate the mouse event on the given position
Cursor.Position = e.Location;
mouse_event(Convert.ToUInt16(MouseEventFlags.LEFTUP), 0, 0, 0, 0);
this.Visible = true;
}
//Get a handle to the mouse event manager
[DllImport("user32.dll")]
private static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint dwData, int dwExtraInfo);