|
@@ -4,6 +4,7 @@ using BBIWARG.Recognition.TouchRecognition;
|
|
|
using BBIWARG.Utility;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.Drawing;
|
|
|
using System.Linq;
|
|
|
using System.Net;
|
|
|
using System.Net.Sockets;
|
|
@@ -95,15 +96,16 @@ namespace BBIWARG.TUIO
|
|
|
|
|
|
foreach (TouchEvent te in frameData.TouchEvents)
|
|
|
{
|
|
|
+ Point p = getButton(te.Touch.RelativePosition.X, te.Touch.RelativePosition.Y);
|
|
|
switch (te.Type)
|
|
|
{
|
|
|
case TouchEventType.Down:
|
|
|
- TuioCursor tcur = server.addTuioCursor(te.Touch.RelativePosition.X, te.Touch.RelativePosition.Y);
|
|
|
+ TuioCursor tcur = server.addTuioCursor(p.X, p.Y);
|
|
|
tcursors.Add(te.Touch.TrackID, tcur);
|
|
|
break;
|
|
|
|
|
|
case TouchEventType.Move:
|
|
|
- server.updateTuioCursor(tcursors[te.Touch.TrackID], te.Touch.RelativePosition.X, te.Touch.RelativePosition.Y);
|
|
|
+ server.updateTuioCursor(tcursors[te.Touch.TrackID], p.X, p.Y);
|
|
|
break;
|
|
|
|
|
|
case TouchEventType.Up:
|
|
@@ -236,6 +238,19 @@ namespace BBIWARG.TUIO
|
|
|
server.commitFrame();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private Point getButton(float rX , float rY)
|
|
|
+ {
|
|
|
+ int activeRow = (int)Math.Min(rY * Parameters.ActiveTouches.Count,
|
|
|
+ Parameters.PalmGridDefaultNumRows - 1);
|
|
|
+ int activeCol = (int)Math.Min(rX * Parameters.ActiveTouches.ElementAt(activeRow).Count,
|
|
|
+ Parameters.ActiveTouches.ElementAt(activeRow).Count - 1);
|
|
|
+ if (activeRow != Parameters.PalmSliderPos)
|
|
|
+ return new Point(activeRow, activeCol);
|
|
|
+ else
|
|
|
+ return new Point(activeRow, Parameters.PalmSliderCurr);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
|