예제 #1
0
 internal void EnqueueContact(MouseContact contact)
 {
     lock (contactsQueue)
     {
         contactsQueue.Enqueue((MouseContact)contact.Clone());
     }
 }
예제 #2
0
		internal void EnqueueContact(MouseContact contact)
		{
			lock (contactsQueue)
			{
                //Trace.WriteLine(contact.Position.ToString());
				contactsQueue.Enqueue((MouseContact)contact.Clone());
			}
		}
예제 #3
0
        void RawDevice_RawInput(object sender, RawInputEventArgs e)
        {
            if (devices.Contains(e.Handle))
            {
                DeviceStatus state     = devices[e.Handle];
                MouseData    mouseData = e.GetRawData() as MouseData;
                if (mouseData != null)
                {
                    UpdateMouse(mouseData, state);
                }
                else
                {
                    DeviceData deviceData = e.GetRawData() as DeviceData;
                    if (deviceData != null)
                    {
                        UpdatePen(deviceData, state);
                    }
                }

                if (state.ButtonState == DeviceState.None)
                {
                    return;
                }

                MouseContact contact = null;
                if (state.ButtonState == DeviceState.Down)
                {
                    contact = new MouseContact(state);
                    //Debug.WriteLine("Down: " + contact);
                    contacts.Add(contact);
                }
                else if ((state.ButtonState == DeviceState.Move || state.ButtonState == DeviceState.Up) && contacts.Contains(e.Handle))
                {
                    contact = contacts[e.Handle];
                    //Debug.WriteLine("Move: " + contact);
                    contact.Update(state);
                }
                if (contact != null)
                {
                    inputProvider.EnqueueContact(contact);
                }
                if (state.ButtonState == DeviceState.Up)
                {
                    contact = contacts[e.Handle];
                    contact.Update(state);
                    //Debug.WriteLine("Up: " + contact);
                    contacts.Remove(e.Handle);
                }
            }
        }
예제 #4
0
		public MouseContact(MouseContact clone)
			: base(clone.Id, clone.State, clone.Position, clone.MajorAxis, clone.MinorAxis)
		{
			Handle = clone.Handle;
			Orientation = clone.Orientation;
		}
예제 #5
0
		void RawDevice_RawInput(object sender, RawInputEventArgs e)
		{
			if (devices.Contains(e.Handle))
			{
				DeviceStatus state = devices[e.Handle];
				MouseData mouseData = e.GetRawData() as MouseData;
				if (mouseData != null)
					UpdateMouse(mouseData, state);
				else
				{
					DeviceData deviceData = e.GetRawData() as DeviceData;
					if (deviceData != null)
						UpdatePen(deviceData, state);
				}

				if(state.ButtonState == DeviceState.None)
					return;

				MouseContact contact = null;
				if (state.ButtonState == DeviceState.Down)
				{
					contact = new MouseContact(state);
					//Debug.WriteLine("Down: " + contact);
					contacts.Add(contact);
				}
				else if ((state.ButtonState == DeviceState.Move || state.ButtonState == DeviceState.Up) && contacts.Contains(e.Handle))
				{
					contact = contacts[e.Handle];
					//Debug.WriteLine("Move: " + contact);
					contact.Update(state);
				}
				if (contact != null)
					inputProvider.EnqueueContact(contact);
				if (state.ButtonState == DeviceState.Up)
				{
					contact = contacts[e.Handle];
					contact.Update(state);
					//Debug.WriteLine("Up: " + contact);
					contacts.Remove(e.Handle);
				}
			}
		}
예제 #6
0
 internal void EnqueueContact(MouseContact contact)
 {
     lock (contactsQueue)
     {
         contactsQueue.Enqueue((MouseContact)contact.Clone());
     }
 }
예제 #7
0
 public MouseContact(MouseContact clone)
     : base(clone.Id, clone.State, clone.Position, clone.MajorAxis, clone.MinorAxis)
 {
     Handle      = clone.Handle;
     Orientation = clone.Orientation;
 }