Example #1
0
 private void HandleMessage(PointerMessage res)
 {
     switch (res.Message)
     {
         case PointerEvent.Move:
             SetCursorPos(res.X, res.Y);
             break;
         case PointerEvent.Down:
             mouse_event(MOUSEEVENTF_LEFTDOWN, res.X, res.Y, 0, 0);
             break;
         case PointerEvent.Up:
             mouse_event(MOUSEEVENTF_LEFTUP, res.X, res.Y, 0, 0);
             break;
     }
 }
Example #2
0
        private void _mSocket_OnNotifyMulticastSocketListener(object sender, NotifyMulticastSocketListenerEventArgs e)
        {
            if (e.Type == MulticastSocketMessageType.MessageReceived)
            {
                var msg = System.Text.Encoding.ASCII.GetString((byte[])e.NewObject);

                var res = new PointerMessage(Convert.ToInt32(msg.Split('@')[0]), Convert.ToInt32(msg.Split('@')[1]), (PointerEvent)Enum.Parse(typeof(PointerEvent), msg.Split('@')[2]));
                
 

                HandleMessage(res);
                //if(DataReceived != null)
                //{
                //    DataReceived(this,new DataEventArgs(msg));
                //}
            }
        }