Added support for the keyboard III

This commit is contained in:
Your Name 2024-11-24 01:54:59 +01:00
parent 8862039e55
commit 4d3bfd1e91

View File

@ -268,7 +268,8 @@ namespace WindowsPhoneSpeedyBlupi
List<TinyPoint> touchesOrClicks = new List<TinyPoint>(); List<TinyPoint> touchesOrClicks = new List<TinyPoint>();
foreach (TouchLocation item in touches) foreach (TouchLocation item in touches)
{ {
if (item.State == TouchLocationState.Pressed || item.State == TouchLocationState.Moved) { if (item.State == TouchLocationState.Pressed || item.State == TouchLocationState.Moved)
{
TinyPoint tinyPoint = default(TinyPoint); TinyPoint tinyPoint = default(TinyPoint);
tinyPoint.X = (int)item.Position.X; tinyPoint.X = (int)item.Position.X;
tinyPoint.Y = (int)item.Position.Y; tinyPoint.Y = (int)item.Position.Y;
@ -424,10 +425,31 @@ namespace WindowsPhoneSpeedyBlupi
Debug.WriteLine("padTouchPos.X=" + padTouchPos.X); Debug.WriteLine("padTouchPos.X=" + padTouchPos.X);
Debug.WriteLine("padTouchPos.Y=" + padTouchPos.Y); Debug.WriteLine("padTouchPos.Y=" + padTouchPos.Y);
{ {
if (keyPressedUp) { padTouchPos.X = PadCenter.X; padTouchPos.Y = PadCenter.Y - 30; } if (keyPressedUp)
if (keyPressedDown) { padTouchPos.X = PadCenter.X; padTouchPos.Y = PadCenter.Y + 30; } {
if (keyPressedLeft) { padTouchPos.X = PadCenter.X - 30; padTouchPos.Y = PadCenter.Y; } padTouchPos.Y = PadCenter.Y - 30;
if (keyPressedRight) { padTouchPos.X = PadCenter.X + 30; padTouchPos.Y = PadCenter.Y;} padTouchPos.X = PadCenter.X;
if (keyPressedLeft) padTouchPos.X = PadCenter.X - 30;
if (keyPressedRight) padTouchPos.X = PadCenter.X + 30;
}
if (keyPressedDown) {
padTouchPos.Y = PadCenter.Y + 30;
padTouchPos.X = PadCenter.X;
if (keyPressedLeft) padTouchPos.X = PadCenter.X - 30;
if (keyPressedRight) padTouchPos.X = PadCenter.X + 30;
}
if (keyPressedLeft) {
padTouchPos.X = PadCenter.X - 30;
padTouchPos.Y = PadCenter.Y;
if (keyPressedUp) padTouchPos.Y = PadCenter.Y - 30;
if (keyPressedDown) padTouchPos.Y = PadCenter.Y + 30;
}
if (keyPressedRight) {
padTouchPos.X = PadCenter.X + 30;
padTouchPos.Y = PadCenter.Y;
if (keyPressedUp) padTouchPos.Y = PadCenter.Y - 30;
if (keyPressedDown) padTouchPos.Y = PadCenter.Y + 30;
}
} }
double horizontalPosition = padTouchPos.X - PadCenter.X; double horizontalPosition = padTouchPos.X - PadCenter.X;
double verticalPosition = padTouchPos.Y - PadCenter.Y; double verticalPosition = padTouchPos.Y - PadCenter.Y;