yoshimoshi-garage / yoshipi

Software for the YoshiPi carrier board for using .NET or Raspberry Pi Zero 2 W
MIT License
2 stars 3 forks source link

Touch events - Screen coordinates always return (0,0) #7

Open jorgedevs opened 3 months ago

jorgedevs commented 3 months ago

Setting up the TouchDown event and print the screen coordinates always return 0:

public class MeadowApp : YoshiPiApp
{
    public override Task Initialize()
    {
        Resolver.Log.Info("Initialize...");

        Hardware.Touchscreen.TouchDown += (s, e) =>
        {
            Resolver.Log.Info($"Screen: ({e.ScreenX}, {e.ScreenY}) | Raw: ({e.RawX}, {e.RawY})");
        };

        return Task.CompletedTask;
    }

    public override async Task Run()
    {
        Resolver.Log.Info("Run...");

        await Task.CompletedTask;
    }
}

output:

[application] Run...
[application] Screen: (0, 0) | Raw: (2560, 2048)
[application] Screen: (0, 0) | Raw: (2304, 2048)
[application] Screen: (0, 0) | Raw: (2079, 2560)
[application] Screen: (0, 0) | Raw: (799, 3072)
[application] Screen: (0, 0) | Raw: (3072, 3072)
[application] Screen: (0, 0) | Raw: (2048, 2304)
[application] Screen: (0, 0) | Raw: (799, 1792)
[application] Screen: (0, 0) | Raw: (2560, 2576)
[application] Screen: (0, 0) | Raw: (3072, 3072)
jorgedevs commented 3 months ago

oh, now that I think of it. I need to calibrate the screen first, am i right?

jorgedevs commented 3 months ago

hm never mind, I still get (0,0) after calibrating.