예제 #1
0
        public void TouchscreenWaitForEvent()
        {
            BasicTypeSerializer.Put(SendContext, (byte)Command.TouchscreenWaitForEvent);
            Execute();
            Receive();
            TouchScreenDataType eventType = (TouchScreenDataType)BasicTypeDeSerializer.Get(ReceiveContext);

            if (eventType != TouchScreenDataType.TouchEvent)
            {
                throw new ApplicationException("eventType");
            }
            var touchEvent = new TouchEvent();

            touchEvent.X        = BasicTypeDeSerializer.Get(ReceiveContext, touchEvent.X);
            touchEvent.Y        = BasicTypeDeSerializer.Get(ReceiveContext, touchEvent.Y);
            touchEvent.Pressure = BasicTypeDeSerializer.Get(ReceiveContext, touchEvent.Pressure);
            touchEvent.IsValid  = BasicTypeDeSerializer.Get(ReceiveContext);
            OnTouch(touchEvent);
            if (WidgetClicked != null)
            {
                foreach (Widget widget in RegisteredWidgets)
                {
                    widget.OnClickEvent(touchEvent);
                    if (widget.Clicked)
                    {
                        WidgetClicked(this, widget, touchEvent);
                    }
                }
            }
        }
예제 #2
0
 public string TouchscreenShowDialog(DialogType dialogType) {
     BasicTypeSerializer.Put(SendContext, (byte)Command.TouchscreenShowDialog);
     BasicTypeSerializer.Put(SendContext, (ushort)dialogType);
     Execute();
     Receive();
     TouchScreenDataType eventType = (TouchScreenDataType) BasicTypeDeSerializer.Get(ReceiveContext);
     if (eventType != TouchScreenDataType.String) {
         throw new ApplicationException("eventType");
     }
     return BasicTypeDeSerializer.Get(ReceiveContext, "");
 }
예제 #3
0
 public CalibrationMatrix GetTouchscreenCalibrationMatrix() {
     BasicTypeSerializer.Put(SendContext, (byte)Command.TouchscreenGetCalibrationMatrix);
     Execute();
     Receive();
     TouchScreenDataType eventType = (TouchScreenDataType)BasicTypeDeSerializer.Get(ReceiveContext);
     if (eventType != TouchScreenDataType.CalibrationMatrix) {
         throw new ApplicationException("eventType");
     }
     var matrix = new CalibrationMatrix();
     matrix.Get(ReceiveContext);
     return matrix;
 }