private void Enqueue(TabletPacketEventArgs e) { lock (queueLock) { packetQueue.Enqueue(e); if (packetQueue.Count==1) { Monitor.Pulse(queueLock); } } }
public virtual void OnTabletPacket(TabletPacketEventArgs e) { if (TabletPacket != null) { TabletPacket(this, e); } }
private void EnqueuePacket(int x, int y, int normalPressure) { //Log("Packet: x = "+x+" y = "+y+" normalPressure = "+normalPressure); TabletPacketEventArgs evArgs = new TabletPacketEventArgs(x, y, normalPressure, tabletSettings); OnTabletPacket(evArgs); }
public override void OnTabletPacket(TabletPacketEventArgs e) { Enqueue(e); base.OnTabletPacket(e); }
//private delegate void PaintDotDelegate(float x, float y, float pressure); void TabletPacketHandler(object sender, TabletPacketEventArgs e) { if (e.NormalPressure > 0) { Console.WriteLine(e.AbsoluteX + " " + e.AbsoluteY + " " + e.NormalPressure); float x = e.AbsoluteX * (float)SystemInformation.PrimaryMonitorSize.Width - (float)this.Left - 10.0f; float y = e.AbsoluteY * (float)SystemInformation.PrimaryMonitorSize.Height - (float)this.Top - 35.0f; PaintDot(x,y,e.NormalPressure); //BeginInvoke(new PaintDotDelegate(PaintDot), new object[] {x,y,e.NormalPressure}); } }