mirror of
https://github.com/openeggbert/mobile-eggbert-monogame-desktop.git
synced 2025-04-02 11:26:14 +02:00
Added support for the keyboard III
This commit is contained in:
parent
8862039e55
commit
4d3bfd1e91
32
InputPad.cs
32
InputPad.cs
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user