2017-12-28 24 views
0

InputInjector 및 InjectedInputTouchInfo를 사용하여 프로그래밍 방식으로 Windows 10 1709에서 터치 이벤트를 보냅니다. InjectMouseInput을 사용하여 마우스 이벤트를 보낼 수있었습니다. 그러나 터치 이벤트를 주입하려고 할 때 예외가 발생했습니다. 이 코드를 실행 예외를 제공 MSDN pageUWP, 터치 이벤트 삽입 예외

inputInjector.InjectTouchInput(
      new List<InjectedInputTouchInfo> { 
      new InjectedInputTouchInfo { 
       Contact = new InjectedInputRectangle 
       { 
        Top = 50, 
        Bottom = 50, 
        Left = 40, 
        Right = 40 
       }, 
       PointerInfo = new InjectedInputPointerInfo { 
        PixelLocation = new InjectedInputPoint { 
         PositionX = 40, PositionY = 50 
        }, 
        PointerOptions = InjectedInputPointerOptions.PointerUp, 
        PointerId = 1, 
       }, 
       Pressure = 0.0, 
       TouchParameters = 
       InjectedInputTouchParameters.Pressure | 
       InjectedInputTouchParameters.Contact 
      } 
     }); 

의해 제공되는 코드 시도는 동일하다.

{System.ArgumentException : 값이 예상 한 범위 내에 있지 않습니다. Windows.UI.Input.Preview.Injection.InputInjector.InjectTouchInput에서 (IEnumerable`1 입력) }

답변